Interface AdvancementDisplay


@NullMarked public interface AdvancementDisplay
Describes the display of an advancement.

The display is used in the chat, in the toast messages and the advancements screen.

  • Method Details

    • frame

      Gets the AdvancementDisplay.Frame.

      This defines the appearance of the tile in the advancements screen and the text when it's completed.

      Returns:
      the frame type
    • title

      Component title()
      Gets the advancement title.
      Returns:
      the title
    • description

      Component description()
      Gets the description.
      Returns:
      the description
    • icon

      ItemStack icon()
      Gets the icon shown in the frame in the advancements screen.
      Returns:
      a copy of the icon
    • doesShowToast

      boolean doesShowToast()
      Gets whether a toast should be displayed.

      A toast is a notification that will be displayed in the top right corner of the screen.

      Returns:
      true if a toast should be shown
    • doesAnnounceToChat

      boolean doesAnnounceToChat()
      Gets whether a message should be sent in the chat.
      Returns:
      true if a message should be sent
      See Also:
    • isHidden

      boolean isHidden()
      Gets whether this advancement is hidden.

      Hidden advancements cannot be viewed by the player until they have been unlocked.

      Returns:
      true if hidden
    • backgroundPath

      @Nullable NamespacedKey backgroundPath()
      Gets the texture displayed behind the advancement tree when selected.

      This only affects root advancements without any parent. If the background is not specified or doesn't exist, the tab background will be the missing texture.

      Returns:
      the background texture path
    • displayName

      Component displayName()
      Gets the formatted display name for this display. This is a part of the component that would be shown in chat when a player completes the advancement.
      Returns:
      the display name
      See Also:
    • isPositionLocked

      boolean isPositionLocked()
      발전 과제 디스플레이의 위치가 재계산되지 않도록 고정되어 있는지를 확인합니다.
      Returns:
      고정 여부
    • setPositionLock

      AdvancementDisplay setPositionLock(boolean lock)
      발전 과제 디스플레이의 위치가 재계산되지 않도록 고정되어 있는지를 설정합니다.
      Parameters:
      lock - 고정 여부
      Returns:
      this
    • positionX

      float positionX()
      발전 과제 디스플레이의 X 위치를 가져옵니다.
      Returns:
      X 위치
    • positionY

      float positionY()
      발전 과제 디스플레이의 Y 위치를 가져옵니다.
      Returns:
      Y 위치
    • position

      AdvancementDisplay position(float x, float y)
      발전 과제 디스플레이의 위치를 설정합니다.
      Parameters:
      x - X 위치
      y - Y 위치
      Returns:
      this