ItemOfTheDay
一款轻量级的 Minecraft Paper 服务器插件,允许玩家每天交换不同的物品以获得奖励。服务器管理员可以设置或随机更换每日物品(IOTD),设置当前每日物品的奖励,并设置默认奖励;当日期变更或 IOTD 被随机更换时,奖励将恢复为默认值。
v1.0.1 更新内容
- 新增
/iotd list-claimed 命令,供服务器管理员查看今日已领取奖励的玩家
- 修复了一些小问题
要求
服务器必须安装 Paper。目前支持的 Paper 版本包括基于 Minecraft 1.21.11 至 26.2 构建的稳定版。在 Alpha/Beta 版本的 Paper 上使用本插件的风险和后果由使用者自行承担。
命令
/iotd info:所有玩家可用 - 显示当前每日物品及其对应奖励的信息。
/iotd exchange:所有玩家可用 - 如果玩家主手中持有单个每日物品且尚未在今日进行交换,则将其手中的每日物品替换为当前奖励。
/iotd shuffle:需要管理员权限 - 随机化每日物品并将奖励重置为指定的默认奖励。
/iotd set <item>:需要管理员权限 - 将当前每日物品设置为指定物品,不更改奖励。
/iotd set-reward <reward> <amount>:需要管理员权限 - 将当前奖励设置为指定物品及数量。
/iotd set-default-reward <default-reward> <amount>:需要管理员权限 - 设置默认奖励(当 IOTD 被随机更换时恢复为此奖励)为指定物品及数量。
/iotd list-claimed:需要管理员权限 - 列出所有今日已领取每日物品的玩家。
/iotd reset-claimed:需要管理员权限 - 清除配置文件中记录的所有已完成兑换的玩家列表(UUID)。
配置文件
插件会在 plugins/ItemOfTheDay/config.yml 创建配置文件。配置文件中的所有键值对均可通过命令进行编辑,除了 blacklisted-items(黑名单物品)列表外,因此服务器所有者只需在添加或移除黑名单物品时才需要手动编辑此配置文件。
默认情况下,blacklisted-items 包含所有在生存模式中无法获取的物品。编辑该列表并重启服务器以使黑名单更改生效。
未来更新将支持通过命令动态添加/移除黑名单中的物品。
特性
- 使用
ItemType 注册表来选择和验证物品,因此由模组或插件添加的任何自定义物品默认都会包含在每日物品池中。
- 支持奖励命令的
ItemStack 类型参数,允许服务器管理员使用与原版 /give 命令相同的语法创建独特的自定义奖励。
DateWatcher:一个轻量级类,每 1 分钟(1200 tick)检查一次保存的 LocalDate 以跟踪当前日期。请注意,这是基于服务器刻(ticks)的,如果您的服务器在玩家离线期间不产生刻数,那么在新日期到来时,第一个加入服务器的玩家将在一分钟内触发每日物品的随机更换。
贡献
请在 github.com/timnorthrop/ItemOfTheDay 提交贡献。
ItemOfTheDay
A lightweight Minecraft Paper server plugin that allows players to exchange a different item each day for a reward. Server operators have the ability to set or shuffle the Item of the Day (IOTD), set the reward for the current Item of the Day, and set the default reward, which is reverted back to on date change or when the IOTD is shuffled.
What's New in v1.0.1
- Added the
/iotd list-claimed command for server operators to view who's already claimed today's reward
- Minor fixes
Requirements
Server must have Paper installed. Currently supported versions of Paper include stable builds built for versions 1.21.11 through 26.2 of Minecraft. Use with alpha/beta builds of Paper at your own risk and discretion.
Commands
/iotd info: available to all players - displays info on the current Item of the Day and corresponding reward.
/iotd exchange: available to all players - if the player has a single instance of the IOTD in their main hand and has not already exchanged today, the IOTD in their hand will be replaced with the current reward.
/iotd shuffle: operator required - randomizes the IOTD and resets the reward back to the specified default reward.
/iotd set <item>: operator required - sets the current IOTD to the specified item WITHOUT changing the reward.
/iotd set-reward <reward> <amount>: operator required - sets the current reward to the specified item and amount.
/iotd set-default-reward <default-reward> <amount>: operator required - sets the default reward (reverted to when IOTD is shuffled) to the specified item and amount.
/iotd list-claimed: operator required - lists all the players who've claimed today's IOTD.
/iotd reset-claimed: operator required - clears the config's list of players (UUIDs) who have already exchanged for the IOTD.
Config
The plugin creates a config file at plugins/ItemOfTheDay/config.yml. All key-value pairs found in the config file can be edited through commands except for the list of blacklisted-items, so the only time server owners should have to edit this config file is to add or remove items from the blacklist.
By default, blacklisted-items contains all items which are unobtainable in survival mode. Edit the list and restart the server for blacklist changes to take effect.
Support for adding/removing items to and from the blacklist on the fly with commands will be added in a future update.
Features
- Uses the
ItemType registry to select items from and validate against, so any custom items added by mods or plugins will be included in IOTD by default.
- Supports command arguments of type
ItemStack for the reward commands, allowing server operators to create unique custom rewards using the same syntax as the Vanilla /give command.
DateWatcher: a lightweight class that keeps track of the current date by checking against a saved LocalDate every 1 minute (1200 ticks). Note that this is based on server ticks, so if ticks do not occur when players are offline on your server, the IOTD will be shuffled the first time someone joins on a new date (within a minute).
Contributing
Contribute at github.com/timnorthrop/ItemOfTheDay.
评论 0
登录后参与评分
还没有评论,来抢沙发吧