2025-05-14 12:27:20 -05:00
|
|
|
// priority: 0
|
|
|
|
// Visit the wiki for more info - https://kubejs.com/
|
2025-05-20 15:43:35 -05:00
|
|
|
const dimrule = [
|
|
|
|
['man:managgresive','the_deep_void:deep_void'],
|
|
|
|
['man:manfromthefog','the_deep_void:deep_void'],
|
|
|
|
['man:manfromthefogback','the_deep_void:deep_void'],
|
|
|
|
['man:mftfhang','the_deep_void:deep_void']
|
|
|
|
];
|
|
|
|
EntityEvents.spawned(event => {
|
2025-05-16 13:20:27 -05:00
|
|
|
const { entity } = event;
|
2025-05-20 15:43:35 -05:00
|
|
|
let type = entity.type;
|
2025-05-22 20:20:46 -05:00
|
|
|
if (!dimrule.includes(type)) {return;};
|
2025-05-20 15:43:35 -05:00
|
|
|
const t = findRowWithValue(dimrule, entity.type);
|
|
|
|
let d = dimrule[t][1];
|
|
|
|
if(entity.level.name != d) {event.cancel();};
|
|
|
|
|
2025-05-14 12:27:20 -05:00
|
|
|
});
|
|
|
|
|
2025-05-20 15:43:35 -05:00
|
|
|
function findRowWithValue(matrix, value) {
|
|
|
|
for (let i = 0; i < matrix.length; i++) {
|
|
|
|
if (matrix[i].includes(value)) {
|
|
|
|
return i; // Return the row index if the value is found
|
|
|
|
};
|
|
|
|
};
|
|
|
|
return -1; // Return -1 if the value is not found in any row
|
|
|
|
};
|
2025-05-14 12:27:20 -05:00
|
|
|
/*
|
|
|
|
@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*/
|