package net.mcreator.cawezsmantletostratus.procedures;

import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Mth;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.network.chat.Component;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.CommandSource;

public class FossilBlockDestroyedByPlayerProcedure {
	public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
		if (entity == null)
			return;
		if (world instanceof ServerLevel _level)
			_level.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, new Vec3(x, y, z), Vec2.ZERO, _level, 4, "", Component.literal(""), _level.getServer(), null).withSuppressedOutput(), "summon minecraft:" + mob());
	}

	private static String mob (){

		int choice = (Mth.nextInt(RandomSource.create(), 0, 77));
		switch(choice) {
			case 0:
				return "blaze";
			case 1:
				return "bogged";
			case 2:
				return "breeze";
			case 3:
				return "creeper";
			case 4:
				return "elder_guardian";
			case 5:
				return "endermite";
			case 6:
				return "evoker";
			case 7:
				return "ghast";
			case 8:
				return "guardian";
			case 9:
				return "hoglin";
			case 10:
				return "husk";
			case 11:
				return "magma_cube";
			case 12:
				return "phantom";
			case 13:
				return "piglin_brute";
			case 14:
				return "pillager";
			case 15:
				return "ravager";
			case 16:
				return "shulker";
			case 17:
				return "silverfish";
			case 18:
				return "skeleton";
			case 19:
				return "slime";
			case 20:
				return "stray";
			case 21:
				return "vex";
			case 22:
				return "vindicator";
			case 23:
				return "warden";
			case 24:
				return "witch";
			case 25:
				return "wither_skeleton";
			case 26:
				return "zoglin";
			case 27:
				return "zombie";
			case 28:
				return "zombie_villager";
			case 29:
				return "bee";
			case 30:
				return "cave_spider";
			case 31:
				return "enderman";
			case 32:
				return "dolphin";
			case 33:
				return "drowned";
			case 34:
				return "fox";
			case 35:
				return "goat";
			case 36:
				return "iron_golem";
			case 37:
				return "llama";
			case 38:
				return "panda";
			case 39:
				return "piglin";
			case 40:
				return "polar_bear";
			case 41:
				return "spider";
			case 42:
				return "trader_llama";
			case 43:
				return "wolf";
			case 44:
				return "zombified_piglin";
			case 45:
				return "allay";
			case 46:
				return "armadillo";
			case 47:
				return "axolotl";
			case 48:
				return "bat";
			case 49:
				return "camel";
			case 50:
				return "cat";
			case 51:
				return "chicken";
			case 52:
				return "cod";
			case 53:
				return "cow";
			case 54:
				return "donkey";
			case 55:
				return "frog";
			case 56:
				return "glow_squid";
			case 57:
				return "horse";
			case 58:
				return "mooshroom";
			case 59:
				return "mule";
			case 60:
				return "ocelot";
			case 61:
				return "parrot";
			case 62:
				return "pig";
			case 63:
				return "pufferfish";
			case 64:
				return "rabbit";
			case 65:
				return "salmon";
			case 66:
				return "sheep";
			case 67:
				return "skeleton_horse";
			case 68:
				return "sniffer";
			case 69:
				return "snow_golem";
			case 70:
				return "squid";
			case 71:
				return "strider";
			case 72:
				return "tadpole";
			case 73:
				return "tropical_fish";
			case 74:
				return "turtle";
			case 75:
				return "villager";
			case 76:
				return "wandering_trader";
			case 77:
				return "zombie_horse";
		}
		return "zombie_horse";	
	}
	
}
