关于此插件
本插件旨在通过 commandAPI 添加可在数据包中使用的实用命令。
它主要面向喜欢使用数据包制作内容、但对其局限性感到困扰的人(比如我)。
重要提示
如果您想禁用服务器记分板,请在每次有人加入时以该加入者的身份运行 /serverboard show default false @a。稍后我会添加一个切换开关。
当前功能
-
/motion @targets < x > < y > < z >
赋予目标 x、y、z 方向的运动速度将其击飞
-
/motionscore @targets < xObjective > < yObjective > < zObjective >
根据目标在指定计分板目标项中的数值,赋予其 x、y、z 方向的运动速度将其击飞
-
/relativemotion @targets <horizontal> <vertical> <forward> <ignore_vertical_rotation>
赋予目标相对运动速度将其击飞
-
/slot @target(max 1 player) < number >
设置玩家的选择槽位(0-8)
-
/slot @target(max 1 player)
返回玩家当前选中的槽位
-
/tagremoveall @target < excludedtag1 > < excludedtag2 > ....
移除所有标签,除了指定的排除标签外
-
/heal @targets amount
为目标恢复指定数量的生命值
-
/food @targets amount
将目标的饥饿值设置为指定数量
-
/saturation @targets amount
将目标的饱和度设置为指定数量
-
/enderchest @targets
强制让目标查看自己的末影箱
对 GUI 制作非常有用
-
/closeinventory
强制执行命令的实体关闭当前打开的物品栏界面
-
/repeat amount delay run <command>
以指定的延迟次数执行 <command> 命令
-
/serverboard
在屏幕侧面显示个人记分板。要进行配置,请查看此插件的配置文件。
可用的替换变量:
- {player} -> 返回玩家名称
- {health} -> 返回玩家生命值
- {objective.NAME} -> 返回玩家在名为 NAME 的计分板目标项中的数值
重要限制:
当玩家看到服务器记分板时,队伍功能将在客户端失效(因此所有服务端逻辑正常运行,但例如玩家将能够互相看到名字标签,无法实现友军隐身等效果,本质上就像他们不在任何队伍中一样。我会尝试修复这个问题)
相关命令如下:
-
/serverboard show BOARD_NAME true/false @targets
为指定目标显示/隐藏特定的服务器记分板(如果为任何人隐藏了某个记分板,则不会显示任何记分板)
-
/serverboard update @targets
更新指定目标的服务器记分板
(记分板中的数值不会自动更新,必须使用此命令)
-
/serverboard configreload
更新配置文件以及所有人的服务器记分板
实验性命令且尚未完善:
-
/eval
执行计算
尚未完成,仍需添加计分板变量支持
-
/waypointset x y z @targets tag color icon_id
在指定位置创建信标,仅对指定目标可见。盔甲架将拥有 TAG、COLOR 标签,并使用 ICON_ID 作为图标标识
信标始终拥有标签:datapacksplus_waypoint
-
/waypointsclear entity selector
参数必须为 @e[],信标始终是盔甲架,可以使用其他限制条件(如距离等)
新标签
您可以为玩家分配多种标签,以赋予其特定属性:
plugin.block.interact
prevent.block.destroy
prevent.block.placing
prevent.attack.all
prevent.attack.player
prevent.attack.-player
- 防止玩家仅攻击玩家
(由于 /gamerule pvp 的存在,此标签不再必要,但出于历史原因仍保留在此处)
prevent.attack.armorstand
prevent.attack.painting
prevent.attack.itemframe
prevent.drop
自定义计分板
plugin.opengui
plugin.closegui
!重要提示!
- 任何自定义命令都不能放在带有标签的函数中(通常是 tick 函数和 load 函数),否则会导致该函数无法正常执行。如果您想在这样的函数中使用它们,请创建一个新函数并将自定义命令放入其中,然后从带标签的函数中调用该新函数。
- 自定义命令现在在数据包中不会再在控制台中抛出错误!
About this Plugin
This Plugin aims to add useful commands that are useable inside of datapacks using commandAPI.
Its mostly for people (like me) who like to make things with datapacks, but are annoyed by the limitations they have.
IMPORTANT
If you want to disable server boards, run /serverboard show default false @a Every time someone joins, as the joining person. I will make a toggle later.
Current Features
-
/motion @targets < x > < y > < z >
Flings the player with x y z motion
-
/motionscore @targets < xObjective > < yObjective > < zObjective >
Flings the player with x y z motion, using the number from the targets scoreboard value for each given objective.
-
/relativemotion @targets <horizontal> <vertical> <forward> <ignore_vertical_rotation>
Flings the player with relative motion
-
/slot @target(max 1 player) < number >
Sets the players slot (0-8)
-
/slot @target(max 1 player)
Returns the players Current Selected Slot
-
/tagremoveall @target < excludedtag1 > < excludedtag2 > ....
removes all tags apart from the ones exlcuded
-
/heal @targets amount
Heals targets by amount
-
/food @targets amount
Sets food of targets to amount
-
/saturation @targets amount
Sets saturation of targets to amount
-
/enderchest @targets
Forces @targets to view their enderchest
Incredibly useful for GUIs
-
/closeinventory
Forces Executing entity to close the inventory they currently have open
-
/repeat amount delay run <command>
Executes <command> amount of times, with a delay of delay
-
/serverboard
Shows a personal scoreboard on the side of the screen. To configure, look in the config file for this plugin.
Available replacements:
- {player} -> Returns Player Name
- {health} -> Returns Player Health
- {objective.NAME} -> Returns the Players value for scoreboard NAME
IMPORTANT LIMITATION:
While the player sees a serverboard, the teams will not work client side (so all the server side logic works fine, but, for example the players will be able to see each others name tags, no friendly invisiblites etc etc, essentially like they are not in a team. I will try to fix this)
Commands for this:
-
/serverboard show BOARD_NAME true/false @targets
Shows/Hides a specific serverboard for @targets (if you hide a serverboard for anyone, none will be shown)
-
/serverboard update @targets
Updates the serverboard for @targets
(VALUES IN THE SERVERBOARD DO NOT AUTOMATICALLY UPDATE, THIS COMMAND IS REQUIRED)
-
/serverboard configreload
Updates the config and everyones serverboard
Experimental Commands and not fleshed out:
-
/eval
perform a caclulation
NOT DONE YET, STILL NEED TO ADD SCOREBOARD VARIABLE SUPPORT
-
/waypointset x y z @targets tag color icon_id
Creates a Waypoint at POS, showing only for TARGETS. The armorstand has the tag TAG, COLOR, and an ICON_ID for sprite purposes
Waypoint ALWAYS has tag: datapacksplus_waypoint
-
/waypointsclear entity selector
Argument needs to be @e[], Waypoints are always armor stands, any other restriction may be used (like distance, etc)
NEW TAGS
There are a number of tags you can give a player, to give them certain properties:
plugin.block.interact
- prevents player from doing right/left click on any block
prevent.block.destroy
- prevents player from destroying blocks
prevent.block.placing
- prevents player from placing blocks
prevent.attack.all
- prevents player from attacking any entity
prevent.attack.player
- prevents player from attacking any player
prevent.attack.-player
- prevents player from attacking JUST players
(Not needed due to /gamerule pvp, but still here due to legacy reasons)
prevent.attack.armorstand
- prevents player from attacking armorstands
prevent.attack.painting
- prevents player from attacking paintings
prevent.attack.itemframe
- prevents player from attacking itemframes
prevent.drop
- prevents player from dropping items
Custom Scoreboards
plugin.opengui
- Players get added 1 when they enter a GUI
plugin.closegui
- Players get added 1 when they leave a GUI
!IMPORTANT!
- any custom commands can not be in tagged functions (usually the tick function and the load function), that will cause the function not to run properly. If you want to use it in such functions, make a new function and add the custom command into it, and call that function from the tagged function.
- Custom Commands no longer throw errors in the console in datapacks!
评论 0
登录后参与评分
还没有评论,来抢沙发吧