So im currently trying to make a zombie that carries a bomb with himself, which behaves like a creeper, however, i want to enlarge how big the explosion is and what particle it can emite.
The other thing im trying to do is a threshold so that if the mob is at 50% hp, it will give certain buffs:
StartupEvents.registry("entity_type", event => {
// Doom Zombie
const doomZombie = event.create('doom_zombie', 'minecraft:creeper')
doomZombie.mobCategory('monster')
doomZombie.sized(0.6, 1.95)
doomZombie.clientTrackingRange(32)
doomZombie.defaultGoals(true)
doomZombie.setRenderType('translucent')
doomZombie.animationResource(() => 'kubejs:animations/entity/doom_zombie.animation.json')
// idle / walk
doomZombie.addAnimationController('movement', 1, event => {
if (event.entity.animationProcedure && event.entity.animationProcedure !== 'empty') return false
if (event.entity.isMoving()) {
event.thenLoop('animation.doom_zombie.walk')
} else {
event.thenLoop('animation.doom_zombie.idle')
}
return true
})
// play procedure-driven animation
doomZombie.addAnimationController('charge', 1, event => {
if (event.entity.animationProcedure === 'animation.doom_zombie.attack') {
event.thenLoop('animation.doom_zombie.attack')
return true
}
return false
})
doomZombie.setAmbientSound('minecraft:entity.zombie.ambient')
doomZombie.setDeathSound('minecraft:entity.zombie.death')
doomZombie.setHurtSound(() => 'minecraft:entity.zombie.hurt')
// Angry Zombie
const angryZombie = event.create('angry_zombie', 'minecraft:zombie')
angryZombie.mobCategory('monster')
angryZombie.sized(0.6, 1.95)
angryZombie.clientTrackingRange(32)
angryZombie.defaultGoals(true)
angryZombie.setRenderType('cutout')
angryZombie.animationResource(() => 'kubejs:animations/entity/angry_zombie.animation.json')
// idle / walk
angryZombie.addAnimationController('movement', 1, event => {
if (event.entity.animationProcedure && event.entity.animationProcedure !== 'empty') return false
if (event.entity.isMoving()) {
event.thenLoop('animation.angry_zombie.walk')
} else {
event.thenLoop('animation.angry_zombie.idle')
}
return true
})
// attack
angryZombie.addAnimationController('attack', 1, event => {
if (event.entity.swingTime > 0) {
if (event.getController().getAnimationState() === 'STOPPED') {
event.getController().forceAnimationReset()
event.thenPlay('animation.angry_zombie.attack')
}
}
return true
})
angryZombie.setAmbientSound('minecraft:entity.zombie.ambient')
angryZombie.setDeathSound('minecraft:entity.zombie.death')
angryZombie.setHurtSound(() => 'minecraft:entity.zombie.hurt')
})```
EntityJSEvents.modifyEntity(event => {
event.modify("kubejs:angry_zombie", builder => {
builder.tick(zombie => {
if (!zombie || zombie.level().isClientSide()) return
const currentHealth = zombie.getHealth()
const maxHealth = zombie.getMaxHealth()
// If health drops below 50% of max
if (currentHealth <= maxHealth * 0.5) {
zombie.addEffect("minecraft:resistance", 200, 0)
zombie.addEffect("minecraft:strength", 200, 0)
zombie.addEffect("minecraft:speed", 200, 0)
}
})
})
})```
@modest vigil this is what i got right now, cant seem to get it to work


