#Is there a way to use the anvil typing field as an "placeholder" of an command

1 messages · Page 1 of 1 (latest)

marble briar
#

I want to add friends over a menu and what you put in the anvil should go into the variable /friend add (Variable)

wet carbon
# marble briar I want to add friends over a menu and what you put in the anvil should go into t...

I'd probably just hook InventoryOpenEvent, open a anvil gui to the player, check if inventory is a anvil inventory in the inventory, put an item that you cannot take out i.e. paper in the anvil, then make it cost nothing. Then with the InventoryClickEvent detect when they click the item which will now be on the otherside of the item, get the display name, cancel the event, close the inventory run the command. Pretty sure thats how an implementation of that would look. then I'd containerize that behavior in some form of gui framework even if its basic for reusability without repeating code.

#

I'd code you a example, but it's 5am, so perhaps tomorrow if you're still needing help I can assist further.

#

oh then after with your text acquired from the result - just force the player to perform a command Player#performCommand(String) I think is still the method.

sick knoll
#

Hello. Since I see that this thread is marked as DeluxeMenus, I assume it was not a coding question but whether this is a feature in DeluxeMenus or not. Unfortunatelly, the answer is, no, this is not a feature.

orchid jetty
#

Command prompter has this

#

Highly recommend it