Nexo
概述
Nexo 为你的服务器添加自定义物品、方块和家具。本扩展将它们引入 TypeWriter:任务可以要求玩家破坏一种自定义矿石或放置你的家具,sequence 可以在玩家击打某个方块时开始,条件(criteria)可以检查玩家持有或注视的内容。
一切都通过 Nexo 的物品 id 来指定,例如 ruby_ore 或 oak_chair。你仍然需要在 Nexo 中定义内容;本扩展只负责读取并响应它。
功能
- 方块事件 — 针对自定义方块的破坏、放置、交互、损坏(玩家开始挖掘)和战利品掉落。
- 家具事件 — 针对家具的破坏、放置、交互和损坏,可选择使用 BetterModel id 过滤。
- 计数目标 — 将破坏或放置自定义方块和家具作为任务目标。
- 物品栏工具 — 给予或移除 Nexo 物品,并响应拾取、丢弃或使用它们。
- 物品 fact — 手持物品、物品数量,以及手持物品是否使用了指定的机制。
- 世界 fact — 注视或站立的方块、注视的家具、家具的灯光状态,以及破坏某个方块所需的时间。
- 变量 — 手持物品以及视野中方块和家具的 id 与属性,以及注册表和标签列表。
- 声音条目 — 在 TypeWriter 要求声音的任何地方使用 Nexo 的声音 id。
安装
- 在服务器上安装 Nexo。没有它,本扩展无法加载。
- 确保已安装 TypeWriter 的 Quest 和 Basic 扩展。
- 从商店下载该扩展(见上方面板中的按钮),并将 JAR 放入
plugins/Typewriter/extensions/。 - 重启服务器。
快速上手
本教程会在玩家右键点击某个自定义方块时开始一个 sequence,并为任务统计家具数量。
- 在一个 sequence 页面上,添加一个 Nexo Block Interact 事件。
- 将
blockId设为 Nexo 方块的 id,将action设为RIGHT_CLICK,并将triggers链接到要运行的条目,例如一个对话。 - 对于计数任务,创建一个任务和一个进度 fact,然后添加一个 Place Furniture 目标。
- 设置
quest、fact,将item设为家具 id,amount设为5。在display中填写追踪器上的文字,如果需要,可将onComplete链接到奖励 sequence。 - Publish(发布),并用已激活该任务的玩家进行测试。
Registry IDs 变量会列出 Nexo 已加载的每一个物品、方块或家具 id。Tag Items 变量会列出某个 Nexo 标签下的物品。
工作原理
事件会把所发生的事情传递给被触发的条目:方块或家具的 id、其位置,对于家具还包括 BetterModel id。战利品掉落事件还会传递掉落了多少组、多少件物品。
目标对每位玩家的每个位置只计数一次,所以在同一位置再次放置和破坏不会累加。只有当玩家激活了所链接的任务时才会计数。被取消的操作会被忽略。
家具事件和目标上的 betterModelId 过滤器,会与你的 Nexo 配置中该家具的 bettermodel_id 键进行匹配。留空则忽略它。
配置
任务追踪器中的目标行由两个 TypeWriter 片段(snippet)构成:
| 片段 | 默认值 |
|---|---|
advancedQuest.display | <display> <dark_gray>(<gray><current><dark_gray>/<gray><required><dark_gray>) |
advancedQuest.completed | <green>✔</green> <st><display></st> <dark_gray>(<gray><current><dark_gray>/<gray><required><dark_gray>) |
条目
35 个条目,由扩展源码生成。
动作2
- Nexo Give Item ActionGive a Nexo item to the player
- Nexo Remove Item ActionRemove a Nexo item from the player
事件12
- Nexo on Customblock Break EventTriggers when a Nexo custom block is broken
- Nexo on Customblock Damage EventTriggers when a player starts breaking a Nexo custom block
- Nexo on Customblock Drop Loot EventTriggers when a Nexo custom block drops loot
- Nexo on Customblock Interact EventTriggers when a Nexo custom block is interacted with
- Nexo on Customblock Place EventTriggers when a Nexo custom block is placed
- Nexo on Furniture Break EventTriggers when a Nexo furniture is broken
- Nexo on Furniture Damage EventTriggers when a player hits a Nexo furniture
- Nexo on Furniture Interact EventTriggers when a Nexo furniture is interacted with
- Nexo on Furniture Place EventTriggers when a Nexo furniture is placed
- Nexo on Item Consume EventTriggers when the player consumes a Nexo item
- Nexo on Item Drop EventTriggers when the player drops a Nexo item
- Nexo on Item Pickup EventTriggers when the player picks up a Nexo item
目标4
- Nexo Break Customblock ObjectiveAn objective to break Nexo custom blocks
- Nexo Break Furniture ObjectiveAn objective to break Nexo furniture
- Nexo Place Customblock ObjectiveAn objective to place Nexo custom blocks
- Nexo Place Furniture ObjectiveAn objective to place Nexo furniture
事实8
- Nexo Break Time FactTicks this player needs to break the Nexo block they are looking at
- Nexo Furniture Light State FactWhether the Nexo furniture the player looks at is lit
- Nexo Holding Item FactWhether the player is holding a Nexo item
- Nexo Item Count FactHow many of a Nexo item the player carries
- Nexo Item Has Mechanic FactWhether the held Nexo item uses a given mechanic
- Nexo Looking at Block FactWhether the player is looking at a Nexo custom block
- Nexo Looking at Furniture FactWhether the player is looking at Nexo furniture
- Nexo Standing on Block FactWhether the player is standing on a Nexo custom block
变量8
- Nexo Furniture Property VariableA property of the Nexo furniture the player is looking at
- Nexo Item in Hand ID VariableThe Nexo ID of the item the player holds
- Nexo Item Property VariableA property of the Nexo item the player holds
- Nexo Looking at Block ID VariableThe Nexo ID of the block the player is looking at
- Nexo Looking at Furniture ID VariableThe Nexo ID of the furniture the player is looking at
- Nexo Registry Ids VariableThe list of IDs Nexo has loaded
- Nexo Standing on Block ID VariableThe Nexo ID of the block the player stands on
- Nexo Tag Items VariableThe Nexo items carrying a given tag
声音1
- Nexo SoundNexo Sound
故障排查
扩展没有出现在面板中。 没有安装 Nexo,或它没有启用。每个条目都会调用 Nexo 的 API,因此没有该插件时扩展会拒绝加载。
事件始终不触发。 请精确使用 Nexo 的物品 id(ruby_ore)。空的 id 会匹配任何内容。如果你填写了 location,则只有该方块位置才会匹配。被其他插件取消的事件会被忽略。对于家具,与该家具的 bettermodel_id 不匹配的 betterModelId 会阻止该事件。
目标没有进展。 玩家必须激活了所链接的任务,并且必须设置了 fact。每个方块位置对每位玩家只计数一次。
注册表或标签变量为空。 Nexo 在后台加载其物品。在 Nexo 加载完成之前,这些变量不会返回任何内容,因此请不要在服务器启动期间读取它们。
某个 fact 始终返回 0。 该物品或方块不是 Nexo 的。方块 fact 只检查 range 格(默认 5)以内的第一个方块。当目标方块无法被 Nexo 破坏时,破坏时间 fact 返回 0。机制 fact 需要精确的 Nexo 机制 id。
Give Item 没有给出任何东西。 itemId 不为 Nexo 所知,因此不会构建任何物品。放不下的剩余物品会掉落在玩家脚下,除非关闭了 dropOverflow。
相关扩展
- ItemsAdder 和 Craft Engine — 针对其他自定义内容插件的同类集成。