Basic Commands
Invoke
- Name:
invoke - Syntax:
invoke [<java_expression>] - Description: Executes a Java string expression. Supports methods, fields, private members, and constructors.
- Tags:
<invoke[<java_expression>]>: The result of the expression.
- Usage:
# Use to change player health.
- invoke player.setHealth(0)
# Use to get definition.
- define health 0
- invoke player.setHealth(health)
# Use to get context — example: <context.damager>.
- invoke damager.setHealth(0)
# Use to get player name.
- define name <invoke[player.getName()]>Async-While
- Name:
async-while - Syntax:
async-while [stop/next/[<value>] (!)(<operator> <value>) (&&/|| ...)] [<commands>] - Description: Runs a series of braced commands asynchronously until the comparisons return false. Unlike the normal
whilecommand, this does not block the current queue. - Tags:
<[loop_index]>: Gets the number of loops so far.
- Usage:
# Use to loop until a player sneaks, or the player goes offline.
- async-while !<player.is_sneaking> && <player.is_online>:
- narrate "Waiting for you to sneak..."
- wait 1sCommand
- Name:
command - Syntax:
command [create/delete/rename] [<command_name>] [with:<args>] - Description: Creates, deletes, or renames Denizen commands at runtime.
- Usage:
# Use to create custom command '- role <player> police'
- command create role with:player|role
# Use to create custom command '- emote <player> type:<type>'
- command create emote with:player|#typeEvent
- Name:
event - Syntax:
event [rename] [<event_name>] [to:<new_event_name>] - Description: Renames Denizen events at runtime.
- Usage:
# Use to rename 'player jumps' event.
- event rename 'player jumps' 'to:player jumps2'Tag
- Name:
tag - Syntax:
tag [create/delete] [<tag_name>] (static:true/false) (in:<object_name>) - Description: Tag manager. Creates or deletes a custom tag.
- Usage:
# Use to create tag <hello>.
- tag create hello
# Use to create tag <player.hello>.
- tag create hello in:playerPlaceholder
- Name:
placeholder - Syntax:
placeholder [create/delete] [<placeholder>] [author:<author>] [version:<version>] - Description: Allows you to create placeholders.
- Usage:
# Use to create placeholder %test%.
- placeholder create test author:isnsest version:1.0Proxy
- Name:
proxy - Syntax:
proxy [<interfaces>|...] (using:<map>) (as:<name>) - Description: Creates a proxy object using the specified interfaces.
- Usage:
# Use to create proxy of Runnable.
- proxy Runnable using:[run=task]Section
- Name:
section - Syntax:
section (<definitions>) (as:<name>) - Description: Creates a
Sectionobject containing a list of commands. This object can be passed around, executed, or used as a handler in aproxycommand. - Usage:
- section:
- narrate "Hello from section"