Interface NMS


public interface NMS
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addSkullTexture(org.bukkit.inventory.ItemStack item, String value, UUID uuid)
     
    void
    changeSkull(org.bukkit.block.Block block, String hash)
     
    default org.bukkit.event.entity.EntityDamageByEntityEvent
    createEntityDamageEvent(org.bukkit.entity.Entity entity, org.bukkit.entity.Entity attacker, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause, double damage)
     
    Attempts to parse/reparse the colors of a string to ensure consistent formatting
    default org.bukkit.attribute.Attribute
     
    default double
    getAttributeValue(org.bukkit.inventory.ItemStack item, org.bukkit.attribute.Attribute attribute)
     
    io.netty.channel.Channel
    getChannel(org.bukkit.entity.Player player)
    Gets the channel for the player
    getConnection(org.bukkit.entity.Player player)
    Gets the connection for the player.
    double
    getDefaultArmor(org.bukkit.inventory.ItemStack itemStack)
    Gets the default armor of the given item.
    double
    getDefaultDamage(org.bukkit.inventory.ItemStack itemStack)
    Gets the default attack damage for the given item.
    double
    getDefaultSpeed(org.bukkit.inventory.ItemStack itemStack)
    Gets the default attack speed of the given item.
    double
    getDefaultToughness(org.bukkit.inventory.ItemStack itemStack)
    Gets the default armor toughness of the given item.
    default Field
    getField(Class<?> clazz, String fieldName)
     
    default net.md_5.bungee.api.chat.HoverEvent
    getHoverEvent(org.bukkit.inventory.ItemStack itemStack)
     
    org.bukkit.Material
    getMaterial(org.bukkit.entity.Boat boat)
     
    getNMSCopy(org.bukkit.inventory.ItemStack itemStack)
     
    default com.mojang.authlib.GameProfile
     
    default net.md_5.bungee.api.chat.BaseComponent
    getTranslatedComponent(org.bukkit.inventory.ItemStack itemStack)
     
    Gets the version of the NMS implementation
    boolean
    isArmor(org.bukkit.inventory.ItemStack itemStack)
    Determines if the given item is armor.
    boolean
    isTool(org.bukkit.inventory.ItemStack itemStack)
    Determines if the given item is a tool.
    boolean
    isWeapon(org.bukkit.inventory.ItemStack itemStack)
    Determines if the given item is a weapon.
    void
    openChestAnimation(org.bukkit.block.Block chest, boolean open)
    Plays the chest animation for the given block
    default org.bukkit.scoreboard.Objective
    registerNewObjective(org.bukkit.scoreboard.Scoreboard scoreboard, org.bukkit.scoreboard.Objective objective)
     
    void
    sendAttackPacket(org.bukkit.entity.Player player, int i)
    Simulates the player attacking
    void
    sendPacket(org.bukkit.entity.Player player, Object packet)
    Sends a packet to the player
    void
    setKiller(org.bukkit.entity.LivingEntity entity, org.bukkit.entity.Player killer)
     
    toJson(org.bukkit.inventory.ItemStack itemStack)
    Gets the NBT string of the given item in JSON.
  • Method Details

    • getVersion

      String getVersion()
      Gets the version of the NMS implementation
      Returns:
      the version of the NMS implementation
    • getConnection

      @NotNull Object getConnection(org.bukkit.entity.Player player)
      Gets the connection for the player. This is a PlayerConnection object.
      Parameters:
      player - the player to get the connection for
      Returns:
      the connection for the player
    • getChannel

      @NotNull io.netty.channel.Channel getChannel(@NotNull org.bukkit.entity.Player player)
      Gets the channel for the player
      Parameters:
      player - the player to get the channel for
      Returns:
      the channel for the player
    • sendPacket

      void sendPacket(@NotNull org.bukkit.entity.Player player, @NotNull Object packet)
      Sends a packet to the player
      Parameters:
      player - the player to send the packet to
      packet - the packet to send
    • openChestAnimation

      void openChestAnimation(@NotNull org.bukkit.block.Block chest, boolean open)
      Plays the chest animation for the given block
      Parameters:
      chest - the chest block to play the animation for
      open - true if the chest should be opened, false if it should be closed
    • sendAttackPacket

      void sendAttackPacket(@NotNull org.bukkit.entity.Player player, int i)
      Simulates the player attacking
      Parameters:
      player - the player to simulate the attack for
      i - the type of attack
    • fixColors

      @NotNull String fixColors(@NotNull String str)
      Attempts to parse/reparse the colors of a string to ensure consistent formatting
      Parameters:
      str - the string to fix
      Returns:
      the fixed string
    • getDefaultDamage

      double getDefaultDamage(@NotNull org.bukkit.inventory.ItemStack itemStack)
      Gets the default attack damage for the given item.
      Parameters:
      itemStack - the item to get the default damage for
      Returns:
      the default attack damage for the item
    • getDefaultSpeed

      double getDefaultSpeed(@NotNull org.bukkit.inventory.ItemStack itemStack)
      Gets the default attack speed of the given item.
      Parameters:
      itemStack - the item to get the default speed of
      Returns:
      the default attack speed of the item
    • getDefaultArmor

      double getDefaultArmor(@NotNull org.bukkit.inventory.ItemStack itemStack)
      Gets the default armor of the given item.
      Parameters:
      itemStack - the item to get the default armor of
      Returns:
      the default armor of the item
    • getDefaultToughness

      double getDefaultToughness(@NotNull org.bukkit.inventory.ItemStack itemStack)
      Gets the default armor toughness of the given item.
      Parameters:
      itemStack - the item to get the default toughness of
      Returns:
      the default armor toughness of the item
    • isWeapon

      boolean isWeapon(@NotNull org.bukkit.inventory.ItemStack itemStack)
      Determines if the given item is a weapon. Weapons include swords, bows, crossbows, tridents, and axes.
      Parameters:
      itemStack - the item to check
      Returns:
      true if the item is a weapon, false otherwise
    • isArmor

      boolean isArmor(@NotNull org.bukkit.inventory.ItemStack itemStack)
      Determines if the given item is armor. Armor includes helmets, chestplates, leggings, and boots.
      Parameters:
      itemStack - the item to check
      Returns:
      true if the item is armor, false otherwise
    • isTool

      boolean isTool(@NotNull org.bukkit.inventory.ItemStack itemStack)
      Determines if the given item is a tool. Tools include pickaxes, axes, shovels, hoes, and shears.
      Parameters:
      itemStack - the item to check
      Returns:
      true if the item is a tool, false otherwise
    • toJson

      String toJson(@NotNull org.bukkit.inventory.ItemStack itemStack)
      Gets the NBT string of the given item in JSON.
      Parameters:
      itemStack - the item to get the NBT string of
      Returns:
      the NBT string of the item
    • setKiller

      void setKiller(@NotNull org.bukkit.entity.LivingEntity entity, @NotNull org.bukkit.entity.Player killer)
    • changeSkull

      void changeSkull(@NotNull org.bukkit.block.Block block, @NotNull String hash)
    • addSkullTexture

      default void addSkullTexture(@NotNull org.bukkit.inventory.ItemStack item, @NotNull String value, @NotNull UUID uuid)
    • getNonPlayerProfile

      default com.mojang.authlib.GameProfile getNonPlayerProfile(String hash)
    • getAttributeValue

      default double getAttributeValue(@NotNull org.bukkit.inventory.ItemStack item, @NotNull org.bukkit.attribute.Attribute attribute)
    • getAttribute

      @NotNull default org.bukkit.attribute.Attribute getAttribute(String name)
    • getNMSCopy

      Object getNMSCopy(@NotNull org.bukkit.inventory.ItemStack itemStack)
    • getMaterial

      org.bukkit.Material getMaterial(org.bukkit.entity.Boat boat)
    • getHoverEvent

      default net.md_5.bungee.api.chat.HoverEvent getHoverEvent(@NotNull org.bukkit.inventory.ItemStack itemStack)
    • registerNewObjective

      default org.bukkit.scoreboard.Objective registerNewObjective(org.bukkit.scoreboard.Scoreboard scoreboard, org.bukkit.scoreboard.Objective objective)
    • getTranslatedComponent

      default net.md_5.bungee.api.chat.BaseComponent getTranslatedComponent(@NotNull org.bukkit.inventory.ItemStack itemStack)
    • createEntityDamageEvent

      default org.bukkit.event.entity.EntityDamageByEntityEvent createEntityDamageEvent(@NotNull org.bukkit.entity.Entity entity, @NotNull org.bukkit.entity.Entity attacker, @NotNull org.bukkit.event.entity.EntityDamageEvent.DamageCause cause, double damage)
    • getField

      @NotNull default Field getField(@NotNull Class<?> clazz, @NotNull String fieldName) throws NoSuchFieldException
      Throws:
      NoSuchFieldException