Search in sources :

Example 1 with MobEntity

use of net.minecraft.entity.MobEntity in project AgriCraft by AgriCraft.

the class GeneAnimalAttractant method onEntitySpawned.

@SubscribeEvent
@SuppressWarnings("unused")
public void onEntitySpawned(EntityJoinWorldEvent event) {
    if (!event.getWorld().isRemote() && this.clazz.isInstance(event.getEntity())) {
        MobEntity entity = this.clazz.cast(event.getEntity());
        EatCropGoal goal = new EatCropGoal(this, entity, SPEED, COOLDOWN, this.defaultPlantIds);
        if (EntityHelper.injectGoal(entity, goal, PRIORITY)) {
            CapabilityEatCropGoal.getInstance().setCropEatGoal(entity, goal);
        }
    }
}
Also used : MobEntity(net.minecraft.entity.MobEntity) CapabilityEatCropGoal(com.infinityraider.agricraft.capability.CapabilityEatCropGoal) SubscribeEvent(net.minecraftforge.eventbus.api.SubscribeEvent)

Aggregations

CapabilityEatCropGoal (com.infinityraider.agricraft.capability.CapabilityEatCropGoal)1 MobEntity (net.minecraft.entity.MobEntity)1 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)1