PluginMessageRecipient
public interface Server extends PluginMessageRecipient
Modifier and Type | Interface | Description |
---|---|---|
static class |
Server.Spigot |
Modifier and Type | Field | Description |
---|---|---|
static String |
BROADCAST_CHANNEL_ADMINISTRATIVE |
Used for all administrative messages, such as an operator using a
command.
|
static String |
BROADCAST_CHANNEL_USERS |
Used for all announcement messages, such as informing users that a
player has joined.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
addRecipe(Recipe recipe) |
Adds a recipe to the crafting manager.
|
Iterator<Advancement> |
advancementIterator() |
Get an iterator through all advancements.
|
void |
banIP(String address) |
Bans the specified address from the server.
|
int |
broadcast(String message,
String permission) |
Broadcasts the specified message to every user with the given
permission name.
|
int |
broadcastMessage(String message) |
Broadcast a message to all players.
|
void |
clearRecipes() |
Clears the list of crafting recipes.
|
BlockData |
createBlockData(String data) |
Creates a new
BlockData instance with material and properties
parsed from provided data. |
BlockData |
createBlockData(Material material) |
Creates a new
BlockData instance for the specified Material, with
all properties initialized to unspecified defaults. |
BlockData |
createBlockData(Material material,
String data) |
Creates a new
BlockData instance for the specified Material, with
all properties initialized to unspecified defaults, except for those
provided in data. |
BlockData |
createBlockData(Material material,
Consumer<BlockData> consumer) |
Creates a new
BlockData instance for the specified Material, with
all properties initialized to unspecified defaults. |
BossBar |
createBossBar(String title,
BarColor color,
BarStyle style,
BarFlag... flags) |
Creates a boss bar instance to display to players.
|
KeyedBossBar |
createBossBar(NamespacedKey key,
String title,
BarColor color,
BarStyle style,
BarFlag... flags) |
Creates a boss bar instance to display to players.
|
ChunkGenerator.ChunkData |
createChunkData(World world) |
Create a ChunkData for use in a generator.
|
ItemStack |
createExplorerMap(World world,
Location location,
StructureType structureType) |
Create a new explorer map targeting the closest nearby structure of a
given
StructureType . |
ItemStack |
createExplorerMap(World world,
Location location,
StructureType structureType,
int radius,
boolean findUnexplored) |
Create a new explorer map targeting the closest nearby structure of a
given
StructureType . |
Inventory |
createInventory(InventoryHolder owner,
int size) |
Creates an empty inventory of type
InventoryType.CHEST with the
specified size. |
Inventory |
createInventory(InventoryHolder owner,
int size,
String title) |
Creates an empty inventory of type
InventoryType.CHEST with the
specified size and title. |
Inventory |
createInventory(InventoryHolder owner,
InventoryType type) |
Creates an empty inventory with the specified type.
|
Inventory |
createInventory(InventoryHolder owner,
InventoryType type,
String title) |
Creates an empty inventory with the specified type and title.
|
MapView |
createMap(World world) |
Create a new map with an automatically assigned ID.
|
Merchant |
createMerchant(String title) |
Creates an empty merchant.
|
World |
createWorld(WorldCreator creator) |
Creates or loads a world with the given name using the specified
options.
|
boolean |
dispatchCommand(CommandSender sender,
String commandLine) |
Dispatches a command on this server, and executes it if found.
|
Advancement |
getAdvancement(NamespacedKey key) |
Get the advancement specified by this key.
|
boolean |
getAllowEnd() |
Gets whether this server allows the End or not.
|
boolean |
getAllowFlight() |
Gets whether this server allows flying or not.
|
boolean |
getAllowNether() |
Gets whether this server allows the Nether or not.
|
int |
getAmbientSpawnLimit() |
Gets user-specified limit for number of ambient mobs that can spawn in
a chunk.
|
int |
getAnimalSpawnLimit() |
Gets user-specified limit for number of animals that can spawn in a
chunk.
|
BanList |
getBanList(BanList.Type type) |
Gets a ban list for the supplied type.
|
Set<OfflinePlayer> |
getBannedPlayers() |
Gets a set containing all banned players.
|
KeyedBossBar |
getBossBar(NamespacedKey key) |
Gets the
KeyedBossBar specified by this key. |
Iterator<KeyedBossBar> |
getBossBars() |
Gets an unmodifiable iterator through all persistent bossbars.
|
String |
getBukkitVersion() |
Gets the Bukkit version that this server is running.
|
Map<String,String[]> |
getCommandAliases() |
Gets a list of command aliases defined in the server properties.
|
long |
getConnectionThrottle() |
Gets the value of the connection throttle setting.
|
ConsoleCommandSender |
getConsoleSender() |
Gets a
ConsoleCommandSender that may be used as an input source
for this server. |
GameMode |
getDefaultGameMode() |
Gets the default
GameMode for new players. |
Entity |
getEntity(UUID uuid) |
Gets an entity on the server by its UUID
|
boolean |
getGenerateStructures() |
Get generate-structures setting.
|
HelpMap |
getHelpMap() |
Gets the
HelpMap providing help topics for this server. |
int |
getIdleTimeout() |
Gets the idle kick timeout.
|
String |
getIp() |
Get the IP that this server is bound to, or empty string if not
specified.
|
Set<String> |
getIPBans() |
Gets a set containing all current IPs that are banned.
|
ItemFactory |
getItemFactory() |
Gets the instance of the item factory (for
ItemMeta ). |
Logger |
getLogger() |
Returns the primary logger associated with this server instance.
|
LootTable |
getLootTable(NamespacedKey key) |
Gets the specified
LootTable . |
MapView |
getMap(int id) |
Deprecated.
Magic value
|
int |
getMaxPlayers() |
Get the maximum amount of players which can login to this server.
|
Messenger |
getMessenger() |
Gets the
Messenger responsible for this server. |
int |
getMonsterSpawnLimit() |
Gets user-specified limit for number of monsters that can spawn in a
chunk.
|
String |
getMotd() |
Gets the message that is displayed on the server list.
|
String |
getName() |
Gets the name of this server implementation.
|
OfflinePlayer |
getOfflinePlayer(String name) |
Deprecated.
Persistent storage of users should be by UUID as names are no longer
unique past a single session.
|
OfflinePlayer |
getOfflinePlayer(UUID id) |
Gets the player by the given UUID, regardless if they are offline or
online.
|
OfflinePlayer[] |
getOfflinePlayers() |
Gets every player that has ever played on this server.
|
boolean |
getOnlineMode() |
Gets whether the Server is in online mode or not.
|
Collection<? extends Player> |
getOnlinePlayers() |
Gets a view of all currently logged in players.
|
Set<OfflinePlayer> |
getOperators() |
Gets a set containing all player operators.
|
Player |
getPlayer(String name) |
Gets a player object by the given username.
|
Player |
getPlayer(UUID id) |
Gets the player with the given UUID.
|
Player |
getPlayerExact(String name) |
Gets the player with the exact given name, case insensitive.
|
PluginCommand |
getPluginCommand(String name) |
Gets a
PluginCommand with the given name or alias. |
PluginManager |
getPluginManager() |
Gets the plugin manager for interfacing with plugins.
|
int |
getPort() |
Get the game port that the server runs on.
|
List<Recipe> |
getRecipesFor(ItemStack result) |
Get a list of all recipes for a given item.
|
BukkitScheduler |
getScheduler() |
Gets the scheduler for managing scheduled events.
|
ScoreboardManager |
getScoreboardManager() |
Gets the instance of the scoreboard manager.
|
CachedServerIcon |
getServerIcon() |
Gets an instance of the server's default server-icon.
|
ServicesManager |
getServicesManager() |
Gets a services manager.
|
String |
getShutdownMessage() |
Gets the default message that is displayed when the server is stopped.
|
int |
getSpawnRadius() |
Gets the radius, in blocks, around each worlds spawn point to protect.
|
<T extends Keyed> |
getTag(String registry,
NamespacedKey tag,
Class<T> clazz) |
Gets a tag which has already been defined within the server.
|
<T extends Keyed> |
getTags(String registry,
Class<T> clazz) |
Gets a all tags which have been defined within the server.
|
int |
getTicksPerAnimalSpawns() |
Gets default ticks per animal spawns value.
|
int |
getTicksPerMonsterSpawns() |
Gets the default ticks per monster spawns value.
|
UnsafeValues |
getUnsafe() |
Deprecated.
|
String |
getUpdateFolder() |
Gets the name of the update folder.
|
File |
getUpdateFolderFile() |
Gets the update folder.
|
String |
getVersion() |
Gets the version string of this server implementation.
|
int |
getViewDistance() |
Get the view distance from this server.
|
Warning.WarningState |
getWarningState() |
Gets the current warning state for the server.
|
int |
getWaterAnimalSpawnLimit() |
Gets user-specified limit for number of water animals that can spawn in
a chunk.
|
Set<OfflinePlayer> |
getWhitelistedPlayers() |
Gets a list of whitelisted players.
|
World |
getWorld(String name) |
Gets the world with the given name.
|
World |
getWorld(UUID uid) |
Gets the world from the given Unique ID.
|
File |
getWorldContainer() |
Gets the folder that contains all of the various
World s. |
List<World> |
getWorlds() |
Gets a list of all worlds on this server.
|
String |
getWorldType() |
Get world type (level-type setting) for default world.
|
boolean |
hasWhitelist() |
Gets whether this server has a whitelist or not.
|
boolean |
isHardcore() |
Gets whether the server is in hardcore mode or not.
|
boolean |
isPrimaryThread() |
Checks the current thread against the expected primary thread for the
server.
|
CachedServerIcon |
loadServerIcon(BufferedImage image) |
Creates a cached server-icon for the specific image.
|
CachedServerIcon |
loadServerIcon(File file) |
Loads an image from a file, and returns a cached image for the specific
server-icon.
|
List<Player> |
matchPlayer(String name) |
Attempts to match any players with the given name, and returns a list
of all possibly matches.
|
Iterator<Recipe> |
recipeIterator() |
Get an iterator through the list of crafting recipes.
|
void |
reload() |
Reloads the server, refreshing settings and plugin information.
|
void |
reloadData() |
Reload only the Minecraft data for the server.
|
void |
reloadWhitelist() |
Reloads the whitelist from disk.
|
boolean |
removeBossBar(NamespacedKey key) |
Removes a
KeyedBossBar specified by this key. |
void |
resetRecipes() |
Resets the list of crafting recipes to the default.
|
void |
savePlayers() |
Writes loaded players to disk.
|
List<Entity> |
selectEntities(CommandSender sender,
String selector) |
Selects entities using the given Vanilla selector.
|
void |
setDefaultGameMode(GameMode mode) |
Sets the default
GameMode for new players. |
void |
setIdleTimeout(int threshold) |
Set the idle kick timeout.
|
void |
setSpawnRadius(int value) |
Sets the radius, in blocks, around each worlds spawn point to protect.
|
void |
setWhitelist(boolean value) |
Sets if the server is whitelisted.
|
void |
shutdown() |
Shutdowns the server, stopping everything.
|
Server.Spigot |
spigot() |
|
void |
unbanIP(String address) |
Unbans the specified address from the server.
|
boolean |
unloadWorld(String name,
boolean save) |
Unloads a world with the given name.
|
boolean |
unloadWorld(World world,
boolean save) |
Unloads the given world.
|
getListeningPluginChannels, sendPluginMessage
static final String BROADCAST_CHANNEL_ADMINISTRATIVE
For use in broadcast(java.lang.String, java.lang.String)
.
static final String BROADCAST_CHANNEL_USERS
For use in broadcast(java.lang.String, java.lang.String)
.
@NotNull String getName()
@NotNull String getVersion()
@NotNull String getBukkitVersion()
@NotNull Collection<? extends Player> getOnlinePlayers()
Collection.size()
zero-allocation.
The collection is a view backed by the internal representation, such
that, changes to the internal state of the server will be reflected
immediately. However, the reuse of the returned collection (identity)
is not strictly guaranteed for future or all implementations. Casting
the collection, or relying on interface implementations (like Serializable
or List
), is deprecated.
Iteration behavior is undefined outside of self-contained main-thread
uses. Normal and immediate iterator use without consequences that
affect the collection are fully supported. The effects following
(non-exhaustive) teleportation
,
death
, and kicking
are undefined. Any use of this collection from
asynchronous threads is unsafe.
For safe consequential iteration or mimicking the old array behavior,
using Collection.toArray(Object[])
is recommended. For making
snapshots, ImmutableList.copyOf(Collection)
is recommended.
int getMaxPlayers()
int getPort()
int getViewDistance()
@NotNull String getIp()
@NotNull String getWorldType()
boolean getGenerateStructures()
boolean getAllowEnd()
boolean getAllowNether()
boolean hasWhitelist()
void setWhitelist(boolean value)
value
- true for whitelist on, false for off@NotNull Set<OfflinePlayer> getWhitelistedPlayers()
void reloadWhitelist()
int broadcastMessage(@NotNull String message)
This is the same as calling broadcast(java.lang.String,
java.lang.String)
to BROADCAST_CHANNEL_USERS
message
- the message@NotNull String getUpdateFolder()
The update folder name is relative to the plugins folder.
@NotNull File getUpdateFolderFile()
long getConnectionThrottle()
int getTicksPerAnimalSpawns()
Example Usage:
Note: If set to 0, animal spawning will be disabled. We recommend using spawn-animals to control this instead.
Minecraft default: 400.
int getTicksPerMonsterSpawns()
Example Usage:
Note: If set to 0, monsters spawning will be disabled. We recommend using spawn-monsters to control this instead.
Minecraft default: 1.
@Nullable Player getPlayer(@NotNull String name)
This method may not return objects for offline players.
name
- the name to look up@Nullable Player getPlayerExact(@NotNull String name)
name
- Exact name of the player to retrieve@NotNull List<Player> matchPlayer(@NotNull String name)
This list is not sorted in any particular order. If an exact match is found, the returned list will only contain a single result.
name
- the (partial) name to match@Nullable Player getPlayer(@NotNull UUID id)
id
- UUID of the player to retrieve@NotNull PluginManager getPluginManager()
@NotNull BukkitScheduler getScheduler()
@NotNull ServicesManager getServicesManager()
@NotNull List<World> getWorlds()
@Nullable World createWorld(@NotNull WorldCreator creator)
If the world is already loaded, it will just return the equivalent of getWorld(creator.name()).
creator
- the options to use when creating the worldboolean unloadWorld(@NotNull String name, boolean save)
name
- Name of the world to unloadsave
- whether to save the chunks before unloadingboolean unloadWorld(@NotNull World world, boolean save)
world
- the world to unloadsave
- whether to save the chunks before unloading@Nullable World getWorld(@NotNull String name)
name
- the name of the world to retrieve@Nullable World getWorld(@NotNull UUID uid)
uid
- a unique-id of the world to retrieve@Deprecated @Nullable MapView getMap(int id)
id
- the id of the map to get@NotNull MapView createMap(@NotNull World world)
world
- the world the map will belong to@NotNull ItemStack createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType)
StructureType
.
world
- the world the map will belong tolocation
- the origin location to find the nearest structurestructureType
- the type of structure to findWorld.locateNearestStructure(org.bukkit.Location,
org.bukkit.StructureType, int, boolean)
@NotNull ItemStack createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType, int radius, boolean findUnexplored)
StructureType
.
world
- the world the map will belong tolocation
- the origin location to find the nearest structurestructureType
- the type of structure to findradius
- radius to search, see World#locateNearestStructure for more
informationfindUnexplored
- whether to find unexplored structuresWorld.locateNearestStructure(org.bukkit.Location,
org.bukkit.StructureType, int, boolean)
void reload()
void reloadData()
@NotNull Logger getLogger()
@Nullable PluginCommand getPluginCommand(@NotNull String name)
PluginCommand
with the given name or alias.name
- the name of the command to retrievevoid savePlayers()
boolean dispatchCommand(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException
sender
- the apparent sender of the commandcommandLine
- the command + arguments. Example: test abc
123
CommandException
- thrown when the executor for the given command
fails with an unhandled exception@Contract("null -> false") boolean addRecipe(@Nullable Recipe recipe)
recipe
- the recipe to add@NotNull List<Recipe> getRecipesFor(@NotNull ItemStack result)
result
- the item to match against recipe results@NotNull Iterator<Recipe> recipeIterator()
void clearRecipes()
void resetRecipes()
@NotNull Map<String,String[]> getCommandAliases()
int getSpawnRadius()
void setSpawnRadius(int value)
value
- new spawn radius, or 0 if noneboolean getOnlineMode()
boolean getAllowFlight()
boolean isHardcore()
void shutdown()
int broadcast(@NotNull String message, @NotNull String permission)
message
- message to broadcastpermission
- the required permission permissibles
must have to receive the broadcast@Deprecated @NotNull OfflinePlayer getOfflinePlayer(@NotNull String name)
This method may involve a blocking web request to get the UUID for the given name.
This will return an object even if the player does not exist. To this method, all players will exist.
name
- the name the player to retrievegetOfflinePlayer(java.util.UUID)
@NotNull OfflinePlayer getOfflinePlayer(@NotNull UUID id)
This will return an object even if the player does not exist. To this method, all players will exist.
id
- the UUID of the player to retrieve@NotNull Set<String> getIPBans()
void banIP(@NotNull String address)
address
- the IP address to banvoid unbanIP(@NotNull String address)
address
- the IP address to unban@NotNull Set<OfflinePlayer> getBannedPlayers()
@NotNull BanList getBanList(@NotNull BanList.Type type)
Bans by name are no longer supported and this method will return null when trying to request them. The replacement is bans by UUID.
type
- the type of list to fetch, cannot be null@NotNull Set<OfflinePlayer> getOperators()
@NotNull GameMode getDefaultGameMode()
GameMode
for new players.void setDefaultGameMode(@NotNull GameMode mode)
GameMode
for new players.mode
- the new game mode@NotNull ConsoleCommandSender getConsoleSender()
ConsoleCommandSender
that may be used as an input source
for this server.@NotNull File getWorldContainer()
World
s.@NotNull OfflinePlayer[] getOfflinePlayers()
@NotNull Messenger getMessenger()
Messenger
responsible for this server.@NotNull HelpMap getHelpMap()
HelpMap
providing help topics for this server.@NotNull Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type)
InventoryType.CHEST
, the new inventory has a size of 27;
otherwise the new inventory has the normal size for its type.
InventoryType.WORKBENCH
will not process crafting recipes if
created with this method. Use
HumanEntity.openWorkbench(Location, boolean)
instead.
InventoryType.ENCHANTING
will not process ItemStack
s
for possible enchanting results. Use
HumanEntity.openEnchanting(Location, boolean)
instead.owner
- the holder of the inventory, or null to indicate no holdertype
- the type of inventory to createIllegalArgumentException
- if the InventoryType
cannot be
viewed.InventoryType.isCreatable()
@NotNull Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title)
InventoryType.CHEST
, the new inventory has a size of 27;
otherwise the new inventory has the normal size for its type.InventoryType.WORKBENCH
will not process crafting recipes if
created with this method. Use
HumanEntity.openWorkbench(Location, boolean)
instead.
InventoryType.ENCHANTING
will not process ItemStack
s
for possible enchanting results. Use
HumanEntity.openEnchanting(Location, boolean)
instead.owner
- The holder of the inventory; can be null if there's no holder.type
- The type of inventory to create.title
- The title of the inventory, to be displayed when it is viewed.IllegalArgumentException
- if the InventoryType
cannot be
viewed.InventoryType.isCreatable()
@NotNull Inventory createInventory(@Nullable InventoryHolder owner, int size) throws IllegalArgumentException
InventoryType.CHEST
with the
specified size.owner
- the holder of the inventory, or null to indicate no holdersize
- a multiple of 9 as the size of inventory to createIllegalArgumentException
- if the size is not a multiple of 9@NotNull Inventory createInventory(@Nullable InventoryHolder owner, int size, @NotNull String title) throws IllegalArgumentException
InventoryType.CHEST
with the
specified size and title.owner
- the holder of the inventory, or null to indicate no holdersize
- a multiple of 9 as the size of inventory to createtitle
- the title of the inventory, displayed when inventory is
viewedIllegalArgumentException
- if the size is not a multiple of 9@NotNull Merchant createMerchant(@Nullable String title)
title
- the title of the corresponding merchant inventory, displayed
when the merchant inventory is viewedint getMonsterSpawnLimit()
int getAnimalSpawnLimit()
int getWaterAnimalSpawnLimit()
int getAmbientSpawnLimit()
boolean isPrimaryThread()
Note: this method should not be used to indicate the current synchronized state of the runtime. A current thread matching the main thread indicates that it is synchronized, but a mismatch does not preclude the same assumption.
@NotNull String getMotd()
@Nullable String getShutdownMessage()
@NotNull Warning.WarningState getWarningState()
@NotNull ItemFactory getItemFactory()
ItemMeta
).ItemFactory
@Nullable ScoreboardManager getScoreboardManager()
This will only exist after the first world has loaded.
@Nullable CachedServerIcon getServerIcon()
@NotNull CachedServerIcon loadServerIcon(@NotNull File file) throws IllegalArgumentException, Exception
Size and type are implementation defined. An incompatible file is
guaranteed to throw an implementation-defined Exception
.
file
- the file to load the fromServerListPingEvent.setServerIcon(CachedServerIcon)
IllegalArgumentException
- if image is nullException
- if the image does not meet current server server-icon
specifications@NotNull CachedServerIcon loadServerIcon(@NotNull BufferedImage image) throws IllegalArgumentException, Exception
Size and type are implementation defined. An incompatible file is
guaranteed to throw an implementation-defined Exception
.
image
- the image to useServerListPingEvent.setServerIcon(CachedServerIcon)
IllegalArgumentException
- if image is nullException
- if the image does not meet current server
server-icon specificationsvoid setIdleTimeout(int threshold)
A value of 0 will disable the idle kick timeout.
threshold
- the idle timeout in minutesint getIdleTimeout()
@NotNull ChunkGenerator.ChunkData createChunkData(@NotNull World world)
ChunkGenerator.generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)
world
- the world to create the ChunkData for@NotNull BossBar createBossBar(@Nullable String title, @NotNull BarColor color, @NotNull BarStyle style, @NotNull BarFlag... flags)
title
- the title of the boss barcolor
- the color of the boss barstyle
- the style of the boss barflags
- an optional list of flags to set on the boss bar@NotNull KeyedBossBar createBossBar(@NotNull NamespacedKey key, @Nullable String title, @NotNull BarColor color, @NotNull BarStyle style, @NotNull BarFlag... flags)
key
- the key of the boss bar that is used to access the boss bartitle
- the title of the boss barcolor
- the color of the boss barstyle
- the style of the boss barflags
- an optional list of flags to set on the boss bar@NotNull Iterator<KeyedBossBar> getBossBars()
Boss
createBossBar(String, BarColor, BarStyle, BarFlag...)
@Nullable KeyedBossBar getBossBar(@NotNull NamespacedKey key)
KeyedBossBar
specified by this key.
Boss
createBossBar(String, BarColor, BarStyle, BarFlag...)
key
- unique bossbar keyboolean removeBossBar(@NotNull NamespacedKey key)
KeyedBossBar
specified by this key.
Boss
createBossBar(String, BarColor, BarStyle, BarFlag...)
key
- unique bossbar key@Nullable Entity getEntity(@NotNull UUID uuid)
uuid
- the UUID of the entity@Nullable Advancement getAdvancement(@NotNull NamespacedKey key)
key
- unique advancement key@NotNull Iterator<Advancement> advancementIterator()
@NotNull BlockData createBlockData(@NotNull Material material)
BlockData
instance for the specified Material, with
all properties initialized to unspecified defaults.material
- the material@NotNull BlockData createBlockData(@NotNull Material material, @Nullable Consumer<BlockData> consumer)
BlockData
instance for the specified Material, with
all properties initialized to unspecified defaults.material
- the materialconsumer
- consumer to run on new instance before returning@NotNull BlockData createBlockData(@NotNull String data) throws IllegalArgumentException
BlockData
instance with material and properties
parsed from provided data.data
- data stringIllegalArgumentException
- if the specified data is not valid@NotNull @Contract("null, null -> fail") BlockData createBlockData(@Nullable Material material, @Nullable String data) throws IllegalArgumentException
BlockData
instance for the specified Material, with
all properties initialized to unspecified defaults, except for those
provided in data.
material
is specified, then the data string must not also
contain the material.material
- the materialdata
- data stringIllegalArgumentException
- if the specified data is not valid@Nullable <T extends Keyed> Tag<T> getTag(@NotNull String registry, @NotNull NamespacedKey tag, @NotNull Class<T> clazz)
Tag
rather than this method
which makes no guarantees about which tags are available, and may also be
less performant due to lack of caching.
Tag
.T
- type of the tagregistry
- the tag registry to look attag
- the name of the tagclazz
- the class of the tag entries@NotNull <T extends Keyed> Iterable<Tag<T>> getTags(@NotNull String registry, @NotNull Class<T> clazz)
Tag
.
T
- type of the tagregistry
- the tag registry to look atclazz
- the class of the tag entries@Nullable LootTable getLootTable(@NotNull NamespacedKey key)
LootTable
.key
- the name of the LootTable@NotNull List<Entity> selectEntities(@NotNull CommandSender sender, @NotNull String selector) throws IllegalArgumentException
sender
- the sender to execute as, must be providedselector
- the selection stringIllegalArgumentException
- if the selector is malformed in any way
or a parameter is null@Deprecated @NotNull UnsafeValues getUnsafe()
UnsafeValues
@NotNull Server.Spigot spigot()
Copyright © 2019. All rights reserved.