How Do I Auto Swap An Item On Pickup

Started by PokePuff05 on

Topic category: Help with modding (Java Edition)

Last seen on 16:07, 18. Mar 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How Do I Auto Swap An Item On Pickup

Basically I want that when a specific item is picked up (it's a custom helmet) that the item will equip, and put the headgear in the player's inventory replacing the crown. I would do this on a one tick delay but I fear that this would make duping of the items possible. Any ideas on what to do? Forums are not very active so I dont expect a response but any help is appreciated. 

This is my current code by the way.

Last seen on 16:07, 18. Mar 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
https://imgur.com/a/tM85HNR…
Tue, 03/05/2024 - 17:29

https://imgur.com/a/tM85HNR
(I dont know it image not loading is just an issue on my end so I'm just going to post it again)

Last seen on 16:07, 18. Mar 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Update if anyone else has…
Thu, 03/14/2024 - 19:29

Update if anyone else has this issue

there is a block called set number of items in _ to _
if you keep the first block as provided itemstack and set the number to 0 then it will just make you not pick up anything