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

I'm trying to make the bed in the nether not explode when you right click it but I just can't do it, I tried to cancel the right click with PlayerInteractEvent.RightClickBlock event and it still exploded, I read somewhere to it depends on the WorldProvider (if canRespawnHere returns true), and I already got a custom WorldProviderHell which I load by unregistering the dimension and then registering it with that WorldProvider, I overriden WorldProviderHell#canRespawnHere in the custom world provider and made it return true but the bed still explodes.

As mentioned, the code is in the onBlockActivated() method of the BlockBed class. You need to not allow allow the respawn but also the biome cannot be biome.HELL. You have two choices to fix it -- change the biome of your world or replace the bed block with your own custom block.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

I guess I'll better work on a custom bed because everyone knows to beds explode in nether, don't want to go through trouble of changing default nether biome, Thanks! If I need some help with the bed I'll probably reply to this topic, but I just need to make my own onBlockActivated

Edited by Terrails

Note that one of the difficulties with replacing a block like bed, is that the specific Blocks.BED instance is used throughout the code. I really, really wish that everywhere instances were checked that they were changed to instanceof type checks as that would make modding much easier -- imagine if all you have to do is extend the BlockBed and all the other code that checks for beds would accept your custom bed.

 

So you can't just create your own custom bed and register it normally, but you need to actually replace the Blocks.BED instance with an instance of your own bed. The good news is that it is a public field so I think you can simply reassign it. But I'm just pointing out to take care that you need all the code that checks for == Blocks.BED to work for your custom bed.

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

15 minutes ago, jabelar said:

So you can't just create your own custom bed and register it normally, but you need to actually replace the Blocks.BED instance with an instance of your own bed. The good news is that it is a public field so I think you can simply reassign it. But I'm just pointing out to take care that you need all the code that checks for == Blocks.BED to work for your custom bed.

Actually, no. You create your own bed, register it normally, but, you make its registry name "minecraft:bed"

Forge takes care of the rest.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.