I am having some procdure problem where my custom weapon does not lose durability when it hits any mobs.

Started by VideoDrifter on

Topic category: Help with modding (Java Edition)

Last seen on 16:40, 22. Jan 2023
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am having some procdure problem where my custom weapon does not lose durability when it hits any mobs.

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?

Last seen on 21:00, 26. Mar 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Difficult to answer without…
Fri, 12/23/2022 - 22:31

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.

Last seen on 16:40, 22. Jan 2023
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Suddz The tool type is…
Fri, 12/23/2022 - 23:12

@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

Last seen on 21:00, 26. Mar 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh i see. I have solutions…
Fri, 12/23/2022 - 23:47

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!

 

Last seen on 21:00, 26. Mar 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I missread your procedure…
Sat, 12/24/2022 - 00:11

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!

Last seen on 16:40, 22. Jan 2023
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Suddz Oh god it works!…
Sat, 12/24/2022 - 04:41

@Suddz Oh god it works! Thank you man, I really appreciated!

Last seen on 21:00, 26. Mar 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Np, hope you have a great…
Sat, 12/24/2022 - 12:00

Np, hope you have a great weekend!