package me.coolade.korra.abilities; import java.util.ArrayList; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerAnimationEvent; import com.projectkorra.ProjectKorra.Methods; public class IgniteListener implements Listener { @EventHandler(priority = EventPriority.NORMAL) public void onLeftClick(PlayerAnimationEvent event) { Player player = event.getPlayer(); if(!Methods.canBend(player.getName(), "Ignite")) return; if(Methods.isRegionProtectedFromBuild(player, "Ignite", player.getLocation())) return; Entity target = Methods.getTargetedEntity(player, 10, new ArrayList()); if(target == null) return; if(!(target instanceof LivingEntity)) return; LivingEntity livingTarget = (LivingEntity) target; livingTarget.setFireTicks(100); } }