Started by
Kubsonix_modding
on
Topic category: Help with Minecraft modding (Java Edition)
i want to make a tesla coil for my mod. it should work like if your distance from tesla coil is less than 5 blocks it should attack you
Topic category: Help with Minecraft modding (Java Edition)
i want to make a tesla coil for my mod. it should work like if your distance from tesla coil is less than 5 blocks it should attack you
Do you mean, say, as a block, or as an entity?
Either way, you can use an entity iterator bracket to target entities within a certain range. You would probably want to use some sort of projectile attack, which would be easier to program for an entity than a block, but either method is possible. Instead of an entity iterator, you could also try using the 'does entity of [type] exist in radius' function, along with the 'nearest entity of [type]' function to target one entity at a time, and prioritize the closest.