#How to make Naturally Spawning mobs

1 messages · Page 1 of 1 (latest)

short shuttle
#

Hello, I've made a Datapack with Naturally spawning mobs, but it isn't working.
I uploaded my Datapack to PMC, so people can download what I've made and help me with the code.
Please help guys, I don't understand what I've done wrong.
https://www.planetminecraft.com/data-pack/op-items-minecraft-broken/

pearl turretBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

fluid harness
#

I'm not going to download your data pack to help you. If you'd like assistance, you can describe what you currently have implemented and what you expect it to do, what it's doing instead, and what you've tried to fix it

short shuttle
#

I have a function with this:


kill @s

scoreboard players reset @s zombieCount```

**I have a load with this:**

```scoreboard objectives add zombieCount dummy```

**And a tick with this**

```execute as @e[type=minecraft:zombie] run scoreboard players add @s zombieCount 1```

**Idk if you can help me, or if any of this makes sense, but I also don't know what I did wrong**
fluid harness
#

Can you put those in code blocks, by putting ``` before and after each section of code?

#

Also, can you please answer the questions I asked instead of only throwing code in my face?

short shuttle
short shuttle
fluid harness
#

Ok. What is running that first function you shared?

short shuttle
#

It instead just kills every one of the mob and then replaces it at some random coords, the mob is then in a loop of dying

short shuttle
fluid harness
#

Ok, and what is running that?

#

Also, please share that

#

@short shuttle

short shuttle
#

I forgot to add that in the tick there's a function that executes the summon function upon reaching the cap

fluid harness
#

Show your work

short shuttle
#

execute as @e[type=minecraft:zombie,scores={zombieCount=11}] run function crafting:tank_zombie

#

It is right under the main thing in the tick

fluid harness
#

Alright, so if I am understanding right, what you want to be happening is that when there are 11 zombies anywhere in the world, one of them becomes a tank zombie. Is that accurate?

short shuttle
#

Yes

fluid harness
#

Ok, yeah that's not at all what you have here

#

Instead, what you're currently doing is having every zombie in the world wait 11 ticks, and then become a tank zombie

short shuttle
#

ohhhhhhh

#

How do I fix that then

fluid harness
#

What you need to do instead, is in your tick function (or, for better performance, in a scheduled function, but I digress), do this command:
execute store result score fake_player zombieCount if entity @e[type=zombie,tag=!tank_zomie]
This assumes your tank zombie has a tank_zombie tag. If it doesn't, I recommend add it or some similar tag to be able to identify, and importantly, exclude it.

Then, in that same function, have this command:
execute if score fake_player zombieCount matches 11.. run function crafting:<new function>

crafting:<new function> should then have:

execute as @e[type=zombie,tag=!tank_zombie,limit=1,sort=random] at @s run function crafting:tank_zombie```
#

I am on mobile so perfect syntax is not guaranteed

short shuttle
#

Thanks

#

Is there any way I can credit you

fluid harness
#

Don't worry about it, we're here to help

short shuttle
#

Nice

pearl turretBOT
# pearl turret <@&1201956957406109788>
Question Closed

Your question, #1244046303126753352 (How to make Naturally Spawning mobs), was resolved!

Original Message

#1244046303126753352 message

Duration open

30m

pearl turretBOT
#
🗑️ Recycling Thread

This thread has been inactive for some time, so I'm going to archive it.

If you're still using the thread, just send a message and it'll pop back on the thread list.