| package fr.darkvince.facrpg; |
| |
| import fr.darkvince.facrpg.monture.EntityDragonDindeSauvage; |
| import net.minecraft.entity.player.EntityPlayer; |
| import net.minecraft.item.Item; |
| import net.minecraft.item.ItemStack; |
| import net.minecraft.world.World; |
| |
| public class oeufDragonDinde extends Item |
| { |
| public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) |
| { |
| if(!world.isRemote) |
| { |
| EntityDragonDindeSauvage entity = new EntityDragonDindeSauvage(world); |
| entity.setTamed(true); |
| entity.setPosition(x, y + 1, z); |
| entity.func_152115_b(player.getUniqueID().toString()); |
| world.spawnEntityInWorld(entity); |
| } |
| return true; |
| } |
| } |
Avec entity.func_152115_b(player.getUniqueID().toString()); au bon endroit et pas de @SideOnly(Side.CLIENT) au dessus de la fonction ça fonctionne mieux