for each entity as, de-spawning items.

Started by platinumlagg on

Topic category: Help with modding (Java Edition)

Last seen on 01:13, 1. May 2024
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
for each entity as, de-spawning items.

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.

Last seen on 01:13, 1. May 2024
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Fixed it. I was deleting theā€¦
Sun, 04/21/2024 - 03:58

Fixed it. I was deleting the player. added a check to make sure the entity being de-spawned wasn't the player.