#lava like fluid? (sets player on fire)

11 messages · Page 1 of 1 (latest)

tall schooner
#

hey, ive been trying to figure out how to make a lava like liquid (if its even possible) that burns the player when he touches it, if anyone has any insight would be greatly appreciated. :D

tacit gladeBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

rapid plinth
#

iirc you can add the minecraft:lava tag to the fluid

#

that can have some side effects tho

tall schooner
# rapid plinth iirc you can add the `minecraft:lava` tag to the fluid

oh i did that already, it gave the fluid the lava shade effect (like the blur when ur in it) but not the burning

ServerEvents.tags("fluid", (event) => {
    // Super Heated Chocolate lava like behavior
    event.add("minecraft:lava", "orbitcycle:superheated_chocolate");
    event.add("minecraft:lava", "orbitcycle:flowing_superheated_chocolate");

    console.log("Added fluid tags");
});
rapid plinth
#

ah okay mb then

tall schooner
tall schooner
#

anyone has any ideas? ive been searching for hours now

tall schooner
#

welp i couldnt find a fix so im doing a workaround, which i actually like better.
creating custom effect and damagesources that way when a player goes in to the liquid, i can do whatever i want :)
example (doesnt work rn but is a general idea) [also using #1169390879308529784 message as source]:

const $DamageSource = Java.loadClass(
    `net.minecraft.world.damagesource.DamageSource`
);

/** Register effects */
StartupEvents.registry("mob_effect", (event) => {
    event
        .create("scalding")
        .displayName(Component.green("Agustus Gloop"))
        // Set a tick event to apply the action
        .effectTick((entity, heat) => global.agustusGloopEffect(entity, heat))
        .color(Color.BROWN_DYE)
        .harmful();
});

/**
 * Applies the the chocolate overload effect.
 * Damages the entity (likely player) with 2 HP (1 hearts) per 10 ticks.
 *
 * @param {Internal.Entity} entity The entity to apply the effect to
 * @param {number} heat The level of the effect
 */
global.agustusGloopEffect = (entity, heat) => {
    let damagesource = new $DamageSource("orbitcycle:agustusgloop");
    // Check if the global is run on the client. If so, return
    if (entity.level.clientSide) return;
    // Damage based on level
    entity.attack(damagesource, heat + 1);
};
grave nebulaBOT
#

Startup Script:

const $DamageSource = Java.loadClass(`net.minecraft.world.damagesource.DamageSource`)

/** Register effects */
StartupEvents.registry('mob_effect', event => {
    // Register radiation effect
    event.create('radiation')
        // Change the name to be "Radiation", in green
        .displayName(Component.green("Radiation"))
        // Set a tick event to apply the action
        .effectTick((entity, lvl) => global.radiationEffect(entity, lvl))
        // Set the color of the effect
        .color(Color.GREEN)
        // Set whether the effect is harmful
        .harmful();
})

/**
 * Applies the radiation effect.
 * Damages the entity (likely player) with 2 HP (1 hearts) per 10 ticks.
 *
 * @param {Internal.Entity} entity The entity to apply the effect to
 * @param {number} lvl The level of the effect
 */
global.radiationEffect = (entity, lvl) => {
    // Create damage source
    let damagesource = new $DamageSource('radiation')
    // Check if the global is run on the client. If so, return
    if (entity.level.clientSide) return;
    // Damage based on level 
    entity.attack(damagesource, lvl + 1);
}```
Client Script:
```js
/** Add language entries */
ClientEvents.lang('en_us', (e) => {
    // Effect / Radiation
    e.add("death.attack.radiation", "%1$s died in a horrible way");
})```

You can add an icon to go along with the effect by just dropping an 18px by 18px image over in ``kubejs/assets/kubejs/mob_effect/radiation.png`` - words of wisdom by @rapid dragon 
Credit to @hearty saffron and @gentle fractal

@shrewd bloom 's 1.18 version here in: #1170471805148999751 message

@karmic osprey 's 1.20 Successful Port here:
#1183085911974608977 message