• 欢迎来到Minecraft插件百科!
  • 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
  • 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289

MagicSpells/魔法/被动魔法

来自Minecraft插件百科
跳转至: 导航搜索

被动魔法是释放魔法的特殊类型,它可以被设置成各种各样的触发器,也可以非常方便的同时触发其他技能。 魔法能量可以传给它所触发的下一个魔法。

配置

选项解释默认值
triggersA list of triggers that activate this spells' effects. See below for more information.
chanceThe chance that this spell will activate when the trigger happens. Should be a number between 1 and 100.100
cast-without-targetIf you use targeted spells but the trigger does not have a target, they will normally not be casted. If you would like them to cast anyway, set this option to true. Note that the External Command Spell is considered a targeted spell.false
send-failure-messagesWhether to send failure messages, like on cooldown and missing reagents.false
delayThe number of ticks to delay spell activation after the trigger is detected. A value of -1 means that the spells will activate at the same time as the trigger (often means just before), a value of 0 means the spells will activate immediately after the trigger, and any value greater than 0 is the number of ticks to wait before activating the spells.-1
cancel-default-actionWhether to cancel the default action that was triggered. For example, with a damage-based trigger, setting this to true would cancel the damage. This will not work if there is any delay (the delay must be -1 for it to work).false
spellsA list of spells to activate when this spell is triggered.

触发器

触发器格式:<名字>[值],并不是所有触发器都有值。

触发器解释
伤害触发器
takedamageTriggers when the player takes damage. The var is the item (or comma-separated list) that the attacker is holding, or a damage type (or comma-separated list). Leave out the var to allow any damage source.
givedamageTriggers when the player gives damage. The var is the item (or comma-separated list) that the player is holding. Leave out the var to allow any item.
killTriggers when the player kills an enemy. The var is the type of entity (or comma-separated list) killed. Leave out the var to allow any entity.
death [v3.0]Triggers when the player dies. Note that this may cause odd behavior in some situations, since dead players can't really cast spells.
玩家事件触发器
join [v3.0]Triggers when the player joins the game.
respawnTriggers when the player respawns.
quit [v3.0]Triggers when the player quits the game. Note that this may cause odd behavior in some situations, since offline players can't really cast spells.
玩家动作触发器
sprintTriggers when the player starts to sprint. Does not use a var.
stopsprintTriggers when the player stops sprinting. Does not use a var.
sneakTriggers when the player starts to sneak. Does not use a var.
stopsneakTriggers when the player stops sneaking. Does not use a var.
fly [v3.0]Triggers when the player starts to fly (presses double-jump). Does not use a var.
stopfly [v3.0]Triggers when the player stops flying. Does not use a var.
dropitem [v3.0]Triggers when the player drops an item from their inventory. The var is the item type or comma-separated list.
pickupitem [v3.0]Triggers when the player picks up an item from the ground. The var is the item type or comma-separated list.
fish [v3.0]Triggers when the player fishes. The var is one of the following: ground, fish, fail, or an entity type.
shoot [v3.1]Triggers when the player fires a projectile (an arrow from a bow). Does not use a var.
teleport [v3.0]Triggers when the player teleports. The var is the teleport cause, which is one of the following: command, endportal, enderpearl, netherportal, plugin, or unknown.
行动触发器
blockbreakTriggers when the player breaks a block. The var is the block id (or comma-separated list). Leave out the var to trigger on any block break.
blockplaceTriggers when the player places a block. The var is the block id (or comma-separated list). Leave out the var to trigger on any block place.
rightclickTriggers when the player right clicks. The var is the item that the player is holding (or comma-separated list).
rightclickblockcoordTriggers when the player right clicks a specific block, or a list of blocks. The var is the coordinates of the block in the format world,x,y,z (can specify a list with semi-colons, ie: world,x,y,z;world,x,y,z).
rightclickblocktypeTriggers when the player right clicks a certain type of block, or list of types. The var is the block id (or comma-separated list).
rightclickentity [v3.0]Triggers when the player right clicks on an entity. The var is the type of entity.
技能触发器
spellcastTriggers when the player casts a spell. The var is the spell name to check. Leave out the var to trigger on any spell cast.
spelltargetTriggers when the player targets another player or monster with a spell. The var is the spell name to check. Leave out the var to trigger on any targeted spell cast.
spelltargetedTriggers when the player is targeted by a spell. The var is the spell name being cast. Leave out the var to trigger on any spell.
buffA special trigger that makes a buff spell always active. Technically triggers on player join, leave, death, and respawn. Does not use a var. Only works with buff spells, and should not generally be used with any other triggers.
其他触发器
ticksTriggers periodically. The var is the tick interval, in server ticks (20 = approx 1 second).

例子

样例1:毒剑

如果玩家拥有此技能,在他使用金剑攻击的时候将会有30%几率使对方中毒。当触发后,冷却4秒之后才会再进行判定。

poisonsword:
    spell-class: ".PassiveSpell"
    triggers: 
        - givedamage 283
    chance: 30
    cooldown: 4
    spells:
        - poison