Open NJL5390 opened 3 years ago
Are you using "onjoin": true? That's required for helditem to work
That's required for helditem to work
Just tried with that condition and it still didn't work, same situation as before, the armor criteria works but helditem doesn't. That requirement is great to know for the future though, I never knew that was needed!
I need to see your rule file
Here's my Spawn.json file, Spawner.json file and latest log in case you need it: https://gist.github.com/NJL5390/b0c46b8e11b7e2f904ceb7c29fdfd937
This screenshot shows the two mobs on either side of me that were spawned by these spawn rules:
So I found out something important about this issue! The cause of this issue seems to be the criteria: "incontrol"
When I remove that criteria from the spawnrule, the "helditem" condition works as it should but when the "incontrol" condition is present in the spawnrule, "helditem" doesn't work and I get results like in the screenshots above.
Can you show the not working rule containing 'incontrol'?
Yes, This is the one that doesn't work that I have specifically tested with. Anything else utilising "helditem" doesn't work when "incontrol" is also used in the spawnrule, but specifically when the mob would ususally spawn with equipment by default (e.g Wither Skeletons) but those giving armour work just fine.
[ { "mob": ["minecraft:wither_skeleton"], "onjoin": true, "block": "minecraft:nether_bricks", "structure": "minecraft:fortress", "incontrol": true, "helditem": "minecraft:bow", "armorhelmet": "minecraft:netherite_helmet", "armorboots": "minecraft:golden_boots", "result": "allow" } ]
InControl version: 5.1.9 Forge Version: 36.1.32 Minecraft Version: 1.16.5
Hello,
First off, I want to say that I've really enjoyed putting together spawnrules for my modpack and this mod has been a lot of fun to mess around with so thank you for putting so much work into this mod!
Secondly, I've been trying to create some spawnrules in the nether which give mobs such as skeletons, wither skeletons and piglins weapons/ items that are determined by the spawnrules written in the spawn.json file. However it never seems to work no matter what I try. I can give them armour just fine and it never has any problem with that, but it always seems to give them their default item regardless of what the spawnrule says.
For example, this is my attempt at making a spawnrule where zombie piglins and regular piglins spawn with mining helmets (from the mining helmet mod) and holding a golden pickaxe when below y 30 in the nether. However as you can see from the screenshot below, it just gives them a golden sword/ crossbow regardless of what the spawnrule states, same is true with regular piglins.
Something I did notice however is that when baby piglins spawned in, they did have the correct equipment as seen here:
I speculate that it works on the baby ones because they don't have any equipment by default, and what seems to be hindering this spawn condition is Incontrol seems to be unable to override any default equipment that a mob would normally spawn with. This problem isn't limited to piglins as I have made previous attempts to add equipment to wither skeletons and skeletons that spawn in nether fortresses and I was only able to add armour to them and not replace their held item with a different one.
(In these screenshots you can see that I can give them any armour I want to, but I can't change their item. The spawnrule used in these screenshots states that wither skeletons should have bows and skeletons should have stone axes but both just have their default weapons):
If you need any more description or information provided about this issue (such as logs or config files) then let me know and I'd be happy to provide it! I hope this issue can be resolved but if not it's no big deal.
Thanks for the great mods!