how can i make a tesla coil

Started by Kubsonix_modding on

Topic category: Help with modding (Java Edition)

Last seen on 14:13, 6. Apr 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how can i make a tesla coil

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

 

Last seen on 04:26, 1. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do you mean, say, as a block…
Sun, 04/07/2024 - 18:44

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.