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.

The Typholorian

Members
  • Joined

  • Last visited

Everything posted by The Typholorian

  1. New issue. I got the keybind to work, but I have an issue with the procedure. It opens the GUI, but closes it nearly instantly. I set it to run the procedure when the key gets released. Here's my procedure code: package net.the_typholorian.skilled.procedures; import net.the_typholorian.skilled.world.inventory.InventoryGUIMenu; import net.minecraftforge.server.ServerLifecycleHooks; import net.minecraftforge.network.NetworkHooks; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.Entity; import net.minecraft.world.MenuProvider; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.network.chat.Component; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.core.BlockPos; import io.netty.buffer.Unpooled; public class InventoryProcedureProcedure { public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) { if (entity == null) return; boolean Disabler = false; Disabler = false; if ((entity instanceof Player _plr ? _plr.containerMenu instanceof InventoryGUIMenu : false) && Disabler == false) { if (!world.isClientSide()) { MinecraftServer _mcserv = ServerLifecycleHooks.getCurrentServer(); if (_mcserv != null) _mcserv.getPlayerList().broadcastSystemMessage(Component.literal("close"), false); } if (entity instanceof Player _player) _player.closeContainer(); Disabler = true; } if (!(entity instanceof Player _plr ? _plr.containerMenu instanceof InventoryGUIMenu : false) && Disabler == false) { if (!world.isClientSide()) { MinecraftServer _mcserv = ServerLifecycleHooks.getCurrentServer(); if (_mcserv != null) _mcserv.getPlayerList().broadcastSystemMessage(Component.literal("open"), false); } { if (entity instanceof ServerPlayer _ent) { BlockPos _bpos = new BlockPos(x, y, z); NetworkHooks.openScreen((ServerPlayer) _ent, new MenuProvider() { @Override public Component getDisplayName() { return Component.literal("InventoryGUI"); } @Override public AbstractContainerMenu createMenu(int id, Inventory inventory, Player player) { return new InventoryGUIMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(_bpos)); } }, _bpos); } } Disabler = true; } } }
  2. What do I do with it? Do I just put it in the ModKeyMappings.java?
  3. Found the issue. I think that the keybind does not work when the GUI is open. How to fix?
  4. Delete from pack: Refined Storage, Mekanism, Mekanism Addons
  5. Image of the top of the red stuff
  6. IntelliJ? Im coding with that rn
  7. Hmm. Can you send an image, so it has color coding?
  8. I am trying to make a GUI. It is supposed to replace the normal inventory. I made a keybind and such and here's the procedure when E is released: package net.the_typholorian.skilled.procedures; import net.the_typholorian.skilled.world.inventory.InventoryGUIMenu; import net.minecraftforge.server.ServerLifecycleHooks; import net.minecraftforge.network.NetworkHooks; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.Entity; import net.minecraft.world.MenuProvider; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.network.chat.Component; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.core.BlockPos; import io.netty.buffer.Unpooled; public class OpenInventoryProcedure { public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) { if (entity == null) return; if (entity instanceof Player _plr ? _plr.containerMenu instanceof InventoryGUIMenu : false) { if (entity instanceof Player _player) { _player.closeContainer(); } if (!world.isClientSide()) { MinecraftServer _mcserv = ServerLifecycleHooks.getCurrentServer(); if (_mcserv != null) _mcserv.getPlayerList().broadcastSystemMessage(Component.literal("close"), false); } } else if (!(entity instanceof Player _plr ? _plr.containerMenu instanceof InventoryGUIMenu : false)) { { if (entity instanceof ServerPlayer _ent) { BlockPos _bpos = new BlockPos(x, y, z); NetworkHooks.openScreen((ServerPlayer) _ent, new MenuProvider() { @Override public Component getDisplayName() { return Component.literal("InventoryGUI"); } @Override public AbstractContainerMenu createMenu(int id, Inventory inventory, Player player) { return new InventoryGUIMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(_bpos)); } }, _bpos); } } if (!world.isClientSide()) { MinecraftServer _mcserv = ServerLifecycleHooks.getCurrentServer(); if (_mcserv != null) _mcserv.getPlayerList().broadcastSystemMessage(Component.literal("open"), false); } } } } I added text messages for debugging. It opens the inventory just fine, but it does not close or send the message in chat. It can only close by pressing 'Escape', which closes all GUIs. Can somebody help me?

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.