MinecraftScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a zombie egg"
/* First, create a custom spawn egg item class that extends SpawnEggItem */ public class ZombieSpawnEggItem extends SpawnEggItem { public ZombieSpawnEggItem(int primaryColor, int secondaryColor, Properties properties) { super(null, primaryColor, secondaryColor, properties); } @Override public EntityType<?> getType(@Nullable CompoundTag nbt) { return EntityType.ZOMBIE; } } /* Then, register the item in your mod's item registry */ public static final RegistryObject<Item> ZOMBIE_SPAWN_EGG = ITEMS.register("zombie_spawn_egg", () -> new ZombieSpawnEggItem(0x00AFAF, 0x795548, new Item.Properties().tab(ItemGroup.TAB_MISC)));