How can i restringe drop an item?

Started by CouLdN on Sun, 03/15/2020 - 20:46

Topic category: Help with modding (Java Edition)

Last seen on 10:36, 27. Aug 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How can i restringe drop an item?
Sun, 03/15/2020 - 20:46

In the title i mean, how can i restringe dropping an specific item with the "Q"? When you "Q" it cames back or you can't drop it. Please help.

Last seen on 03:24, 27. Oct 2020
Joined May 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
MCreator has a "hidden"…
Mon, 03/30/2020 - 15:07

MCreator has a "hidden" built-in event system that can stop an item from dropping. All you need to do is create a procedure, open the dropdown menu at the top block ("no additional trigger") and select "Gem dropped". Then make an "if" block that detects if "provided item" = the item you want to stop from dropping. In that block, I think you should be able to cancel the event by getting a custom code snippet from the Advanced section and writing exactly this:

event.setCanceled(true);

Include the semicolon.

Tell me if it works because this would actually be pretty useful information for me to know as well.