You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having problems with setting the displayname of the items. I want one of the displaynames to be "Cancel" in red, and another be "Accept" in green.
Behavior
When triggering the GUI, these items appear to have the default names. (Barrier and Green wool)
Versions
Server:
This server is running Paper version git-Paper-426 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 7ccefdc)
You are 9 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
AnvilGUI version 1.9.2-SNAPSHOT
Reproducible example
AnvilGUI.Builderbuilder = newAnvilGUI.Builder();
ItemStackitemLeft = newItemStack(Material.BARRIER);
ItemMetaitemMetaLeft = itemLeft.getItemMeta();
itemMetaLeft.displayName(Component.text("Cancel").color(NamedTextColor.RED));
itemLeft.setItemMeta(itemMetaLeft);
ItemStackitemOutput = newItemStack(Material.GREEN_WOOL);
ItemMetaitemMetaOutput = itemOutput.getItemMeta();
itemMetaOutput.displayName(Component.text("Accept").color(NamedTextColor.GREEN));
itemOutput.setItemMeta(itemMetaOutput);
builder.itemLeft(itemLeft).itemOutput(itemOutput).title("Type flag arguments").plugin(plugin).text("");
builder.onClickAsync((slot, stateSnapshot) -> CompletableFuture.supplyAsync(() -> {
if (slot == AnvilGUI.Slot.INPUT_RIGHT) {
returnCollections.emptyList();
}
if (slot == AnvilGUI.Slot.OUTPUT) {
action.accept(stateSnapshot.getText()); // Do whatever action I want with the string I fetched from the anvil
}
returnList.of(AnvilGUI.ResponseAction.close());
}));
builder.interactableSlots(AnvilGUI.Slot.INPUT_LEFT, AnvilGUI.Slot.INPUT_RIGHT, AnvilGUI.Slot.OUTPUT);
builder.open(activator);
The text was updated successfully, but these errors were encountered:
Issue
I'm having problems with setting the displayname of the items. I want one of the displaynames to be "Cancel" in red, and another be "Accept" in green.
Behavior
When triggering the GUI, these items appear to have the default names. (Barrier and Green wool)
Versions
Server:
AnvilGUI version 1.9.2-SNAPSHOT
Reproducible example
The text was updated successfully, but these errors were encountered: