How can i restringe drop an item?

Started by CouLdN on

Topic category: Help with modding (Java Edition)

Last seen on 19:42, 27. Feb 2022
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can i restringe drop an item?

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 00:30, 24. Aug 2023
Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.

Last seen on 20:10, 6. Apr 2024
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It made the item disappear…
Sat, 06/10/2023 - 08:09

It made the item disappear which was exactly what I needed!