public class ServerCommandSource extends Object implements CommandSource
CommandSource.RelativePosition
Modifier and Type | Field and 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 |
Modifier | Constructor and 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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachMatching, forEachMatching, getBlockPositionSuggestions, getEntitySuggestions, getPositionSuggestions, method_27136, suggestColumnPositions, suggestFromIdentifier, suggestFromIdentifier, suggestIdentifiers, suggestIdentifiers, suggestIdentifiers, suggestMatching, suggestMatching, suggestMatching, suggestPositions
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType REQUIRES_PLAYER_EXCEPTION
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType REQUIRES_ENTITY_EXCEPTION
private final CommandOutput output
private final Vec3d position
private final ServerWorld world
private final int level
private final String simpleName
private final Text name
private final MinecraftServer server
private final boolean silent
private final com.mojang.brigadier.ResultConsumer<ServerCommandSource> resultConsumer
private final EntityAnchorArgumentType.EntityAnchor entityAnchor
private final Vec2f rotation
public ServerCommandSource(CommandOutput output, Vec3d pos, Vec2f rot, ServerWorld world, int level, String simpleName, Text name, MinecraftServer server, @Nullable Entity entity)
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)
public ServerCommandSource withEntity(Entity entity)
public ServerCommandSource withPosition(Vec3d position)
public ServerCommandSource withRotation(Vec2f rotation)
public ServerCommandSource withConsumer(com.mojang.brigadier.ResultConsumer<ServerCommandSource> consumer)
public ServerCommandSource mergeConsumers(com.mojang.brigadier.ResultConsumer<ServerCommandSource> consumer, BinaryOperator<com.mojang.brigadier.ResultConsumer<ServerCommandSource>> binaryOperator)
public ServerCommandSource withSilent()
public ServerCommandSource withLevel(int level)
public ServerCommandSource withMaxLevel(int level)
public ServerCommandSource withEntityAnchor(EntityAnchorArgumentType.EntityAnchor anchor)
public ServerCommandSource withWorld(ServerWorld world)
public ServerCommandSource withLookingAt(Entity entity, EntityAnchorArgumentType.EntityAnchor anchor) throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public ServerCommandSource withLookingAt(Vec3d position) throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public Text getDisplayName()
public String getName()
public boolean hasPermissionLevel(int level)
hasPermissionLevel
in interface CommandSource
public Vec3d getPosition()
public ServerWorld getWorld()
public Entity getEntityOrThrow() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public ServerPlayerEntity getPlayer() throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxException
public Vec2f getRotation()
public MinecraftServer getMinecraftServer()
public EntityAnchorArgumentType.EntityAnchor getEntityAnchor()
public void sendFeedback(Text message, boolean broadcastToOps)
private void sendToOps(Text message)
public void sendError(Text message)
public void onCommandComplete(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, boolean success, int result)
public Collection<String> getPlayerNames()
getPlayerNames
in interface CommandSource
public Collection<String> getTeamNames()
getTeamNames
in interface CommandSource
public Collection<Identifier> getSoundIds()
getSoundIds
in interface CommandSource
public Stream<Identifier> getRecipeIds()
getRecipeIds
in interface CommandSource
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> getCompletions(com.mojang.brigadier.context.CommandContext<CommandSource> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
getCompletions
in interface CommandSource
public Set<RegistryKey<World>> getWorldKeys()
getWorldKeys
in interface CommandSource
public DynamicRegistryManager getRegistryManager()
getRegistryManager
in interface CommandSource