#Macro

1 messages · Page 1 of 1 (latest)

timber flickerBOT
#

Im trying to use a command macro, but its giving me the error (image) and the command is

scoreboard players set @s pickupdummy 0
$execute as $(entity) kill @e[distance=1,limit=3,type = block_display]

and I am executing the function like this:
/function dummy:pickupdummy with (mob uuid)

teal thunderBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1735485964:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

somber junco
#

image?

latent laurel
#

it didns send bc of mcfunction syntax

#

there it is

frank star
latent laurel
#

?

timber flickerBOT
#

you do it like this:

/function dummy:pickupdummy {entity:230ad6f....}
latent laurel
#

ah

#

ill resolve this if it works

verbal stratus
#

You're missing run

#

execute as ... run kill, not execute as ... kill

frank star
#

this too

latent laurel
#

alr

#

didnt work

#

but didnt give me an error

verbal stratus
#

That distance=1 looks suspicious to me. You almost never want exact distance selectors

latent laurel
#

oh right

#

ok I tried remove the macro part of the command and now it doesnt register

#

as in the tick function doesnt check

timber flickerBOT
#
#tick.mcfunction
execute as @a if score @s pickupdummy >= @s 1 if entity @e[distance=..2,limit=1,tag=Dummy] run function dummy:pickupdummy

things to note:
1 is a scoreboard, and the villager has the tag 'Dummy'

frank star
#

is 1 a constant?

latent laurel
#

1 is always set to 1

frank star
#

then do matches 1.. instead of >= @s 1

latent laurel
#

still doesnt work

frank star
#

you forgot at too

#

the command is ran from the world origin

latent laurel
#

ohhhhh

frank star
#

I doubt that there is where you want to run it

latent laurel
#

I always forget at

#

ok now it runs but doesnt kill the display entities

timber flickerBOT
#
#pickupdummy.mcfunction
scoreboard players set @s pickupdummy 0
execute as @e[distance=..2,limit=1,tag=Dummy] run kill @e[distance=..1,limit=3,type = block_display]

The scoreboard bit works

latent laurel
#

wait I assume its at again

#

alr works now

frank star
#

yesm but you can simplify it

latent laurel
#

how?

#

also another issue I have 3 block displays in range but I need to click the villager twice to remove all of them

timber flickerBOT
#

don't check if the entities are there, just run it as them instead.

tick.mcfunction

execute as @a[scores={pickupdummy=1..}] store result score @s pickupdummy at @s as @e[distance=..2,limit=1,tag=Dummy] run function dummy:pickupdummy

pickupdummy.mcfunction

execute at @s run kill @e[distance=..1,limit=3,type = block_display]
return 0
latent laurel
#

ohh

frank star
#

the return to reset a score is a bit unconventional but it gets rid of the double selector

latent laurel
#

yeah

#

now back to the issue where not all block displays are dying, what do you think the issue is?

frank star
#

you set a limit of 3

#

I assume this is the issue

latent laurel
#

yeah but when I set it to 4 it was the same issue

#

it works when set to 10

#

so ill try find the perfect number

frank star
#

your selector arguments are a bit messed up, try putting the type check at the start

#

it does matter in which order they are

#

for performance and I think for limits too

latent laurel
#

alr

#

but it works at 4 but not 3 even though there are 3 block displays

frank star
#

What it does now (I think) is it first gets all entities in range, picks the first 3 and then filters out the block displays

latent laurel
#

so it seems there are 4 block displays, even though the program I used to make the mcfunction said 3

#

but I appreciate the help with everything else!