How to make ore drop no xp with silk touch?

Started by Pyrovoltage on Sat, 04/18/2020 - 06:19

Topic category: Help with modding (Java Edition)

Last seen on 19:42, 18. Apr 2020
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make ore drop no xp with silk touch?
Sat, 04/18/2020 - 06:19

I was curious how to make an ore not drop XP when broken with the silk touch enchantment. I can't figure it out. I know it involves the checking of the item in the hand of the entity and checking item enchantment but I'm stumped.

Last seen on 01:30, 18. Jun 2021
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hello there! It's actually a…
Wed, 03/10/2021 - 17:11

Hello there! It's actually a pretty straightforward procedure, but I get how it can be tricky to piece together this stuff.

I came across the same issue in a mod I'm working on, and I've actually attached a screenshot of the working procedure!

It basically checks if you're in creative mode, first of all, and if you aren't, it'll test if your itemstack (the tool in your hand) doesn't have silk touch, through the little "not" procedure block there. Once it tests for all that, it'll spawn the XP orb!

https://imgur.com/vpAy2Qj