Search in sources :

Example 1 with CraftLightningStrike

use of org.bukkit.craftbukkit.v1_15_R1.entity.CraftLightningStrike in project solinia3-core by mixxit.

the class SpecialEffectUtils method playLightningStrike.

public static void playLightningStrike(Entity entity) {
    try {
        Location loc = entity.getLocation();
        net.minecraft.server.v1_15_R1.WorldServer world = ((CraftWorld) loc.getWorld()).getHandle();
        EntityLightning lightning = new EntityLightning(world, loc.getX(), loc.getY(), loc.getZ(), true, true);
        world.strikeLightning(lightning);
        new CraftLightningStrike(world.getServer(), lightning);
        return;
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : EntityLightning(net.minecraft.server.v1_15_R1.EntityLightning) CraftLightningStrike(org.bukkit.craftbukkit.v1_15_R1.entity.CraftLightningStrike) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld) Location(org.bukkit.Location)

Aggregations

EntityLightning (net.minecraft.server.v1_15_R1.EntityLightning)1 Location (org.bukkit.Location)1 CraftWorld (org.bukkit.craftbukkit.v1_15_R1.CraftWorld)1 CraftLightningStrike (org.bukkit.craftbukkit.v1_15_R1.entity.CraftLightningStrike)1