Only allow player to hold one of an item at once

Started by Aksumite on

Topic category: Help with modding (Java Edition)

Last seen on 01:21, 23. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Only allow player to hold one of an item at once

I have a powerful item, and was wondering if you can prevent the player from picking up/holding more than one of the item at once.

Thanks!

Last seen on 14:24, 21. Feb 2022
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Simply set the max stack…
Sat, 05/23/2020 - 12:48

Simply set the max stack size to 1 for the item.

Last seen on 01:21, 23. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This wouldn't solve the…
Sat, 05/23/2020 - 20:17

This wouldn't solve the problem, because the player can still pick it up in a different slot. What I meant was only being able to hold one of the item in the entire inventory.

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To not allow pickup, make a…
Sat, 05/23/2020 - 23:24

To not allow pickup, make a procedure element and on event trigger select from the pulldown "when entity picks up item".

Use the code block "has provided entity (item) in inventory". IF blocks to check if true then don't allow pickup. 

Last seen on 01:21, 23. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Alright, thanks!
Sat, 05/23/2020 - 23:25

Alright, thanks!