Jump to content

Recommended Posts

Posted

Hello,

 

I'm trying to create a custom door (ie, a vanilla door with a different texture). Here's my code. Basically, I created a new class called ModBlockDoor that extends the vanilla BlockDoor

The project compiles perfectly, and runs without a hitch. The only problem is that in game, when I place the door, it only places the bottom of the door. The top doesn't get place at all (I know because I'm able to jump over the bottom of the door). 

 

Can anyone let me know how to fix this? I figure I'd need to override some functions in my class, but I'm not sure which ones.

 

Also, do I need a door item? It seems to work without it?

Posted (edited)

I found what I was doing wrong. You can't register a block and an ItemBlock with the same name. So I have an item now that successfully places a door. I just need to find out how to make the texture show up.

 

Thanks,

Edited by DragonFerocity
....
Posted
26 minutes ago, DragonFerocity said:

Does this mean that I don't need an ItemBlock for a door? Just a block and an item?

 

Yes. If you registered an itemblock with your door, that would mean you could place the top/bottom parts independently, which wouldn't make any sense.

26 minutes ago, DragonFerocity said:

Is there a way to register items and blocks independently with the same name?

 

As you state, you can already do this. An ItemBlock is just an Item that places a block when right clicked. It is not a block. You are crashing because you are setting the registry name of your ItemBlock to the same registry name as your Door placer.

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.