#Does "harmful()" not work on 1.20+?

22 messages · Page 1 of 1 (latest)

gilded vector
#

I'm creating a harmful effect for a custom item when rightclicked; the effect is applied when the player right clicks it, but even after i set it to .harmful() it doesn't damage the player.

I'm aware the DamageSource class changed and it's now net.minecraft.world.damagesource.DamageSources;
should i also use net.minecraft.world.damagesource.DamageSource to apply it to the entity so it actually does harm the player/entity? That class seem to hold the entity data while the other just contains the list of sources.

neat viperBOT
#

Paste version of effect_registry.js from @gilded vector

humble larkBOT
#

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

gleaming breach
#

Is there anything in the logs?

gilded vector
neat viperBOT
#

Paste version of server.log, startup.log from @gilded vector

gilded vector
#

the class was loaded correctly on startup and the only server "errors" are a couple of recipes I forgot to comment xD

tame birch
#

IIRC harmful/beneficial is just a category, isn't?

gleaming breach
#

Yeah, i would have thought that aswell

#

So there needs to be an Error in Our damage function

tame birch
#

also you don't need to load damage source, you can just new DamageSource
it is available

#

yeah harmful does nothing by itself

#

it is used for coloring

gilded vector
#

huh, never checked that specifically 😆; I will try using a different type of damage than "attack" and see it if applies

tame birch
#

minecraft uses .hurt(

gilded vector
#

huh, got a ticking error

#
[12:23:42] [ERROR] ! effect_registry.js#32: Error while ticking mob effect kubejs:mana_overload for entity Aikaya: dev.latvian.mods.rhino.EvaluatorException: Java constructor for "pie.ilikepiefoo.player.CustomDamageSourceJS" with arguments "string,dev.latvian.mods.rhino.Undefined" not found.

gleaming breach
#

Something is undefined

#

To be more exact something with a damage sourcw

gilded vector
#

well, I'll close the ticket for now and keep testing tonight, time to work now...