Hey guys, I'm developing a mod in 1.7.10 and I'm trying to make a keybind where when you press it it opens an inventory gui, but only if you're wearing my custom leggings. Does anyone know how to do that?
Go ahead and register your custom keybind and inventory. Then make an event handler with an event that will fire every time a key is pressed. Check if the key is your keybind as well as if the armor piece in the leggings slot of the player is your custom leggings. If true, have the game open your inventory. I'm not going to get into the nitty-gritty of the specific code for each step, but there are lots of great tutorials that do.
For what exactly? This is a combination of a few things: GUIs, key bindings and sending packets
That's the problem, I don't know which one I need. I shouldn't need a GUI tutorial as I have already made one before. I have watched tons of keybinds tutorials, but none of them seem to work, and then I don't know what sending packets are.
Well if you're fine with a GUI, then okay. If you're having issues with keybinds, have a go at it and then post back here about it if you have any problems. As for packets, use Forge's docs here for that.
Hey guys, I'm developing a mod in 1.7.10 and I'm trying to make a keybind where when you press it it opens an inventory gui, but only if you're wearing my custom leggings. Does anyone know how to do that?
Thanks,
BloxBoss6
Go ahead and register your custom keybind and inventory. Then make an event handler with an event that will fire every time a key is pressed. Check if the key is your keybind as well as if the armor piece in the leggings slot of the player is your custom leggings. If true, have the game open your inventory. I'm not going to get into the nitty-gritty of the specific code for each step, but there are lots of great tutorials that do.
Also if necessary, you may need to send a packet to the server to open the inventory GUI.
Do you have any links to certain tutorials? I can't seem to find any.
For what exactly? This is a combination of a few things: GUIs, key bindings and sending packets.
That's the problem, I don't know which one I need. I shouldn't need a GUI tutorial as I have already made one before. I have watched tons of keybinds tutorials, but none of them seem to work, and then I don't know what sending packets are.
Well if you're fine with a GUI, then okay. If you're having issues with keybinds, have a go at it and then post back here about it if you have any problems. As for packets, use Forge's docs here for that.