CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.arguments.LocationArgument Class Reference

An argument that represents the Bukkit Location object. More...

+ Inheritance diagram for dev.jorel.commandapi.arguments.LocationArgument:

Public Member Functions

 LocationArgument (String nodeName)
 A Location argument. More...
 
 LocationArgument (String nodeName, LocationType type)
 A Location argument. More...
 
 LocationArgument (String nodeName, LocationType type, boolean centerPosition)
 A Location argument. More...
 
LocationType getLocationType ()
 Returns whether this argument is LocationType#BLOCK_POSITION or LocationType#PRECISE_POSITION. More...
 
Class< Location > getPrimitiveType ()
 
CommandAPIArgumentType getArgumentType ()
 
Function< S, String > getMapper ()
 

Static Public Member Functions

static< S > Function< S, String > fromKey (Function< S, NamespacedKey > mapper)
 

Detailed Description

An argument that represents the Bukkit Location object.

Since
1.1 @apiNote Returns a Location object

Constructor & Destructor Documentation

◆ LocationArgument() [1/3]

dev.jorel.commandapi.arguments.LocationArgument.LocationArgument ( String  nodeName)

A Location argument.

Represents Minecraft locations. Defaults to LocationType#PRECISE_POSITION

Parameters
nodeNamethe name of the node for this argument

◆ LocationArgument() [2/3]

dev.jorel.commandapi.arguments.LocationArgument.LocationArgument ( String  nodeName,
LocationType  type 
)

A Location argument.

Represents Minecraft locations

Parameters
nodeNamethe name of the node for this argument
typethe location type of this location, either LocationType#BLOCK_POSITION or LocationType#PRECISE_POSITION

◆ LocationArgument() [3/3]

dev.jorel.commandapi.arguments.LocationArgument.LocationArgument ( String  nodeName,
LocationType  type,
boolean  centerPosition 
)

A Location argument.

Represents Minecraft locations

Parameters
nodeNamethe name of the node for this argument
typethe location type of this location, either LocationType#BLOCK_POSITION or LocationType#PRECISE_POSITION
centerPositionwhether LocationType.PRECISE_POSITION should center the position of the location within a block

Member Function Documentation

◆ fromKey()

static< S > Function< S, String > dev.jorel.commandapi.arguments.SafeOverrideableArgument< T, S >.fromKey ( Function< S, NamespacedKey >  mapper)
staticinherited

Composes a S to a NamespacedKey mapping function to convert S to a String

Parameters
mapperthe mapping function from S to NamespacedKey
Returns
a composed function that converts S to String

◆ getLocationType()

LocationType dev.jorel.commandapi.arguments.LocationArgument.getLocationType ( )

Returns whether this argument is LocationType#BLOCK_POSITION or LocationType#PRECISE_POSITION.

Returns
the location type of this argument