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.

maximuslotro

Members
  • Joined

  • Last visited

Everything posted by maximuslotro

  1. Understood. Just to clarify, the client doesn't need to be modded? I just want to have a vanilla client use the crafting gui without a physical table, or mods.
  2. Using: NetworkHooks.openGui(Splayer, new SimpleMenuProvider( (containerId, playerInventory, player) -> new VirtualCraftingMenu(containerId, playerInventory), CONTAINER_TITLE )); to open the menu results in the same problem
  3. Using this code: player.openMenu(getMenuProvider(player.level, player.blockPosition())); public MenuProvider getMenuProvider(Level p_52241_, BlockPos p_52242_) { return new SimpleMenuProvider((p_52229_, p_52230_, p_52231_) -> { return new VirtualCraftingMenu(p_52229_, p_52230_); }, CONTAINER_TITLE); } I get the crafting gui to fully open stay open, but putting items into the crafting gid will not show an output item
  4. I have extended the crafting menu public class VirtualCraftingMenu extends CraftingMenu { private final ContainerLevelAccess access; public VirtualCraftingMenu(int p_39356_, Inventory p_39357_, ContainerLevelAccess p_39358_) { super(p_39356_, p_39357_, p_39358_); this.access = p_39358_; } public VirtualCraftingMenu(int p_39353_, Inventory p_39354_) { this(p_39353_, p_39354_, ContainerLevelAccess.NULL); } // Override to return your menu type that identifies the screen to use @Override public MenuType<?> getType() { return MenuType.CRAFTING; } // Override to identify the block instance (used to force the user out of the screen if the block is destroyed) @Override public boolean stillValid(Player p_39368_) { //return stillValid(this.access, p_39368_, MY_CRAFTING_BLOCK.get()); return true; } } How would i now open it with player.openMenu() it is asking for a MenuProvider.
  5. Ok, I kinda new that wouldn't be ideal 😥 Thanks so much! I will try and implement that and will get back to you
  6. I'm creating a server-side mod that would allow one to use the command /craft and the crafting gui opens. In old versions (1.12.2) it would be done with this code. EntityPlayerMP player = someMethod(args) player.displayGui(new BlockWorkbench.InterfaceCraftingTable(player.world, player.getPosition())); In 1.18.2, I can cause the crafting gui/menu to open for a brief second with this code. if (commandContext.getSource().getEntity() instanceof Player) { ServerPlayer player = (ServerPlayer)commandContext.getSource().getEntity(); player.sendMessage(new TextComponent("Opening Crafting table"), player.getUUID()); CraftingTableBlock craftingTableBlock = new CraftingTableBlock(BlockBehaviour.Properties.of(Material.WOOD).strength(2.5F).sound(SoundType.WOOD)); player.openMenu(craftingTableBlock.getMenuProvider(craftingTableBlock.defaultBlockState(), player.getLevel(), player.blockPosition())); return Command.SINGLE_SUCCESS; } How do i stop it from closing? I'm probably calling the wrong methods.

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.