How to naturally spawn custom mobs?

2 emeralds4 replies179 views
Peakstep started 03/31/2020 10:09 pm
GParcade replied 04/04/2020 6:49 am
I'm creating a new mob for my datapack, but I want it to naturally spawn.
How can I do this? pls help
Sorry about my poor English. I'm a Chinese.
Posted by avatar
Level 16 : Journeyman Modder

comment Login or register to post a reply.

4 replies

04/04/2020 6:49 amhistory
Level 18 : Journeyman Explorer
You can use tags to find new mobs, it is desirable that this mob is the same as your modified one and change it NBT to yours, this is the most optimal way in view of its compactness and low load. If you are going to use all entities then do as Galdevear.

"/summon" heavier than hundred commands
03/31/2020 10:56 pm
Level 1 : New Crafter
You can leach off of the current mob spawning system. What you want to do is tag new mobs when they spawn so you know which ones are new. You can test for this tag to make sure you don't process the mobs a second time. Then, (using loot tables so you can add random chance) summon a mob at the location of the newly spawned mob. Make sure you use a loot table to keep this from happening every time. You don't want to double the number of mobs. Optionally, you can kill the original mob after doing this to swap them out, but then you would need to either edit the nbt to keep a said entity from dropping the loot, or change the loot tables of every entity you do this with to check for a tag which tells it not to drop anything. Do not use the first option due to the resource impact of editing nbt. The third option would be to teleport the mob you want to swap out directly into the void so you kill it without ending up with drops, but I have yet to test the performance impact of this option. For now, I suggest you just leave the original entity, but eventually, you will want to do it properly by editing the loot tables. Keep in mind that you don't want to inflate the overall entity count too much, as this will slow down performance. This is why I suggested getting rid of the original entity

Furthermore, I suggest you split passive and hostile mobs into two tags which you can test for. These two groups have drastically different spawning patterns from each other and you will want to pick carefully.

As you can tell, I've spent the last nine or so months of my life studying this stuff XD.

Feel free to pick my brain.
03/31/2020 11:33 pm
Level 16 : Journeyman Modder
I'll try later!
03/31/2020 10:49 pm
Level 29 : Expert Unicorn
Find a random mob/same type of actual mob and replace it with the custom mob
Planet Minecraft Logo


© 2010 - 2020