Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

  • Author

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.

  • Author

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.