Posted December 20, 201311 yr Hello, I have another issue: In my ItemGun i have this: if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityBullet(par2World, ((EntityPlayer)par3Entity), 21.0F)); par2World.spawnEntityInWorld(new EntityNoiseLocation(par2World, ((EntityPlayer)par3Entity), this.noiseRange)); } And in my EntityBullet i have this in onUpdate: if(this.stopTick && this.doneDisplay) { int nbMs = nbTicks * 50; System.out.println(this.entityId + " 100 meters in " + nbMs + "ms"); this.doneDisplay = false; } this.stopTick take false when in onUpdate again: if (this.inGround) { int j = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); this.stopTick = true; ............ } My issue is when my bullet hit a block, this: System.out.println(this.entityId + " 100 meters in " + nbMs + "ms"); is writting twice in consol and most of time nbMs is different (1 tick more) I don't know why this is showing twice, my entity is only spawning once i think with isRemote. Thanks
December 20, 201311 yr Hi onUpdate is called both on server and client side. Spawning an entity on the server side automatically spawns a "copy" on the client side, and onUpdate are called for both of them. If you want your message on one side only, then use isRemote, like you did when spawning the bullet. -TGG
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.