#Not detecting variable.attack_time from another entity
1 messages · Page 1 of 1 (latest)
Are you trying to test that variable in a none-player entity?
no, im trying to detect when the player attack
Then why ur using q.get_nearby_entities
whats the problem with that?
I need to know the context to help
its a dummy entity
So it’s another entity which is testing if the nearby player is attacking
im trying to detect from the dummy entity when the player attack
yeah
Just set “variable.attack_time” to public inside your player client
that would make the addon incompatible in the resource pack
That’s the solution tho
Isn't there another way to detect when an entity attack?
You could always just do it on the player side, like test if attacking and then trigger event on the nearest entity
What happens is that Im just trying to detect when player attacks from another entity so as not to edit the player.json
then I will have to settle for the system of hitting the dummy entity directly :/
I think the last part may be wrong, but not sure how the break is playing into it. Anyways, I transferred it something I was given before...
v.player = 0; for_each(t.player, q.get_nearby_entities(5, 'minecraft:player'), {v.player = t.player->v.attack_time > 0.1});
Not sure right tho, but notice the diff in the last part...