#Damage sensor is not getting triggered in player.json

1 messages · Page 1 of 1 (latest)

haughty shoal
#

Hey, I am trying to make a combat logger using player.json, but for some reasons my event is not getting triggered by the damage sensor, as per I know, I did everything fine and tried various alternative ways to fix the problem, but the event is still not getting triggered by the damage sensor. Also, I did try to run event command and it worked perfectly fine.
Here's the code for my damage sensor,

{
                        "cause": "entity_attack",
                        "on_damage": {
                            "filters": {
                               "all_of": [{
                                    "test": "is_family",
                                    "operator": "==",
                                    "subject": "other",
                                    "value": "player"
                                    }]
                            },
                            "event": "wrs:in_combat",
                            "target": "self"
                        }
                    }
safe depot
#

Take out the cause.

#

It will default to all. The filter is the only thing you need. I think the entity attack is conflicting with player

haughty shoal
#

But, it is working when someone hits me and I fall on the ground and takes fall damage, then the damage sensor is getting triggered and the combat timer made by me starts which is weird

haughty shoal
#

I fixed it

safe depot
#

What was the problem?

haughty shoal
# safe depot What was the problem?

There was one more damage sensor which also uses same conditions, but different target which was "other" so, both the damage sensors were conflicting with each other so, none of them got executed, so I removed the other damage sensor and made it so that when the combat damage sensor is run, then inside the event I added one more trigger which executes the other event but on the target "other"

#

Although I have one more problem now

#

My one more damage sensor is not running again

#

But this damage sensor shouldn't conflict with any other sensor

#
{
                        "on_damage": {
                            "filters": {
                                "all_of": [{
                                        "test": "has_damage",
                                        "value": "fatal"
                                    },
                                    {
                                        "test": "is_family",
                                        "subject": "other",
                                        "value": "player"
                                    }
                                ]
                            },
                            "event": "wrs:kill",
                            "target": "other"
                        }
                    }

This is the other damage sensor, and the event should trigger on the other player, but it is not getting triggered by the damage sensor and this time there is no conflicting with any other damage sensor

#

I am literally so much annoyed with this damage sensor now

#

It is basically a kill counter system you could suppose

dry fox
#

Why do you need a damage sensor to make a kill counter?

haughty shoal
haughty shoal
#

Sorry for the ping if you get one

haughty shoal
haughty shoal
haughty shoal
dry fox
#

Any content log errors?

haughty shoal
haughty shoal
#

Can someone send me some full documentations for events and damage sensor?

dry fox
haughty shoal
#

Am I doing something wrong in events? Holiday creator features experimental is also enable

"wrs:kill": {
                "run_command": {
                    "target": "self",
                    "command": [
                        "scoreboard players set @s in_combat 0",
                        "scoreboard players set @s combat_timer 0"
                    ]
                }
            }
haughty shoal
#

Is there any alternate way to detect a player who killed an other player? (Except Script API)

#

Damage sensor is not really working properly

haughty shoal
#

I don't know why, but I fixed it by changing the location of this on_damage to a different location in damage sensor and it worked! (Bruh)

safe depot
#

This is my kill counter
damage senor partjson { "on_damage": { "filters": { "all_of": [ {"test":"has_damage","value":"fatal"}, {"test":"is_family","subject":"damager","value":"player"} ] }, "event": "ev:kill_count" } } eventjson "ev:kill_count": { "sequence": [ { "run_command": { "target": "other", "command": ["scoreboard players add @s kill_count 1"] } } ] }

haughty shoal
# safe depot This is my kill counter damage senor part```json { "on...

I did exactly that, but for some reasons my on_damage was not working in the last position of damage sensors, so I moved its position to up in damage sensor and it starts working, which was really bruh moment. I literally just moved the on_damage code position up in the damage sensor and didn't even change anything in the on_damage code and it worked after doing it

#

Now I am not going to touch damage sensor again

safe depot
#

only one sensor will be caught and it goes in physical order. So must be something else that matches... can you send the whole damage sensor?

haughty shoal
haughty shoal
#

Due to this, it was not working

#

Looks like the damage_sensor.json file is not getting send properly in discord

#

Is there any alternate way to send a json file in discord?

dry fox
safe depot
haughty shoal
#

Also, I am in phone