#how i can make zombie have infinite invisibility

1 messages · Page 1 of 1 (latest)

severe temple
#

I have such a problem my datapack for 1.21.1 make a new mob,base is zombie and the model of mob is pumpkin,i need to make my zombie to have infinite invisibility i have sketched my script and i will paste it here

execute at @s run summon minecraft:zombie ~ ~ ~ {PersistenceRequired:1b,Silent:1b,Health:30f,CustomNameVisible:0b,active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:-1,show_particles:0b}],Attributes:[{id:"minecraft:generic.max_health",base:30.0},{id:"minecraft:generic.attack_damage",base:5.0},{id:"minecraft:generic.movement_speed",base:0.28}],ArmorItems:[{},{},{},{id:"minecraft:carved_pumpkin",count:1,components:{"minecraft:custom_model_data":666001}}],HandItems:[{id:"minecraft:iron_sword",count:1},{}],ArmorDropChances:[0.0f,0.0f,0.0f,0.0f],Tags:["devil_mob"],DeathLootTable:"devil:entities/devil"}

slender stone
#

I don't understand the problem. You have your invisibility duration set to -1, which is infinite. In what way is this not working?

severe temple
#

i can show screenshot where it doesnt work

worn fog
#

strange, it should work

#

you can try to use execute summon instead

#

and then use the effect command

#

but above should do the trick already, it could be some race condition artifact

#

hard to tell, might be worth a bug report.

slender stone
#

Could be a mod conflict

severe temple
slender stone
#

Okay

rose hill
worn fog
#

ah you are right, well you can still try to call the effect command on the special zombie after it is summoned

rose hill
#

So you just can summon the mob with special tag, and in tick function just give the invisibility effect to it

rose hill
#

Or like that

#

Actually your method is more efficient

slender stone
rose hill
slender stone
#

What?

rose hill
# slender stone What?

Like, instead of summoning the mob with the effect and then adding the NBT to it it would (i think) easier to summon the mob with the NBT and after that just adding the effect to it

#

But everyone have their methods

slender stone
#

Yes, you can do that with execute summon as well of course