1.8.8 Create a LightningStrike entity before spawning it in the world?

Discussion in 'Spigot Plugin Development' started by OshaGon, Jan 18, 2021.

  1. Pretty much in the title. The idea is that I want to create the Lightning Strike entity first without spawning it to store in the map, such that when it does spawn and when I use the LightningStrikeEvent, it'll exist in the map. I cannot use world#strikeLightning(location) because by the time the event is called, I won't have the chance to insert it in the map. Any ideas?

    I managed to create a NMS EntityLightning, but I'm having trouble spawning the actual Bukkit Lightning into the world to trigger the event as well, if that leads anywhere...
     
  2. What's really funny is that this somehow solved my issue... I was going down a rabbit hole and as I was trying to reword my original question, I stumbled upon a solution. Thank you!
     
    • Friendly Friendly x 1
  3. wait so you want to create the lightning, add it to a map, spawn it, listen to the event, and get the lightning from the map?


    you can just get the lightning that just spawned with the event without using the map.
     
  4. Get the location of where you wanna spawn whatever, strike it with lightning then spawn a mob or whatever at that spot
     
  5. Yeah pretty much, I was being super small brain and got distracted by the previous implementation.