#function with macros aint running

1 messages · Page 1 of 1 (latest)

hasty pantherBOT
#

so i have a function that checks every tick:
item_check.mcfunction

function jmj:block/wand_table/gui/eject with block ~ ~ ~ Items[{Slot:0b}]

but the function it trys to call with item data just... doesnt run?
eject.mcfunction

$execute at @s run summon item ~ ~0.1 ~ {Motion:[0.0,0.04,0.0],PickupDelay:0,Health:5s,Air:300s,PortalCooldown:20,Item:{id:$(id),count:$(count),components:$(components)}}

help???

rugged coyoteBOT
#

<@&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:1722718562: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

terse void
#

Do every items for which the function is called always have components?

stoic mural
#

uhm

#

idk

#

ig not

#

but i still want to keep all the item data

terse void
#

Yeah but if the item doesn't have any components, the macro misses a parameter and thus doesn't run

stoic mural
#

is there anything i can do?

hasty pantherBOT
#
data modify storage namespace:temp macro set value {id:"", count:1, components:{}}
data modify storage namespace:temp macro merge from block ~ ~ ~ Items[{Slot:0b}]

That sould work

stoic mural
#

hm

#

yea maybe

#

hold on

#

nope

terse void
#

the function still doesn't run?

stoic mural
#

nope

terse void
#

try to run it in the chat to view the error

stoic mural
terse void
#

looks like the id passed from the macro misses quotation marks

stoic mural
#

ah

#

so i just add them to the function right

terse void
#

try id:"$(id)"

#

yes

stoic mural
#

like that

#

WAIT

#

YUP IT WORKS 💀

#

that was a jumpscare