[REQUEST] InControl compatibility
Xarmat-GitHub opened this issue ยท 5 comments
Description
InControl mod allows custom spawning rules for mobs with JSON. Allowing them to spawn like the modpack creator needs it.
It also allows changes in NBT data after the mob spawn in the game world.
NBT Editing
DDD adds following lines of NBT to mobs based on the config: pastbin nbt ddd
When ingame, nbt can be changed and work properly on a mob (don't refreshing WAILA, but damage works fine).
But when manipulating DDD NBT with InControl, then all DDD NBT values resets (no resistance, only b damage).
Request
It would be great, if InControl NBT editing had the last word when spawning a mob.
This will allow different DDD values based on dimension, biome, x,y,z position, gamestage, etc.
Question
Would this be an option for integration?
If yes, I will provide more informations on this topic (working on this more then 4 hours now and test all sorts of things).
So you're saying in spawn.json, you're doing something like:
nbt: {
ForgeCaps: {
"distinctdamagedescriptions:mobresists": {
<STUFF>
}
}
}
I don't know why that wouldn't work. Can you edit other mod's Forge Capabilities with InControl?
Testing
I pick up "Ice and Fire" mod and start testing.
Here are the ForgeCaps on a Blaze when this mod is installed: https://pastebin.com/kWhM0LRT
Changing "TurnedToStone": INGAME from 0 to 1 turn the entity to stone:
- Now I try to achieve this with InControl without DDD configurations: spawn.json
- Result: Failed
- Next: Delete DDD Configs for "Blaze" mob and try again
- Result: Failed
- Next: Reduce ForgeCaps Script to minimum: https://pastebin.com/G3mNP72Q
- Result: Failed
- Next: testing with mobs that can spawn naturally - Sheep: https://pastebin.com/5nbme05S
- Result: Failed
- Next: testing with different ForgeCaps values ("TicksUntilUnfrozen": 1000, "IsFrozen": 1)
- Result: Failed
- Next. same like 5 but deleting sheep from DDD config
- Result: Failed
- ZombieTest with one DDD FC (fire attack) and deleted DDD config defined: https://pastebin.com/F3aGTxn7
- Result: Failed
Questions that might help:
A. "ForgeCaps" is written in big letters, but other JSON code are always small (writing it small will not help, I test this with DDD)
Result of Testing
It never worked, nit with DDD and nit with IceAndFire.
Then the problem seams that ForgeCaps are not supported by InControl OR get overwritten in spawning process.
The "onjoin" option in InControl fire after mob spawn (to be sure that the changes work, as far I know).
If you dont have any idea, then I will go with this to InControl and hope he is ready to work on the 1.12. version again. : S
Oh my, so much work put into this and my excel... such a shame.
Have to start redesign how I will use mobs to make nice encounter D:
Have also created a ticket on InControl GitHub McJtyMods/InControl#290
Oh, I miss some console informations.
When using this script: https://pastebin.com/5nEjRY1V
Then this warning occur each time a mob spawn:
Server thread/WARN] [distinctdamagedescriptions]: [DISTINCT DAMAGE DESCRIPTIONS] ResourceLocation was null for: unknown, but entity is non null!
Maybe something come into your mind that may help.
At given state, there is no way to edit "ForgeCaps" when an entity spawns.
I my case, CNPC Mod and other mobs can not have condition specific (dimension, biome, etc.) DDD types.
Maybe in future there is a way to make this possible with craft tweaker support.
Until then, this ticket may stay open OR can be closed now.
Idea: Try using CraftTweaker.
DDD exposes its mob resistances and the like to CraftTweaker. You should be able to listen to EntityJoinWorldEvent and get the IEntity
joining the world, cast to IEntityLivingBase
, determine the conditions and if satisfied, you can use the ZenGetter resistances
on the IEntityLivingBase
(entityLivingBase.resistances
) to get the instance of Resistances
(Which is just the DDD IMobResistances
capability wrapped in some CT stuff). From there, you should be able to set their resistances no problem. If your curious what kind of stuff you can do, you can check the source here (The wiki is pretty outdated and might not be accurate, so don't use that for reference for now).
I'm more than happy to answer any specific questions regarding how to use CraftTweaker with DDD over on Discord in #ddd-configs-and-scripts
, since the wiki is outdated.