ForgeEvents.onEvent('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 } } = event
let { originalTarget, newTarget } = event
//returning if the original target is not a player
if (newTarget.id == "hordes:zombie_player")
{
event.setCanceled(true)
}
}
Hi people, I wonder does ForgeEvents.onEvent do they exists in 1.18.2 as well? I found a script that I needed but it only exists in 1.19.2, so wondering those syntax is there a way to convert them or anyone could help out?
Essentially I want all the mobs ignore the zombie player because of a bug I am trying to fix.

