#Tplist macro function argument type: int, expected Compound

1 messages · Page 1 of 1 (latest)

viral beacon
#

So I made a tpa datapack it all works.
Now I'm trying to add tplist which just for each player sends their name + tp with run command /trigger tpa set (playerid)

execute store result storage tpa:temp playerid int 1 run scoreboard players get @s tpa.pid function tpa:tplist_msg with storage tpa:temp playerid

$tellraw @p[scores={tplist=0}] [{"text":"[$(playerid)] ","color":"#4c74c9"},{"selector":"@s","color":"#ffffff"},{text:"Teleport",color:blue,underlined:true,click_event:{action:"run_command",command:"/trigger tpa set $(playerid)"}}]

I know the @p[scores={tplist=0}] selector works because i tried it without it being a macro and it worked (tplist is -1 by default so 0 is when triggered)

rare parcelBOT
#

<@&1201956957406109788>

Someone will come and help soon!

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

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

viral beacon
#

If I try /function tpa:tplist_msg {playerid:2} it works so im not sure what's wrong

rare parcelBOT
# rare parcel <@&1201956957406109788>

<@&1166082198152159386> <@&1202694677766348840>

🙇 Helpers Arise!

Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)

viral beacon
#

pls ping if you give an answer

twilit island
#

Could you play apply some grave accent (`) characters around your commands, this improves readability. This is only for in discord messages, alternatively use the code formatting that discord provides (it adds the accents for you). Example: say Hello World!

Or make screenshots of your code editing tool like VSCode. Right now all I can do is guesses because the flow of the functions and storage is unclear to me.

twilit island
#

Change your macro call to use tpa:temp without the playerid path.

Q: Why?
A: Try doing data get storage tpa:temp and data get storage tpa:temp playerid

faint cedar
#

@viral beacon why do you use a macro in the first place?

#

you can do a score check (even dynamic with a value_chek predicate) to do the same but simpler and mire efficient.

viral beacon
#

how would that work how can a predicate enter a dynamic value into a tellraw

faint cedar
#

oh, not that but you can use a selector text component that prints the name of the player where the predicate matches

#

@a[predicate=...]

#

setting a score as the target value is much cheaper and simpler than using macros

viral beacon
#

thats true but selector @s is the correct user i need the click event to run /trigger tpa set (@s playerid)

#

its tplist tpa is already working

faint cedar
#

if it's already working, then don't bother changing it

viral beacon