#Entity can only be damaged by a specific item

1 messages · Page 1 of 1 (latest)

candid kite
#

How can I make my entity only take damage from a specific item/weapon without using scripts? And if you hit it with something other than that, it won't take damage

stoic widget
#
                "triggers": [
                    {
                        //Parts that must take damage
                        "cause": "all", //If you wish, enter an entity attack or other damage value.
                        "deals_damage": true, //Should the entity take damage?
                        "on_damage": {
                            "event": "Example:Event", //If necessary, add an event
                            "filters": {
                                "test": "has_equipment",
                                "value": "item name", //specific item/weapon name
                                "domain": "hand",
                                "subject": "other",
                                "operator": "==" //Use ==
                            },
                            "target": "self"
                        }
                    },
                    {
                        //Parts that must 'NOT' take damage
                        "cause": "all", //If you wish, enter an entity attack or other damage value.
                        "deals_damage": false, //Should the entity take damage?
                        "on_damage": {
                            "event": "Example:Event",
                            "filters": {
                                "test": "has_equipment",
                                "value": "item name", //specific item/weapon name
                                "domain": "hand",
                                "subject": "other",
                                "operator": "!=" //Use !=
                            },
                            "target": "self"
                        }
                    }
                ]
            }```