- added some custom food and drinks

- added kand coins
- started working on the blazing set
This commit is contained in:
FantasyPvP
2024-07-11 12:06:50 +01:00
parent 7f74460775
commit bb1e1d8b0b
28 changed files with 599 additions and 101 deletions
@@ -0,0 +1,65 @@
package fantasypvp.kand.events;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.Listener;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.potion.PotionEffect;
import static org.bukkit.Bukkit.*;
public class Events implements Listener {
@EventHandler
public static void onEntityDamageByEntity(org.bukkit.event.entity.EntityDamageByEntityEvent event) {
if (event.getDamager() instanceof org.bukkit.entity.Player) {
Player player = (Player) event.getDamager();
// check if the player is using the lightning sword
try {
player.getInventory().getItemInMainHand().getItemMeta().getLore().toString();
} catch (NullPointerException e) {
return;
}
if (player.getInventory().getItemInMainHand().getItemMeta().getLore().toString().contains("§7All who oppose shall be smitten")) {
// check if hit is critical
if (player.getFallDistance() > 0.0F && !player.isInsideVehicle() && !player.isGliding() && !player.isSwimming() && !player.isClimbing() && player.getAttackCooldown() == 1.0F) {
player.getWorld().strikeLightningEffect(event.getEntity().getLocation());
}
}
else if (player.getInventory().getItemInMainHand().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Sword")) {
// if affected entity is wearing witherite gear
if (event.getEntity() instanceof Player) {
Player entity = (Player) event.getEntity();
if (entity.getInventory().getHelmet().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Helmet")
&& entity.getInventory().getChestplate().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Chestplate")
&& entity.getInventory().getLeggings().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Leggings")
&& entity.getInventory().getBoots().getItemMeta().getLore().toString().contains("§f[T5+] Witherite Boots")) {
;
} else {
PotionEffect effect = new PotionEffect(
org.bukkit.potion.PotionEffectType.WITHER,
20 * 5,
2
);
effect.apply((LivingEntity) event.getEntity());
}
} else {
PotionEffect effect = new PotionEffect(
org.bukkit.potion.PotionEffectType.WITHER,
20 * 5,
2
);
effect.apply((LivingEntity) event.getEntity());
}
}
}
}
}