Topic category: Help with Minecraft modding (Java Edition)
I'm using the latest version of MCreator 2024.1, making a forge mod for 1.16.5
Procedure Code: https://pastebin.com/337yzR3a
I have a command set up ("clearitems") that when you call it, clears all the item entities in a near by area. it's using the "for each entity as" loop code block
The problem is, once the comand is run, i can't drop new item's on the ground. they don't show up until you exit the world and load it back up then they show up. even the ones you dropped prior when they weren't showing up.
stranger still, if I use the same de-spawning code, just without the loop so it runs only the one time with a "get nearest entity at" code block, then it doesn't work at all! "An un-expected error occurred trying to execute that command"
Not sure if I've found a bug or if I'm really dumb.
Fixed it. I was deleting the player. added a check to make sure the entity being de-spawned wasn't the player.