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

An argument that represents the Bukkit Location object in x and z directions. More...

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

Public Member Functions

 Location2DArgument (String nodeName)
 A Location argument. More...
 
 Location2DArgument (String nodeName, LocationType type)
 A Location argument. More...
 
 Location2DArgument (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< Location2DgetPrimitiveType ()
 
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 in x and z directions.

Since
3.0 @apiNote Returns a Location2D object

Constructor & Destructor Documentation

◆ Location2DArgument() [1/3]

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

A Location argument.

Represents Minecraft locations in 2D space. Defaults to LocationType#PRECISE_POSITION

Parameters
nodeNamethe name of the node for this argument

◆ Location2DArgument() [2/3]

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

A Location argument.

Represents Minecraft locations in 2D space

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

◆ Location2DArgument() [3/3]

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

A Location argument.

Represents Minecraft locations in 2D space

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.Location2DArgument.getLocationType ( )

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

Returns
the location type of this argument