每日奖励 GUI:
玩家使用 /daily 命令打开一个精美的库存 GUI,显示他们的每日奖励进度。每一天都由一个彩色面板表示:
绿色面板:
奖励已被领取或当前可领取。
红色面板:
奖励被锁定或已错过(连击重置)。
可配置的奖励:
在 config.yml 中使用简单的语法轻松定义每天的奖励。可以添加任意天数的奖励!
冷却系统:
奖励在可配置的冷却期后解锁(默认 24 小时)。玩家必须在下一个奖励解锁前领取奖励,否则连击将重置。
权限支持:
通过 daily.use 权限控制访问(默认授予所有玩家)。
健壮的领取逻辑:
防止在冷却期内重复领取,在不活跃时重置连击,并在最后一天后自动循环奖励。
命令
/daily
描述:打开每日奖励 GUI。
用法:/daily
权限:daily.use(默认:所有玩家为 true)
行为:
打开一个显示所有奖励天的库存 GUI。
绿色面板表示已领取或可领取的奖励。
红色面板表示被锁定或错过的奖励。
玩家可以点击当前可领取天的绿色面板以获取奖励。
配置 (config.yml)
yaml
在下一个奖励解锁之前必须经过多少秒(默认 86400 = 24 小时)
claim_cooldown_seconds: 86400
每天的奖励。格式:MATERIAL_NAME(数量)
rewards:
day1: "DIAMOND_SWORD (1)"
day2: "EMERALD (3)"
day3: "GOLDEN_APPLE (2)"
day4: "DIAMOND (2)"
通过编辑 rewards 部分来添加或删除天数。
使用有效的大写 Minecraft 材质名称。
数量必须是正整数。
数据持久化
玩家的领取数据保存在插件文件夹内的 data.yml 中。
按玩家 UUID 存储的数据包括:
上次领取时间戳(纪元秒)
当前连击天数
工作原理
打开 GUI:
当玩家运行 /daily 时,插件加载其领取数据和冷却状态。它构建一个每个奖励天一个面板的 GUI。
面板颜色:
绿色:已领取的天数或当前可领取的天数。
红色:被锁定的天数,或者如果玩家未能及时领取(连击重置)。
领取奖励:
点击当前可领取天的绿色面板会发放配置的奖励,更新玩家的上次领取时间和连击天数,并关闭 GUI。
冷却与连击重置:
玩家必须在两次领取之间等待配置的冷却时间。如果他们未能在下一个奖励解锁前领取(超过两倍的冷却时间),他们的连击将重置为第 1 天。
奖励循环:
在最后一个配置的天数之后,连击会自动重置为第 1 天。
权限
daily.use
允许使用 /daily 命令
true
支持
如需提交错误报告、功能请求或其他任何问题,请加入我们的 Discord!
Daily Reward GUI:
Players use the /daily command to open a sleek inventory GUI showing their daily reward progress. Each day is represented by a colored pane:
Green Pane:
Reward already claimed or currently claimable.
Red Pane:
Reward locked or missed (streak reset).
Configurable Rewards:
Easily define rewards per day in the config.yml using simple syntax. Add as many days as you want!
Cooldown System:
Rewards unlock after a configurable cooldown period (default 24 hours). Players must claim their reward before the next one unlocks or their streak resets.
Permission Support:
Control access with the daily.use permission (granted to all players by default).
Robust Claiming Logic:
Prevents multiple claims within cooldown, resets streaks on inactivity, and automatically cycles rewards after the last day.
Commands
/daily
Description: Opens the daily rewards GUI.
Usage: /daily
Permission: daily.use (default: true for all players)
Behavior:
Opens an inventory GUI showing all reward days.
Green panes indicate claimed or claimable rewards.
Red panes indicate locked or missed rewards.
Players can click the green pane for the current claimable day to receive their reward.
Configuration (config.yml)
yaml
How many seconds must pass before the next reward unlocks (default 86400 = 24 hours)
claim_cooldown_seconds: 86400
Rewards per day. Format: MATERIAL_NAME (amount)
rewards:
day1: "DIAMOND_SWORD (1)"
day2: "EMERALD (3)"
day3: "GOLDEN_APPLE (2)"
day4: "DIAMOND (2)"
Add or remove days by editing the rewards section.
Use valid Minecraft material names in uppercase.
Amount must be a positive integer.
Data Persistence
Player claim data is saved in data.yml inside the plugin folder.
Data stored per player UUID includes:
Last claim timestamp (epoch seconds)
Current streak day
How It Works
Opening the GUI:
When a player runs /daily, the plugin loads their claim data and cooldown status. It builds a GUI with one pane per reward day.
Pane Colors:
Green: Days already claimed or the current claimable day.
Red: Locked days or if the player missed claiming in time (streak reset).
Claiming Rewards:
Clicking the green pane for the current claimable day grants the configured reward, updates the player's last claim time and streak day, and closes the GUI.
Cooldown & Streak Reset:
Players must wait the configured cooldown between claims. If they miss claiming before the next reward unlocks (more than twice the cooldown passes), their streak resets to Day 1.
Reward Cycle:
After the last configured day, the streak resets to Day 1 automatically.
Permissions
daily.use
Allows use of /daily command
true
Support
For bug reports, feature requests, and anything else please join our discord!
评论 0
登录后参与评分
还没有评论,来抢沙发吧