Started by Xanderz_1001 on Mon, 02/20/2023 - 19:11
Topic category: Help with modding (Java Edition)
I want a custom weapon to inflict vulnerability to an entity on hit, basically like negative resistance for a few seconds, where it is more prone to taking damage. I've tried just adding negative resistance, but it seems to have no effect. Any help is appreciated.
Create a way for the entity to get a potion effect (the debuff).
Then make this procedure:
This basicly causes the entity to take increased damage when they take damage form attacks (or "before entity hurt", then it is all damage).
For some reason my game crashes whenever the effect is inflicted and the entity is hit again. Either it's a bug or I did something wrong.
I made a procedure by itself (not under anything, don't think I'm supposed to) and put the "flat amount of damage" block in it, as well as a procedure under a custom sword where when the sword attacks an entity it inflicts it with the effect.
It might be from the game trying to deal damage twice in a row when an entity is only supposed to be hit once before its invulnerability frames are up, at least that's my best guess.
I was thinking, is possible to just set the entity's health to -2 of what its current health is instead of dealing damage? If it's a bug then that might fix it.
This procedure has nothing that can cause problems, i tried it out and it crashed aswell. I am using the latest snapshot so it most likely is a bug because i have made similar procedures before, so we will have to use a makeshift one in the meantime as "deal damage" seems to be bugged. So here is a new procedure untill deal damage is fixed:
Replace the 2 with the damage you want. This is to be expected with test versions, that is if you are using the snapshot aswell.
Thanks, this works!
Also, how could I make it deal more damage if the effect is a higher level?
Np, use the "get effect level/amplifier of potion --- for event/target entity" where "if level 0 do 2 damage" and a bunch of else ifs for each level. Should work.