How can i restringe drop an item?

Started by CouLdN on

Topic category: Help with Minecraft modding (Java Edition)

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.

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.

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!

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is there a way to make this…
Mon, 06/24/2024 - 01:30

is there a way to make this work on MCreator 2020.2