Posted October 23, 20205 yr Small clarification, this is my very first mod on minecraft. I basically cloned the minecraft crafting table to make more variables of it, it find out that the vanilla gui won't open if the block is not the original vanilla one. Is there a tutorial o someone who can explain me to put a custom gui to my block and make it work like the vanilla one?
October 23, 20205 yr I see you already made a post regarding the crafting table GUI: https://forums.minecraftforge.net/topic/92683-1163-my-item-gui-closes-instantaneously/ Didn't the answer you received help you? Does your GUI still open and closes right after, or doesn't show up at all? Be more specific please, and show what you tried Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
October 23, 20205 yr Author 2 minutes ago, Beethoven92 said: I see you already made a post regarding the crafting table GUI: https://forums.minecraftforge.net/topic/92683-1163-my-item-gui-closes-instantaneously/ Didn't the answer you received help you? Does your GUI still open and closes right after, or doesn't show up at all? Be more specific please, and show what you tried I understood what the problem was and try to solve it by following some tutorials in internet, everything that i found was related to chest and furnaces, and some commands that works in 1.15 but in 1.16 needs some new parameters, so i'm stuck again with the same This is my code, simple has the idea of the mod
October 23, 20205 yr Mmmm it seems you did not folllow the advice of Draco18s, which i'll quote here: Quote You're trying to use the vanilla crafting GUI. The vanilla crafting gui checks to see if the block being accessed is The One And Only Vanilla Crafting Table. Your block is not The One And Only Vanilla Crafting Table. Therefor the use of that gui is invalid and thus closed. Your block extends the vanilla CraftingTableBlock class, but its not the vanilla crafting table itself (Blocks.CRAFTING_TABLE)...the vanilla crafting table container checks for the player proximity only with the Block.CRAFTING_TABLE, so of course your block doesn't satisfy the condition for the container to open. I think you would need to create a custom container which extends WorkbenchContainer and override the canInteractWith method to check for proximity with your own crafting table block. Then you have to tell your CraftingTable block to open your custom container instead of the vanilla one. You can see how vanilla opens the WorkbenchContainer by looking inside the CraftingTableBlock class. I don't know if this is the best way to achieve this though, there may be a better way Edited October 23, 20205 yr by Beethoven92 Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
October 23, 20205 yr Author 41 minutes ago, Beethoven92 said: Mmmm it seems you did not folllow the advice of Draco18s, which i'll quote here: Your block extends the vanilla CraftingTableBlock class, but its not the vanilla crafting table itself (Blocks.CRAFTING_TABLE)...the vanilla crafting table container checks for the player proximity only with the Block.CRAFTING_TABLE, so of course your block doesn't satisfy the condition for the container to open. I think you would need to create a custom container which extends WorkbenchContainer and override the canInteractWith method to check for proximity with your own crafting table block. Then you have to tell your CraftingTable block to open your custom container instead of the vanilla one. You can see how vanilla opens the WorkbenchContainer by looking inside the CraftingTableBlock class. I don't know if this is the best way to achieve this though, there may be a better way I think you gave me an idea what I can do about it, thanks for your answer, I will update this topic later to report if it worked or not
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.