Interface CommandSender

All Superinterfaces:
net.kyori.adventure.audience.Audience, Permissible, net.kyori.adventure.pointer.Pointered, ServerOperator
All Known Subinterfaces:
AbstractArrow, AbstractCow, AbstractCubeMob, AbstractHorse, AbstractNautilus, AbstractSkeleton, AbstractVillager, AbstractWindCharge, AcaciaBoat, AcaciaChestBoat, Ageable, Allay, Ambient, Animals, AreaEffectCloud, Armadillo, ArmorStand, Arrow, Axolotl, BambooChestRaft, BambooRaft, Bat, Bee, BirchBoat, BirchChestBoat, Blaze, BlockCommandSender, BlockDisplay, Boat, Bogged, Boss, Breedable, Breeze, BreezeWindCharge, Bucketable, Camel, CamelHusk, Cat, CaveSpider, CherryBoat, CherryChestBoat, ChestBoat, ChestedHorse, Chicken, Cod, CollarColorable, CommandMinecart, ComplexEntityPart, ComplexLivingEntity, ConsoleCommandSender, CopperGolem, Cow, Creaking, Creature, Creeper, Cushion, Damageable, DarkOakBoat, DarkOakChestBoat, Display, Dolphin, Donkey, DragonFireball, Drowned, Egg, ElderGuardian, EnderCrystal, EnderDragon, EnderDragonPart, Enderman, Endermite, EnderPearl, EnderSignal, Enemy, Entity, Evoker, EvokerFangs, ExperienceOrb, Explosive, ExplosiveMinecart, FallingBlock, Fireball, Firework, Fish, FishHook, Flying, Fox, Frog, Ghast, Giant, GlowItemFrame, GlowSquid, Goat, Golem, Guardian, Hanging, HappyGhast, Hoglin, HopperMinecart, Horse, HumanEntity, Husk, Illager, Illusioner, Interaction, IronGolem, Item, ItemDisplay, ItemFrame, JungleBoat, JungleChestBoat, LargeFireball, Leashable, LeashHitch, LightningStrike, LingeringPotion, LivingEntity, Llama, LlamaSpit, MagmaCube, MangroveBoat, MangroveChestBoat, Mannequin, Marker, MessageCommandSender, Minecart, Mob, Monster, Mule, MushroomCow, Nautilus, NPC, OakBoat, OakChestBoat, Ocelot, OminousItemSpawner, Painting, PaleOakBoat, PaleOakChestBoat, Panda, Parched, Parrot, Phantom, Pig, Piglin, PiglinAbstract, PiglinBrute, PigZombie, Pillager, Player, PolarBear, PoplarBoat, PoplarChestBoat, PoweredMinecart, Projectile, ProxiedCommandSender, PufferFish, Rabbit, Raider, RangedEntity, Ravager, RemoteConsoleCommandSender, RideableMinecart, Salmon, SchoolableFish, Shearable, Sheep, Shulker, ShulkerBullet, Silverfish, Sittable, SizedFireball, Skeleton, SkeletonHorse, Slime, SmallFireball, Sniffer, Snowball, Snowman, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, SplashPotion, SpruceBoat, SpruceChestBoat, Squid, Steerable, StorageMinecart, Stray, Strider, SulfurCube, Tadpole, Tameable, TextDisplay, ThrowableProjectile, ThrownExpBottle, ThrownPotion, TippedArrow, TNTPrimed, TraderLlama, Trident, TropicalFish, Turtle, Vehicle, Vex, Villager, Vindicator, WanderingTrader, Warden, WaterMob, WindCharge, Witch, Wither, WitherSkeleton, WitherSkull, Wolf, Zoglin, Zombie, ZombieHorse, ZombieNautilus, ZombieVillager
All Known Implementing Classes:
BufferedCommandSender, TimingsReportListener

public interface CommandSender extends net.kyori.adventure.audience.Audience, Permissible
Since:
1.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Gets the name of this command sender
    @NotNull Server
    Returns the server instance that this command is running on
    @NotNull net.kyori.adventure.text.Component
    Gets the name of this command sender
    void
    sendMessage(@NotNull String message)
    Sends this sender a message
    void
    sendMessage(@NotNull String... messages)
    Sends this sender multiple messages
    void
    sendMessage(@Nullable UUID sender, @NotNull String message)
    Deprecated.
    sender UUID is ignored
    void
    sendMessage(@Nullable UUID sender, @NotNull String... messages)
    Deprecated.
    sender UUID is ignored
    default void
    sendMessage(@NotNull net.kyori.adventure.chat.SignedMessage signedMessage, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
    default void
    sendMessage(@NotNull net.kyori.adventure.text.Component message)
    default void
    sendMessage(@NotNull net.kyori.adventure.text.Component message, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
    default void
    sendMessage(net.md_5.bungee.api.chat.BaseComponent component)
    Deprecated.
    default void
    sendMessage(net.md_5.bungee.api.chat.BaseComponent... components)
    Deprecated.
    default void
    sendPlainMessage(@NotNull String message)
    Sends a plain message to the command sender.
    default void
    sendRichMessage(@NotNull String message)
    Sends a message with the MiniMessage format to the command sender.
    default void
    sendRichMessage(@NotNull String message, @NotNull net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolvers)
    Sends a message with the MiniMessage format to the command sender.
     

    Methods inherited from interface net.kyori.adventure.audience.Audience

    clearResourcePacks, clearTitle, closeDialog, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showDialog, showTitle, stopSound, stopSound

    Methods inherited from interface net.kyori.adventure.pointer.Pointered

    get, getOrDefault, getOrDefaultFrom, pointers

    Methods inherited from interface ServerOperator

    isOp, setOp
  • Method Details

    • sendMessage

      @Obsolete void sendMessage(@NotNull @NotNull String message)
      Sends this sender a message
      Parameters:
      message - Message to be displayed
      Since:
      1.0.0
      See Also:
    • sendMessage

      @Obsolete void sendMessage(@NotNull @NotNull String... messages)
      Sends this sender multiple messages
      Parameters:
      messages - An array of messages to be displayed
      Since:
      1.1.0
      See Also:
    • sendMessage

      @Deprecated void sendMessage(@Nullable @Nullable UUID sender, @NotNull @NotNull String message)
      Deprecated.
      sender UUID is ignored
      Sends this sender a message
      Parameters:
      sender - The sender of this message
      message - Message to be displayed
      Since:
      1.16.3
      See Also:
    • sendMessage

      @Deprecated void sendMessage(@Nullable @Nullable UUID sender, @NotNull @NotNull String... messages)
      Deprecated.
      sender UUID is ignored
      Sends this sender multiple messages
      Parameters:
      sender - The sender of this message
      messages - An array of messages to be displayed
      Since:
      1.16.3
      See Also:
    • getServer

      @NotNull @NotNull Server getServer()
      Returns the server instance that this command is running on
      Returns:
      Server instance
      Since:
      1.0.0
    • getName

      @NotNull @NotNull String getName()
      Gets the name of this command sender
      Returns:
      Name of the sender
      Since:
      1.0.0
    • spigot

      @NotNull @NotNull CommandSender.Spigot spigot()
      Since:
      1.12
    • name

      @NotNull net.kyori.adventure.text.Component name()
      Gets the name of this command sender
      Returns:
      Name of the sender
      Since:
      1.17.1
    • sendMessage

      default void sendMessage(@NotNull net.kyori.adventure.text.Component message)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience
      Since:
      26.2
    • sendMessage

      default void sendMessage(@NotNull @NotNull net.kyori.adventure.text.Component message, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience
      Since:
      26.2
    • sendMessage

      default void sendMessage(@NotNull @NotNull net.kyori.adventure.chat.SignedMessage signedMessage, @NotNull net.kyori.adventure.chat.ChatType.Bound boundChatType)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience
      Since:
      26.2
    • sendRichMessage

      default void sendRichMessage(@NotNull @NotNull String message)
      Sends a message with the MiniMessage format to the command sender.

      See MiniMessage docs for more information on the format.

      Parameters:
      message - MiniMessage content
      Since:
      1.19
    • sendRichMessage

      default void sendRichMessage(@NotNull @NotNull String message, @NotNull net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolvers)
      Sends a message with the MiniMessage format to the command sender.

      See MiniMessage docs and MiniMessage Placeholders docs for more information on the format.

      Parameters:
      message - MiniMessage content
      resolvers - resolvers to use
      Since:
      1.20.1
    • sendPlainMessage

      default void sendPlainMessage(@NotNull @NotNull String message)
      Sends a plain message to the command sender.
      Parameters:
      message - plain message
      Since:
      1.19
    • sendMessage

      @Deprecated default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent component)
      Deprecated.
      Sends the component to the sender

      If this sender does not support sending full components then the component will be sent as legacy text.

      Parameters:
      component - the component to send
      Since:
      1.9.4
    • sendMessage

      @Deprecated default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components)
      Deprecated.
      Sends an array of components as a single message to the sender

      If this sender does not support sending full components then the components will be sent as legacy text.

      Parameters:
      components - the components to send
      Since:
      1.9.4