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 Entityentityprivate EntityAnchorArgumentType.EntityAnchorentityAnchorprivate intlevelprivate Textnameprivate CommandOutputoutputprivate Vec3dpositionstatic com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeREQUIRES_ENTITY_EXCEPTIONstatic com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeREQUIRES_PLAYER_EXCEPTIONprivate com.mojang.brigadier.ResultConsumer<ServerCommandSource>resultConsumerprivate Vec2frotationprivate MinecraftServerserverprivate booleansilentprivate StringsimpleNameprivate ServerWorldworld -
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)protectedServerCommandSource(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, waitMethods 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) -
withLookingAt
-
getDisplayName
-
getName
-
hasPermissionLevel
public boolean hasPermissionLevel(int level)- Specified by:
hasPermissionLevelin 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:
getPlayerNamesin interfaceCommandSource
-
getTeamNames
- Specified by:
getTeamNamesin interfaceCommandSource
-
getSoundIds
- Specified by:
getSoundIdsin interfaceCommandSource
-
getRecipeIds
- Specified by:
getRecipeIdsin 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:
getCompletionsin interfaceCommandSource
-
getWorldKeys
- Specified by:
getWorldKeysin interfaceCommandSource
-
getRegistryManager
- Specified by:
getRegistryManagerin interfaceCommandSource
-