Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make a zombie spawn for a baby with a certain probability after killing a zombie, minecraft v 1.20.1 #449

Open
KejinX opened this issue Oct 3, 2024 · 0 comments

Comments

@KejinX
Copy link

KejinX commented Oct 3, 2024

This is a test script after killing a cow a zombie appears, it works fine, but I don't know how to add a nbt tag so that instead of a regular zombie a baby zombie spawns:
[
{
"on": "mob_killed",
"parameters": {
"mob": "minecraft:cow",
"player": true,
"helditem": ["minecraft:wooden_sword", "minecraft:stone_sword", "minecraft:iron_sword", "minecraft:golden_sword", "minecraft:diamond_sword", "minecraft:netherite_sword"]
},
"conditions": {
"dimension": "minecraft:overworld",
"random": 0.3
},
"spawn": {
"mob": "minecraft:zombie",
"mindistance": 1,
"maxdistance": 1,
"mincount": 0,
"maxcount": 1,
"attempts": 20
}
}
]
Although after several attempts to add the nbt tag to this script, I seemed to have succeeded and after killing the zombies, the babies began to spawn, but I just need them to spawn with a complete replacement of the regular zombie.
Here is my attempt to add the nbt tag:
[
{
"on": "mob_killed",
"parameters": {
"mob": "minecraft:cow",
"player": true,
"helditem": ["minecraft:wooden_sword", "minecraft:stone_sword", "minecraft:iron_sword", "minecraft:golden_sword", "minecraft:diamond_sword", "minecraft:netherite_sword"]
},
"conditions": {
"dimension": "minecraft:overworld",
"random": 0.3
},
"spawn": {
"mob": "minecraft:zombie",
"nbt": {
"tag":"IsBaby",
"contains":"1"
},
"mindistance": 1,
"maxdistance": 1,
"mincount": 0,
"maxcount": 1,
"attempts": 20
}
}
]
And I would also like to know how to prevent a child zombie from turning into another zombie.
Don't judge me too harshly, I don't understand codes and scripts very well, I'm learning in the process what and how to do....

@KejinX KejinX changed the title How to make a zombie spawn for a baby with a certain probability after killing a zombie How to make a zombie spawn for a baby with a certain probability after killing a zombie, minecraft v 1.20.1 Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant