Data Command Plus
此模组扩展了 /data 命令和 /loot
仅在
服务端必需,客户端需要安装以获得完整的语法提示!
该命令的语法与原版语法完全兼容。请参阅 Minecraft Wiki 上的 Commands/data
请始终下载最新版本以获取所有功能。
在 NeoForge/Forge 上使用
请遵循以下说明:
Sinytra Connector 和
Forgified Fabric API。
请注意,该移植版本并不完美,可能会导致游戏崩溃。
如果发生崩溃,应向
Sinytra Connector 模组的开发者报告!
/data 命令精简版
- … get (block <目标位置>|entity <目标实体>|storage <目标存储>|storageplayer <玩家>) [<路径>] [<缩放比例>]
- … merge (block <目标位置>|entity <目标实体>|storage <目标存储>|storageplayer <玩家>) <nbt数据>
- … modify (block <目标位置>|entity <目标实体>|storage <目标存储>|storageplayer <玩家>) <目标路径> (append|insert <索引>|merge|prepend|set| operation)
- … from (block <源位置>|entity <源实体>|storage <源存储>|storageplayer <玩家>) [<源路径>]
- … concat (block <源位置>|entity <源实体>|storage <源存储>|storageplayer <玩家>) [<源路径>]
- … string (block <源位置>|entity <源实体>|storage <源存储>|storageplayer <玩家>) [<源路径>] [<起始位置>] [<结束位置>]
- … <(operation 之一: =, +=, -=, *=, /=, %=, ^=, <, >)> <双精度数值>
- … value <值>
- … remove (block <目标位置>|entity <目标实体>|storage <目标存储>|storageplayer <玩家>) <路径>
压缩树:/Loot 命令
/loot <TARGET> <SOURCE>
其中
<TARGET> 为:
- give | insert | spawn | replace <targetPos>
- insert entity <to entity> inventory <from entity>
<SOURCE> 为:
- fish | loot | kill | mine
- inventory <entity> [MaxSlots]
<entity> 的类型包括:player, cart, boat, villager, horse/donkey/llama, item, other living entity
[MaxSlots] 是可选参数,将返回最多 n 个槽位(从第 1 个开始计数),(-n) 负数将返回最后 n 个槽位
装备顺序:脚部护甲至头部护甲,主手,副手,身体,鞍。
示例,将一个矿车箱中的物品压缩到另一个矿车箱中:
/loot insert entity @e[limit=1,type=chest_minecart,tag=1] inventory @e[limit=1,type=chest_minecart,tag=2]
功能
拼接
- 字符串 old + 字符串 new
- 字符串列表
- 任意数组
- 多个 Nbt 值(通过 nbt 选择器选取)
- Nbt Compound(仅限顶层)作为带有转义引号的字符串 ("key":"value")
- 返回结果:拼接后的元素数量
给定路径将被替换为新字符串
附注:如果给定路径是字符串且进行字符串拼接,结果是这两个字符串的拼接
数学运算
- 对目标值执行数学运算,目标可以是任何数值类型,当类型非数值时将抛出错误并将 success 设为 0
- ^= 表示幂运算,也可用于计算根
- 目标路径 数字类型 不会改变
- 如需命令语法帮助,请在本端安装此模组
- 返回结果和成功标志:成功时为非零值
Storageplayer
- 在玩家自己的文件 /players/<UUID>_pds.dat 中存储数据
- 仅适用于玩家,其他实体将返回错误
- ! 存储在 storageplayer 中的数据不会与客户端同步,它纯粹是服务器端的 !
战利品 ... 库存 ...
- 将实体的库存物品放入容器(适用于玩家、矿车、船、商人、马、物品以及所有生物实体)
- 向双箱中插入物品现在成为可能(相比常规的战利品命令,容量提升一倍)...
- 返回结果:返回的槽位数量
/execute as @e[type=item] run loot insert ~ ~-0.1 ~ inventory @s (尝试将世界中掉落的所有物品副本插入到你脚下的容器中)
有关 Loot ... inventory ... 的示例可在
数据包 Fafik77 Lib/inventory_manager 中找到
删除击杀命令
响应视频《So I Added WAY Too Many Slimes to Minecraft》-by Fundy
/
deletekill <实体>
删除选定的实体,不掉落任何战利品,不触发任何事件,直接消失
附注:对史莱姆效果极佳
Data Command Plus
This mod expands the capabilities of /data command, /loot
Only
required on the
Server side, client will need it for full syntax help!
Syntax of the command fits right into Vanilla syntax. see Commands/data on Minecraft Wiki
Always download the latest release to have access to all the features
To use with NeoForge/Forge
Follow instructions at:
Sinytra Connector and
Forgified Fabric API.
Please be aware that that port is not perfect and can crash your game.
In case it does crash, it should be reported to
Sinytra Connector mod developer!
Squished tree: of /data command
- … get (block <targetPos>|entity <target>|storage <target>|storageplayer <player>) [<path>] [<scale>]
- … merge (block <targetPos>|entity <target>|storage <target>|storageplayer <player>) <nbt>
- … modify (block <targetPos>|entity <target>|storage <target>|storageplayer <player>) <targetPath> (append|insert <index>|merge|prepend|set| operation)
- … from (block <sourcePos>|entity <source>|storage <source>|storageplayer <player>) [<sourcePath>]
- … concat (block <sourcePos>|entity <source>|storage <source>|storageplayer <player>) [<sourcePath>]
- … string (block <sourcePos>|entity <source>|storage <source>|storageplayer <player>) [<sourcePath>] [<start>] [<end>]
- … <(operation one of: =, +=, -=, *=, /=, %=, ^=, <, >)> <double value>
- … value <value>
- … remove (block <targetPos>|entity <target>|storage <target>|storageplayer <player>) <path>
Squished tree: of /Loot command
/loot <TARGET> <SOURCE>
where
<TARGET> is:
- give | insert | spawn | replace <targetPos>
- insert entity <to entity> inventory <from entity>
<SOURCE> is:
- fish | loot | kill | mine
- inventory <entity> [MaxSlots]
<entity> is of type: player, cart, boat, villager, horse/donkey/llama, item, other living entity
[MaxSlots] is optional and will return up to n Slots (counting from 1), (-n) minus will return last n Slots
Equipment in order: Armor feet to head, mainhand, offhand, body, saddle.
Example, compacting inventory from one chest minecart into another one:
/loot insert entity @e[limit=1,type=chest_minecart,tag=1] inventory @e[limit=1,type=chest_minecart,tag=2]
Possibilities
Concatenate
- String old + String new
- List of Strings
- Any Array
- Multiple Nbt Values (selected by nbt selector)
- Nbt Compound (only the top layer) as strings with escaped Quotes ("key":"value")
- Return result: amount of elements concatenated
given path will be replaced with new string
p.s. if given path is a string and a string is concatenated, the result is concatenation of those two strings
Math Operation
- performs math operation on the target value, target can be of any numeric type, Error will be thrown and success set to 0 when type is not numeric
- ^= stands for Power, can also be used to calculate Root
- Targeted Path number TYPE will not change
- for command syntax help install this mod client side
- Return result and success: non zero on success
Storageplayer
- store data per player in their own file /players/<UUID>_pds.dat
- works only on players, any other entity will return an error
- ! Data stored in storageplayer will not be synced with clients, it's purely server side !
Loot ... inventory ...
- loot enitiy's inventory into container (works with players, minecarts, boats, merchants, horses, items, and all living entities)
- inserting into double chests is now possible (1up over regular loot command) ...
- Return result: Slots returned
/execute as @e[type=item] run loot insert ~ ~-0.1 ~ inventory @s (will try to insert a copy of all dropped items from the world into inventory under your feet)
Examples of Loot ... inventory ... can be found in
datapack Fafik77 Lib/inventory_manager
Delete Kill Command
In response to So I Added WAY Too Many Slimes to Minecraft -by Fundy
/
deletekill <entities>
Deletes selected entities, no loot dropped, no events fired just gone
p.s. works grat on slimes
评论 0
登录后参与评分
还没有评论,来抢沙发吧