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

Yo! Here again, I'm trying to create a new custom GUI Screen, smthing like, press V and it displays a GUI with buttons, etc.

So, how can I create it? extending screen? And how can I register it? Btw, there's any doc or example?

24 minutes ago, Zanckor said:

So, how can I create it?

depends on what the Screen should do? Do you only want to have a Button?

24 minutes ago, Zanckor said:

extending screen?

a Screen extension is in all cases required

25 minutes ago, Zanckor said:

Btw, there's any doc or example?

unfortunately there is no doc but you can take a look at all vanilla Screens as an example

  • Author
1 minute ago, Luis_ST said:

depends on what the Screen should do? Do you only want to have a Button?

I want a Button that increase a capability per one, like a stat "Stamina" that i want to increase one per one.

Something like a MMORPG menu to increase my stats

create a new class and extends Screen,
override #init and add there all Buttons you want (use #addRenderableWidget)

inside the OnPress action of the Button you need to send a custom Network Packet (see: https://forge.gemwire.uk/wiki/SimpleChannel) to the server
which increase your Capability value, if your Capability is also required on the client you need to sync it back after the value changes

Ad hoc screens don't need to be registered. You only register container screens.

Use ClientRegistry.registerKeyBinding() and have it do Minecraft.setScreen()

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

  • Author
2 minutes ago, diesieben07 said:

Do not use @OnlyIn.

ItemPickupEvent is a server side event, you cannot directly open a screen from there.

Oh okay, i was thinking that too xD, and about the rest of the code? There's something wrong?

15 minutes ago, Zanckor said:

about the rest of the code? There's something wrong?

looks okay, your Button is just 1x1 large but everything else looks okay

Edit: you should not super null in the constructor

Edited by Luis_ST

You need a render method in your screen and then use renderBackground()

Don't forget to call super.render() after that to draw the widgets.

There is also renderDirtBackground() if you want that.

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

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.