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

Hello.

 

I've created a custom rendered gate that open and closes with a gui button but it seems to open and close other gates in your view.

 

I have looked at my code and cant see where im going wrong.

 

I have all my code available on github https://github.com/paranormalryno/Test-Mod

 

Thanks.

 

 

i think that you will need packets to sync your client(gui) with server....

Here could be your advertisement!

  • 3 weeks later...
  • Author

I have looked into packets and got the basics up but im stuck with how to sync the button press with the server.

 

I have updated the github with the Packet Handler and Message class.

  • Author

If you have a Container (which you do) you don't need custom packets. Just call Minecraft#playerController.sendEnchantPacket(windowID, buttonID) when the button is pressed. That will trigger a call to the enchantItem method on your Container on the server, with the same ID.

 

I've added a enchantItem method in my container which now sends the command to open or close the gate and added the sendEnchantPacket under the actionPreformed sending the windowID and buttonID but im getting a NullPointerException. I not sure if I'm doing it correct but after looking at the enchantment GUI and Container class that's what I came up with.

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.