User Tools

Site Tools


externalcommandspell

External Command Spell

External command spells allow you to make spells out of commands from other plugins, complete with reagent cost, cooldown, and everything that comes with a spell.

An external spell functions the same as any other spell as far as the plugin is concerned. If you'd like multiple external spells, just use the Spell Copies system like you would for any other spell. They can also be used as part of a Multi Spell.

Configuration Options

OptionDescription
command-to-executeThe command(s) to execute when the spell is cast. This is a list of commands. You should leave off the beginning slash.
command-to-execute-laterThe command(s) to execute after a certain time has passed. This is a list of commands. You should leave off the beginning slash. The delay time is defined by the command-delay option.
command-delayThe amount of time to delay the commands defined in command-to-execute-later option. This is in server ticks (20 ticks per second usually).
command-to-blockThis is a list of commands to block players from using. You should leave off the beginning slash. This option is mostly unnecessary as of version 1.1, you should use the temporary-permissions option instead if possible.
temporary-permissionsA list of permission nodes to grant a player temporarily when casting the spell. Note: PermissionsEx doesn't seem to properly support this feature.
temporary-opIf this is true, the casting player will be opped temporarily so they can use the commands.
require-player-targetWhether to require a player target to cast the spell.
execute-as-target-insteadIf this is true, the target of the spell will execute the commands instead of the caster. This only works if require-player-target is true.
execute-on-console-insteadIf this is true, the command will be executed on the console instead of by the player.
obey-losWhether to obey line-of-sight restrictions. Only matters if require-player-target is true.
rangeThe range to target a player. Only matters if require-player-target is true.
beneficialWhether this is a beneficial spell (when require-player-target is true).false
block-chat-outputWhether to block chat output of commands run by the player for this spell. This will still output at least one line, which can be customized by the str-blocked-output optionfalse
str-blocked-outputSee block-chat-output above.(empty)

Parameter Codes

The commands can use parameter codes to fill in certain information in the command.

Code Description
%a The name of the caster (actor)
%t The name of the target, if require-player-target is true
%1 The first typed parameter, if the spell is cast with the /cast command
%2 - %9 Same as above

Example

gianttree:
    spell-class: ".ExternalCommandSpell"
    name: gianttree
    enabled: false
    description: Create a giant tree!
    cooldown: 300
    can-cast-by-command: true
    can-cast-with-item: false
    command-to-execute: 
        - "gt 25 4"
    command-to-execute-later: []
    command-delay: 0
    command-to-block:
        - "gt"
    temporary-permissions: 
        - "gianttrees.build"
    require-player-target: false
    execute-as-target-instead: false
    obey-los: true
    range: 20
    cost:
        - 331 10
        - 6 5
    str-cost: 10 redstone dust and 5 saplings
    str-cast-self: You grow a tree!
    str-cant-use-command: "&4You don't have permission to do that."
spawn:
    spell-class: ".ExternalCommandSpell"
    cast-item: stick
    execute-on-console-instead: true
    command-to-execute:
        - "warp Spawn %a"
externalcommandspell.txt · Last modified: 2014/11/04 23:21 by nisovin