#Macros and parameters in tellraw

1 messages · Page 1 of 1 (latest)

echo pumice
#

how can I get for instance the name of a player and put it "behind my function" before I run the ../finishadd function? like a dynamic function

and can I put parameters into the string of a tellraw command in this arrangement?

-# is there somewhere better documentation for macros and indepth function use?

fossil aspenBOT
#

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

open sapphire
#

you forgot the $ at the beginning of the command

echo pumice
#

ooh

#

function in picture 2 now doesn't work anymore with the parameter
do I have to adjust something? I dont get errors

open sapphire
#

does the function show up in game?

echo pumice
#

yes

#

nothing in the logs either

#

ooh, I had to input it like that
it didnt give me feedback running it via the datapack

#

now I only need to know how to dynamically get and insert a players name

open sapphire
carmine escarp
#

^ which is probably easier than adding them to the player name as well

open sapphire
#

For the name, get a player's head through a loot table and fill it in with the fill_player_head loot function. The head item has an nbt called profile which contains a field called name. In there is the player's name.

#

You can store that name in a storage and use the storage as input for your macro function

echo pumice
#

can I have an undefined parameter?

haughty vaporBOT
#
execute ... run function <function name> with storage <storage path> <nbt to use>
open sapphire
echo pumice
#

having a macro function and dont run it with a paramater so i can leave the $(player) empty by default before the user enters a value manually

open sapphire
#

you can set the player name to "" and pass that in

echo pumice
#

oh cool

#

thank you guys

open sapphire
echo pumice
#

is there documentation on macros somewhere?

open sapphire
#

We cover how to use macros to make dynamic commands!

🔵 Discord & Other Links: https://linktr.ee/CloudWolfMC
💻 Website: https://cloudwolfyt.github.io

▶ Play video
Minecraft Wiki

Functions are data pack files, allowing players to run lists of commands.
This page covers how functions are defined and invoked in Java Edition.