Skip to content

Added context placeholders - #304

Draft
BlitzOffline wants to merge 1 commit into
mainfrom
internal-placeholder
Draft

Added context placeholders#304
BlitzOffline wants to merge 1 commit into
mainfrom
internal-placeholder

Conversation

@BlitzOffline

Copy link
Copy Markdown
Member

Added context placeholders

Added a set of built-in placeholders that describe the menu a player has open, the item involved, and the click they made. They are resolved by DeluxeMenus itself, not PlaceholderAPI, and they work in display names, lore, click commands and requirements

All follow the form %context.key%:

  • %menu.*% - name, title, type, size, rows, item_count, open_command, has_placeholder_player
  • %viewer.*% - name, uuid, display_name
  • %item.*% - slot, row, column, priority, update, material, amount, model_data, display_name
  • %click.*% - type, action, slot, raw_slot, hotbar_button, cursor_material, is_left, is_right, is_shift
display_name: "&aSlot %item.slot% (row %item.row%)"
lore:
  - "&7You are &f%viewer.name%&7, in &f%menu.title%"
click_commands:
  - "[message] &7You %click.type%-clicked slot %click.slot%"

Booleans render through two new config.yml keys, internal_placeholders.true_value / internal_placeholders.false_value, so a server can print Yes / No instead.

Placeholders that don't apply in a given spot are left literal (e.g.: %item.material% inside a view_requirement stays as text, because the ItemStack does not exist yet at that point).

Internal placeholders resolve last, after PAPI and after {args}.

I have not tested at all. The only thing I know to be working now is the compilation.

Closes #62
Closes #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SUGGESTION] Add internal item placeholders Add internal placeholders

1 participant