KubeJS PMMO

Core Configuration

Config Events

Configure PMMO's core systems through these server-side events.

Anti-Cheese Configuration

The anti-cheese system prevents XP exploitation through AFK farming and repetitive actions.

PmmoJS.antiCheese((event) => {
event.setAfkCanSubtract(false);
event
.addAfkSetting(EventType.BREAK)
.minTime(600) // 30 seconds before penalties apply
.reduction(0.1) // 10% reduction per half-second
.cooloff(5) // Reduce AFK time by 5 ticks per half-second when not AFK
.tolerance(3.0) // Distance tolerance for AFK detection
.strictTolerance(true) // Consider camera movement
.build();
// Add diminishing returns for repeated actions
event
.addDiminishingSetting(EventType.KILL)
.retention(6000) // 5 minutes before reset
.reduction(0.1) // 10% reduction per repeat
.build();
// Add normalization for extreme XP gains
event
.addNormalizationSetting(EventType.CRAFT)
.retention(1200) // 1 minute tracking
.toleranceFlat(50) // Flat tolerance for small XP
.tolerancePercent(0.2) // 20% tolerance for large XP
.build();
});

Auto Values

Configure automatic XP awards and requirement calculations.

PmmoJS.autoValues((event) => {
// Global settings
event
.setAutoValuesEnabled(true)
.setRaritiesModifier(1.5)
.setHardnessModifier(2.0);
// XP awards
event.addItemXpAward(EventType.CRAFT, "smithing", 25);
event.addBlockXpAward(EventType.BREAK, "mining", 50);
event.addEntityXpAward(EventType.KILL, "combat", 100);
// Remove skills from auto-calculations
event.removeItemXpSkill(EventType.CRAFT, "agility");
// Tool-specific overrides
event.setAxeOverride({
woodcutting: 15,
foraging: 5,
});
// Requirements
event.addItemReq(ReqType.WEAR, "defense", 10);
event.addBlockReq(ReqType.BREAK, "mining", 5);
});

Perks Configuration

Define perks that players unlock at specific skill levels. For some variables, check here

PmmoJS.perksConfig((event) => {
// Add a jump boost perk that increases with agility level
event
.addPerk(EventType.JUMPED, "pmmo:jump_boost", "agility")
.asJumpBoostPerk()
.withMinLevel(10)
.withBase(0.05)
.withPerLevel(0.01)
.withMaxBoost(0.5)
.build();
// Add a damage boost for specific weapons
event
.addPerk(EventType.DEAL_DAMAGE, "pmmo:damage_boost", "combat")
.asDamageBoostPerk()
.forWeapons("minecraft:sword", "minecraft:axe")
.withBase(0.1)
.withPerLevel(0.01)
.withMaxBoost(1.0)
.withCooldown(100)
.build();
// Add a potion effect perk
event
.addPerk(EventType.KILL, "pmmo:regen_effect", "endurance")
.asEffectPerk()
.withEffect("minecraft:regeneration")
.withDuration(200)
.withModifier(0)
.withMinLevel(25)
.withChance(0.15)
.build();
// Clear all perks of a specific type
event.clearPerks(EventType.BLOCK_PLACE);
// Remove a specific perk type
event.removePerkType("pmmo:fireworks");
});

Skills Configuration

Define skills and skill groups.

PmmoJS.skillsConfig((event) => {
event
.addSkill("test")
.withColor(0xa52a2a)
.withIcon(new ResourceLocation("pmmo", "textures/skills/archery.png"))
.withIconSize(32)
.withMaxLevel(100)
.build();
event
.addSkill("combat")
.withColor(0xff0000)
.withUseTotal(true)
.setGroupOf({
swordsmanship: 0.6,
archery: 0.4,
})
.build();
// Use this to remove default Skills.
event.removeDefaultSkill("swiming");
// If you want to modfy them.
const test = SKillHelper.getSkill("test");
event.removeDefaultSkill("test");
event
.addSkill("test")
.withAfkExempt(test.afkExempt())
.withColor(test.color())
.withUseTotal(test.useTotalLevels())
.withIcon(test.icon())
.withIconSize(test.iconSize())
.withDisplayName(test.displayGroupName())
.withMaxLevel(test.maxLevel());
});

Server Configuration

Modify core server settings.

PmmoJS.serverConfig((event) => {
// All config values for server configs with docs.
event
.setCreativeReach(15.0)
.setSalvageBlock("minecraft:anvil")
.setTreasureEnabled(true);
event
.setMaxLevel(100)
.setLossOnDeath(0.1)
.setLoseLevelsOnDeath(false)
.setUseExponentialFormula(true);
event
.setExponentialBaseXp(100)
.setExponentialPowerBase(1.05)
.setExponentialLevelMod(1.15);
event
.setReqEnabled(ReqType.BREAK, true)
.setReqEnabled(ReqType.PLACE, false);
event
.addJumpXp("agility", 0.5)
.addSprintJumpXp("agility", 1.0)
.addSwimmingXp("swimming", 0.2);
event
.addDealDamageXp("minecraft:player", "combat", 5)
.addReceiveDamageXp("minecraft:fall", "endurance", 2);
event.setVeinEnabled(true).setBaseChargeRate(0.5).setBaseChargeCap(1000);
});

Globals Configuration

Define global paths and constants for data access.

PmmoJS.globalsConfig((event) => {
event.addPath("durability", "Damage");
event.addConstant("MAX_SKILL_LEVEL", "100");
event.remove("unused_path");
event.removeConstant("OLD_CONSTANT");
});