#(frigmun) Target for tablist update
20 messages · Page 1 of 1 (latest)
(frigmun) Target for tablist update
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
are you referring to the event triggering, or something happening during the script?
Look, I want to update the data about all players on the server for all players, but I've run into the fact that "tablist update," and "tablist" in general, has no purpose to fulfill; it automatically searches for <player> in the code. And to run tablist, you literally have to run foreach where the data will be signed as "as:__player"
And because of this, if I want to make a custom prefix via tablist, I have to run foreach on all players on the network "foreach <server.online_platers> as:__player:"
And then run another loop on all players to change each player's data.
Here is the script, I just removed everything unnecessary so that you can understand what it is about.
- foreach <server.online_players> as:players:
- tablist update uuid:<[players].uuid> "display:<[prefix]> <[players].nameplate>```
!lang the player and npc arguments
The "player:<player>" and "npc:<npc>" arguments are special meta-arguments that are available for all commands, but are only useful for some.
They are written like:
- give stick player:<server.flag[some_player]>
or: - sit npc:<entry[save].created_npc>
Denizen tracks a "linked player" and a "linked NPC" in queues and the commands within.
Many commands automatically operate on the linked player/NPC default or exclusively
(for example, "give" defaults to giving items to the linked player but that can be changed with the "to" argument,
"sit" exclusively makes the linked NPC sit, and that cannot be changed except by the global NPC argument).
When the player argument is used, it sets the linked player for the specific command it's on.
This is only useful for commands that default to operating ...
Script Command System
is this what you're looking for?
Yes, but is there a way for me to specify the list of players?
To make my code look like this, without running foreach inside foreach?
# test
- foreach <server.online_players> as:players:
- tablist update uuid:<[players].uuid> "display:<[prefix]> <[players].nameplate>" players:<server.online_players>```
there isn't a "player_s_" argument for the tablist command since it's tied to a singular player, you'll have to use a "foreach" loop
I understand, it's unfortunate, but I'm just trying to optimize it as much as possible, because foreach in foreach isn't great for the load, and it will load more than the tab plugin.
who told you the foreach wasn't good for the load?
it's never given me any issues for 2,024 days and i update it every tick
there isn't much room for a different consensus here, if you're having any issues (especially performance related) you can look to seek more help
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@maiden peak