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

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

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

Public Member Functions

 PlayerArgument (String nodeName)
 A Player argument. More...
 
Class< Player > 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 Player object.

Note that this Argument internally references Mojang's authentication servers to resolve usernames, which gives it a slight performance overhead compared to EntitySelectorArgument.OnePlayer.

Since
1.1

Constructor & Destructor Documentation

◆ PlayerArgument()

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

A Player argument.

Produces a single player, regardless of whether , , @r or is used.

Parameters
nodeNamethe name of the node for this argument

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