Package net.minecraft.server.command
Class ServerCommandSource
java.lang.Object
net.minecraft.server.command.ServerCommandSource
- All Implemented Interfaces:
CommandSource
public class ServerCommandSource extends Object implements CommandSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.command.CommandSource
CommandSource.RelativePosition
-
Field Summary
Fields Modifier and Type Field Description private Entity
entity
private EntityAnchorArgumentType.EntityAnchor
entityAnchor
private int
level
private Text
name
private CommandOutput
output
private Vec3d
position
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
REQUIRES_ENTITY_EXCEPTION
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
REQUIRES_PLAYER_EXCEPTION
private com.mojang.brigadier.ResultConsumer<ServerCommandSource>
resultConsumer
private Vec2f
rotation
private MinecraftServer
server
private boolean
silent
private String
simpleName
private ServerWorld
world
-
Constructor Summary
Constructors Modifier Constructor Description ServerCommandSource(CommandOutput output, Vec3d pos, Vec2f rot, ServerWorld world, int level, String simpleName, Text name, MinecraftServer server, Entity entity)
protected
ServerCommandSource(CommandOutput output, Vec3d pos, Vec2f rot, ServerWorld world, int level, String simpleName, Text name, MinecraftServer server, Entity entity, boolean silent, com.mojang.brigadier.ResultConsumer<ServerCommandSource> consumer, EntityAnchorArgumentType.EntityAnchor entityAnchor)
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.command.CommandSource
getBlockPositionSuggestions, getEntitySuggestions, getPositionSuggestions
-
Field Details
-
REQUIRES_PLAYER_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType REQUIRES_PLAYER_EXCEPTION -
REQUIRES_ENTITY_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType REQUIRES_ENTITY_EXCEPTION -
output
-
position
-
world
-
level
private final int level -
simpleName
-
name
-
server
-
silent
private final boolean silent -
entity
-
resultConsumer
-
entityAnchor
-
rotation
-
-
Constructor Details
-
ServerCommandSource
public ServerCommandSource(CommandOutput output, Vec3d pos, Vec2f rot, ServerWorld world, int level, String simpleName, Text name, MinecraftServer server, @Nullable Entity entity) -
ServerCommandSource
protected ServerCommandSource(CommandOutput output, Vec3d pos, Vec2f rot, ServerWorld world, int level, String simpleName, Text name, MinecraftServer server, @Nullable Entity entity, boolean silent, com.mojang.brigadier.ResultConsumer<ServerCommandSource> consumer, EntityAnchorArgumentType.EntityAnchor entityAnchor)
-
-
Method Details
-
withEntity
-
withPosition
-
withRotation
-
withConsumer
public ServerCommandSource withConsumer(com.mojang.brigadier.ResultConsumer<ServerCommandSource> consumer) -
mergeConsumers
public ServerCommandSource mergeConsumers(com.mojang.brigadier.ResultConsumer<ServerCommandSource> consumer, BinaryOperator<com.mojang.brigadier.ResultConsumer<ServerCommandSource>> binaryOperator) -
withSilent
-
withLevel
-
withMaxLevel
-
withEntityAnchor
-
withWorld
-
withLookingAt
public ServerCommandSource withLookingAt(Entity entity, EntityAnchorArgumentType.EntityAnchor anchor) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
withLookingAt
public ServerCommandSource withLookingAt(Vec3d position) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getDisplayName
-
getName
-
hasPermissionLevel
public boolean hasPermissionLevel(int level)- Specified by:
hasPermissionLevel
in interfaceCommandSource
-
getPosition
-
getWorld
-
getEntity
-
getEntityOrThrow
Gets the entity from this command source or throws a command syntax exception if this command source is not an entity.- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getPlayer
Gets the player from this command source or throws a command syntax exception if this command source is not a player.- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getRotation
-
getMinecraftServer
-
getEntityAnchor
-
sendFeedback
-
sendToOps
-
sendError
-
onCommandComplete
public void onCommandComplete(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, boolean success, int result) -
getPlayerNames
- Specified by:
getPlayerNames
in interfaceCommandSource
-
getTeamNames
- Specified by:
getTeamNames
in interfaceCommandSource
-
getSoundIds
- Specified by:
getSoundIds
in interfaceCommandSource
-
getRecipeIds
- Specified by:
getRecipeIds
in interfaceCommandSource
-
getCompletions
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> getCompletions(com.mojang.brigadier.context.CommandContext<CommandSource> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)- Specified by:
getCompletions
in interfaceCommandSource
-
getWorldKeys
- Specified by:
getWorldKeys
in interfaceCommandSource
-
getRegistryManager
- Specified by:
getRegistryManager
in interfaceCommandSource
-