Interface NMS


public interface NMS
Interface class for handling version based Minecraft methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.inventory.ItemStack
    addNBTTag​(org.bukkit.inventory.ItemStack i, String arg, Integer arg1)
    Adds a custom Integer NBT-Tag to an ItemStack.
    org.bukkit.inventory.ItemStack
    addNBTTag​(org.bukkit.inventory.ItemStack i, String arg, String arg1)
    Adds a custom String NBT-Tag to an ItemStack.
    void
    changeTab​(org.bukkit.entity.Player arg)
    Update the tablist of a player, according to AdditionsPlus configurations.
    getCustomBook​(org.bukkit.inventory.ItemStack i)
    Check if an ItemStack is a custom AdditionsPlus book.
    getCustomItem​(org.bukkit.inventory.ItemStack i)
    Check if an ItemStack is a custom AdditionsPlus item.
    int
    Get the version number of the Bukkit API that has been detected.
    void
    sendActionbar​(org.bukkit.entity.Player arg, String arg1)
    Send an actionbar message to a player.
    void
    sendMessage​(org.bukkit.entity.Player arg, String json)
    Send a raw JSON message to a player.
    void
    sendTitle​(org.bukkit.entity.Player arg, String arg1, String arg2)
    Deprecated.
    This method has been deprecated since Minecraft 1.10, use sendTitle(Player, String, String, int, int, int) instead.
    void
    sendTitle​(org.bukkit.entity.Player arg, String arg1, String arg2, int arg3, int arg4, int arg5)
    Send a timed title to a player.
    org.bukkit.inventory.ItemStack
    setCustomBook​(org.bukkit.inventory.ItemStack i, String arg)
    Adds a custom NBT-Tag to the ItemStack of a custom book to handle future events.
    org.bukkit.inventory.ItemStack
    setCustomItem​(org.bukkit.inventory.ItemStack i, String arg)
    Adds a custom NBT-Tag to the ItemStack of a custom item to handle future events.
  • Method Details

    • getVersion

      int getVersion()
      Get the version number of the Bukkit API that has been detected. Version format is as follows: '1.16' = 16, '1.8' = 8.
      Returns:
      Integer - version of the server API used
    • sendTitle

      @Deprecated void sendTitle(org.bukkit.entity.Player arg, String arg1, String arg2)
      Deprecated.
      This method has been deprecated since Minecraft 1.10, use sendTitle(Player, String, String, int, int, int) instead.
      Send a title to a player. This sends a title with default times of 20,50,20.
      Parameters:
      arg - Player to display the title to.
      arg1 - String Main title to be sent.
      arg2 - String Subtitle to be sent.
    • sendTitle

      void sendTitle(org.bukkit.entity.Player arg, String arg1, String arg2, int arg3, int arg4, int arg5)
      Send a timed title to a player.
      Parameters:
      arg - Player to display the title to.
      arg1 - String Main title to be sent.
      arg2 - String Subtitle to be sent.
      arg3 - Integer Fade-in time in ticks.
      arg4 - Integer Stay time in ticks.
      arg5 - Integer Fade-out time in ticks.
    • sendActionbar

      void sendActionbar(org.bukkit.entity.Player arg, String arg1)
      Send an actionbar message to a player.
      Parameters:
      arg - Player to send the actionbar to.
      arg1 - String text to be displayed.
    • sendMessage

      void sendMessage(org.bukkit.entity.Player arg, String json)
      Send a raw JSON message to a player.
      Parameters:
      arg - Player to send the raw JSON message to.
      json - String JSON text to be displayed.
    • changeTab

      void changeTab(org.bukkit.entity.Player arg)
      Update the tablist of a player, according to AdditionsPlus configurations.
      Parameters:
      arg - Player to update the tablist for.
    • getCustomItem

      String getCustomItem(org.bukkit.inventory.ItemStack i)
      Check if an ItemStack is a custom AdditionsPlus item.
      Parameters:
      i - ItemStack to check.
      Returns:
      String name of custom item when detected, null if no custom item was found.
    • getCustomBook

      String getCustomBook(org.bukkit.inventory.ItemStack i)
      Check if an ItemStack is a custom AdditionsPlus book.
      Parameters:
      i - ItemStack to check.
      Returns:
      String name of custom book when detected, null if no custom book was found.
    • setCustomBook

      org.bukkit.inventory.ItemStack setCustomBook(org.bukkit.inventory.ItemStack i, String arg)
      Adds a custom NBT-Tag to the ItemStack of a custom book to handle future events.
      Parameters:
      i - Book ItemStack to modify.
      arg - String Identifier of the custom book.
      Returns:
      ItemStack with an additional NBT tag.
    • setCustomItem

      org.bukkit.inventory.ItemStack setCustomItem(org.bukkit.inventory.ItemStack i, String arg)
      Adds a custom NBT-Tag to the ItemStack of a custom item to handle future events.
      Parameters:
      i - Custom item ItemStack to modify.
      arg - String Identifier of the custom item.
      Returns:
      ItemStack with an additional NBT tag.
    • addNBTTag

      org.bukkit.inventory.ItemStack addNBTTag(org.bukkit.inventory.ItemStack i, String arg, Integer arg1)
      Adds a custom Integer NBT-Tag to an ItemStack.
      Parameters:
      i - ItemStack to add the NBT-Tag to.
      arg - String key of the NBT-Tag
      arg1 - Integer value of the NBT-Tag
      Returns:
      ItemStack with the added NBT-Tag.
    • addNBTTag

      org.bukkit.inventory.ItemStack addNBTTag(org.bukkit.inventory.ItemStack i, String arg, String arg1)
      Adds a custom String NBT-Tag to an ItemStack.
      Parameters:
      i - ItemStack to add the NBT-Tag to.
      arg - String key of the NBT-Tag
      arg1 - String value of the NBT-Tag
      Returns:
      ItemStack with the added NBT-Tag.