Skip to content

AdvancementDisplay

fren_gor edited this page Aug 19, 2021 · 25 revisions

The AdvancementDisplay class stores information about the advancement graphic aspect. It stores:

Components

The display groups all the graphic components into one object. The display consists of:

Name Description
icon The itemstack that will be shown on the advancement GUI
title The title of the advancement, shown when a player hovers the advancement in the advancement GUI
description The description of the advancement, shown when a player hovers the advancement in the advancement GUI
frame The shape of advancement in the advancement GUI
x The x coordinate of the advancement in the advancement GUI
y The y coordinate of the advancement in the advancement GUI
showToast Whether to show the toast when a player grants the advancement
announceChat Whether to show the announce message on the chat when a player grants the advancement

How to work with the Advancement plan

Advancement plan work as a Cartesian plane with both positive axes. The y-axis point down. If there are few advancements, they are centered.

plan


Frame Types

Task

Goal

Challange

Toast

The toast is the notification that comes out at the top right when you complete an advancement.
An example:

Through the API it is also possible to send custom toast. Use the method UltimateAdvancementAPI#displayCustomToast()


AnnounceChat

This message is sent to all online players on the server when someone completes an advancement. There is a default message which is similar to the vanilla one:

If you go over the name of the advancement, the title and description of the advancement will be displayed:

To customize the hover message override Advancement#getAnnounceMessage() method and return a BaseComponent[]