From 5082fd42f36c9b910b17ee11954a22d10671d604 Mon Sep 17 00:00:00 2001 From: B1G-FUNGUS Date: Mon, 4 Oct 2021 15:36:18 -0700 Subject: [PATCH] ruhwerwerwer --- .../quidproquo/rituals/RSpawnEggRitual.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/main/java/top/penowl/quidproquo/rituals/RSpawnEggRitual.java diff --git a/src/main/java/top/penowl/quidproquo/rituals/RSpawnEggRitual.java b/src/main/java/top/penowl/quidproquo/rituals/RSpawnEggRitual.java new file mode 100644 index 0000000..c44bd7a --- /dev/null +++ b/src/main/java/top/penowl/quidproquo/rituals/RSpawnEggRitual.java @@ -0,0 +1,43 @@ +package top.penowl.quidproquo.rituals; + +import java.util.Random; + +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.material.SpawnEgg; +import org.bukkit.Material; + +import top.penowl.quidproquo.Ritual; + +public class RSpawnEggRitual extends Ritual { + + private static final EntityType[] pEnt = { + EntityType.BAT, EntityType.BLAZE, EntityType.CAVE_SPIDER, EntityType.CHICKEN, + EntityType.COW, EntityType.CREEPER, EntityType.ENDERMAN, EntityType.ENDERMITE, + EntityType.GHAST, EntityType.GUARDIAN, EntityType.HORSE, EntityType.MAGMA_CUBE, + EntityType.MUSHROOM_COW, EntityType.OCELOT, EntityType.PIG, EntityType.PIG_ZOMBIE, + EntityType.RABBIT, EntityType.SHEEP, EntityType.SILVERFISH, EntityType.SKELETON, + EntityType.SLIME, EntityType.SPIDER, EntityType.SQUID, EntityType.VILLAGER, + EntityType.WITCH, EntityType.WOLF, EntityType.ZOMBIE + }; + + @Override + public void setup() { + /* addIngredient(Material.EGG, 16); + addIngredient(Material.WHEAT, 64); */ + addIngredient(Material.MOSSY_COBBLESTONE, 1); + name = "egging"; + // health = 2; + } + + @Override + public void execute(Player caster, Player target, Location location) { + Random random = new Random(); + SpawnEgg sEgg = new SpawnEgg(pEnt[random.nextInt(pEnt.length)]); + ItemStack egg = sEgg.toItemStack(1); + location.getWorld().dropItemNaturally(location.clone().add(0, 1, 0), egg); + } + +}