Code example for adding attributes to items

Started by Kalmeira on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Code example for adding attributes to items

Since mcreator does not yet support adding attributes to items, I am trying to figure out how to do it with code. If I could get an example, I could probably figure it out from there. To further clarify, I don't mean spawning an item in with a command. 

Also, I have tried using the attributes plugin (nerdy version) but could not get it to work with items. There is virtually no documentation for it and the plugin itself may be not working, hence why I am seeking help with code.

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you add this chunk of…
Sun, 09/22/2024 - 22:29

If you add this chunk of code to (ITEMNAME)Item.java It will add whatever attribute you set it as, you can also change the slot the item has to be put in for the attributes to work.

https://pastebin.com/0sKL1FUs

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for your help.
Mon, 09/23/2024 - 18:29

Thank you for your help.