Removed: /eldritch awakening for having no content and crashing /vita craftis for spawning too many blood pigs and no spawnrules, as well as very little content and lazy instakill mob /dweller ores has been replaced by a far superior deeplings mod with actually scary mobs that have drops and a boss /defilex3dsun because the shader overrides this added: /Chatgpt garbage kubejs script that doesn't work but I've learned how to make it work in the next push /elytra slot /cosmetic armor reworked /voidscape, new bedrock based dimension accessible by standing on bedrock for too long or something like that. Modified: /sodiumdynamiclights and enhanced_bes because they were drawing performance despite being overriden by the shader. also the enhanced block entity mod was causing severe lag rendering large quantities of create contraptions with chests that spawned naturally.
56 lines
1.7 KiB
JavaScript
56 lines
1.7 KiB
JavaScript
// priority: 0
|
|
/*
|
|
// Visit the wiki for more info - https://kubejs.com/
|
|
EntityEvents.entityCheckSpawn(event => {
|
|
const { entity, level, pos, spawnReason } = event;
|
|
|
|
// Only apply restrictions to natural spawns
|
|
if (spawnReason !== 'natural') return;
|
|
|
|
const spawnRules = {
|
|
'minecraft:creeper': {
|
|
dimensions: ['minecraft:the_nether'],
|
|
blockWhitelist: ['minecraft:netherrack'],
|
|
minLight: 0,
|
|
maxLight: 14,
|
|
timeRange: [0, 24000] // Night
|
|
},
|
|
'minecraft:enderman': {
|
|
dimensions: ['minecraft:overworld'],
|
|
blockWhitelist: ['minecraft:grass_block'],
|
|
minLight: 0,
|
|
maxLight: 7,
|
|
timeRange: [12000, 24000] // Late dusk/night
|
|
}
|
|
};
|
|
|
|
const rule = spawnRules[entity.type];
|
|
if (!rule) return; // No restrictions
|
|
|
|
const dimMatch = rule.dimensions.includes(level.dimension);
|
|
const blockBelow = level.getBlock(pos.down()).id;
|
|
const blockMatch = rule.blockWhitelist.includes(blockBelow);
|
|
const light = level.getRawBrightness(pos);
|
|
const lightMatch = light >= rule.minLight && light <= rule.maxLight;
|
|
const timeOfDay = level.dayTime % 24000;
|
|
const timeMatch = timeOfDay >= rule.timeRange[0] && timeOfDay <= rule.timeRange[1];
|
|
|
|
if (!(dimMatch && blockMatch && lightMatch && timeMatch)) {
|
|
event.cancel();
|
|
}
|
|
});
|
|
|
|
EntityEvents.removeSpawn(event => {
|
|
event.remove('minecraft:overworld', 'minecraft:creeper');
|
|
event.remove('minecraft:the_end', 'minecraft:enderman');
|
|
}); GPT GARBAGE
|
|
*/
|
|
|
|
/*
|
|
@silytonta
|
|
Is there a way for me to make mobs spawn in a dimension/biome that they usually dont?
|
|
|
|
@dob3a
|
|
yea, u can use "entity.block.biomeId" to get their current biome, and u can use "entity.level.name" to get their current dimension.
|
|
|
|
sry for late reply i didnt see the notify*/ |