Jump to content

Crafting menu not opening on right click after update to vanilla crafting table


Capricocious

Recommended Posts

Hi, I'm creating a mod that involved reskinning the default crafting table to look like a real table, I have re-registered the item with the method .noOcclusion() so you can't see the rest of the world under the table legs:

public static final RegistryObject<Block> CraftingTableBlock = VANILLA_BLOCKS.register("crafting_table",
() -> new Block(BlockBehaviour.Properties.of(Material.WOOD).destroyTime(5).sound(SoundType.WOOD).noOcclusion()));

However, on right-click the table no longer brings up the crafting menu. I've had to re-register the crafting table block item to ensure it shows up in the creative menu. I have looked in the java file for the craftingTableBlock and found the use and getMenuProvider methods, but I'm not sure how to call them. Is it a similar task I need to do to re-register the crafting menu so it can be opened? If anyone could provide some guidance it would be much appreciated <3

Minecraft version: 1.19.2
Forge version: 43.1.7

I'm the CEO of breaking things 

Link to comment
Share on other sites

You can't just replace the crafting table. Look at the CraftingMenu.stillValid() check

or see for example: https://forums.minecraftforge.net/topic/114789-best-way-to-create-a-custom-crafting-table-in-119/?do=findComment&comment=508881

 

In general it is a bad idea to replace vanilla objects in the registries.

You will just create conflicts with other mods trying to do the same thing or run into code where Mojang hard wires things.

 

What you should do is create your own block and let users or modpack developers decide whether to use your crafting table.

e.g. they can change the recipe so it crafts your block instead of the vanilla one using a datapack.

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.

Link to comment
Share on other sites

Hi warjort, thanks for the input!

Is there a better way to turn off culling for blocks surrounding the vanilla crafting table rather than trying to overwrite the registries? I'd like to just use a resource pack to reskin it if I can, but I wasn't able to find a way to stop the faces of the surrounding blocks from culling.

Or is it most sensible to just create my table as a new block?

I'm the CEO of breaking things 

Link to comment
Share on other sites

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.