CommandPrompter 0.1.19

Great Plugin Companion for DeluxeMenus or ChestCommand

  1. CyR1en
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    Source Code:
    https://github.com/CyR1en/CommandPrompter
    [​IMG] My Post (1).png

    My Post (8).png

    CommandPrompter is for plugins such as DeluxeMenus or Chest Commands. Menu plugins requires you to provide argument(s) for every command. However, with CommandPrompter, you can now prompt the command completion​

    My Post (9).png
    [​IMG]
    *Gif credit goes to clip | demo presented with DeluxeMenus
    Code (YAML):
    menu_title: '&cPunish menu'
    open_command
    : punish
    size
    : 9
    open_requirement
    :
      requirements
    :
        permission
    :
          type
    : has permission
          permission
    : menu.open.punish
          deny_commands
    :
          - '[message] You dont have permission to open menu
    : punish'
    items
    :
      '1'
    :
        material
    : barrier
        slot
    : 0
        display_name
    : '&cMute a player'
        lore
    :
      - '&aYou will be prompted to type the player name'
        - '&ato mute after selecting this option'
        left_click_commands
    :
      - '[player] mute <Type the name of the player you want to mute>'
        - '[close]'
        right_click_commands
    :
      - '[player] mute <Type the name of the player you want to mute>'
        - '[close]'
      '2'
    :
        material
    : barrier
        slot
    : 4
        display_name
    : '&aKick a player'
        lore
    :
      - '&aYou will be prompted to type the player name'
        - '&ato kick after selecting this option'
        left_click_commands
    :
      - '[player] kick <Type the name of the player you want to kick>'
        - '[close]'
        right_click_commands
    :
      - '[player] kick <Type the name of the player you want to kick>'
        - '[close]'
      '3'
    :
        material
    : barrier
        slot
    : 8
        display_name
    : '&aBan a player'
        lore
    :
      - '&aYou will be prompted to type the player name'
        - '&ato ban by clicking here'
        left_click_commands
    :
      - '[player] ban <Type the name of the player you want to ban>'
        - '[close]'
        right_click_commands
    :
      - '[player] ban <Type the name of the player you want to ban>'
        - '[close]'
     

    How do I use this plugin?
    If a player executes a command with arguments that are surrounded by "<" and ">". Those arguments are considered prompts. So after a player executes a command with prompts. CommandPrompter will send those prompts back to the player without the "<>" one by one and wait for the player's response. CommandPrompter will keep sending prompts until all the arguments have been replaced with the player's response.

    example:
    Code (Text):
    Player executes: /gamemode <What game mode do you want to switch to?>
    CommandPrompter sends: What game mode do you want to switch to?
    Player sends: creative
    All prompts have been answered, CommandPrompter now makes the player execute the command "/gamemode creative".

    Prompt Types
    Currently, CommandPrompter have two types of prompt. First is Chat Prompts where the user have to complete the command by typing the argument in chat.
    Code (Text):
    /gamemode <what game mode do you want?>
    and Anvil Prompt, where an anvil will pop up and the user have to enter their response in the anvil text field.
    just add "-a " (with space after) anywhere in the prompt.
    Sample:
    Code (Text):
    [player] gamemode <-a what gamemode do you want to be in?>
    or
    Code (Text):
    [player] gamemode <what gamemode do you want to be in? -a >
    or even
    Code (Text):
    [player] gamemode <what gamemode do -a you want to be in?>
    Code (Text):
    /gamemode <-a What gamemode do you want? {br}0: Surivival {br}1: Creative {br}2: Adventure {br}3: Spectator>
    Will be:
    [​IMG]

    How do I cancel command once I'm already prompted?
    Just reply "cancel" to CommandPrompter and it will stop the command execution.

    Installation
    Just drag and drop the jar file to your plugins folder. No need to configure anything, no permissions, and no commands. But there is a config file if you do want to configure it. Should work like a charm.

    Menu plugin configuration:
    On your menu plugin. Just configure an item to have a command that has argument prompts (surrounded by <>) and that command will be dispatched by the player when the Item gets clicked.

    My Post (10).png

    Dispatching player commands like this would allow CommandPrompter to catch it.
    Code (Java):
      public static void dispatchCommand(Plugin plugin, Player sender, String command) {
        new BukkitRunnable() {
          public void run() {
            sender.chat(checked);
          }
        }.runTask(plugin);
      }
    Or you can add it as a dependency for your project. (Support starts with CommandPrompter 0.1.17)

    For Maven:
    Code (Text):
    //Maven
        <repositories>
            <repository>
                <id>jitpack.io</id>
                <url>https://jitpack.io</url>
            </repository>
        </repositories>

        <dependency>
            <groupId>com.github.CyR1en</groupId>
            <artifactId>CommandPrompter</artifactId>
            <version>Tag</version>
        </dependency>
    For Gradle:
    Code (Text):
        repositories {
            maven { url 'https://jitpack.io' }
        }
     
        dependencies {
                compileOnly 'com.github.CyR1en:CommandPrompter:Tag'
        }
     
    Once added, you can just use the the Dispatcher Class.
    Code (Java):

    import com.cyr1en.cp.api.Dispatcher;

    private void dispatch(Player sender, String command) {
        Dispatcher.dispatchCommand(plugin, sender, command);
    }
    You have to check if CommandPrompter is loaded before you can use the Dispatcher class.

    Disclaimer:
    The idea for this plugin came from the user named Tommiek on Bukkit forums. Someone already wrote a similar plugin according to the thread, but the project page for that plugin can no longer be found. So I tried to recreate the plugin. The link for that thread is here.

    Thanks to:
    logo.png
    aeonhdaz, Luisomar0369, yuri2 and 2 others like this.

Recent Updates

  1. Minor changes [0.1.19]
  2. Changes and Bug fix
  3. Dispatcher for devs

Recent Reviews

  1. CSSJ-Ami
    CSSJ-Ami
    3/5,
    Version: 0.1.18
    i found a bug
    i can't change Prompt-Prefix become a chinese
    i try to use unicode,but it doesn't work
    so i wish you fix this mistake,by the way,it's a good Plugins
    1. CyR1en
      Author's Response
      Will be on next update
  2. MasterRip
    MasterRip
    5/5,
    Version: 0.1.18
    Отличный плагин!!! Я использовал на своем сервере sirius.mcstudio.pro:25575 Спасибо, за отличную работу!
  3. Zhi_Han_
    Zhi_Han_
    5/5,
    Version: 0.1.18
    This is a great plugin
    Hope to add a guI menu input instruction
    Thanks to the author for sharing
  4. Dingoster
    Dingoster
    5/5,
    Version: 0.18
    Awesome plugin to use with Deluxe Menus.

    They never implemented a %target_player% API, so this is the best alternative I could find for my Management team using:

    pl user <Type the players name you would like to give this rank.> parent set Mod etc.
  5. Hazae41
    Hazae41
    5/5,
    Version: 0.1.15
    Works as intended
    But please explain everything in the main page instead of the updates page
  6. Alvarado_321
    Alvarado_321
    5/5,
    Version: 0.1.15
    --------------------------------------------------------

    Nice complement with good support.
    5 STARS

    --------------------------------------------------------
    1. CyR1en
  7. ed333
    ed333
    5/5,
    Version: 0.1.14
    This plugin is very useful for me.

    Sorry, I forgot to rate.

    Can you alle me to upload it in MCBBS?(www.mcbbs.net)

    This is a forum for China.

    I hope you agree!

    Thank you ;)
    1. CyR1en
      Author's Response
      If you want to, go ahead. But I believe someone already here posted on the forum
  8. ACrispyCookie
    ACrispyCookie
    5/5,
    Version: 0.1.13
    Awesome plugin! I will use it to create a punish gui menu and it's just what I needed! Also could you add a permission so normal players can't use it?
    1. CyR1en
      Author's Response
      Will add permissions
  9. Jadiction
    Jadiction
    5/5,
    Version: 0.1.12
    Unfortunately, this doesn't work for 1.14 (at least not 1.14.4 that I tested.)

    The plugin loads fine, and I even tried the example given above "/ gamemode <Game mode?>". It just doesn't do anything.

    Still giving a 5-star rating because the plugin seems simple to use, lightweight and a useful plugin for DeluxeMenus and I'm sure an update for 1.14.x will come soon.
  10. Awkn
    Awkn
    1/5,
    Version: 0.1.12
    Says it needs updating even on most recent version...
    please help other than that its fine.
    1. CyR1en
      Author's Response
      Hotfixed it, it should be good now. No need to download a new jar!