#how to check the entities around?

1 messages · Page 1 of 1 (latest)

willow musk
#

help

olive hare
#

Experimental:
query.get_nearby_entities
query.get_nearby_entities_except_self

with commands:
/testfor @e[...]

willow musk
#

        "sequence": [
          {            
            "run_command": {
              "command": [
                "playsound aba.shot_hit @a ~~~"
              ]
            }              
          },
          {
            "run_command": {
              "command": [
                "playsound aba.shot_no_hit @a ~~~"
              ]
            }              
          }
        ]

olive hare
# willow musk can you write the range?
{
    "format_version": "1.10.0",
    "animations": {
        "animation.pig.find_player": {
            "animation_length": 0.05,
            "loop": true,
            "timeline": {
                "0": [
                    "v.x = 0.0; for_each(t.player, q.get_nearby_entities_except_self(16, 'minecraft:player'), { v.x = v.x + 1; }); return v.x > 0.0;"
                ]
            }
        }
    }
}

You can find more details here

willow musk
#

I want there to be a different sound when a player hits and when a block hits

olive hare
willow musk
olive hare
#

Sorry I don't know how to do that.

#

        "sequence": [
          {            
            "run_command": {
              "command": [
                "execute at @s if entity @p[r=1] run playsound aba.shot_hit @a ~~~"
              ]
            }              
          },
          {
            "run_command": {
              "command": [
                "execute at @s unless entity @p[r=1] run playsound aba.shot_no_hit @a ~~~"
              ]
            }              
          }
        ]

But maybe this works, could you test it?

willow musk
# olive hare ```js "sequence": [ { "run_command": ...

[Json][error]-Ошибка синтаксиса: непредвиденное «@s»: в «xecute at >>@s<< if entity»

[Commands][error]-Command response could not compile commands

[Json][error]-Ошибка синтаксиса: непредвиденное «@s»: в «xecute at >>@s<< unless en»

olive hare
#

Can you put the full file here?

olive hare
willow musk
# olive hare

[Json][error]-Ошибка синтаксиса: непредвиденное «@s»: в «xecute at >>@s<< if entity»

[Commands][error]-Command response could not compile commands

[Json][error]-Ошибка синтаксиса: непредвиденное «@s»: в «xecute at >>@s<< unless en»

olive hare
#

What is the version of your manifest file?

willow musk
#

minecraft version: 1.20.41

olive hare
#

this work?

willow musk
#

?

willow musk