Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
@Override
public boolean itemInteractionForEntity(ItemStack is, EntityPlayer player, EntityLivingBase entity) {
if (entity instanceof EntityAnimal) {
((EntityAnimal)entity).func_146082_f(player);
return true;
}
return false;
}
@Override
public boolean itemInteractionForEntity(ItemStack is, EntityPlayer player, EntityLivingBase entity) {
if (entity instanceof EntityAnimal) {
((EntityAnimal)entity).setInLove(player);
return true;
}
return false;
}
entity_animal.tasks.addTask(4, new EntityAITempt(entity_animal, 1.25D, SMTPhytology.item.itemFeed, false));
@SubscribeEvent
public void addTempt(LivingUpdateEvent event)
{
boolean cow = true;
boolean horse = true;
if (event.getEntity() instanceof EntityAnimal)
{
EntityAnimal animal = (EntityAnimal)event.getEntity();
if (cow && animal instanceof EntityCow)
{
animal.tasks.addTask(3, new EntityAITempt(animal, 1.25D, ModItems.item, false));
cow = false;
}
if (horse && animal instanceof EntityHorse)
{
animal.tasks.addTask(3, new EntityAITempt(animal, 1.25D, ModItems.item, false));
horse = false;
}
}
}