Started by
mabolob
on
Topic category: Help with Minecraft modding (Java Edition)
I have a radioactive block and I want it so if an entity is within a 3x3 distance of the block it gives them a poison effect. I couldn't find anyone else having answered this but I might have just missed it.
I know that there is a get nearest entity but I want every entity in the area. I might be stupid and there is a simple thing to do but i don't know.
You can try to put this in the OnBlockTickUpdate procedure, but be careful because searching for entities in a large radius can cause various lag problems. I recommend that you reduce the tick update interval of your block in case you intend to add many such blocks to the world.
Only seen this now but cheers I'll try it out
To reduce the size of your procedure, since it is a fixed 3x3 size, remove the radius variable and just use the number 3 in your "for each entity..." function as the variable is unnecessary in this use.
I can't put it as a block tick update trigger because it's "Missing dependencies". I think its something to do with the fact the procedure is naming entities but I'm not sure how to fix it.