Trying to make an Unbreakable enchantment

Started by mobjack878 on

Topic category: Help with modding (Java Edition)

Last seen on 21:11, 14. Sep 2023
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Trying to make an Unbreakable enchantment

I'm trying to make a treasure enchantment you can apply to any item with durability that makes it Unbreakable. I don't really know what I'm doing. I got the enchantment book to appear in the creative inventory and it can be applied to items. What event trigger should I use? I didn't see a trigger related to using an anvil. Also, how do I refer to the player? It gets mad at me for trying to refer to the item in the main hand of an entity that doesnt exist.

 

Last seen on 21:37, 17. Feb 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try "on player tick update"…
Fri, 09/15/2023 - 15:08

Try "on player tick update" and for all slots in the player's inventory, if it has the enchantment, reset durability.

Last seen on 16:34, 21. Mar 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i tried it with the "for…
Wed, 02/28/2024 - 17:42

i tried it with the "for each slot of inventory of entity get contents copy as itemstack iterator", but i dont know how to change that item in the inventory because im only getting a copy of the slot.