/loot can spawn air items that instantly despawn
Spawned item entities from a mobs loot table may not save their "Item" tag resulting in the item entities getting killed immediately after they have spawned. I have noticed this happening with the loot command. I don't know if the same applies to a natural scenario.
Reproduce:
- Spawn in any mob whose loot table can drop items (e.g. creeper)
- Setup a command block chain:
- Impulse
Set to: "Needs Redstone" - Chain
Set to: "Always Active"
Command:loot spawn <pos> kill <the mob entity>
e.g. after placing a witch near the command block:
loot spawn ~ ~1 ~ kill @e[type=witch,distance=..5,limit=1]
- Impulse
-
- Chain
Set to: "Always Active"
Command:execute as @e[type=item] unless data entity @s Item run say hi
Make sure the @e selector won't catch any other existing entities.
- Chain
- Activate the impulse command block (probably multiple times)
You may notice the "Item" tag sometimes being omitted in the chat message.
2020-08-07, 06:43 PM
2024-09-07, 02:34 PM
1
2
-