Initial commit
This commit is contained in:
25
kubejs/startup_scripts/mutation_ignore.js
Normal file
25
kubejs/startup_scripts/mutation_ignore.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// priority: 0
|
||||
|
||||
console.info('Loaded mutation_sickness_check.js')
|
||||
onForgeEvent('net.minecraftforge.event.entity.living.LivingChangeTargetEvent', event => {
|
||||
//set the global changetarget function into here and restart your game once
|
||||
global.changetarget(event)
|
||||
})
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Internal.LivingChangeTargetEvent} event
|
||||
*/
|
||||
global.changetarget = event => {
|
||||
//since this is a global event you can run /kubejs reload startup_scripts to reload whatever is in here without
|
||||
//restarting the entire game!
|
||||
let { entity, entity: { persistentData }, originalTarget, newTarget } = event
|
||||
if (!entity.type.toString().includes("entity.mutationcraft")) return
|
||||
if (newTarget == null) return
|
||||
if (newTarget.type.toString().includes("entity.hordes") ||
|
||||
newTarget.type.toString().includes("zombie") ||
|
||||
newTarget.type.toString().includes("husk") ||
|
||||
newTarget.type.toString().includes("drowned")) {
|
||||
event.setNewTarget(null)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user