Package net.minecraft.command
Class CommandSource
- java.lang.Object
-
- net.minecraft.command.CommandSource
-
- All Implemented Interfaces:
ISuggestionProvider
public class CommandSource extends java.lang.Object implements ISuggestionProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.minecraft.command.ISuggestionProvider
ISuggestionProvider.Coordinates
-
-
Field Summary
Fields Modifier and Type Field Description private EntityAnchorArgument.Type
anchor
private com.mojang.brigadier.ResultConsumer<CommandSource>
consumer
private ITextComponent
displayName
private Entity
entity
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_NOT_ENTITY
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_NOT_PLAYER
private ServerWorld
level
private int
permissionLevel
private Vector2f
rotation
private MinecraftServer
server
private boolean
silent
private ICommandSource
source
private java.lang.String
textName
private Vector3d
worldPosition
-
Constructor Summary
Constructors Modifier Constructor Description CommandSource(ICommandSource p_i49552_1_, Vector3d p_i49552_2_, Vector2f p_i49552_3_, ServerWorld p_i49552_4_, int p_i49552_5_, java.lang.String p_i49552_6_, ITextComponent p_i49552_7_, MinecraftServer p_i49552_8_, Entity p_i49552_9_)
protected
CommandSource(ICommandSource p_i49553_1_, Vector3d p_i49553_2_, Vector2f p_i49553_3_, ServerWorld p_i49553_4_, int p_i49553_5_, java.lang.String p_i49553_6_, ITextComponent p_i49553_7_, MinecraftServer p_i49553_8_, Entity p_i49553_9_, boolean p_i49553_10_, com.mojang.brigadier.ResultConsumer<CommandSource> p_i49553_11_, EntityAnchorArgument.Type p_i49553_12_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
broadcastToAdmins(ITextComponent p_197020_1_)
java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
customSuggestion(com.mojang.brigadier.context.CommandContext<ISuggestionProvider> p_197009_1_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_197009_2_)
CommandSource
facing(Entity p_201006_1_, EntityAnchorArgument.Type p_201006_2_)
CommandSource
facing(Vector3d p_201005_1_)
java.util.Collection<java.lang.String>
getAllTeams()
EntityAnchorArgument.Type
getAnchor()
java.util.Collection<ResourceLocation>
getAvailableSoundEvents()
ITextComponent
getDisplayName()
Entity
getEntity()
Entity
getEntityOrException()
ServerWorld
getLevel()
java.util.Collection<java.lang.String>
getOnlinePlayerNames()
ServerPlayerEntity
getPlayerOrException()
Vector3d
getPosition()
java.util.stream.Stream<ResourceLocation>
getRecipeNames()
Vector2f
getRotation()
MinecraftServer
getServer()
java.lang.String
getTextName()
boolean
hasPermission(int p_197034_1_)
java.util.Set<RegistryKey<World>>
levels()
void
onCommandComplete(com.mojang.brigadier.context.CommandContext<CommandSource> p_197038_1_, boolean p_197038_2_, int p_197038_3_)
DynamicRegistries
registryAccess()
void
sendFailure(ITextComponent p_197021_1_)
void
sendSuccess(ITextComponent p_197030_1_, boolean p_197030_2_)
CommandSource
withAnchor(EntityAnchorArgument.Type p_201010_1_)
CommandSource
withCallback(com.mojang.brigadier.ResultConsumer<CommandSource> p_197029_1_)
CommandSource
withCallback(com.mojang.brigadier.ResultConsumer<CommandSource> p_209550_1_, java.util.function.BinaryOperator<com.mojang.brigadier.ResultConsumer<CommandSource>> p_209550_2_)
CommandSource
withEntity(Entity p_197024_1_)
CommandSource
withLevel(ServerWorld p_201003_1_)
CommandSource
withMaximumPermission(int p_197026_1_)
CommandSource
withPermission(int p_197033_1_)
CommandSource
withPosition(Vector3d p_201009_1_)
CommandSource
withRotation(Vector2f p_201007_1_)
CommandSource
withSuppressedOutput()
-
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.ISuggestionProvider
getAbsoluteCoordinates, getRelevantCoordinates, getSelectedEntities
-
-
-
-
Field Detail
-
ERROR_NOT_PLAYER
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NOT_PLAYER
-
ERROR_NOT_ENTITY
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NOT_ENTITY
-
source
private final ICommandSource source
-
worldPosition
private final Vector3d worldPosition
-
level
private final ServerWorld level
-
permissionLevel
private final int permissionLevel
-
textName
private final java.lang.String textName
-
displayName
private final ITextComponent displayName
-
server
private final MinecraftServer server
-
silent
private final boolean silent
-
entity
@Nullable private final Entity entity
-
consumer
private final com.mojang.brigadier.ResultConsumer<CommandSource> consumer
-
anchor
private final EntityAnchorArgument.Type anchor
-
rotation
private final Vector2f rotation
-
-
Constructor Detail
-
CommandSource
public CommandSource(ICommandSource p_i49552_1_, Vector3d p_i49552_2_, Vector2f p_i49552_3_, ServerWorld p_i49552_4_, int p_i49552_5_, java.lang.String p_i49552_6_, ITextComponent p_i49552_7_, MinecraftServer p_i49552_8_, @Nullable Entity p_i49552_9_)
-
CommandSource
protected CommandSource(ICommandSource p_i49553_1_, Vector3d p_i49553_2_, Vector2f p_i49553_3_, ServerWorld p_i49553_4_, int p_i49553_5_, java.lang.String p_i49553_6_, ITextComponent p_i49553_7_, MinecraftServer p_i49553_8_, @Nullable Entity p_i49553_9_, boolean p_i49553_10_, com.mojang.brigadier.ResultConsumer<CommandSource> p_i49553_11_, EntityAnchorArgument.Type p_i49553_12_)
-
-
Method Detail
-
withEntity
public CommandSource withEntity(Entity p_197024_1_)
-
withPosition
public CommandSource withPosition(Vector3d p_201009_1_)
-
withRotation
public CommandSource withRotation(Vector2f p_201007_1_)
-
withCallback
public CommandSource withCallback(com.mojang.brigadier.ResultConsumer<CommandSource> p_197029_1_)
-
withCallback
public CommandSource withCallback(com.mojang.brigadier.ResultConsumer<CommandSource> p_209550_1_, java.util.function.BinaryOperator<com.mojang.brigadier.ResultConsumer<CommandSource>> p_209550_2_)
-
withSuppressedOutput
public CommandSource withSuppressedOutput()
-
withPermission
public CommandSource withPermission(int p_197033_1_)
-
withMaximumPermission
public CommandSource withMaximumPermission(int p_197026_1_)
-
withAnchor
public CommandSource withAnchor(EntityAnchorArgument.Type p_201010_1_)
-
withLevel
public CommandSource withLevel(ServerWorld p_201003_1_)
-
facing
public CommandSource facing(Entity p_201006_1_, EntityAnchorArgument.Type p_201006_2_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
facing
public CommandSource facing(Vector3d p_201005_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getDisplayName
public ITextComponent getDisplayName()
-
getTextName
public java.lang.String getTextName()
-
hasPermission
public boolean hasPermission(int p_197034_1_)
- Specified by:
hasPermission
in interfaceISuggestionProvider
-
getPosition
public Vector3d getPosition()
-
getLevel
public ServerWorld getLevel()
-
getEntity
@Nullable public Entity getEntity()
-
getEntityOrException
public Entity getEntityOrException() throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getPlayerOrException
public ServerPlayerEntity getPlayerOrException() throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getRotation
public Vector2f getRotation()
-
getServer
public MinecraftServer getServer()
-
getAnchor
public EntityAnchorArgument.Type getAnchor()
-
sendSuccess
public void sendSuccess(ITextComponent p_197030_1_, boolean p_197030_2_)
-
broadcastToAdmins
private void broadcastToAdmins(ITextComponent p_197020_1_)
-
sendFailure
public void sendFailure(ITextComponent p_197021_1_)
-
onCommandComplete
public void onCommandComplete(com.mojang.brigadier.context.CommandContext<CommandSource> p_197038_1_, boolean p_197038_2_, int p_197038_3_)
-
getOnlinePlayerNames
public java.util.Collection<java.lang.String> getOnlinePlayerNames()
- Specified by:
getOnlinePlayerNames
in interfaceISuggestionProvider
-
getAllTeams
public java.util.Collection<java.lang.String> getAllTeams()
- Specified by:
getAllTeams
in interfaceISuggestionProvider
-
getAvailableSoundEvents
public java.util.Collection<ResourceLocation> getAvailableSoundEvents()
- Specified by:
getAvailableSoundEvents
in interfaceISuggestionProvider
-
getRecipeNames
public java.util.stream.Stream<ResourceLocation> getRecipeNames()
- Specified by:
getRecipeNames
in interfaceISuggestionProvider
-
customSuggestion
public java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> customSuggestion(com.mojang.brigadier.context.CommandContext<ISuggestionProvider> p_197009_1_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_197009_2_)
- Specified by:
customSuggestion
in interfaceISuggestionProvider
-
levels
public java.util.Set<RegistryKey<World>> levels()
- Specified by:
levels
in interfaceISuggestionProvider
-
registryAccess
public DynamicRegistries registryAccess()
- Specified by:
registryAccess
in interfaceISuggestionProvider
-
-