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

So, I have set up a "digital" compass in my mod.

When you shift+right click it opens a GUI which you can use to turn it on or off.

It is on then I have a renderer that pops at the top of the screen "DIRECTION_FACING" (being one of the four directions).

 

The question I have is once it is turned on, I can put it in a chest and it will stay on, however once you leave game and rejoin you have to turn it on again. Is it possible to set it up so that if it is turned on its saved "on?" 

I feel like maybe nbt could do it? I'm not experienced with nbt at all so any help is great! Thank you :P

3 minutes ago, minecraftbigfoot said:

It is spread across 4 classes, 2 gui, 1 item, 1 guihandler, want them all?

Yep!

So, the player activates your item and then something is added to the player's overlay display that shows their direction, even when they put the item down? (just checking I understand your aim)

 

To make it work consistently, you will need to store the information in the player (using a capability). Otherwise, what happens if one player activates a compass and another doesn't? Currently, you're storing the state in a static field in your item class so it will apply the same thing to all players no matter what.

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.