Armourer's Workshop

Armourer's Workshop

6M Downloads

Rules for equip spawning

EzerArch opened this issue ยท 2 comments

commented

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.

commented

Implemented by kubejs

commented

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.