tutorial:spawn_egg
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:spawn_egg [2021/07/18 18:01] – created spawn egg page (feel free to make changes if you would like to) daviddevsdumbstuff | tutorial:spawn_egg [2023/01/15 01:30] – [Creating the Spawn Egg] solidblock | ||
---|---|---|---|
Line 7: | Line 7: | ||
<code java> | <code java> | ||
public class ExampleMod implements ModInitializer { | public class ExampleMod implements ModInitializer { | ||
- | public static final Item IRON_GOLEM_SPAWN_EGG = new SpawnEggItem(EntityType.IRON_GOLEM, | + | public static final Item IRON_GOLEM_SPAWN_EGG = new SpawnEggItem(EntityType.IRON_GOLEM, |
} | } | ||
</ | </ | ||
- | The spawn egg item takes an entity type, a primary and secondary color, and an item settings option.\\ It also uses decimal coloring for the spawn egg colors. Not hexadecimal, | + | :!:This example is used for versions //before// 1.19.3, as Minecraft 1.19.3 directly added iron golem spawn eggs. However, you can create spawn eggs for other entity types. In 1.19.3, remember to remove the '' |
- | You can also [[https:// | + | |
+ | The spawn egg item takes an entity type, a primary and secondary color, and an item settings option. | ||
After you've done that, you will need to register your item: | After you've done that, you will need to register your item: | ||
Line 17: | Line 18: | ||
public class ExampleMod implements ModInitializer { | public class ExampleMod implements ModInitializer { | ||
- | public static final Item IRON_GOLEM_SPAWN_EGG = new SpawnEggItem(EntityType.IRON_GOLEM, | + | public static final Item IRON_GOLEM_SPAWN_EGG = new SpawnEggItem(EntityType.IRON_GOLEM, |
@Override | @Override | ||
public void onInitialize() { | public void onInitialize() { | ||
- | Registry.register(Registry.ITEM, | + | Registry.register(Registry.ITEM, |
+ | // For versions above 1.19.3, replace '' | ||
} | } | ||
} | } |
tutorial/spawn_egg.txt · Last modified: 2023/01/15 01:33 by solidblock