Started by
Wekio
on
Topic category: Feature requests and ideas for MCreator
Not sure if this has been suggested already, or if there's a workaround for this. (I'm still fairly new to mcreator)
Essentially just a condition field for whether or not the entity-bound gui gets opened or not. Right now I'm making a Custom-NPC's styled mod, and want entity inventories to be opened only when right-clicked while a certain item is held. If there is a way to do this already, I'd greatly appreciate someone letting me know as I haven't found any documentation on it and haven't been able to figure it out myself.
Bump
Bumping again - if this is already possible I'd appreciate some help
You can use procedures.
First make a procedure triggered when you're entity is right click(make a new procedure if you don't have any ) and add a if block to your procedure before your opening of screen like "if the player has a wrench in hand,open inventory
For clarification I didn't include in my original post, I'm trying to find a workaround for binding the inventory to the entity in the actual entity section mcreator provides. When making a new entity and enabling it's inventory, and binding a gui to it, mcreator automatically links opening the inventory to right click, seperate from any procedure one might make. No matter what I seem to do, I can't seem to override this with any additional procedures. I've messed around some more and followed your suggestion, but ran into the same roadblock... I've created a "can opener" item to open an npc's inventory when right clicked. I've created if blocks for opening the gui when right clicking the npc with the can opener, however this opens an unbound inventory gui, and not one linked to the npc - any items put in are lost as soon as the gui is closed. Additionally, I've tried overriding the base inventory right click mcreator causes with a procedure causing all open gui's to be closed for the player upon right click if not holding the can opener, but for some reason this doesn't work either and the inventory is still opened even with an empty hand.
In short, I'm looking for a way to apply a condition to the actual inventory function of the entity section within MCreator. As far as I've tested I can't come up with a way to do this with procedures, as there's no way to link an inventory gui to an entity instance within procedures. I know the typical response is "You'll need to code it manually" or "Time to learn Java", but I feel as though this would be an excellent addition to mcreator and a useful tool for mod developers. That being said if anyone has found an actual workaround I'd love some help on this!