I made an evoker that can use a totem of undying, a very simple mob and I want it to have a chance to spawn instead of a normal evoker how do I do it?
Create an account or sign in to comment.
5
3
You have to run a random chance predicate as newly spawned evokes and it it return true turn them into your custom one.
1
Oh ok but how do I do that
2
tick:
execute as @e[type=evoker,tag=!spawned] at @s run function <namespace>:spawn_check
spawn_check:
execute if predicate <namespace>:<random chance predicate> run function <namespace>:spawn
tag @s add spawned
spawn:
<summon custom mob>
tp @s ~ -1000 ~
kill @s
execute as @e[type=evoker,tag=!spawned] at @s run function <namespace>:spawn_check
spawn_check:
execute if predicate <namespace>:<random chance predicate> run function <namespace>:spawn
tag @s add spawned
spawn:
<summon custom mob>
tp @s ~ -1000 ~
kill @s
1
hi, I did exactly what you wrote but for some reason the mob isn't spawning while the functions are loaded, can you maybe check what's wrong
Datapack:www.mediafire.com/file/sszcrgskyzp480i/Default_Datapack_-_Copy.zip/file
Datapack:www.mediafire.com/file/sszcrgskyzp480i/Default_Datapack_-_Copy.zip/file
1
Oh ok thank you for your time