Platform: Minecraft Java 26.3, Fabric Purpose: Limit the entire server to a maximum of 2 maces.
- Mace limit
- Maximum of 2 maces across the entire server.
- Players cannot craft a third mace if two already exist.
- Applies to both survival and creative crafting.
- If a mace is destroyed, another can be crafted.
2. Where maces count The mod must count maces in:
- Player inventories.
- Normal chests and trapped chests.
- Barrels.
- Shulker boxes.
- Dropped items on the ground.
- Other storage containers.
3. Ender Chest restriction
- Players cannot put maces into Ender Chests.
- This applies to every mace, including ones obtained through /give.
4. /give command
- /give is allowed to create additional maces.
- These maces still count towards the global limit.
- /give does not bypass the Ender Chest restriction.
5. Persistence
- The mace count must survive server restarts.
- The mod must account for maces in unloaded chunks.
- Moving maces between containers must not accidentally create extra available slots.
6. Installation
- Server-side Fabric mod.
- Players do not need to install it on their clients.
- Delivered as a .jar file.
Mod name: MaceLimit
Build persistent server-wide mace counting that survives restarts and unloaded chunks.
Block crafting past two, while allowing
/giveto create counted maces.Prevent mace insertion into Ender Chests and package this as a server-side Fabric mod.
Implemented MaceLimit as a server-side Fabric 26.3 mod. Players don’t need it on their clients. It blocks taking a crafted mace when two are already counted, including in creative, and blocks putting maces into Ender Chests. /give remains allowed; given maces are counted.
Counts cover player inventories, Ender Chests, loaded block and entity containers, and dropped items. Per-chunk and per-player counts persist across unloads and restarts. Existing-world caveat: a chunk containing maces that has never loaded since the mod was installed won’t be indexed until it loads.
To get the jar: click Compile in the top bar (or ⋮ → Compile Project on phone), click Compile in the window, then Download on the successful build.
package com.kodari.macelimit;
import net.fabricmc.api.ModInitializer;
public class MaceLimit implements ModInitializer {
public static final String MOD_ID = "macelimit";
@Override
public void onInitialize() {
MaceLimitTracker.initialize();
}
}