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

Hi!

 

I have a problem with the BlockEvent#EntityPlaceEvent. Not a problem with the event or how to subscribe to it, that works perfectly fine. So I check the block the player places if that block is a specific block then it goes to second if statement (I know I could use one but this way it is more clear what is happening in the code. Gonna use one if statement later) the second if statement should check if that block has enough charges or not. Now in my mod there is only one block that has a "public int charge" in it's class. I have no idea how to check for that value. I was thinking about something like getInstanceAtLocationOfSpecificBlock() but there is no such function. Any ideas how to manage this?

You cannot just put an int variable in your block class, this will not work, as only one instance of your block class exists in the game. To do what you want you have to use blockstate properties or a tile entity. Take a look at the vanilla RespawnAnchorBlock, which is a block that can be charged multiple times

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

  • Author

I took a look at the RespawnAnchorBlock code, but it's full of functions like: 

func_235566_a_()

It's really hard to find out what is happening exactly. 

 

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.