Commands 命令
This page provides a comprehensive list of commands available in ZNPCsPlus, along with detailed explanations and examples for each command.
本页面提供了 ZNPCsPlus 中可用的命令的全面列表,以及每个命令的详细说明和示例。
Creates a NPC with the specified ID and type. The id parameter is a unique identifier for the NPC, and the type parameter determines the type of the NPC. List of All NPC Types
使用指定的 ID 和类型创建 NPC。 id 参数是 NPC 的唯一标识符, type 参数确定 NPC 的类型。所有 NPC 类型的列表
Examples: 示例:
/npc create my_npc zombie/npc create npc1 player/npc create shop_npc villager
Deletes the NPC with the specified ID. This command permanently removes the specified NPC from the world.
删除具有指定 ID 的 NPC。此命令永久从世界中移除指定的 NPC。
Example: 示例:
/npc delete my_npc/npc delete npc1
Changes the ID of an existing NPC. This command allows you to update the identifier of an NPC.
更改现有 NPC 的 ID。此命令允许您更新 NPC 的标识符。
Example: 示例:
/npc changeid old_npc new_npc/npc changeid villager_npc trader_npc
Toggles the state of an NPC, making it visible or invisible. This command switches the NPC's visibility between being active and inactive.
切换 NPC 的状态,使其可见或不可见。此命令在活动和非活动状态之间切换 NPC 的可见性。
Example: 示例:
/npc toggle my_npc/npc toggle npc1
Lists all existing NPCs.
列出所有现有的 NPC。
Usage: 使用方法:
/npc list
Changes the type of an NPC. List of All NPC Types
更改 NPC 的类型。所有 NPC 类型列表
Example: 示例:
/npc type my_npc skeleton/npc type npc1 cow
Clones an existing NPC. This command creates a copy of the specified NPC with a new ID at the same location as the player.
克隆现有的 NPC。此命令在玩家相同的位置创建指定 NPC 的副本,并分配新的 ID。
Example: 示例:
/npc clone my_npc new_npc/npc clone npc1 cloned_npc
Reloads the configuration file. This command refreshes the configuration settings for ZNPCsPlus.
重新加载配置文件。此命令刷新 ZNPCsPlus 的配置设置。
Usage: 使用方法:
/npc reloadconfig
Displays the current version of ZNPCsPlus with build information.
显示 ZNPCsPlus 的当前版本及构建信息。
Usage: 使用方法:
/npc version
Lists NPCs within a specified distance. This command shows a list of NPCs located within the specified range from the player.
列出指定范围内的 NPC。此命令显示玩家指定范围内位置的 NPC 列表。
Example: 示例:
/npc near 10/npc near 5
Moves the NPC to the center of the block in the X and Z axes without changing its elevation
将 NPC 移动到 X 轴和 Z 轴的中心块,但不改变其高度
Example: 示例:
/npc center my_npc/npc center npc1
Makes the NPC look at the player. This command adjusts the NPC's orientation to face the player.
使 NPC 看向玩家。此命令调整 NPC 的方向以面向玩家。
Example: 示例:
/npc lookatme my_npc/npc lookatme npc1
Sets the location of an NPC. This command allows you to specify the exact coordinates (x, y, z) where the NPC should be placed.
设置 NPC 的位置。此命令允许您指定 NPC 应放置的确切坐标(x,y,z)。
Example: 示例:
/npc setlocation my_npc 100 64 200/npc setlocation npc1 50.5 70 -30.5
Sets the rotation of an NPC. This command adjusts the yaw and pitch angles of the specified NPC.
设置 NPC 的旋转。此命令调整指定 NPC 的偏航角和俯仰角。
Example: 示例:
/npc setrotation my_npc 180 45/npc setrotation npc1 90 0
Adjusting rotation can be useful for directing the NPC's orientation within the game.
调整旋转可用于在游戏中指导 NPC 的方向。
Moves the NPC to the player's location.
将 NPC 移动到玩家的位置。
Example: 示例:
/npc move my_npc/npc move npc1
Teleports the player to the location of the specified NPC.
将玩家传送到指定 NPC 的位置。
Example: 示例:
/npc teleport my_npc/npc teleport npc1
Changes the skin of an NPC. This command allows you to customize the appearance of the specified NPC with different skin types and additional arguments.
更改 NPC 的皮肤。该命令允许您使用不同的皮肤类型和附加参数自定义指定 NPC 的外观。
There are four types of skins available for the /npc skin command:
/npc skin 命令有四种皮肤类型可供选择:
-
Static: 静态:
- Used to set the skin using a player's username.
用于通过玩家的用户名设置皮肤。 - The skin remains unchanged even if the player changes their skin.
即使玩家更改了他们的皮肤,皮肤也不会改变。 - Placeholders are not allowed.
不允许使用占位符。 - Example:
/npc skin my_npc static D3v1s0m/npc skin my_npc static D3v1s0m
- Used to set the skin using a player's username.
-
Dynamic: 动态:
- Used to set the skin using a player's username.
用于通过玩家的用户名设置皮肤。 - The skin updates according to the input.
皮肤会根据输入进行更新。 - Placeholders are allowed; it updates if the player changes their skin or based on a specified placeholder.
允许使用占位符;如果玩家更改了他们的皮肤或基于指定的占位符,它将进行更新。 - Example:
/npc skin my_npc dynamic Notch/npc skin my_npc dynamic Notch - Example:
/npc skin my_npc dynamic %player_name%/npc skin my_npc dynamic %player_name%
- Used to set the skin using a player's username.
-
Mirror: 镜像:
- Makes the NPC have the same skin as the player viewing it.
使 NPC 拥有与观看它的玩家相同的皮肤。 - For each player, it shows their own skin.
对于每个玩家,它显示他们自己的皮肤。 - Example:
/npc skin my_npc mirror/npc skin my_npc mirror
- Makes the NPC have the same skin as the player viewing it.
-
URL:
- Sets the skin using the URL of the skin file.
使用皮肤文件的 URL 来设置皮肤。 - Two skin variants available: Classic (4-pixel skin) and Slim (3-pixel skin or Alex slim).
可选两种皮肤变体:经典(4 像素皮肤)和纤薄(3 像素皮肤或 Alex 纤薄)。 - Example:
/npc skin my_npc url classic http://textures.minecraft.net/texture/5d6f51d459e743fc87cf61f1ca6d312e46270847c5ce293a0744be3e73d26751/npc skin my_npc url classic http://textures.minecraft.net/texture/5d6f51d459e743fc87cf61f1ca6d312e46270847c5ce293a0744be3e73d26751 - Example:
/npc skin my_npc url slim https://imgur.com/VZ8Yo58/npc skin my_npc url slim https://imgur.com/VZ8Yo58
- Sets the skin using the URL of the skin file.
Adds a hologram line to the specified NPC.
为指定 NPC 添加全息线。
Example: 示例:
/npc holo add my_npc Hello, I am an NPC/npc holo add npc1 &6Welcome to the server
Note: To add an empty hologram line, use %blank% as the text.
注意:要添加空全息线,请将文本设置为 %blank% 。
Adds an item hologram to the specified NPC. This command allows you to display an item in the NPC's hologram.
为指定 NPC 添加物品全息。此命令允许您在 NPC 的全息中显示物品。
Example: 示例:
-
/npc holo additem my_npc(Holding item in hand)
/npc holo additem my_npc(手持物品)
Deletes a hologram line from the specified NPC.
删除指定 NPC 的虚影线。
Example: 示例:
/npc holo delete my_npc 1/npc holo delete npc1 2
Displays information about the hologram of the specified NPC.
显示指定 NPC 虚影的信息。
Example: 示例:
/npc holo info my_npc
Inserts a new hologram line at the specified position for the specified NPC.
在指定位置为指定 NPC 插入新的虚影线。
Example: 示例:
/npc holo insert my_npc 1 Welcome/npc holo insert npc1 2 Goodbye
Note: To insert an empty hologram line, use %blank% as the text.
注意:要插入一个空的全息线,请将文本设置为 %blank% 。
Inserts an item hologram at the specified position for the specified NPC.
为指定 NPC 在指定位置插入一个物品全息。
Example: 示例:
-
/npc holo insertitem my_npc 1(Holding item in hand)
/npc holo insertitem my_npc 1(手持物品) -
/npc holo insertitem npc1 2(Holding item in hand)
/npc holo insertitem npc1 2(手持物品)
Sets the text of a hologram line for the specified NPC.
设置指定 NPC 的全息文本行。
Example: 示例:
/npc holo set my_npc 1 Hello/npc holo set npc1 2 Welcome
Note: To set an empty hologram line, use %blank% as the text.
注意:要设置空的全息文本行,请将文本设置为 %blank% 。
Sets the item hologram for the specified NPC.
设置指定 NPC 的物品全息。
Example: 示例:
-
/npc holo setitem my_npc 1(Holding item in hand)
/npc holo setitem my_npc 1(手持物品) -
/npc holo setitem npc1 2(Holding item in hand)
/npc holo setitem npc1 2(手持物品)
Sets the offset of the hologram for the specified NPC. This command allows you to adjust the vertical position of the hologram.
设置指定 NPC 的全息影像偏移量。此命令允许您调整全息影像的垂直位置。
0 is the default value where the hologram is placed at the NPC's head.
0 是默认值,此时全息影像将放置在 NPC 头部。
Example: 示例:
-
/npc holo offset my_npc 1(Moves the hologram up by 1 block)
/npc holo offset my_npc 1(将全息影像向上移动 1 格) -
/npc holo offset npc1 -0.5(Moves the hologram down by 0.5 blocks)
/npc holo offset npc1 -0.5(将全息影像向下移动 0.5 格)
Sets the refresh delay of the hologram for the specified NPC. This command allows you to adjust the refresh rate of the hologram.
设置指定 NPC 的全息影像刷新延迟。此命令允许您调整全息影像的刷新频率。
The refresh delay is the time in seconds between each update of the hologram. This is useful for placeholders.
刷新延迟是指每个全息图更新之间的秒数。这对于占位符很有用。
-1 is the default value where the hologram is not refreshed.
-1 是默认值,此时全息图不会刷新。
Example: 示例:
-
/npc holo refreshdelay my_npc 5(Sets the refresh delay to 5 seconds)
/npc holo refreshdelay my_npc 5(将刷新延迟设置为 5 秒)
Sets a property for the specified NPC to the specified value. All Properties are listed in Properties page
为指定 NPC 设置属性为指定值。所有属性均在属性页面中列出
Example: 示例:
-
/npc property set my_npc dinnerbone true(Applies to all NPCs except Player and Ender Dragon)
/npc property set my_npc dinnerbone true(适用于所有非玩家和末影龙 NPC) -
/npc property set zombie1 baby true(Applies to Ageable NPCs)
/npc property set zombie1 baby true(适用于可成长型 NPC) -
/npc property set farm_shop villager_profession farmer(Applies to Villager NPCs)
/npc property set farm_shop villager_profession farmer(适用于村民型 NPC)
Removes a property from the specified NPC.
从指定的 NPC 中移除一个属性。
Example: 示例:
/npc property remove my_npc dinnerbone/npc property remove zombie1 baby/npc property remove farm_shop villager_profession
Adds an action to the specified NPC. This command allows you to add an action to the NPC, which can be triggered when a player interacts with the NPC.
向指定的 NPC 添加一个动作。此指令允许您向 NPC 添加动作,当玩家与 NPC 互动时可以触发该动作。
<action> can be one of the following:
<action> 可以是以下之一:
-
consolecommand- Executes a command as the console.
consolecommand- 以控制台身份执行命令。 -
message- Sends a message to the player.
message- 向玩家发送消息。 -
playerchat- Sends a message on behalf of the player.
playerchat- 代表玩家发送消息。 -
playercommand- Executes a command as the player.
playercommand- 以玩家身份执行命令。 -
switchserver- Moves the player to another server. (BungeeCord only)
switchserver- 将玩家移动到另一个服务器。(仅限 BungeeCord)
<click type> can be one of the following:
<click type> 可以是以下之一:
-
ANY_CLICK- action will be triggered on any click (left or right)
ANY_CLICK- 任何点击(左键或右键)都会触发操作。 -
LEFT_CLICK- action will be triggered on left click (attack) only
LEFT_CLICK- 仅在左键点击(攻击)时触发动作 -
RIGHT_CLICK- action will be triggered on right click (interact) only
RIGHT_CLICK- 仅在右键点击(交互)时触发动作
<cooldown seconds> is the cooldown time in seconds for the action. If the player interacts with the NPC before the cooldown time has passed, the action will not be triggered.
<cooldown seconds> 是动作的冷却时间(秒)。如果玩家在冷却时间结束前与 NPC 交互,动作将不会触发。
<delay ticks> is the delay in ticks before the action is triggered. This is useful for delaying the action after the player interacts with the NPC.
<delay ticks> 是在动作触发前的延迟(刻)。这适用于在玩家与 NPC 交互后延迟动作。
<value> is the value of the action. This can be a command, message, or server name depending on the action type.
<value> 是动作的值。这可以是命令、消息或服务器名称,具体取决于动作类型。
Examples: 示例:
-
/npc action add consolecommand my_npc ANY_CLICK 5 0 say Hello, I am an NPC(Executes the commandsay Hello, I am an NPCon any click)
/npc action add consolecommand my_npc ANY_CLICK 5 0 say Hello, I am an NPC(在任何点击时执行命令say Hello, I am an NPC) -
/npc action add message npc1 LEFT_CLICK 10 20 Welcome to the server!(Sends a messageWelcome to the server!to the player when the NPC is left-clicked)
/npc action add message npc1 LEFT_CLICK 10 20 Welcome to the server!(当 NPC 左键点击时向玩家发送消息Welcome to the server!) -
/npc action add playercommand shop_warp RIGHT_CLICK 5 0 warp shop(Executes the commandwarp shopwhen the NPC is right-clicked)
/npc action add playercommand shop_warp RIGHT_CLICK 5 0 warp shop(当右键点击 NPC 时执行命令warp shop)
Clears all actions from the specified NPC.
清除指定 NPC 的所有动作。
Example: 示例:
/npc action clear my_npc
Deletes the action at the specified index from the specified NPC. The index is the position of the action in the list of actions (use List Command to see the index).
从指定 NPC 中删除指定索引处的动作。索引是动作在动作列表中的位置(使用列表命令查看索引)。
Example: 示例:
/npc action delete my_npc 1/npc action delete npc1 2
Edits the action at the specified index for the specified NPC. This command allows you to modify the properties of an existing action.
修改指定 NPC 在指定索引处的动作。此命令允许您修改现有动作的属性。
Example: 示例:
/npc action edit my_npc 1 consolecommand ANY_CLICK 5 0 msg %player_name% Hello, I am an NPC- `/npc action edit npc1 2 message LEFT_CLICK 10 20 Welcome to the server!``
`/npc action edit npc1 2 message LEFT_CLICK 10 20 Welcome to the server!` /npc action edit shop_npc 3 playercommand ANY_CLICK 5 0 warp shop
Lists all actions of the specified NPC.
列出指定 NPC 的所有动作。
Example: 示例:
/npc action list my_npc/npc action list npc1
Saves all NPCs 保存所有 NPC
Usage: 使用方法:
/npc storage save
Reloads all NPCs 重新加载所有 NPC
Usage: 使用方法:
/npc storage reload
Imports NPCs from the specified importer.
从指定的导入器中导入 NPC。
Note: please refer to the Converting page for more information.
注意:请参考转换页面获取更多信息。
Migrates NPCs from one storage type to another. This command allows you to convert NPCs from one storage format to another.
将 NPC 从一个存储类型迁移到另一个存储类型。此命令允许您将 NPC 从一种存储格式转换为另一种存储格式。
Example: 示例:
/npc storage migrate YAML SQLITE-
/npc storage migrate SQLITE YAML true(Force migration to overwrite existing npcs with the same id)
/npc storage migrate SQLITE YAML true(强制迁移,用具有相同 ID 的新 NPC 覆盖现有 NPC)
Welcome to the documentation for ZNPCsPlus!
欢迎来到 ZNPCsPlus 的文档!
-
Home: Introduction and Overview
首页:介绍和概览 -
Setup: Installation and Configuration
设置:安装和配置 -
Converting: Migrating from Older Versions or Other Plugins
转换:从旧版本或其他插件迁移 -
Commands: List of Available Commands
命令:可用命令列表 -
Permissions: Permissions and Access Control
权限:权限和访问控制 -
NPC Types: Information about Different NPC Types
NPC 类型:不同 NPC 类型的信息 -
Properties: Customization Options
属性:自定义选项 -
API Docs: Documentation of API
API 文档:API 文档 -
Other: Additional Resources and Information
其他:其他资源和信息
Feel free to click on any of the links above to access the corresponding page for detailed information on that topic. If you have any questions or need further assistance, please don't hesitate to reach out on our Discord server
欢迎点击上述任何链接,访问相应页面以获取该主题的详细信息。如果您有任何问题或需要进一步的帮助,请随时在我们的 Discord 服务器上联系我们。