How would I make my snowball like ranged item have durability?

Started by amogus6116 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How would I make my snowball like ranged item have durability?

I've made a projectile, and attached that to an item with ranged properties. It's basically like a snowball, but when it hits anything, it returns (teleports) back to your hand.

Now, is it possible to make this item lose durability every time it returns to me? Obviously just lowering the durability is easy, but how would I save it's durability for the next time it'll be shot and return? Is there a way to save that?

 

For more clearance:

Item > Projectile Entity > (Newly generated) Same Item

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It isn't perfect, but you…
Mon, 07/08/2024 - 21:35

It isn't perfect, but you could try using a variable. When it is thrown, have a variable decrease by one. When the player gets the new item, set it to that.