Jump to content

[1.8][Solved] TileEntity update not being called consistently


ratismal

Recommended Posts

Hello,

 

I've run into an issue that I can't seem to solve.

 

Objective: Create a block that checks if players are in creative mode. If so, set to adventure mode and give them a message related to them not being allowed in creative mode.

 

Progress: Block sets players to adventure mode almost immediately after they switch to creative, which is desirable.

 

Issue: The message is not being sent 100% of the time. Whether or not it is actually sent seems to be completely random.

 

Source: GitHub

 

The update function changes the player's gamemode consistently. If I add a debug log outside of the isRemote statement, sometimes it appears in console once and sometimes twice. I believe the issue is the function, while always getting called server side, it's not always getting called client side. I am unsure of how to fix this. Any help would be greatly appreciated. I will be happy to provide any more information if needed.

 

Thank you for your time,

Ratismal

Did I help you? Don't be afraid to give that 'thank you' button a good smack for me!

It's been looking at me weirdly for a while now.

Link to comment
Share on other sites

You must only run the code on the server. Currently you run it (mostly) only on the client.

 

Thanks! I forgot that player.addChatMessage(...) worked server-side.

 

Just out of curiosity, is there a reason why the update() function isn't consistently called client-side?

Did I help you? Don't be afraid to give that 'thank you' button a good smack for me!

It's been looking at me weirdly for a while now.

Link to comment
Share on other sites

Hmm. It should, but it wasn't. I'm not sure what would cause that.

 

In any case, I'm just happy that it's working. I'll stop poking it lest it also stops :P

Did I help you? Don't be afraid to give that 'thank you' button a good smack for me!

It's been looking at me weirdly for a while now.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.