Rules for equip spawning
EzerArch opened this issue ยท 2 comments
Mobs spawn with assorted armors: each body part with a piece from a different set. I was thinking of rules for equipped mob spawning, but I wouldn't want something complicated (poor @RiskyKen :<). I want to keep it as simple as possible.
That's my idea: using folders to set the rules.
- Currently the mod randomly picks any item in the target library path. Let it be so.
- If the first pick is a .armour file, the next pick should also be a .armour file until the mod is done equipping the mob.
- But if first pick is a folder, the mod will use the .armour files only within that folder.
Example: I have S:enitiySpawnSkinTargetPath=spawn/
in the config and this is the folder structure.
๐ spawn
- ๐ Biker Helmet.armour
- ๐ Mekanism Boots.armour
- ๐ Diving
-- ๐ Diving Fins.armour
-- ๐ Diving Tank with Life Jacket.armour
-- ๐ Diving Mask.armour
etc
If the mod picks ๐ Biker Helmet.armour
, the next pick ought to be ๐ Mekanism Boots.armour
.
If the mod picks ๐ Diving
, the mod will pick the .armour files within. If here are 2 or 3 head armor pieces, the pick will be also random.
~Plot twist
Say, I want something specific: a certain armor set should used only on Skeletons (entity.skeleton
) in the Nether (DIM-1
). I could use the IDs as folder names to set a restriction rule, which makes an armor piece/set specific to a certain dim/mob.
๐ spawn
- ๐ DIM-1
-- ๐ entity.skeleton
--- ๐ Hellish set
---- ๐ Hellish head.armour
---- ๐ Hellish torso.armour
---- ๐ Hellish boots.armour
This means that the ๐ Hellish set
can be used only by Skeletons in the Nether, not the other way around, so that the mod doesn't need to scan every file/directory to find the matching criteria.
This is the workflow:
- Mob spawns.
- Mod picks an item in ๐ spawn
: is it a file or folder?
-- file: use it.
-- folder: does its name match DIM*
or entity.*
patterns?
--- then: does it match the current dimension/mob ID?
---- then: use files/folders within.
---- else: skip. It belongs to a different dim/mob.
--- else: use files/folders within.
Implemented by kubejs
Posted this on Discord the other day. I think using this for the set spawning will be better. https://cdn.discordapp.com/attachments/322871899497431040/535897922546434048/2019-01-18_19-04-36.mp4 1.12 should be public soon I will see about adding some of the other options for then.