forked from nisovin/MagicSpells
-
Notifications
You must be signed in to change notification settings - Fork 68
ConversationSpell
JasperLorelai edited this page May 19, 2024
·
15 revisions
spell-class: ".targeted.ConversationSpell"
Value | Supported |
---|---|
entity |
true |
location |
false |
entity_from_location |
false |
Opens a chat prompt that can be used to store the target's response in a variable. This is a targeted spell, so remember to use target-self: true
to capture the caster's response instead.
Option | Description |
---|---|
conversation |
Starts a section with a number of options. Will fail if not defined. |
Option | Description | Type |
---|---|---|
prefix |
Accepts a string. | String |
local-echo |
Whether or not to let the player see their responses in chat. | Boolean |
timeout-seconds |
The amount of time until the conversation automatically closes. | Integer |
escape-sequence |
The string (in quotes) the player can send to exit the conversation spell. | String |
first-prompt |
Name is misleading - you can only have one prompt. Starts a section with a number of options. Will fail if not defined. | Prompt Options |
Option | Description |
---|---|
prompt-type |
Accepts the values regex , fixed-set , or enum . |
prompt-text |
Accepts a string. The message that will be sent to the player upon the spell being cast. |
variable-name |
The variable to save the response to. |
Expand that same section with the prompt type's specific options. For:
-
regex
- addregexp
option which accepts a valid RegExp string. -
fixed-set
- add anoptions
string list for valid expected responses. -
enum
- addenum-class
string with the full qualified class name of an enum. For example, limit valid responses to Paper's potion effect types by setting the string to the package and class name:org.bukkit.potion.PotionEffectType
.
variables:
varMagicUserResponse:
type: playerstring
Conversation:
spell-class: ".targeted.ConversationSpell"
target-self: true
conversation:
prefix: "&3&l[&bQuest&3&l] &7"
local-echo: true
first-prompt:
prompt-type: fixed-set
prompt-text: |
Are you a magic user? Can you help me?
&3Do you want to accept this quest? §bType your response!
&7- &aYes
&7- &cNo
options:
- "Yes"
- "No"
variable-name: varMagicUserResponse
timeout-seconds: 6
escape-sequence: "Exit"