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);
}
}
}
Aggregations