Samū's Commands (ModID: rfx-cmd)
一款面向 Minecraft 1.20.x 的小型模组,添加了若干细微的游戏玩法特性。该模组基于 Fabric 开发,并需要 Fabric API。
此模组同时包含客户端和服务端功能,但运作方式使得如果服务器已安装该模组,则客户端无需安装;反之亦然。该模组主要添加了一些命令,在服务端最为实用,但客户端也提供了一些便捷的小功能(特别是当服务器也安装了该模组时)。
服务端功能
此处列出的所有命令和游戏内规则(gamerules)会自动同步给所有客户端,因此无论玩家是否安装了该模组,均可访问这些功能。
家园 (Homes)
模组添加了广为人知的 /home 和 /sethome 命令。你拥有一个主家园,可以通过不带额外名称地调用基础命令来使用它。你可以通过带特定名称调用命令来添加更多命名家园。
/home (别名 /h) 传送至你上次调用 /sethome 的位置
/sethome (别名 /sh) 将当前位置设置为主家园
/delhome 删除你的主家园
/gethome (别名 /gh) 获取你的主家园坐标;或者在 reducedDebugInfo 游戏内规则设为 true 时,仅显示你是否拥有主家园
/homes 列出你的所有命名家园及其坐标(若游戏内规则允许)
/clearhomes 移除你所有的命名家园,保留主家园
/clearhomes true 移除你所有的家园,包括主家园
家园功能受游戏内规则控制:
/gamerule allowHomeTp true|false (默认 true) 启用或禁用所有家园命令。当设为 false 时,仅有管理员可访问家园命令。此游戏内规则对单人世界中开启作弊的玩家无效。
/gamerule maxHomes <nr> (默认 0) 设置玩家最多可拥有的家园数量,无论是命名家园还是主家园。数值 0 表示禁用限制。如果玩家拥有的家园数量超过此限制,必须先删除部分家园才能设置新的家园。如果玩家拥有的家园数量恰好等于此限制,则只能覆盖现有的家园。此限制仅影响 /sethome 命令;即使玩家拥有的家园数量超过此游戏内规则允许的数量,他们仍可传送到任意已有的家园。管理员和开启作弊的玩家可创建更多家园。
家园支持任意距离和跨维度传送。在下界设置的家园允许主世界中的玩家瞬间传送至下界的该家园处。
一个实用的功能:聊天栏中显示的家园名称是可点击的,系统会根据该家园在打印时是否存在,自动建议输入 /home 或 /sethome 命令。
出生点传送
模组添加了一个简单命令,让玩家能够传送至主世界的世界出生点。
此行为可通过游戏内规则启用或禁用:
/gamerule allowSpawnTp true|false (默认 true) 启用或禁用 /spawn 命令。
传送请求
模组添加了广为人知的 /tpa 系统,用于向其他玩家发送传送请求。通过一组命令进行控制:
/tpa <player> 向 <player> 发送传送请求。如果他们接受,你将传送至他们身边。
/tpc <player> 向 <player> 发送被召唤请求。如果他们接受,他们将传送至你身边。
/tpaccept 接受最后收到的传送请求
/tpaccept <player> 接受来自 <player> 的传送请求
/tpaccept * 接受所有传送请求和召唤请求,请谨慎使用,因为如果你收到了大量请求和召唤,这可能会导致相当大的混乱
/tpdeny 拒绝最后收到的传送请求
/tpdeny <player> 拒绝来自 <player> 的传送请求
/tpdeny * 拒绝所有传送请求
你可以使用黑名单和白名单来控制谁可以向你发送请求。白名单默认处于禁用状态,但可以启用。如果启用了白名单,除非玩家在白名单中,否则任何人都无法向你发送请求。黑名单中的玩家永远无法向你发送请求,即使他们在白名单中也是如此。如果禁用了白名单,除了黑名单中的玩家外,所有人都可以发起请求。
/tpblacklist add <player> (别名 /tpbl add <player>) 将玩家加入你的 TP 黑名单
/tpblacklist remove <player> (别名 /tpbl remove <player>) 将玩家从你的 TP 黑名单中移除
/tpwhitelist add <player> (别名 /tpwl add <player>) 将玩家加入你的 TP 白名单
/tpwhitelist remove <player> (别名 /tpwl remove <player>) 将玩家从你的 TP 白名单中移除
/tpwhitelist enable (别名 /tpwl enable) 启用你的白名单,阻止所有人,除非他们在白名单中
/tpwhitelist disable (别名 /tpwl disable) 禁用你的白名单,不阻止任何人,除非他们在黑名单中
/tpwhitelist toggle (别名 /tpwl toggle) 切换你的白名单状态,如果当前禁用则启用,如果当前启用则禁用
传送请求可以通过以下游戏规则进行控制:
/gamerule allowTpa true|false(默认 true)启用或禁用所有人的所有传送请求命令,包括管理员和拥有作弊权限的玩家(毕竟他们还有常规的 /tp 命令,否则玩家无法接受请求)。
/gamerule tpaRequestTimeout 1..3600(默认 300)定义传送请求过期前的时间长度(以秒为单位)。必须在此时间范围内接受请求,否则请求将被静默拒绝(不会向发送者或接收者显示任何消息)。
/gamerule tpaRequestSameTeam true|false(默认 false)设置是否仅允许向同一队伍中的玩家发送传送请求。这也考虑了未加入队伍的玩家被视为在一个单独的“未加入队伍”队伍中,以便他们之间仍然可以互相发送请求。如果禁用,任何人都可以向任何人发送请求。
/gamerule tpaMode tpa|tpc|both(默认 both)设置玩家可以以何种方向互相传送。如果设置为 tpa,玩家只能将自己传送到其他人那里(即可以使用 /tpa)。如果设置为 tpc,玩家只能将其他人传送到自己这里(即可以使用 /tpc)。如果设置为 both,玩家可以进行两种操作(即可以使用 /tpa 和 /tpc)。
个人笔记
玩家可以为自己编写简短的笔记,这些笔记按世界存储(在服务器端)。笔记由多行组成,玩家可以自由编辑、移动、删除和添加内容。
/notes add <note>(别名 /note <note>)添加一条带有给定文本的新笔记
/notes edit <ln> <note> 编辑第 <ln> 行的笔记,并将文本替换为给定的文本
/notes remove all 删除所有笔记
/notes remove <ln> 删除特定的某一行笔记
/notes remove <from> <to> 删除一定范围内的笔记
/notes move <from> <to> 将一行笔记从当前位置移动到另一位置
/notes last(别名 /note)显示最后一行编号处的笔记
/notes last <nr> 显示最后 <nr> 行编号处的笔记
/notes get all(别名 /notes)列出所有笔记
/notes get <ln> 列出特定的一行笔记
/notes get <from> <to> 列出一定范围内的笔记
笔记支持插入一些简单的数据点,例如你的坐标或所在维度,前提是游戏规则 reducedDebugInfo 设置为 false。每个插入项会在笔记中放置它们的位置处插入具体信息。这旨在让你更容易地将调试屏幕中的某些信息插入到笔记中。
{xyz}(别名 {pos}, {coords})插入你在世界中的坐标
{xz} 插入你在世界中的 X 和 Z 坐标
{x} 插入你在世界中的 X 坐标
{y} 插入你在世界中的 Y 坐标
{z} 插入你在世界中的 Z 坐标
{dimension}(别名 {dim})插入你当前所在维度的维度 ID
由于笔记存储在服务器端的玩家数据中,因此存在一个游戏规则来限制每位玩家的笔记数量,从而限制每位玩家的内存使用量。笔记有硬编码的长度限制,最多为 1024 个字符,但每位玩家的笔记数量是可配置的。
/gamerule maxNotes 1..4096(默认 1024)设置玩家最多可以拥有的笔记数量。更改此值不会立即从玩家身上移除笔记。
一个有用的功能:聊天中打印的笔记行可以点击,以将笔记行复制到剪贴板。
兴趣点
除了家园命令外,该模组还提供了兴趣点(Points of Interest),类似于所有玩家共享的家园。除非另行配置,否则只有管理员可以设置这些兴趣点。默认情况下,所有玩家都可以传送至这些兴趣点。所有针对单个兴趣点的命令都可以选择性地使用名称作为参数来设置命名的兴趣点。主要的兴趣点没有名称,必须通过不提供名称来引用它。
/poi 传送到由 /setpoi 设置的兴趣点
/setpoi 将当前位置设置为兴趣点
/delpoi 删除一个兴趣点
/getpoi 获取兴趣点的坐标,或者当游戏规则 reducedDebugInfo 设置为 true 时,仅检查兴趣点是否存在
/pois 列出所有兴趣点及其坐标(如果游戏规则允许)
/clearpois 删除所有命名的兴趣点,保留主要兴趣点
/clearpois true 删除所有兴趣点,包括主要兴趣点
兴趣点可以通过游戏规则进行控制:
/gamerule allowPoi true|false(默认 true)启用或禁用所有兴趣点命令。当设置为 false 时,只有操作员可以访问兴趣点命令。此游戏规则对单人世界中开启作弊功能的玩家无效。
/gamerule allCanSetPoi true|false(默认 false)启用或禁用兴趣点修改命令。当设置为 false 时,只有操作员可以更改、添加和删除兴趣点。当设置为 true 时,所有玩家都可以编辑兴趣点。
/gamerule hidePoiInfo true|false(默认 false)启用或禁用兴趣点查询命令。当设置为 false 时,只有操作员可以访问兴趣点查询命令(/pois, /getpoi)。这不会禁用 /poi 传送命令。
兴趣点与家园一样,可以在任意距离和不同维度之间工作。在下界设置的兴趣点允许主世界中的玩家瞬间传送至下界的该兴趣点。
最近死亡地点
该模组具有一项功能,可将玩家传送至其最近死亡的地点。这可以通过两种方式实现:
- 使用
/death 命令
- 使用恢复罗盘点击(这需要玩家获得这样的罗盘)
一个游戏规则可以控制此功能:
/gamerule deathTp off|command|compass|both(默认值为 compass)设置玩家如何传送到他们上次死亡的位置。
- 当设置为
off 时,该功能被禁用。
- 当设置为
command 时,仅通过命令使用该功能,玩家不需要使用回春之球。
- 当设置为
compass 时,仅通过回春之球使用该功能。
- 当设置为
both 时,可以通过命令和回春之球两种方式使用该功能,因此玩家不一定需要回春之球,但仍可以使用它。
对于管理员,此游戏规则无效:他们可以无限制地使用命令和回春之球。
宠物与拴绳生物
现在你拥有了酷炫的传送命令,但如果你有一只猫或狗,它们会留在你传送前的位置。哦不!但别担心,因为宠物可以跟随你一起传送,拴绳的生物也可以。默认情况下,拴绳的生物可以跨维度传送,而宠物只能在同一维度内传送。这可以通过游戏规则进行配置:
/gamerule teleportPets off|dimension|interdimensional(默认值为 dimension)设置宠物如何跟随玩家传送。
/gamerule teleportLeashedMobs off|dimension|interdimensional(默认值为 interdimensional)设置拴绳生物如何跟随玩家传送。
这两个游戏规则遵循相同的原理:
off 完全禁用该功能。
dimension 允许仅在相同维度内传送动物,不能传送到不同的维度。
interdimensional 允许将动物传送到其他维度。
客户端特性
目前,客户端特性并不多。
家园钥匙
你可以绑定按键来设置并传送至你的主家园。
计划中的特性
- 家园管理器:一个可视化界面,显示你的家园列表,你可以在此管理它们。
- 下界锚传送:允许玩家使用指南针右键点击以传送至其关联的下界锚。
许可证
Copyright (C) 2023 Runefox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Samū's Commands (ModID: rfx-cmd)
A small mod for Minecraft 1.20.x that adds several small little gameplay features. The mod is made for Fabric and requires the Fabric API.
The mod has both client and server features, but operates in such a way that clients don't need to have the mod if the server has it, and vice versa. The mod mostly adds some commands and is most useful on the server, but the client adds some neat little features as well (especially if the server has the mod too).
Server Features
All commands and gamerules listed here are automatically shared with all clients, so all players have access to this whether they have the mod or not.
Homes
The mod adds the well known /home and /sethome commands. You have a main home which you can use by calling the base commands with no extra name. You can add more homes under names by calling the commands with a specific name.
/home (alias /h) teleports where you last called /sethome
/sethome (alias /sh) sets your home to the current location
/delhome deletes your home
/gethome (alias /gh) gets your home's coordinates, or just whether you have the home when the gamerule reducedDebugInfo is set to true
/homes lists your homes, and coordinates if gamerules allow
/clearhomes removes all your named homes, except your main one
/clearhomes true removes all your homes, including your main one
Homes can be controlled by gamerules:
/gamerule allowHomeTp true|false (default true) enables or disables all home commands. When false, only operators have access to home commands. This gamerule is also not effective to players with cheats enabled in singleplayer worlds.
/gamerule maxHomes <nr> (default 0) sets the maximum amount of homes a player can have, whether that is a named home or a main home. The value 0 disables the limit. If a player has more homes, they must first remove homes before they can set more homes. If a player has exactly this amount of homes, they can only overwrite existing homes. This command only affects /sethome, players that have more homes than this gamerule allows can still teleport to any of those. Admins and players with cheats enabled can make more homes.
Homes work from any distance and through different dimensions. A home set in the Nether allows players in the Overworld to teleport to that home in the Nether instantly.
A useful feature: home names can be clicked in the chat and it will suggest either a /home or /sethome command based on whether the home existed when it was printed or not.
Spawn teleportation
The mod adds a simple command to let players teleport to the world spawn point in the Overworld.
This behaviour can be enabled or disabled with a gamerule:
/gamerule allowSpawnTp true|false (default true) enables or disables the /spawn command.
Teleportation Requests
The mod adds the well known /tpa system, to send teleportation requests to players. It is controlled using a set of commands:
/tpa <player> sends a teleportation request to <player>. If they accept it, you will be teleported to them.
/tpc <player> sends a teleportation call to <player>. If they accept it, they will be teleported to you.
/tpaccept accepts the last received teleportation request
/tpaccept <player> accepts a teleportation request from <player>
/tpaccept * accepts all teleportation requests and calls, use wisely since this may cause quite some chaos if you received a lot of requests and calls
/tpdeny denies the last received teleportation request
/tpdeny <player> denies a teleportation request from <player>
/tpdeny * denies all teleportation requests
You can control who can send you requests using a blacklist and a whitelist. The whitelist is by default disabled but can be enabled. If the whitelist is enabled, nobody can send you a request unless they're whitelisted. Blacklisted players can never send you a request even if they're whitelisted. If the whitelist is disabled, everyone except those in your blacklist can request.
/tpblacklist add <player> (alias /tpbl add <player>) adds a player to your TP blacklist
/tpblacklist remove <player> (alias /tpbl remove <player>) removes a player from your TP blacklist
/tpwhitelist add <player> (alias /tpwl add <player>) adds a player to your TP whitelist
/tpwhitelist remove <player> (alias /tpwl remove <player>) removes a player from your TP whitelist
/tpwhitelist enable (alias /tpwl enable) enables your whitelist, blocking everyone unless they're whitelisted
/tpwhitelist disable (alias /tpwl disable) disables your whitelist, blocking nobody unless they're blacklisted
/tpwhitelist toggle (alias /tpwl toggle) toggles your whitelist, enabling it if it is disabled and disabling it if it is enabled
Teleportation requests can be controlled with several gamerules:
/gamerule allowTpa true|false (default true) enables or disables all teleportation request commands for everyone, even admins and players with cheats (they have the regular /tp command after all, and players could not accept otherwise).
/gamerule tpaRequestTimeout 1..3600 (default 300) defines, in seconds, the amount of time before a teleportation request expires. A request must be accepted within this timeframe, otherwise it will be denied silently (with no message to source or target).
/gamerule tpaRequestSameTeam true|false (default false) sets whether teleportation requests may only be sent to players in the same team. This also considers players that are not in a team to be in a single "not in a team"-team so they can still send requests to eachother. If disabled, everyone can send requests to everyone.
/gamerule tpaMode tpa|tpc|both (default both) sets in which direction players may teleport eachother. If set to tpa, players may only teleport themselves to others (i.e. they can use /tpa). If set to tpc, players may only teleport others to themselves (i.e. they can use /tpc). If set to both, players may do both (i.e. they can use /tpa and /tpc).
Personal Notes
Players can write small notes for themselves, which are stored per world (on the server's side). Notes are stored a bunch of lines which the player may edit, move, remove and add to freely.
/notes add <note> (alias /note <note>) adds a new note with the given text
/notes edit <ln> <note> edits the note at line <ln> and replaces the text with the given text
/notes remove all removes all notes
/notes remove <ln> removes one specific note
/notes remove <from> <to> removes a range of notes
/notes move <from> <to> moves a note from one line to another
/notes last (alias /note) shows the note at the last line number
/notes last <nr> shows the notes at the last <nr> line numbers
/notes get all (alias /notes) lists all notes
/notes get <ln> lists one specific note
/notes get <from> <to> lists a range of notes
Notes allow the interpolation of some simple data points such as your coordinates or your dimension, if the gamerule reducedDebugInfo is set to false. Each of these insert the specific information at the location where they were put in the note. They are meant to make it easier to insert some information from the debug screen in your notes.
{xyz} (alias {pos}, {coords}) inserts your coordinates in the world
{xz} inserts your X and Z coordinates in the world
{x} inserts your X coordinate in the world
{y} inserts your Y coordinate in the world
{z} inserts your Z coordinate in the world
{dimension} (alias {dim}) inserts the dimension ID of the dimension you're in
Since notes are stored on the server side in the player data, a gamerule exists to limit the amount of notes per player in order to limit memory usage per player. Notes have a hardcoded length limit of 1024 characters, but the amount of notes per player is configurable.
/gamerule maxNotes 1..4096 (default 1024) sets the maximum amount of notes a player can have. Changing it will not immediately remove notes from players.
A useful feature: note lines printed in chat can be clicked upon to copy a note line to the clipboard.
Points of interests
In addition to the home commands, the mod provides points of interests, which are like homes shared across all players. Unless configured otherwise, only admins can set these. All players can teleport to them by default. All commands targeting a single POI can have an optional name as argument to set a named POI. The main POI has no name and must be referred to by not providing the name.
/poi teleports to a POI set by /setpoi
/setpoi sets a POI to the current location
/delpoi deletes a POI
/getpoi gets a POI's coordinates, or just whether the POI exists when the gamerule reducedDebugInfo is set to true
/pois lists all POIs, and their coordinates if gamerules allow
/clearpois removes all named POIs, it keeps the main one
/clearpois true removes all POIs, including the main one
Points of interest can be controlled by gamerules:
/gamerule allowPoi true|false (default true) enables or disables all POI commands. When false, only operators have access to POI commands. This gamerule is also not effective to players with cheats enabled in singleplayer worlds.
/gamerule allCanSetPoi true|false (default false) enables or disables POI modification commands. When false, only operators can change, add and remove POIs. When true, all players can edit POIs.
/gamerule hidePoiInfo true|false (default false) enables or disables POI querying commands. When false, only operators have access to the POI query commands (/pois, /getpoi). This does not disable the /poi teleportation command.
POIs, like homes, work from any distance and through different dimensions. A POI set in the Nether allows players in the Overworld to teleport to that POI in the Nether instantly.
Last death
The mod has a feature to teleport players to where they last died. This can be done in two ways:
- Using
/death
- By clicking with a recovery compass (which requires players to obtain such a compass)
A gamerule can control this ability:
-
/gamerule deathTp off|command|compass|both (default compass) sets how the player can teleport to where they last died.
- When
off, the feature is disabled.
- When
command, the feature is accessible through commands only, and players don't need a recovery compass.
- When
compass, the feature is accessible through the recovery compass only.
- When
both, the feature is accessible through both the command and the recovery compass, so players don't necessarily need a recovery compass but they can still use it.
For operators, this gamerule has no effect: they can use the command and the recovery compass limitlessly.
Pets and Leashed Mobs
Now you have your fancy teleport commands, but you have a cat or dog and it will stay behind at the place you teleported from. Oh no! But fear no more, because pets can teleport with you, and so can leashed mobs. By default, leashed mobs can teleport through dimensions, and pets only in the same dimension. This can be configured with game rules:
/gamerule teleportPets off|dimension|interdimensional (default dimension) sets how pets teleport with the player.
/gamerule teleportLeashedMobs off|dimension|interdimensional (default interdimensional) sets how leashed mobs teleport with the player.
Both gamerules follow the same principles:
off disables the feature entirely.
dimension allows teleporting the animals only through the same dimension, not to different dimensions.
interdimensional allows teleporting the animals to other dimensions.
Client Features
Currently, not much client features exist.
Home Keys
You can bind keys to set and teleport to your main home.
Planned Features
- A home manager: a visual interface showing your homes where you can manage them.
- Lodestone teleportation: allows players to click with a lode compass to teleport to the lodestone it's associated with.
License
Copyright (C) 2023 Runefox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
评论 0
登录后参与评分
还没有评论,来抢沙发吧