Package net.gcnt.additionsplus.NMS
Interface NMS
public interface NMS
Interface class for handling version based Minecraft methods.
-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStack
Adds a custom Integer NBT-Tag to an ItemStack.org.bukkit.inventory.ItemStack
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
Deprecated.void
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.This method has been deprecated since Minecraft 1.10, usesendTitle(Player, String, String, int, int, int)
instead.Send a title to a player. This sends a title with default times of 20,50,20. -
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. -
sendActionbar
Send an actionbar message to a player.- Parameters:
arg
- Player to send the actionbar to.arg1
-String
text to be displayed.
-
sendMessage
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
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
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
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
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. -
addNBTTag
org.bukkit.inventory.ItemStack addNBTTag(org.bukkit.inventory.ItemStack i, String arg, String arg1)Adds a custom String NBT-Tag to an ItemStack.
-
sendTitle(Player, String, String, int, int, int)
instead.