1

I am trying to make a freestanding crawling system that works for multiplayer in version 1.15. I was wondering if there would be a way to summon an entity to the player when that specific entity is not near the player. Here are the commands that I have so far:

/scoreboard objectives add sneak minecraft.custom:minecraft.sneak_time

/execute as @a[scores={sneak=1}] at @s run tp @e[type=minecraft:armor_stand,distance=..2] ~ ~-1 ~

/execute as @a[scores={sneak=1..}] run scoreboard players reset @a sneak

/execute as @a[scores={sneak=1}] at @s unless entity @e[tag=IsCrawl,distance=3..,limit=1] run summon armor_stand ~ ~ ~ {NoGravity:1b,Invisible:1b,NoBasePlate:1b,Tags:["IsCrawl"],Passengers:[{id:"minecraft:shulker",Silent:1b,Invulnerable:1b,CustomNameVisible:0b,DeathLootTable:"minecraft:empty",AttachFace:0b,Tags:["IsCrawl"],ActiveEffects:[{Id:14b,Amplifier:1b,Duration:1000000,ShowParticles:0b}]}]}

/execute as @a at @s if entity @e[tag=IsCrawl,distance=3..,limit=1] run kill @e[tag=IsCrawl]
  • You're going to have to give us a few more details. I don't fully understand the problem. – MBraedley Jul 17 at 19:50
  • I just need help with detecting for when an entity is not near the player. – Help Please Jul 17 at 20:28
  • There's an execute variant similar to execute if that inverts the result; execute unless. You're most of the way there already with your last command. – MBraedley Jul 17 at 20:38
  • I made a command like this: execute as @a at @s unless entity @e[tag=IsCrawl,distance=3..,limit=1] run summon armor_stand ~ ~ ~ {NoGravity:1b,Invisible:1b,NoBasePlate:1b,Tags:["IsCrawl"],Passengers:[{id:"minecraft:shulker",Silent:1b,Invulnerable:1b,CustomNameVisible:0b,DeathLootTable:"minecraft:empty",AttachFace:0b,Tags:["IsCrawl"],ActiveEffects:[{Id:14b,Amplifier:1b,Duration:1000000,ShowParticles:0b}]}]} – Help Please Jul 17 at 21:39
  • But I need one that only summons when the player has a sneak score of 1 and when the entity is not near the player – Help Please Jul 17 at 21:41
0

try making it so the entity sets your player a dummy score of 2 when within a certain radius and having the game subtract the dummy by 1 every tick.

if the score reaches 0, summon a new entity

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.