Search code examples
minecraftitemsminecraft-commands

Minecraft: summon an item that can't be picked/grabbed by hoppers


I used the following command to summon items around a player for aesthetic purposes. (Minecraft: 1.16.5)

 execute as @e[name=Counting,type=minecraft:armor_stand,scores={Count=1}] run execute at
 @a[name=Name,gamemode=creative] run summon item ~0.75 ~1 ~-0.75 {Item:
 {id:"barrier",Count:1},PickupDelay:20,Age:5985}

I used 4 repeating command blocks to summon 4 different items around the player. Using a dummy scoreboard to determine when to summon each item. The items can't be picked up and last for just a second, but hoppers and hopper minecarts can still pick them up. So if someone with this effect would like to have diamonds or something hard to get, they would just need to stand on top of a hopper to gather the dropped items.

I tried to find a way to summon items that weren't able to get picked/grabbed by hoppers but couldn't find any so I post a question here.


Solution

  • There are 2 ways I can think of

    1: Summon an invisible armorstand with the item as a passenger. This might cause hoppers to not pick it up (havent tested), just remember to kill the armorstand and item when removing them.

    2: Summon an invisible armorstand with the item on its head. Hoppers/minecarts cannot pick it up, but it will not rotate and bob. This is the easier method, but it wont look like an actual item. If you wanted, you could have the armorstands tp @s ~ ~ ~ ~1 ~ to make them rotate.