19 mars 2014, 20:55
public void onUpdate(ItemStack stack, World world, Entity entity, int id, boolean isCurrent)
{
if(!world.isRemote)
{
if (this.timer > -1 && entity instanceof EntityPlayer)
{
–this.timer;
}

if (this.timer == 0 && entity instanceof EntityPlayer)
{
ICommandManager icommandmanager = MinecraftServer.getServer().getCommandManager();
icommandmanager.executeCommand((EntityPlayer)entity, "/pokegive @p pichu lvl1");
}
}
}

Les commandes c’est côté serveur uniquement, donc toujours !world.isRemote