欢迎来到Minecraft插件百科!
对百科编辑一脸懵逼?
帮助:快速入门
带您快速熟悉百科编辑!
因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289
查看“Skript”的源代码
←
Skript
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于这些用户组的用户执行:
用户
、
自动确认用户
、
巡查者
您可以查看和复制此页面的源代码。
{{急需改进|缺少引言/概述|滥用一级标题|页面冗长,需要拆分子页面}} = 库 = * 什么是脚本库? 脚本库是Skript脚本的“脚本百科”,你可以在脚本库中查看各类脚本的索引。当然,你也可以在脚本库中收录/认领自己的脚本。 ---- * 访问脚本库 [[Skript/脚本库|脚本库]] <---点击访问 ---- * 关于脚本库 脚本库负责人:[[用户:0o酱|0o酱]]([[用户讨论:0o酱|讨论]]) 点击右方“讨论”按钮可以咨询脚本库的相关问题''(你也可以在主页中寻找我的联系方式)'' = Skript = ==原文地址== http://njol.ch/projects/skript/ == 介绍 == Skript是一个流行的服务器插件。 它允许服务器管理员在不写任何Java语言的情况下简单的管理Minecraft。 这是用触发器、条件和效果三个部分做到的。 当触发器触发,所有条件均满足,效果就会被触发。 Skript的基础想法是——自定义 —— 每个服务器都能在没有自定义插件的情况下表现不同。 这比你自己钻研插件和找人写插件快的多。 同时你也不需要那么多小插件了,这一个插件就够了。 你可以在[[https://github.com/bensku/Skript/releases 这里]]<ref>原文给的是DropBox地址无法访问,这里是作者的GitHub地址</ref>下载最新版本的Skript 已经提及了,Skript的触发器提供了这个插件的基本功能。 触发器很普通,并由一些条件和效果组成,就像这个简单的掉落修复脚本: <pre> on break of glass: drop glass 译者注: 当打破玻璃的时候: 掉落玻璃 </pre> Skript也能用来做自定义命令。 这些基本的触发器已被改成了执行特定的命令。 下面的简单触发器允许玩家在手持物品输入/id时显示它的ID。 <pre> command /id: description: Find the ID of the item you're holding trigger: message "You're holding a %type of tool% whose ID is %id of tool%." 译者注: 当使用/id时: 描述: 获取你当前持有物的ID 触发器: 给玩家发送消息 "你现在正在拿着一个%type of tool%[工具类型] ,它的ID是 %id of tool%[工具ID]" </pre> Skript同时也有直接从聊天栏执行效果的选项,输出一个可配置的符号打头(!是默认的)的聊天信息。 这经常被指令使用。例如, <pre>!repair tool</pre>,将会修复你的工具。因为这些指令非常强大且用的地方很多。 只有在玩家拥有<pre>skript.effectcommands</pre>权限时才能使用(OP默认不拥有!) Skript的语法不仅限制于上面的简单指令,还包括一些循环,包含等语法。 下面的脚本是一个很简单的从附近箱子抽调燃料的例子—— <pre> on burn of fuel: fuel slot of the block is empty loop blocks in radius 1: loop-block is chest loop items of type fuel: loop-block contains loop-item remove loop-item from loop-block set fuel of the event-block to loop-item stop trigger 译者注: 当燃料燃烧时: 熔炉的燃料槽空了 在周围半径一格寻找方块: 寻找箱子 寻找物品是燃料类型 箱子包含燃料 从箱子中移除燃料 把燃料移到燃料槽 停止触发器 </pre> 更多信息请前往[[https://dev.bukkit.org/bukkit-plugins/skript/ BukkitDev]]<ref>译者注:作者的BukkitDev已经停止更新,请前往GitHub,在文章开始处</ref>,然后也请阅读下面的教程和帮助文档。 教程是新手的必读品。它解释了如何写一个脚本。这里是[[https://dev.bukkit.org/bukkit-plugins/skript/pages/general-tutorial/ 另一段教程]]<ref>译者注: 两段都翻译了</ref> 帮助文档是所有触发器的集合,这里面有所有关于脚本的东西。 [[http://dev.bukkit.org/bukkit-plugins/skript/ 链接到BukkitDev]] [[http://dev.bukkit.org/bukkit-plugins/skript/forum/ 链接到作者论坛]] == 教程 == ===作者在自带页面给出的教程=== ====开始==== 在你开始写脚本之前你应该先安装Skript插件 下载最新的Skript插件,把它放入plugins,重启服务器来生成配置和一些示例脚本。 ====写触发器==== 在你打开你的编辑器之前我推荐你知道你要写什么脚本,但你可以简单地开始写了。 在这个教程中我会说明如何写一个用锄头来直接撒播种子的脚本。 它应该包括 当一个人手持锄头右键泥土时自动种植作物。 首先,打开你的文档编辑器[例如NotePad++] <ref>译者注:经测试,不推荐使用微软自带的记事本!</ref> 现在思考怎么样能让你的触发器被触发,所以我们写下第一行: <pre> on right click: 译者注: 在右键时: </pre> 如果你不知道有哪些条件可以触发的话,点击[[http://njol.ch/projects/skript/doc/events/ 这里]]<ref>译者注:这里是下面帮助文档的Events 事件大类</ref> 但是我们不想让人们右键都触发,只是在泥土上用锄头而已。 所以我们应该改变一下—— <pre> on right click on soil holding a hoe: 译者注: 当持有锄头右键泥土时: </pre> 我们也可以用这个事件+条件来替代—— <pre> on right click: block is soil player is holding a hoe 译者注: 当右键时: 方块是泥土 玩家手持锄头 </pre> 这两种都可以,但我在这篇文档中将使用第一种。 然后我们来检测玩家有无种子: <pre> on right click on soil holding a hoe: player has seeds 译者注: 当用锄头右键泥土时: 玩家拥有种子 </pre> 请注意第二行的缩进。这会使读取器认为这是一个触发器中的语句,并且使脚本更简单的阅读。 如果你不注意这个缩进的话你的插件就会报错因为插件认为他们不属于一个触发器。 在那之后我们应该种植作物了—— <pre> on right click on soil holding a hoe: player has seeds set block above the clicked block to crops 译者注: 当手持锄头右键泥土时: 玩家拥有种子 将泥土上方的方块设置为作物 </pre> 这不是很精确因为可能我们点击的泥土方块上方有方块(如下图) [_] <- 其他方块 [_] <- 泥土方块 如果我们只是设置的话我们会覆盖掉原有方块。 这可能是别的玩家领地中的物品甚至是基岩。 这样的问题看起来并不明显但会有BUG的存在。你可以在你服务器上使用之前先在一个测试服务器上尝试运行。 这个问题可以用检测泥土上方的方块来解决—— <pre> on right click on soil holding a hoe: player has seeds block above the clicked block is air set block above the clicked block to crops 当手持锄头右击方块时: 玩家拥有种子 被点击方块的上面是空气 把点击方块上面的方块设置为作物 </pre> 然后不要忘了移除玩家的种子,不然他们就有免费作物了:D <pre> on right click on soil holding a hoe: player has seeds block above the clicked block is air set block above the clicked block to crops remove seeds from player 当手持锄头右击方块时: 玩家拥有种子 被点击方块的上面是空气 把点击方块上面的方块设置为作物 移除玩家的种子 </pre> 最后一件事是把你的脚本储存到 <pre>./plugins/Skript/scripts</pre>里,你可以取任何名字。 但请不要以<pre>-</pre>号打头,因为这会使脚本无法读取。 文件的扩展名必须是<pre>.sk</pre>,例如,你可以把这个脚本储存为<pre>hoe.sk</pre> 现在开启你的服务器[可能是测试的],检查后台有无错误信息,如果有,尝试修复。 然后登入服务器测试脚本查看是不是都可以运行。 如果你测试完毕,你可以上传到你的主服务器让玩家使用了。 你也可以使用<pre>/sk reload 脚本名称</pre>来使脚本重载。这方便你调试脚本,不要重启服务器。 所有的错误将会发送给使用指令的玩家。 如果后台使用,将发送给后台。 ===BukkitDev给出的教程=== Skript的目标就是让不会语法的程序员们写他们自己的小插件[称之为脚本]。 我感觉这个目的渐渐的被人淡化因为人们也不会写脚本。 这个教程教写脚本的新人,如何让这个绝妙的插件在TA的服务器上工作。 [[http://njol.ch/projects/skript/doc 帮助文档]]解释了你服务器所需要的所有的脚本构成。 我不是这里单一的教程帖子了,我将会引用一些他们的东西。 这个插件在你自己编程的时候非常有用,你可以做你想做的东西,以及它不需要完美的语法。 帮助文档可以在这篇文章的最上方找到。 变量,循环,指令,条件和事件—— 你写脚本的时候,你最少要用到一个,甚至你可能都需要。 下面我会详细介绍每个是干什么的,什么时候用他们—— ====事件==== 事件就是当一件事情发生的时候,例如玩家点击了一些东西,打出伤害,狗带,或一个怪物做了一些事情,甚至是环境自己改变。 这允许你做一些另外的事情——例如: <pre> on explode: cancel event 当爆炸时: 取消事件的发生 </pre> 注意空格,事件后都有一个冒号。你可以用4个或8个空格<ref>译者从来没有试过8个,都是4个</ref>。 你不能使用tab或空格来换行。我偏向于使用tab来缩进因为我只需要点一次<ref>译者喜欢4个空格 因为这样语法感觉更好</ref> 真正的事件其实非常简单。当一个爆炸发生,取消它。 这能很好地防止TNT 苦力怕的爆炸,甚至防止末影龙。 记住这个会真正的取消爆炸,就是玩家也不会受到伤害。 所以这个脚本非常简单,你可以简单的变换结局。 例如杀死服务器上的所有玩家<Ref>这个人怎么想的=-=</ref> ====条件==== 条件是任何脚本的基础。他们是执行下一部分的条件代码。一个权限示例如下—— <pre> on rightclick: player has permission "skript.boom" create explosion with force 3 at targeted block 当右键时: 玩家拥有"skript.boom"权限 在指向方块处创造力量为3的爆炸 </pre> 这会创建一个比TNT更小的爆炸,但只会在玩家拥有对应权限时工作。 条件能被用来检查玩家是否拥有物品,或牌子上写的东西。 你甚至可以用多个条件来限制效果。 <pre> on rightclick: block is a sign line 1 of sign is "[Shop]" player has permission "skript.shop" player has 2 gold nuggets remove 2 gold nuggets from player give player 1 bread message "<light green>You bought a bread." </pre> 在这个脚本中玩家必须右击一个第一行为[Shop]的牌子,拥有权限,2个金粒,然后才能有效果。 ====指令==== 每个服务器的管理员都知道指令,这是你运营服务器的方式。 Skript允许你自己自定义指令。这些命令与事件写法大体相似,除了事件需要被你自定义。 这个事件简单的版本是通过玩家输入指令来自定义效果。如果想获取更好的想法,看我下面的例子。 <pre> command /hi: permission: skript.hi trigger: message "hi" </pre> 这个简单的命令给发送/hi的玩家发送消息。第一行是事件。首先我们说要自定义一个命令,然后我们写什么命令。 然后我们给它一个权限和使用方法。最后,我们增加触发器,使我们想要指令做的事情。 你可以看网页提及的自定义命令的部分。 你也可以做一些可以获取信息的指令,或者指定被作用效果的玩家。看下面的指令: <pre> command /hi <player>: permission: skript.hi trigger: send "hi" to argument </pre> 这个命令和之前一样发送同样的消息,但这次将会发送给别的玩家。 我们使用这个发送效果的原因是因为消息效果只发送消息给事件中的玩家,而不是输入指令的玩家。 有了发送效果,我们就能够给别的玩家发送信息了。 argument是指令中的玩家,所以当你使用/hi demon_penguin时,将会给 demon_penguin 发送hi。 同时你也可以查看网页来了解更多关于自定义命令的信息。 ====循环==== 循环任务可以用来完成复杂的任务。例如如果你想检测在你附近是不是有个箱子,你可能要检测你周围所有的方块来查看它是不是箱子。这可以用一个简单的循环解决—— <pre> command /chest: trigger: loop blocks in radius 3 around player: loop-block is a chest message "There is a chest at %location of loop-block%" </pre> 牌子上的变量会取代它的文本。这里有 x y z三个变量来代替 %location of loop-block%。 循环代码的一部分是任何方块的循环检查。 循环将会在玩家3格半径的范围内寻找箱子 因为我们在用一个自定义指令,我们可以增加寻找的范围和arguments来允许玩家选择距离。 <pre> command /chest <integer=3>: trigger: loop blocks in radius argument around player: loop-block is a chest message "There is a chest at %location of loop-block%" </pre> 这里我们为指令设置了默认值,如果在玩家没有选择的情况下为3.在循环表达中我们将argument代替了数字。 这意味着无论你输入什么数字,指令都会把其读取。如果没有输入数字,3将会成为默认值。 如果你想要看精确的半径的话,做一个圆球脚本,你就能看见尺寸了。 <pre> command /sphere <integer=3>: trigger: loop blocks in radius argument around player: loop-block is air set loop-block to stone set {clear.block} to location of player set {clear.radius} to argument command /clear: trigger: loop blocks in radius {clear.radius} around {clear.block}: loop-block is stone set loop-block to air </pre> /clear指令将会轻松删掉你设置的圆球。同样因为你在圆球的中心,你要想一个让自己出去的方法。 这个指令可能会对地面造成一些伤害,所以请飞行来使用。 {}中的东西叫做变量,下节会说到。如果你想了解更多关于循环的知识请看帮助文档。 ====变量==== 变量是用来在名字下储存数据的。它像一个盒子上的标签,如果你想要知道盒子里的信息,只要找到正确的标签就可以。Skript的变量就是这样。你可以像这样储存变量: <pre> set {variable.name.goes.here} to true </pre> 变量值可以是true/false ,一个坐标,或数字。这样的原因是我们可以晚些获得这个信息。所以也许我们可以检查玩家是否输入过指令,我们可以这样做: <pre> command /sethome: trigger: set {home} to location of player command /home: trigger: teleport player to {home} </pre> 你的变量必须用{}括起来,因为这才能告诉Skript这是一个变量。上面是一个非常简单的家园脚本。 我们记录玩家的位置在一个叫做{home}的'盒子'里。当玩家输入/home时因为有变量所以我们知道把玩家传送去哪里。这不会把变量清除,它更偏向于只读类型。 即读取后放回原处。但在你写脚本中,你必须思考用户可能出错的方式。 例如玩家并没有设置他的家,那么在用/home后会发生什么?他们会被传送到哪里? 这你需要使用if来检测。检测是否有一些错误,如果没有,再继续执行脚本。 上面的脚本并不会给玩家发送信息,所以你需要自己创建—— <pre> command /sethome: trigger: set {home} to location of player command /home: trigger: if {home} is not set: message "<red>You need to set a home first!" stop trigger teleport player to {home} </pre> 现在当玩家尝试用/home时他们会受到错误提示并且剩下的脚本不会运行。 如果你忘记停止脚本,剩下的事件将照常继续运行。同时如果同时如果if判断的是false,那么剩下的代码便不会运行,玩家也收不到错误消息。 现在我们这个脚本主要的问题是当一个人/sethome后,另一个人使用/home可以直接到达这个位置。 然后在另一个人设置家后,便会覆盖前一个人家的记录。 修复它的方法是使用表达式。这些可以读取触发事件的人。 在这样输入指令后,会记录谁输入的指令。 所以让每个人都有不同的家,我们其实可以用玩家的名字作为变量。例如这样—— <pre> command /sethome: trigger: set {home.%player%} to location of player command /home: trigger: if {home.%player%} is not set: message "<red>You need to set a home first!" stop trigger teleport player to {home.%player%} </pre> 现在玩家的名字在变量中了,所以当检测是否存在时,对我将会检测{home.demon_penguin},对别人将会检测 {home.whateveryouruseernameis}。 在这个脚本中每个人都会有他们自己家的位置了。 ====注意事项==== 记住你学到的命令部分下所有的东西,都可以使用在任何触发器中。 这其中包括许多事件。 如果你想了解更多,看帮助文档吧<ref>下面的内容</ref>。 如果你关于我说的有任何疑问,或要寻求帮助等,请在这里发帖 [[http://dev.bukkit.org/server-mods/skript/forum/help/ 传送点]] -Demon 原作者 -c7w 翻译者 == WIKI帮助文档== ===总帮助=== 写Skript触发器并不比描述它的条件更难。 因为许多你想做的事情都与事件,例如放置方块,拉动拉杆开关,所有的触发器在触发时都被自定义。 这叫做触发器的事件。无论事件什么时候产生 , 例如当一个玩家放置一个方块,插件将会依次检测触发器的条件.如果满足所有触发条件,触发器将执行. 下面是一个单一事件,条件,效果的简单例子: <pre> # 第一行就是事件: on place of sand: # condition: block below is air # effect: send "Watch the sand falling!" to player </pre> 这样你就领会了这个事件是干嘛的——检测放了沙子的玩家,然后如果下面是空气,就会有发送消息。 若要写触发器,新建一个文件,然后把它保存到 Skript/scripts/ directory /‘名字.sk’, 如 ‘plant with hoe.sk’. 你可以使用任意名,但最好与内容有关。 然后你需要重启你的服务器或使用<pre>/skript reload</pre>来使这个触发器工作。 如果你是重启服务器,检查有无错误。如果使用指令,若有错误会直接发送给你。 一般来说如果你得到许多错误信息应该是表明无法读取你的信息,并且一般会告诉你哪儿错了。如果你是得到这种报错 can't understand '...' or '...' is not a(n) ... 检查你的拼写。 你可以继续阅读以获取所有事件 条件 效果。 如果你需要帮助请去论坛反馈。一般在反馈前请仔细阅读本帮助文献,它一般可以回答你的问题。 你也可以看看别人的教程,如果我的教程不适合你的话。 ====高级语法==== Skript的高级语法并不限制于简单的陈述,但比这个更复杂 若要使 ‘tool of …’ 或 ‘block below/north of/above …’ 可能,你要使用表达式,请继续向下阅读。 有时触发器语法的基本语法也比较高级。以下章节包括这些特殊情况。 ====条件==== 一个很棒的特性是条件陈述。这样的陈述是触发器的一部分,但只有当主部分满足时才会被检查,像这样—— 主条件[又称事件]: 条件 条件满足继续执行 满足条件后可以继续缩进 你也可以使用else: 来在不满足条件的情况下使用—— 如下 <pre> on login: chance of 50%: give a cake to the player send "You got a gift for logging in =)" to the player else: send "You were not fortunate enough to get a gift this time. Try again next time!" to the player </pre> 这个脚本会在玩家登入的时候有几率给予玩家一个蛋糕,但如果没有接收到会给玩家说他们不够幸运。 ====循环==== 循环可以减少触发器内的重复任务,当前来说可以循环的东西还是很少,如变量,物品,方块,玩家。 循环很简单,这就是格式 <pre> 要循环的值: 关于这个值做一些是 条件在循环中不同,如果条件没有满足,会跳过条件继续执行下面的代码。如果你想停止执行,请这样使用—— <pre> condition: exit loop </pre> 你也可以使用‘exit’ 或 ‘exit trigger’. 这儿就有一个示例,他会在使用/find时找寻附近的方块。 <pre>command /find <material>: description: Find a block of the given material trigger: loop blocks in radius 10: loop-block is argument message "Found a %argument% block at %location of loop-block%" stop trigger send "There's no %argument% block around!" to player </pre> ===事件=== 下面的列表内容是你可以开始一个触发器的事件。 每个触发器只能有一个事件,你不能在给出的语法外自行创造事件。 请注意每个事件前面的on都是完全可选的,不过我加上会感觉更好:D 请注意如果事件只有一种触发方式的话就没有例子。 ====At time==== <pre> 模型: at %time% [in %worlds%] 加入的版本: 1.3.4 关于Minecraft中所有/任一世界的时间 示例: at 18:00 at 7am in "world" </pre> ====On AoE Cloud Effect==== <pre> 模型: (area|AoE) [cloud] effect 加入的版本: 2.2-dev21 当药水云生成时触发,默认5tick发生一次。 示例: on area cloud effect </pre> ====On Bed Enter==== <pre> 模型: [on] bed enter[ing] [on] [player] enter[ing] [a] bed 加入的版本: 1.0 当玩家上床时 </pre> ====On Bed Leave==== <pre> 模型: [on] bed leav(e|ing) [on] [player] leav(e|ing) [a] bed 加入的版本: 1.0 当玩家离开床 </pre> ====On Block Damage==== <pre> 模型: [on] block damage 加入的版本: 1.0 当玩家开始打方块,你可以用来探测左键 </pre> ====On Block Growth==== <pre> 模型: (plant|crop|block) grow[(th|ing)] [[of] %item types%] 加入的版本: 2.2-Fixes-V10 当作物生长时触发 示例: on crop growth </pre> ====On Book Edit==== <pre> 模型: book (edit|change|write) 加入的版本: 2.2-dev31 当玩家编辑书籍时触发 示例: on crop growth </pre> ====On Book Sign==== <pre> 模型: book sign[ing] 加入的版本: 2.2-dev31 当玩家署名书与笔时触发 示例: on book sign </pre> ====On Break / Mine==== <pre> 模型: [on] [block] (min(e|ing)) [[of] %item types%] 加入的版本: 1.0 (break), unknown (mine) 当方块被玩家破坏。如果使用on mine的话,只有掉落东西才会触发触发器。 示例: on mine on break of stone on mine of any ore </pre> ====On Bucket Empty==== <pre> 模型: [on] bucket empty[ing] [on] [player] empty[ing] [a] bucket 加入的版本: 1.0 当玩家把桶里的东西倒出,可以检测水和岩浆的放置事件。 </pre> ====On Bucket Fill==== <pre> 模型: [on] bucket fill[ing] [on] [player] fill[ing] [a] bucket 加入的版本: 1.0 当玩家在桶里装东西,可以检测水和岩浆的破坏事件。 </pre> ====On Burn==== <pre>模型: [on] [block] burn[ing] [[of] %item types%] 加入的版本: 1.0 当方块被火燃烧 示例: on burn on burn of wood, fences, or chests</pre> ====On Can Build Check==== <pre>模型: [on] [block] can build check 加入的版本: 1.0 (基础), 2.0 (可以取消事件发生) 当玩家手持一个方块或能防止的物品时右击方块被触发。你可以取消这个事件,来防止方块被放置。 只支持物品ID的检查,不允许数据值</pre> ====On Chat==== <pre>模型: [on] chat 加入的版本: 1.4.1 当玩家聊天时.</pre> ====On Chunk Generate==== <pre>模型: [on] chunk (generat|populat)(e|ing) 加入的版本: 1.0 当区块被创建</pre> ====On Chunk Load==== <pre>模型: [on] chunk load[ing] 加入的版本: 1.0 当区块读取</pre> ====On Chunk Unload==== <pre>模型: [on] chunk unload[ing] 加入的版本: 1.0 当区块被卸载,可以取消事件</pre> ====On Click==== <pre>模型: [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] [on %entity type/item type%] [(with|using|holding) %item type%] [on] [(right|left)[( |-)]][mouse[( |-)]]click[ing] (with|using|holding) %item type% on %entity type/item type% 加入的版本: 1.0 当玩家空手点击方块、空气和实体 在玩家没有看向方块/手拿东西时是无法检测的 示例: on click on rightclick holding a fishing rod on leftclick on a stone or obsidian on rightclick on a creeper on click with a sword</pre> ====On Combust==== <pre>模型: [on] combust[ing] 加入的版本: 1.0 当实体开始燃烧 </pre> ====On Command==== <pre>模型: [on] command [%text%] 加入的版本: 2.0 当玩家输入一个指令 使用这个事件不如自定义命令,改变权限的方式不能预防某些指令,记录命令,检测其他插件。 示例: on command on command "/stop" on command "pm Njol "</pre> ====On Connect==== <pre>模型: [on] [player] connect[ing] 加入的版本: 2.0 当玩家连接服务器,这在玩家加入服务器之前运行。 示例: on connect: player doesn't have permission "VIP" number of players is larger than 20 kick the player due to "The last 5 slots are reserved for VIP players."</pre> ====On Consume==== <pre>模型: [on] [player] ((eat|drink)[ing]|consum(e|ing)) [[of] %item types%] 加入的版本: 2.0 当玩家吃/喝一些东西</pre> ====On Craft==== <pre>模型: [on] [player] craft[ing] [[of] %item types%] 加入的版本: unknown 当玩家合成物品</pre> ====On Creeper Power==== <pre>模型: [on] creeper power 加入的版本: 1.0 当苦力怕被充能</pre> ====On Damage==== <pre>模型: [on] damag(e|ing) [of %entity type%] 加入的版本: 1.0 当实体接受攻击 示例: on damage on damage of a player</pre> ====On Death==== <pre>模型: [on] death [of %entity types%] 加入的版本: 1.0 实体死亡 示例: on death on death of player on death of a wither or ender dragon: broadcast "A %entity% has been slain in %world%!"</pre> ====On Dispense==== <pre>模型: [on] dispens(e|ing) [[of] %item types%] 加入的版本: unknown 发射器发射物品</pre> ====On Drop==== <pre>模型: [on] [player] drop[ing] [[of] %item types%] 加入的版本: unknown 玩家扔掉物品</pre> ====On Enderman/Sheep/Silverfish==== <pre>模型: [on] enderman place [on] enderman pickup [on] sheep eat [on] silverfish enter [on] silverfish exit 加入的版本: unknown 末影人搬运方块/羊吃草/蠹虫进出方块</pre> ====On Entity Dismount==== <pre>模型: [on] dismount[ing] 加入的版本: 2.2-dev13b 当一个实体被卸载时 示例: on dismount: kill event-entity </pre> ====On Entity Mount==== <pre>模型: [on] mount[ing] 加入的版本: 2.2-dev13b 当一个实体乘坐上另一个实体时(例:坐船/矿车/骑骷髅马) 示例: on mount: cancel event </pre> ====On Experience Spawn==== <pre>模型: [on] [e]xp[erience] [orb] spawn [on] spawn of [a[n]] [e]xp[erience] [orb] 加入的版本: 2.0 当经验值生成时,不能检测其他插件生成的经验。 示例: on xp spawn: world is "minigame_world" cancel event</pre> ====On Explode==== <pre>模型: [on] explo(d(e|ing)|sion) 加入的版本: 1.0 当发生爆炸时</pre> ====On Explosion Prime==== <pre>模型: [on] explosion prime 加入的版本: 1.0 爆炸前的准备</pre> ====On Fade==== <pre>模型: [on] [block] fad(e|ing) [[of] %item types%] 加入的版本: 1.0 融化 示例: on fade of snow or ice</pre> ====On Firework Explode==== <pre>模型: [a] firework explo(d(e|ing)|sion) [colo[u]red %colors%] 加入的版本: 2.4 当烟花火箭爆炸时 示例: on firework explode on firework exploding colored red, light green and black on firework explosion coloured light green: broadcast "A firework colored %colors% was exploded at %location%!"</pre> ====On First Join==== <pre>模型: [on] first (join|login) 加入的版本: 1.3.7 玩家第一次加入游戏</pre> ====On Fishing==== <pre>模型: [on] [player] fish[ing] 加入的版本: 1.0 玩家钓到了一些东西</pre> ====On Flight Toggle==== <pre>模型: [player] flight toggl(e|ing) [player] toggl(e|ing) flight 加入的版本: 2.2-dev36 当玩家切换飞行模式时调用 (译者注:当玩家开始飞行/停止飞行时调用,并非使用某些插件的/fly指令时) 示例: on flight toggle: if {game::%player%::playing} exists: cancel event </pre> ====On Flow==== <pre>模型: [on] [block] flow[ing] [on] block mov(e|ing) 加入的版本: 1.0 液体流动</pre> ====On Form==== <pre>模型: [on] [block] form[ing] [[of] %item types%] 加入的版本: 1.0 当一个不是玩家放置的方块创建[下雪,结冰] 示例: on form of snow on form of a mushroom</pre> ====On Fuel Burn==== <pre>模型: [on] fuel burn[ing] 加入的版本: 1.0 熔炉的燃料开始烧</pre> ====On Gamemode Change==== <pre>模型: [on] game[ ]mode change [to %gamemode%] 加入的版本: 1.0 玩家切换游戏模式 示例: on gamemode change on gamemode change to adventure</pre> ====On Gliding State Change==== <pre>模型: (gliding state change|toggl(e|ing) gliding) 加入的版本: 2.2-dev21 当玩家使用鞘翅滑翔时 示例: on toggling gliding: cancel the event # bad idea, but you CAN do it!(译者注:这不是什么好主意,但是依然可以实现!)</pre> ====On Grow==== <pre>模型: [on] grow [of %tree type%] 加入的版本: 1.0 树/蘑菇长大 示例: on grow on grow of a tree on grow of a huge jungle tree</pre> ====On Hand Item Swap==== <pre>模型: swap[ping of] [(hand|held)] item[s] 加入的版本: 2.3 当玩家的主副手物品调换时,即使主副手物品为空气(没有物品)也可以触发,这个触发器会在实际调换物品之前时触发,这意味着您可以在发生任何事情之前取消事件。 示例: on swap hand items: event-player's tool is a diamond sword cancel event</pre> ====On Heal==== <pre>模型: [on] heal[ing] 加入的版本: 1.0 实体被治疗 </pre> ====On Hunger Meter Change==== <pre> 模型: [on] (food|hunger) (level|met(er|re)|bar) chang(e|ing) 加入的版本: 1.4.4 当玩家的饥饿值改变</pre> ====On Ignition==== <pre>模型: [on] [block] ignit(e|ion) 加入的版本: 1.0 方块被燃烧</pre> ====On Inventory Click==== <pre>模型: [player] inventory(-| )click[ing] [[at] %item types%] 加入的版本: 2.2-Fixes-V10 当玩家点击物品栏中的物品时(包括任意容器的"物品栏") 示例: on inventory click: if event-item is stone: give player 1 stone remove 20$ from player's balance</pre> ====On Inventory Close==== <pre>模型: inventory clos(ing|e[d]) 加入的版本: 2.2-dev21 当玩家关闭任意物品栏时 示例: on inventory close: if player's location is {location}: send "You exited the shop!"</pre> ====On Inventory Open==== <pre>模型: inventory open[ed] 加入的版本: 2.2-dev21 当玩家打开任意物品栏时 示例: on inventory open: close player's inventory</pre> ====On Item Break==== <pre>模型: [on] [player] tool break[ing] [on] [player] break[ing] [(a|the)] tool 加入的版本: 2.1.1 玩家的工具没耐久,自然损坏[这个不能被取消事件]</pre> ====On Item Despawn==== <pre>模型: [on] (item[ ][stack]|[item] %item types%) despawn[ing] [on] [item[ ][stack]] despawn[ing] [[of] %item types%] 加入的版本: 2.2-dev35 当一个掉落物即将被Minecraft删除时,通常这会发生在物品被丢弃的5分钟后 示例: on item despawn of diamond: send "Not my precious!" cancel event</pre> ====On Item Merge==== <pre>模型: [on] (item[ ][stack]|[item] %item types%) merg(e|ing) [on] item[ ][stack] merg(e|ing) [[of] %item types%] 加入的版本: 2.2-dev35 当一个掉落物与另一个掉落物合并时(即两个同样的物品丢在同一位置时产生的"掉落物合并") 示例: on item merge of gold blocks: cancel event</pre> ====On Item Spawn==== <pre>模型: [on] item spawn[ing] [[of] %item types%] 加入的版本: unknown 当有掉落物生成</pre> ====On Join==== <pre>模型: [on] [player] (login|logging in|join[ing]) 加入的版本: 1.0 当玩家加入游戏 示例: on join: message "Welcome on our awesome server!" broadcast "%player% just joined the server!"</pre> ====On Jump==== <pre>模型: [on] [player] jump[ing] 加入的版本: 2.3 当玩家跳跃时 示例: on jump: event-player does not have permission "jump" cancel event</pre> ====On Kick==== <pre>模型: [on] [player] (kick|being kicked) 加入的版本: 1.0 当一个玩家被T出游戏</pre> ====On Language Change==== <pre>模型: [player] (language|locale) chang(e|ing) [player] chang(e|ing) (language|locale) 加入的版本: 2.3 当玩家在设置中设置的语言改变时,你可以使用语言表达式(language)来获取玩家的设置的语言,这需要Minecraft 1.12+版本才能使用 示例: on language change: if player's language starts with "en": send "Hello!"</pre> ====On Leaves Decay==== <pre>模型: [on] leaves decay[ing] 加入的版本: 1.0 树叶消失</pre> ====On Level Change==== <pre>模型: [on] [player] level [change] 加入的版本: unknown 玩家等级改变</pre> ====On Lightning Strike==== <pre>模型: [on] lightning [strike] 加入的版本: 1.0 发生闪电</pre> ====On Move On==== <pre>模型: [on] (step|walk)[ing] (on|over) %*item types% 加入的版本: 2.0 玩家踩上指定方块 示例: on walking on dirt or grass on stepping on stone</pre> ====On Physics==== <pre>模型: [on] [block] physics 加入的版本: 1.4.6 物理变化 示例: # prevents sand from falling on block physics: block is sand cancel event</pre> ====On Pick Up==== <pre>模型: [on] [player] (pick[ ]up|picking up) [[of] %item types%] 加入的版本: unknown 玩家捡起物品</pre> ====On Pig Zap==== <pre>模型: [on] pig[ ]zap 加入的版本: 1.0 猪变成僵尸猪人</pre> ====On Piston Extend==== <pre>模型: [on] piston extend[ing] 加入的版本: 1.0 当活塞被激活</pre> ====On Piston Retract==== <pre>模型: [on] piston retract[ing] 加入的版本: 1.0 当活塞收回</pre> ====On Place==== <pre>模型: [on] [block] (plac(e|ing)|build[ing]) [[of] %item types%] 加入的版本: 1.0 放置方块 示例: on place on place of a furnace, workbench or chest</pre> ====On Player World Change==== <pre>模型: [on] [player] world chang(ing|e[d]) 加入的版本: 2.2-dev28 当玩家加入其它世界时,这仅对玩家有效! 示例: on player world change: world is "city" send "Welcome to the City!"</pre> ====On Portal==== <pre>模型: [on] [player] portal 加入的版本: 1.0 使用地狱门/末地门</pre> ====On Portal Create==== <pre>模型: [on] portal create 加入的版本: 1.0 当传送门被创建.</pre> ====On Portal Enter==== <pre>模型: [on] portal enter [on] entering [a] portal 加入的版本: 1.0 玩家进入传送门</pre> ====On Prepare Craft==== <pre>模型: [player] (preparing|beginning) craft[ing] [[of] %item types%] 加入的版本: 2.2-Fixes-V10 在向玩家显示合成结果之前。请注意,由于Bukkit错误,设置结果项可能工作,也可能不工作。 示例: on preparing craft of torch</pre> ====On Pressure Plate / Trip==== <pre>模型: [on] [step[ping] on] [a] [pressure] plate [on] (trip|[step[ping] on] [a] tripwire) 加入的版本: 1.0 (pressure plate), 1.4.4 (tripwire) 压力板</pre> ====On Projectile Hit==== <pre>模型: [on] projectile hit 加入的版本: 1.0 当发射物击中实体或方块[箭 雪球 骷髅头 火球 鸡蛋]</pre> ====On Quit==== <pre>模型: [on] (quit[ting]|disconnect[ing]|log[ ]out|logging out) 加入的版本: 1.0 当玩家离开游戏</pre> ====On Redstone==== <pre>模型: [on] redstone [current] [chang(e|ing)] 加入的版本: 1.0 红石流通</pre> ====On Region Enter/Leave==== <pre>模型: cannot be used directly 加入的版本: 2.1 进入/离开区域[需要区域插件] 示例: on region exit: message "Leaving %region%."</pre> ====On Respawn==== <pre>模型: [on] [player] respawn[ing] 加入的版本: 1.0 当玩家重生时</pre> ====On Resurrect Attempt==== <pre>模型: [on] [entity] resurrect[ion] [attempt] 加入的版本: 2.2-dev28 当一个实体手持不死图腾死亡时(你可以通过使用取消事件来取消不死图腾的效果) 示例: on resurrect attempt: entity is player entity has permission "admin.undying" uncancel the event</pre> ====On Script Load/Unload==== <pre>模型: [on] [script] (load|init|enable) [on] [script] (unload|stop|disable) 加入的版本: 2.0 当脚本被读取/卸载 示例: on load: set {running.%script%} to true on unload: set {running.%script%} to false</pre> ====On Server List Ping==== <pre>模型: server [list] ping 加入的版本: 2.3 当服务器在多人游戏的服务器列表中被ping时,通常在Minecraft客户端ping服务器以在服务器列表中显示其信息时调用。 IP表达式可用于获取Pinger(玩家)的IP地址。此事件只能在PaperSpigot 1.12.2+上取消,这意味着玩家将看到服务器脱机(但仍可以加入)。 你还可以使用 MOTD, Max Players, Online Players Count, Protocol Version, Version String, Hover List 和 Server Icon 表达 使用 Player Info Visibility 和 Hide Player from Server List effects 来修改服务器列表。 示例: on server list ping: set the motd to "Welcome %{player-by-IP::%ip%}%! Join now!" if {player-by-IP::%ip%} is set, else "Join now!" set the fake max players count to (online players count + 1) set the shown icon to a random server icon out of {server-icons::*}</pre> ====On Server Start/Stop==== <pre>模型: (server|skript) (start|load|enable) (server|skript) (stop|unload|disable) 加入的版本: 2.0 当服务器开启/关闭时,(实际上是Skript插件加载/卸载时,所以/reload也会触发事件) 示例: on skript start: on server stop:</pre> ====On Sheep Regrow Wool==== <pre>模型: sheep [re]grow[ing] wool 加入的版本: 2.2-dev21 当羊长毛时 示例: on sheep grow wool: cancel event</pre> ====On Shoot==== <pre>模型: [on] [projectile] shoot 加入的版本: 1.0 当一个发射物被发射</pre> ====On Sign Change==== <pre>模型: [on] sign (chang[e]|edit)[ing] [on] [player] (chang[e]|edit)[ing] [a] sign 加入的版本: 1.0 牌子被玩家结束编辑 示例: on sign change: line 2 is empty set line 1 to "<red>%line 1%"</pre> ====On Slime Split==== <pre>模型: [on]slime split[ting] 加入的版本: 2.2-dev26 当史莱姆分裂时。这通常在大型的史莱姆死亡后发生 示例: on slime split</pre> ====On Smelt==== <pre>模型: [on] [ore] smelt[ing] [on] smelt[ing] of ore 加入的版本: 1.0 当熔炉开始烧炼矿物</pre> ====On Sneak Toggle==== <pre>模型: [on] [player] toggl(e|ing) sneak [on] [player] sneak toggl(e|ing) 加入的版本: 玩家是否潜行 示例: # make players that stop sneaking jump on sneak toggle: player was sneaking push the player upwards at speed 0.5</pre> ====On Spawn==== <pre>模型: [on] spawn[ing] [of %entity types%] 加入的版本: 1.0 当一个实体生成 示例: on spawn of a zombie on spawn of an ender dragon: broadcast "A dragon has been sighted in %world%!"</pre> ====On Spawn Change==== <pre>模型: [on] [world] spawn change 加入的版本: 1.0 当世界的重生点被切换</pre> ====On Spread==== <pre>模型: [on] spread[ing] 加入的版本: 1.0 当一个新方块生成,原方块可以传播,例如蘑菇和水</pre> ====On Sprint Toggle==== <pre>模型: [on] [player] toggl(e|ing) sprint [on] [player] sprint toggl(e|ing) 加入的版本: unknown 当玩家切换疾跑状态</pre> ====On Swim Toggle==== <pre>模型: [entity] toggl(e|ing) swim [entity] swim toggl(e|ing) 加入的版本: 2.3 当一个实体开始/停止游泳时 示例: on swim toggle: event-entity does not have permission "swim" cancel event</pre> ====On Tame==== <pre>模型: [on] [entity] tam(e|ing) 加入的版本: 1.0 当玩家驯服狼/豹猫</pre> ====On Target==== <pre>模型: [on] [entity] target [on] [entity] un[-]target 加入的版本: 1.0 当怪物锁定一个实体进行攻击</pre> ====On Teleport==== <pre>模型: [on] [player] teleport[ing] 加入的版本: 1.0 当玩家被传送</pre> ====On Throwing of an Egg==== <pre>模型: [on] throw[ing] [of] [an] egg [on] [player] egg throw 加入的版本: 1.0 当玩家扔鸡蛋</pre> ====On Tool Change==== <pre>模型: [on] [player['s]] (tool|item held|held item) chang(e|ing) 加入的版本: 1.0 当玩家的工具切换</pre> ====On Vehicle Create==== <pre>模型: [on] vehicle create [on] creat(e|ing|ion of) [a] vehicle 加入的版本: 1.0 当一个载具被创建.</pre> ====On Vehicle Damage==== <pre>模型: [on] vehicle damage [on] damag(e|ing) [a] vehicle 加入的版本: 1.0 载具被攻击</pre> ====On Vehicle Destroy==== <pre>模型: [on] vehicle destroy [on] destr(oy[ing]|uction of) [a] vehicle 加入的版本: 1.0 载具被摧毁</pre> ====On Vehicle Enter==== <pre>模型: [on] vehicle enter [on] enter[ing] [a] vehicle 加入的版本: 1.0 实体进入载具</pre> ====On Vehicle Exit==== <pre>模型: [on] vehicle exit [on] exit[ing] [a] vehicle 加入的版本: 1.0 实体离开载具</pre> ====On Weather Change==== <pre>模型: [on] weather change [to %weather types%] 加入的版本: 1.0 一个世界的天气被切换 示例: on weather change on weather change to sunny</pre> ====On World Init==== <pre>模型: [on] world init 加入的版本: 1.0 一个新的世界被创建</pre> ====On World Load==== <pre>模型: [on] world load[ing] 加入的版本: 1.0 世界被加载</pre> ====On World Save==== <pre>模型: [on] world sav(e|ing) 加入的版本: 1.0 世界被存储</pre> ====On World Unload==== <pre>模型: [on] world unload[ing] 加入的版本: 1.0 世界被卸载</pre> ====On Zombie Break Door==== <pre>模型: [on] zombie break[ing] [a] [wood[en]] door 加入的版本: unknown 僵尸破坏门</pre> ====Periodical==== <pre>模型: every %time span% in [world[s]] %worlds% 加入的版本: 1.0 每隔一定的现实时间 示例: every second every minecraft hour every tick # 警告:卡的一比 every minecraft day in "world"</pre> ===条件=== ====Can Build==== <pre>模型: %players% (can|(is|are) allowed to) build %directions% %locations% %players% (can('t|not)|(is|are)(n't| not) allowed to) build %directions% %locations% 加入的版本: 2.0 检测玩家是否可以在区域中放置方块,需要一个区域插件 示例: command /setblock <material>: description: set the block at your crosshair to a different type trigger: player cannot build at the targeted block: message "You do not have permission to change blocks there!" stop set the targeted block to argument</pre> ====Can Fly==== <pre>模型: %players% can fly %players% (can't|cannot|can not) fly 加入的版本: 2.3 检测玩家是否被允许飞行 示例: player can fly</pre> ====Can Hold==== <pre>模型: %inventories% (can hold|ha(s|ve) [enough] space (for|to hold)) %item types% %inventories% (can(no|')t hold|(ha(s|ve) not|ha(s|ve)n't|do[es]n't have) [enough] space (for|to hold)) %item types% 加入的版本: 1.0 检测玩家的背包或箱子是否有足够的空间 示例: block can hold 200 cobblestone player has enough space for 64 feathers</pre> ====Can See==== <pre>模型: %players% (is|are) [(in)]visible for %players% %players% can see %players% %players% (is|are)(n't| not) [(in)]visible for %players% %players% can('t| not) see %players% 加入的版本: 2.3 检测指定的玩家能否看到其他玩家 示例: if the player can't see the player-argument: message "The player %player-argument% is not online!"</pre> ====Chance==== <pre>模型: chance of %number%[\%] 加入的版本: 1.0 脚本成功或失败的几率 示例: chance of 50%: drop a diamond chance of {var}% # {var} between 0 and 100 chance of {var} # {var} between 0 and 1</pre> ====Comparison==== <pre>模型: [neither] %objects% ((is|are)[((n't| not| neither)]) ((greater|more|higher|bigger|larger) than|above)|\>) %objects% [neither] %objects% ((is|are)[((n't| not| neither)]) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as)|\>=) %objects% [neither] %objects% ((is|are)[((n't| not| neither)]) ((less|smaller) than|below)|\<) %objects% [neither] %objects% ((is|are)[((n't| not| neither)]) (less|smaller|below) [than] or (equal to|the same as)|\<=) %objects% [neither] %objects% ((is|are) (not|neither)|isn't|aren't|!=) [equal to] %objects% [neither] %objects% (is|are|=) [(equal to|the same as)] %objects% [neither] %objects% (is|are) between %objects% and %objects% [neither] %objects% (is not|are not|isn't|aren't) between %objects% and %objects% [neither] %objects% (was|were)[((n't| not| neither)]) ((greater|more|higher|bigger|larger) than|above) %objects% [neither] %objects% (was|were)[((n't| not| neither)]) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects% [neither] %objects% (was|were)[((n't| not| neither)]) ((less|smaller) than|below) %objects% [neither] %objects% (was|were)[((n't| not| neither)]) (less|smaller|below) [than] or (equal to|the same as) %objects% [neither] %objects% ((was|were) (not|neither)|wasn't|weren't) [equal to] %objects% [neither] %objects% (was|were) [(equal to|the same as)] %objects% [neither] %objects% (was|were) between %objects% and %objects% [neither] %objects% (was not|were not|wasn't|weren't) between %objects% and %objects% [neither] %objects% (will be|(will (not|neither) be|won't be)) ((greater|more|higher|bigger|larger) than|above) %objects% [neither] %objects% (will be|(will (not|neither) be|won't be)) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects% [neither] %objects% (will be|(will (not|neither) be|won't be)) ((less|smaller) than|below) %objects% [neither] %objects% (will be|(will (not|neither) be|won't be)) (less|smaller|below) [than] or (equal to|the same as) %objects% [neither] %objects% ((will (not|neither) be|won't be)|(isn't|aren't|is not|are not) (turning|changing) [in]to) [equal to] %objects% [neither] %objects% (will be [(equal to|the same as)]|(is|are) (turning|changing) [in]to) %objects% [neither] %objects% will be between %objects% and %objects% [neither] %objects% (will not be|won't be) between %objects% and %objects% 加入的版本: 1.0 非常常规的脚本,比较两量关系。通常你可以使用平等(如 block is/isn't of <type>), 但一些值可以使用更多/更少。 在这种情况下,你也可以测试一个对象是否在两个其他量之中。 注意:这只是一些形式。事实上,另外两套类似的模式,但(was|were)或将代替(is|are)分别检测不同时间状态的表达。 示例: the clicked block is a stone slab or a double stone slab time in the player's world is greater than 8:00 the creature is not an enderman or an ender dragon</pre> ====Contains==== <pre>模型: %inventories% ha(s|ve) %item types% [in [(the[ir]|his|her|its)] inventory] %inventories/texts/objects% contain[s] %item types/texts/objects% %inventories% do[es](n't| not) have %item types% [in [(the[ir]|his|her|its)] inventory] %inventories/texts/objects% do[es](n't| not) contain %item types/texts/objects% 加入的版本: 1.0 检查有无物品,一段对话有无一些字,或列出变量表是否包含某变量。 示例: block contains 20 cobblestone player has 4 flint and 2 iron ingots</pre> ====Damage Cause==== <pre>模型: [the] damage [(n('|o)]t) [been] (caused|done|made) by %damage cause% 加入的版本: 2.0 检查是什么造成的伤害,来源可以查看变量表。 示例: # make players use their potions of fire resistance whenever they take any kind of fire damage on damage: damage was caused by lava, fire or burning victim is a player victim has a potion of fire resistance cancel event apply fire resistance to the victim for 30 seconds remove 1 potion of fire resistance from the victim # prevent mobs from dropping items under certain circumstances on death; entity is not a player damage wasn't caused by a block explosion, an attack, a projectile, a potion, fire, burning, thorns or poison clear drops</pre> ====Event Cancelled==== <pre>模型: [the] event is cancel[l]ed [the] event (is not|isn't) cancel[l]ed 加入的版本: 2.2-dev36 检查时间是否被取消 示例: on click: if event is cancelled: broadcast "no clicks allowed!"</pre> ====Exists/Is Set==== <pre>模型: %~objects% (exist[s]|(is|are) set) %~objects% (do[es](n't| not) exist|(is|are)(n't| not) set) 加入的版本: 1.2 检查一个表达式是否被创建 示例: {teamscript.%player%.preferred team} is not set on damage: projectile exists broadcast "%attacker% used a %projectile% to attack %victim%!"</pre> ====Has Client Weather==== <pre>模型: %players% (has|have) [a] (client|custom) weather [set] %players% (doesn't|does not|do not|don't) have [a] (client|custom) weather [set] 加入的版本: 2.3 检查玩家客户端是否自定义了天气(通常在装有高清修复的客户端中才能自定义天气) 示例: if the player has custom weather: message "Your custom weather is %player's weather%"</pre> ====Has Metadata==== <pre>模型: %metadata holders% (has|have) metadata [(value|tag)[s]] %texts% %metadata holders% (doesn't|does not|do not|don't) have metadata [(value|tag)[s]] %texts% 加入的版本: 2.2-dev36 检查玩家是否持有数据值 示例: if player has metadata value "healer":</pre> ====Has Permission==== <pre>模型: [%players/console%] (do[es]n't|don't|do[es] not) have [the] permission[s] %texts% [%players/console%] ha(s|ve) [the] permission[s] %texts% 加入的版本: 1.0 检查玩家有无权限 示例: player has permission "skript.tree" victim has the permission "admin": send "You're attacking an admin!" to attacker</pre> ====Has Played Before==== <pre>模型: %offline player% [(h