R's Experience — Mastery & Equipment Restriction Mod
Version: 1.0-SNAPSHOT (v0.3)
Minecraft: 1.21.1
Loader: Fabric
Requires: Fabric API
📖 Overview
R's Experience adds a Mastery Level system to Minecraft. Every player starts at level 0 and gains mastery experience by killing mobs and using gear. Equipment can be tagged with a required mastery level — if your level is too low, the item will penalize you or even reject you entirely.
Think of it as an RPG-style leveling system: the more you fight and use gear, the stronger equipment you can wield.
⚙️ Core Mechanics
Mastery Levels
- Max level: 30
- XP formula:
100 + current_rank × 50XP per level - Data is persisted via
PersistentState(saved inworld/data/rsexperience_mastery.dat)
Earning XP
| Source | XP |
|---|---|
| Zombie / Skeleton / Spider | 5 |
| Creeper | 8 |
| Enderman | 10 |
| Blaze | 12 |
| Wither Skeleton / Ghast | 10 |
| Shulker | 15 |
| Elder Guardian | 20 |
| Wither / Ender Dragon | 50 |
| Cow / Pig / Sheep | 2 |
| Chicken | 1 |
| Using same-level equipment | +2 per use |
Note: Wearing any equipment above your level blocks all XP gain — including mob kill XP.
⚔️ Equipment Restrictions
Items can be tagged with a required mastery level via NBT:
/give @p minecraft:diamond_sword[custom_data={rs_experience:{rank:10}}]
Penalty Tiers
| Tier | Level Gap | Effect |
|---|---|---|
| None | Player ≥ item level | No penalty |
| Light | Item is 1–3 levels higher | Damage & speed reduced by 10–30% (10% per level) |
| Heavy | Item is 4–6 levels higher | Damage & speed reduced by 40–60% (10% per level) |
| Blocked | Item is 7+ levels higher | Item ejected from inventory — must be appeased! |
Attribute System (v0.3+)
Penalties now use EntityAttributeModifiers instead of potion effects:
- Swords & weapons → ATTACK_DAMAGE + ATTACK_SPEED reduced
- Pickaxes, shovels, hoes → MINING_SPEED reduced (via Mining Fatigue)
- Axes → Both ATTACK_DAMAGE and MINING_SPEED reduced
- No potion particles or icons — clean and compatible with other mods
💀 The "Disdain" System (Item Rejection)
When you try to use an item 7+ levels above your rank, it's Blocked:
What happens:
- Item is ejected from your inventory with a sound (anvil for weapons, shield for armor)
- The item drops on the ground 1 block in front of you
- You receive Blindness + Slowness effects
- The Appease UI appears — a red progress bar with instructions
Appease (Accept) — ✅ Sneak + Look up/down
- Crouch and look up and down repeatedly (accumulate 60° of pitch movement)
- After 3 seconds of particle effects, the item teleports into your inventory
- Costs 10% of your current level's XP
Reject — ❌ Rotate camera 360°
- Turn in a full circle (accumulate 360° of yaw movement)
- The item stays on the ground for 30 seconds
- Any player can sneak-approach the item to restart the appease process
- If rejected a second time, the item is destroyed immediately
- If no one appeases it in 30 seconds, the item vanishes permanently
📋 Commands
| Command | Description | Permission |
|---|---|---|
/mastery |
View your mastery level & XP | Everyone |
/mastery addxp <amount> |
Add mastery XP (cheat) | OP level 2 |
/mastery reload |
Reload config (placeholder) | OP level 2 |
🎨 HUD Features
- Blue XP bar — Replaces the vanilla green XP bar, showing mastery progress
- Level text — Displays
✦ Mastery X级 (current/needed)next to the bar - Tooltip — Items with level requirements show
✦ Requires Mastery Level: X - Appease UI — Red progress bar + instructions when blocked by an item
📁 Mod Structure
src/
├── main/java/.../
│ ├── Rs_experience.java ← Main entry
│ └── mastery/
│ ├── MasteryState.java ← Data persistence
│ ├── MasteryRestrictions.java ← NBT restriction + tier calculation
│ ├── MasteryEvents.java ← Event handling + XP
│ ├── MasteryEffects.java ← Attribute modifier system
│ ├── MasteryXpSources.java ← Mob XP table
│ ├── MasteryCommand.java ← /mastery commands
│ ├── ModEffects.java ← Custom status effect
│ └── AppeaseState.java ← Appease state machine
│
├── client/java/.../
│ ├── Rs_experienceClient.java ← Client entry
│ ├── MasteryHudOverlay.java ← XP bar + appease UI
│ ├── MasteryTooltip.java ← Item tooltip
│ └── mixin/.../
│ └── HideVanillaXpMixin.java ← Hide vanilla XP bar
🔧 Technical Details
- Storage:
world/data/rsexperience_mastery.dat(NBT, one entry per player) - Thread safety:
ConcurrentHashMapfor player data - Attribute modifiers: Temporary modifiers with
EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL - Particle effects:
END_RODparticles rising from item to 5 blocks high (3-second animation) - Sound effects: Anvil land, shield block, enderman teleport, armor stand break, iron door
📜 Changelog
v0.3 — Attribute System & Appease Mechanic
- Removed potion-based penalties; replaced with
EntityAttributeModifiersystem - Added full Appease (讨好) system: sneak + look up/down to accept, 360° turn to reject
- Added 3-second particle animation before item teleports to inventory
- Added re-appease mechanic: any player can reclaim rejected items
- Added Appease UI (red progress bar + instructions)
- XP cost on successful appease (10% of current level)
- Item destruction on second rejection
v0.2 — Tiered Penalties & XP Sources
- Tiered penalty system (30%/60%/Blocked)
- Custom "Disdain" status effect
- Mob kill XP + same-level equipment XP
/mastery addxpcommand
v0.1 — Initial Release
- Basic mastery level system
- NBT-based equipment restrictions
- Blue XP bar HUD
- Item tooltip

