Started by
VideoDrifter
on
Topic category: Help with Minecraft modding (Java Edition)
So I made a procedure where my custom mob takes damage from a specific weapon. It works fine but for some reason whenever I hit any mob with the weapon it doesn't lose durability. What's even weirder is that whenever I dig up a block with the weapon, it does loses durability for some reason. I'm also new to this modding stuff and I am probably doing something wrong here. Does anyone have a solution?
Difficult to answer without seeing the procedure, i think the problem might be how it is made.
What is the tool type?
What is the durability set to?
Do you use the "damage item" procedure in your procedure with the entity being hurt?
What is the weapon? a spell or a melee attack?
Might be able to help if i understand it a bit more.
@Suddz
The tool type is sword.
Durabillity is 59
The weapon is suppose to be a stake that use melee attack
Event Trigger - triggered by external call or when (global trigger): Entity attacked
Check if Is Event/target entity (sub)type of CUSTOM:Vampire
do Check if item in main-hand of source entity = Wooden_Stake
do Deal 6 damage to Event/target entity type: GENERIC
Oh i see. I have solutions that should work.
1. First change to "before entity is hurt" in global trigger. Remove "deal 6 damage". after "check main hand" add an "else" statement. After the "else" add "cancel event that triggered global trigger" wich is found in the advanced procedure tab.
Change the weapon damage within its element instead (where you change the durability and name)
This should make it immune to all your attacks exept the stake.
2. If you want the vampire to take increased damage with the stake and still be able to damage it with normal weapons, go to your vampire entity, triggers, then "when entity hurt". And use the "main hand" and so on like you did (without global trigger).
You can give the vamire ludicrous amount of HP and make the stake do big damage to only the vampire.
3. A bit of cheating but, if all fail, you can simply add "deal damage to itemstack".
Hope some will help!
I missread your procedure and my (1) option is not correct, instead i made a procedure that works. It causes the chosen mob to only take damage from your weapon of choise, here it is:
If the Screenchot does not work: https://imgur.com/ItGpj7X
Test it and let me know if it works!
@Suddz Oh god it works! Thank you man, I really appreciated!
Np, hope you have a great weekend!