Interface ServerPlayerKJS

All Superinterfaces:
DataSenderKJS, EntityKJS, LivingEntityKJS, MessageSenderKJS, PlayerKJS, ScriptTypeHolder, WithAttachedData<net.minecraft.world.entity.player.Player>, WithPersistentData
All Known Implementing Classes:
ServerPlayerMixin

@RemapPrefixForJS("kjs$") public interface ServerPlayerKJS extends PlayerKJS
  • Method Details

    • kjs$self

      @HideFromJS default net.minecraft.server.level.ServerPlayer kjs$self()
      Specified by:
      kjs$self in interface EntityKJS
      Specified by:
      kjs$self in interface LivingEntityKJS
      Specified by:
      kjs$self in interface PlayerKJS
    • kjs$isServerPlayer

      @ThisIs(net.minecraft.server.level.ServerPlayer.class) @Info("Checks if the entity is a server-side player.") default boolean kjs$isServerPlayer()
      Specified by:
      kjs$isServerPlayer in interface EntityKJS
    • kjs$sendData

      default void kjs$sendData(String channel, @Nullable @Nullable net.minecraft.nbt.CompoundTag data)
      Specified by:
      kjs$sendData in interface DataSenderKJS
    • kjs$getStats

      default PlayerStatsJS kjs$getStats()
      Specified by:
      kjs$getStats in interface PlayerKJS
    • kjs$isMiningBlock

      @Info("Checks, whether the player is currently mining a block.") default boolean kjs$isMiningBlock()
      Specified by:
      kjs$isMiningBlock in interface PlayerKJS
    • kjs$setPositionAndRotation

      default void kjs$setPositionAndRotation(double x, double y, double z, float yaw, float pitch)
      Specified by:
      kjs$setPositionAndRotation in interface EntityKJS
    • kjs$setCreativeMode

      @Info(value="Switches the player\'s gamemode between Creative and Survival.\nTo change the player\'s gamemode to a mode other than Creative or Survival, use `setGameMode`.\n", params=@Param(name="mode",value="`true` to change the player\'s gamemode to Creative.\n`false` to change the player\'s gamemode to Survival.\n")) default void kjs$setCreativeMode(boolean mode)
    • kjs$isOp

      @Info("Checks, whether the player is a server operator.") default boolean kjs$isOp()
    • kjs$kick

      @Info(value="Kicks the player from the server with the provided reason.", params=@Param(name="reason",value="A text component, containing the kick reason. It may be a string, which will be implicitly wrapped into a text component.")) default void kjs$kick(net.minecraft.network.chat.Component reason)
    • kjs$kick

      @Info("Kicks the player from the server with a generic reason.") default void kjs$kick()
    • kjs$ban

      @Info(value="Bans the player from the server.",params={@Param(name="banner",value="A string, that specifies who/what banned the player."),@Param(name="reason",value="A string, that contains the ban reason."),@Param(name="banDuration",value="Duration of a ban. Negative durations will result in a 10-year ban.")}) default void kjs$ban(String banner, String reason, Duration banDuration)
    • kjs$isAdvancementDone

      default boolean kjs$isAdvancementDone(net.minecraft.resources.ResourceLocation id)
    • kjs$unlockAdvancement

      default void kjs$unlockAdvancement(net.minecraft.resources.ResourceLocation id)
    • kjs$revokeAdvancement

      default void kjs$revokeAdvancement(net.minecraft.resources.ResourceLocation id)
    • kjs$setSelectedSlot

      default void kjs$setSelectedSlot(int index)
      Specified by:
      kjs$setSelectedSlot in interface PlayerKJS
    • kjs$setMouseItem

      default void kjs$setMouseItem(net.minecraft.world.item.ItemStack item)
      Specified by:
      kjs$setMouseItem in interface PlayerKJS
    • kjs$getSpawnLocation

      @Nullable default @Nullable LevelBlock kjs$getSpawnLocation()
    • kjs$setSpawnLocation

      default void kjs$setSpawnLocation(LevelBlock c)
    • kjs$notify

      default void kjs$notify(NotificationToastData builder)
      Specified by:
      kjs$notify in interface PlayerKJS
    • kjs$openChestGUI

      default void kjs$openChestGUI(Consumer<KubeJSGUI> gui)
    • kjs$openInventoryGUI

      default void kjs$openInventoryGUI(InventoryKJS inventory, net.minecraft.network.chat.Component title)
    • kjs$openInventoryGUI

      default void kjs$openInventoryGUI(InventoryKJS inventory, net.minecraft.network.chat.Component title, int columns)
    • kjs$openInventoryGUI

      default void kjs$openInventoryGUI(InventoryKJS inventory, net.minecraft.network.chat.Component title, int columns, int rows)
    • kjs$captureInventory

      default net.minecraft.world.Container kjs$captureInventory(boolean autoRestore)
    • kjs$openChestGUI

      default void kjs$openChestGUI(net.minecraft.network.chat.Component title, int rows, Consumer<ChestMenuData> gui)
    • kjs$heal

      @Info("Heals the player to full, and fully restores hunger and saturation.") default void kjs$heal()
    • kjs$setActivePostShader

      default void kjs$setActivePostShader(@Nullable @Nullable net.minecraft.resources.ResourceLocation id)
      Specified by:
      kjs$setActivePostShader in interface MessageSenderKJS