Posted February 15, 20187 yr I am creating a block with a tile entity that will spawn a specific enemy after a random amount of time (currently I have it hardcoded to make it easier to debug). A dilemma I had was that since I randomed on both the client and the server there would be two different timers for each side. I tried to solve this by checking if !world.isRemote, but doing this resulted in this being posted in the log whenever I rejoin a world, and the countdown doesn't resume. Another problem is that once the countdown finishes the mob I want to spawn simply doesn't spawn. No crash, no log output, nothing, as if I didn't try and spawn the mob at all. He does spawn if I use a spawn egg however. TileEntity Where I register it (I call registerTileEntities from preInit from my main mod class) EDIT: I found a partial solution. Rather than checking if the world is on the server or not, I am instead sending a packet which syncs the server time with the client. Now my mob spawns! Hooray! Except for I reload the world. If the block is still counting down, then it will stop counting down when I rejoin. If the block has counted down and spawned the mob it will dissapear when I rejoin, and will not count down. In both cases this is a part of what it outputs in the log. Updated Tile Entity Edited February 15, 20187 yr by That_Martin_Guy
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.