Created
August 30, 2016 22:07
-
-
Save AtomicBlom/8e9c31ac675a61876e4bc7809e238beb to your computer and use it in GitHub Desktop.
Simplified use case for the BabyEntitySpawnEvent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.minecraftforge.debug; | |
import net.minecraft.entity.passive.EntityCow; | |
import net.minecraftforge.common.MinecraftForge; | |
import net.minecraftforge.event.entity.living.BabyEntitySpawnEvent; | |
import net.minecraftforge.fml.common.Mod; | |
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; | |
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | |
@Mod(modid = BreedingTest.MODID, name = "BreedingTest", version = "1.0") | |
public class BreedingTest | |
{ | |
public static final String MODID = "breedingtest"; | |
@Mod.EventHandler | |
public void preInit(FMLPreInitializationEvent event) { | |
MinecraftForge.EVENT_BUS.register(this); | |
} | |
@SubscribeEvent | |
public void onBabyBorn(BabyEntitySpawnEvent event) { | |
event.setChild(new EntityCow(event.getChild().worldObj)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment