Ive been trying to edit the Nbt of an entity and I tried searching on here and couldnt get any of the methods to work. This is my script as of right now.
ForgeEvents.onEvent("net.minecraftforge.event.entity.living.BabyEntitySpawnEvent", event =>{
try {
let mob_whitelist = [
"aether:sheepuff",
"deep_aether:quail",
"aether:phyg",
"aether:moa",
"aether_redux:shimmercow",
"aether:flying_cow",
"aether:aerbunny",
]
event.parentA.mergeNbt("{Age:24000}")
event.parentB.mergeNbt("{Age:24000}")
// this part isnt important to the support ticket, and probably isnt staying anyways.
if (mob_whitelist.indexOf(event.child.type) > -1){
if (JavaMath.random() > 0.10){
console.log("A " + event.child.type + " was removed")
event.setCanceled(true)
return
}
}
} catch(e) {
console.log(e)
}
})

