1.8 Command Block GUI?

Discussion in 'BungeeCord Plugin Development' started by BlackBeltPanda, May 17, 2015.

  1. I read both that fake command block screens are and aren't possible in 1.8. I can't find any working examples from anybody who stated that they are still possible to create in 1.8, though.

    Anyone know if it actually is possible to create a fake command block screen in 1.8? I find the command block screen to be the nicest form of text input and would love to be able to utilize it in my plugins.
     
  2. It is handled by the client since mc 1.8, so it is not possible to fake a command block gui. What about using signs to read an input?
     
  3. I need something that can support more text. I looked into using anvils, but it seems that clicking in a fake Anvil inventory throws NPEs. =/
     
  4. The best approach is to use plain inventories.

    You can, however, use command blocks as input if you require the user to interact with the command block. You can then implement `CommandBlockAbstract` and replace the command handler for the tile entity in the server.
     
  5. Not sure what you mean by plain inventories.

    As for interaction, I'm looking for a good way to get text input from a player after clicking an item in an inventory GUI. I.e. - Player clicks "Add friend" item, input screen appears for player to enter in another player's name.

    With command block screens being client-side and fake anvil inventories throwing NPEs when clicked in, it seems my options are limited to either using NMS for the anvils or using a fake sign screen. For longer input, I feel the anvil would be better since writing to multiple lines on a sign feels clunky. Wish there was a better way. =/
     
  6. Plain inventories as in the classic menus with items, listening for inventory events to trigger different actions for each slot. I guess this is ruled out if you want to grab text input, though.

    The Bukkit API doesn't do everything, often if you're trying to do something unique (ie, using anvils or command blocks to grab input), you'll have to do some NMS hackery.

    I'm going to go suggest the blatant, but you could go the easy route and just grab input from a chat event with your plugin. It may not be as fancy as an anvil, but it certainly isn't odd and requires minimal code.
     
  7. I might end up doing that with the conversation API. Not quite as smooth as having an input field pop up for the player but it's probably the easiest to implement. =)