Item-specific Enchantment?

Started by Drake__archer on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 months ago
Joined Sep 2021
Points:
979

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 118
Item-specific Enchantment?

I'm making a mod that adds a new tool/weapon, and a new enchantment. I want to make it so the enchantment can only go on the tool, and the tool can only be enchanted with the enchantment.

For example, if I have an enchantment called Boost, and an item called Blaster, I want to make it so Boost can only go on the Blaster, and the blaster can only be enchanted with Boost.

I tried to get this working, but it just won't work.

Would it be possible to get this working for the book and in the table?

Any help would be greatly appreciated!

Active 4 days ago
Joined Apr 2024
Points:
428

User statistics:

  • Modifications: 9
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 474
To make an enchantment work…
Tue, 07/23/2024 - 21:09

To make an enchantment work on only a specific item you can simply put the item in the "can be applied to" list in the enchantment settings, but unfortunately I don't think there is a way to make the tool only enchantable by that enchantment, the only thing you could do is a procedure that removes every other enchantment from the tool

Active 3 months ago
Joined Sep 2021
Points:
979

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 118
Are you sure there isn't a…
Tue, 07/23/2024 - 22:15

Are you sure there isn't a way to make the tool only enchantable by the enchantment?

Active 4 days ago
Joined Apr 2024
Points:
428

User statistics:

  • Modifications: 9
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 474
Yes, there is no feature to…
Tue, 07/23/2024 - 22:23

Yes, there is no feature to choose the specific enchantments a tool can have, I think that the only way could be custom code

Active 3 months ago
Joined Sep 2021
Points:
979

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 118
Do you know what code I'd be…
Wed, 07/24/2024 - 02:01

Do you know what code I'd be able to use?

Active 4 days ago
Joined Apr 2024
Points:
428

User statistics:

  • Modifications: 9
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 474
no, I'm sorry
Wed, 07/24/2024 - 02:17

no, I'm sorry