In Control!

In Control!

74M Downloads

Feature Request: Support for other mod's damage types

Noobulus opened this issue ยท 4 comments

commented

Would it be possible to have damage sources from other mods (such as crusher from Immersive Engineering) be available for use in scripts? I've been attempting to use the crusher damage type to modify the drops of a cow when killed by the crusher with the following script:

[
    {
        "mob": "minecraft:cow",
        "source": "immersiveengineering:crusher",
        "remove": "minecraft:beef"
    },
    {
        "mob": "minecraft:cow",
        "source": "immersiveengineering:crusher",
        "item": "harvestcraft:groundbeefitem",
        "itemcount": "2-6"
    }
]
commented

Create uses CrushingWheelTileEntity.DAMAGE_SOURCE for the crushing wheel according to Pepper from the Create Discord. If this is added I would be able to treat the crushing wheel as a player kill.

Side note, if this is added I believe TellMe can dump a list of damage sources. That might be worth adding to the documentation.

commented

I actually don't know where to find modded damage sources. Is that even possible?

commented

From Pepper again:

Damage sources are not registered, so there is no way to retrieve all sources without a mixin.
Also since they are not registered, their names might conflict and detecting which mod a certain source is from is not possible.
They are not registered because new sources can be created on the fly, like when a player kills another player.

commented

In Control wouldn't have to retrieve a damage source for a script to work. It would need to wait for a lethal damage event, and compare the damage source to the one listed in the loot.json file.