PlayerEvents.tick(event => {
let player = event.player;
let world = player.level;
let dimension = world.dimension;
// List of dimensions where the effect should apply
let nerfedDimensions = [
'minecraft:the_nether', // Nether
'aether:dimension', // Aether (if using the Aether mod)
'twilightforest:twilight_forest', // Twilight Forest
'ad_astra:moon', // Moon (Ad Astra mod)
'ad_astra:mars', // Mars (Ad Astra mod)
'ad_astra:mercury', // Mercury (Ad Astra mod)
'ad_astra:venus' // Venus (Ad Astra mod)
];
// Check if the player is in one of the nerfed dimensions
if (nerfedDimensions.includes(dimension.id)) {
player.persistentData.overworld_tools_debuff = true;
} else {
player.persistentData.overworld_tools_debuff = false;
}
});
// Modify the tool properties when used
ItemEvents.modify(event => {
let player = event.entity;
if (!player || !player.persistentData.overworld_tools_debuff) return;
let item = event.item;
let id = item.id;
// List of affected tools and weapons
let nerfedTools = [
'minecraft:iron_sword',
'minecraft:diamond_sword',
'minecraft:netherite_sword',
'minecraft:iron_pickaxe',
'minecraft:diamond_pickaxe',
'minecraft:netherite_pickaxe',
'minecraft:golden_sword', // Optional:I can add more tools/weapons if needed
'minecraft:stone_pickaxe'
];
// Apply nerf to all tools in the affected list
if (nerfedTools.includes(id)) {
event.multipliers.damage = 0.9; // Reduces attack damage by 90%
event.multipliers.miningSpeed = 0.9; // Reduces mining speed by 90%
}
});