Jump to content

Recommended Posts

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.

Posted (edited)

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
Posted (edited)

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/

Posted
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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.