i know there is a placeholder for players in a world but thats not what i want. For example if im making a lobby and name the world "lobby" and i make an npc for joining world "world", which is for smp. I want to get the player count in worlds "world,world_nether,world_the_end" without counting players in world "lobby". For example there are 3 players in world "world", 1 in "world_the_end", 3 in world "world_nether" and 6 in world "lobby". I want it to say Players: 7 in the npc's name.
#(ARDrag) player count per specified worlds
96 messages · Page 1 of 1 (latest)
(ARDrag) player count per specified worlds
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.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
it explicitly depends on how you're applying this NPC's name
but:
!tag entitytag.world
Returns the world the entity is in. Works with offline players.
Group
location
Returns
WorldTag
!tag worldtag.players
!tag listtag.size
Returns the size of the list.
Returns
ElementTag(Number)
Examples
# Narrates '3'
- narrate <list[one|two|three].size>
<npc.world.players.size> would literally return the NPC's world's player list's size
depending on how that's being applied to the NPC, that would be the most relevant tag
but without understanding how you're playing it, it may be different
i want the second one, but i want it so that it adds up the sum of selected words as online players
because im making a minigames server and u know how hypixel has X Playing above each minigame in each npc? I want just that.
for example bedwars npc. It adds up the sum of all players in all maps, except they are using bungeecord (i think) and im just using spigot
So you want to get the number of players in several worlds or just one world?
Oh wait of all maps yeah
What you could do is create a list of your worlds and then parse the world.players.size on it, afterwards List.sum to get the value.
worlds_to_get_player_size_from:
type: data
minigames:
- world
- world_nether
<script[worlds_to_get_player_size_from].data_key[minigames].parse[as[world].players.size].sum>
!t script.data_key
Returns the value from a data key on the script as an ElementTag, ListTag, or MapTag.
For example, "script.data_key[type]" on a task script will return "task".
Custom keys should usually go in a 'data' script container, or under a key labeled 'data' for other script containers.
Returns
ObjectTag
!t list.parse
Returns a copy of the list with all its contents parsed through the given tag.
One should generally prefer !tag ListTag.parse_tag.
Returns
ListTag
Examples
# Narrates a list of 'ONE|TWO'
- narrate "<list[one|two].parse[to_uppercase]>
!t as[
Cannot Specify Searched Tag
Multiple possible tags: <ObjectTag.as[<type>]>, <BinaryTag.hash[<format>]>, <ElementTag.asin>, <ListTag.last[(<#>)]>, <LocationTag.areas[(<matcher>)]>, <AreaShopTag.name>, <SkillAPIClassTag.name>, <ElementTag.as_npc>, <EntityTag.has_ai>, <TradeTag.has_xp>, <ElementTag.as_map>, <SkillAPIClassTag.icon>, <ElementTag.as_item>, <ElementTag.as_list>, <MapTag.with[<key>].as[<value>]>, <AreaShopTag.groups>, <AreaShopTag.price>, <AreaShopTag.owner>, <SkillAPIClassTag.parent>, <TownTag.has_pvp>, ...
!t element.as
Cannot Specify Searched Tag
Multiple possible tags: <ElementTag.asin>, <ElementTag.as_npc>, <ElementTag.as_map>, <ElementTag.as_item>, <ElementTag.as_list>, <ElementTag.as_biome>, <ElementTag.as_chunk>, <ElementTag.as_color>, <ElementTag.as_trade>, <ElementTag.as_world>, <ElementTag.as_element>, <ElementTag.as_money>, <ElementTag.as_queue>, <ElementTag.as_cuboid>, <ElementTag.as_entity>, <ElementTag.as_player>, <ElementTag.as_plugin>, <ElementTag.as_custom>, <ElementTag.as_script>, <ElementTag.as_polygon>, ...
Returns the object, automatically converted to the named object type.
Type names can be of the long form, like "ListTag", "MapTag", "ElementTag", ... or the short form, like "List", "Map", "Element", ...
Type name input is not case-sensitive, so "List" or "list" are the same.
Returns
ObjectTag
Examples
my_example:
type: task
# Some input can be any raw object type, but will be forced to a list using 'as[list]' below
definitions: some_input
script:
- narrate "Input list has size <[some_input].as[list].size>"
!t world.players
!t list.size
Returns the size of the list.
Returns
ElementTag(Number)
Examples
# Narrates '3'
- narrate <list[one|two|three].size>
!t list.sum
Returns the sum of all numbers in the list. Ignores non-numerical values.
Returns
ElementTag(Decimal)
Examples
# Narrates "6"
- narrate <list[1|2|3].sum>
!lang data script
Data script containers are generic script containers for information that will be referenced by other scripts.
No part of a 'data' script container is ever run as commands.
There are no required keys.
Generally, data is read using the !tag ScriptTag.data_key tag.
data_script_name:
type: data
# Your data here
some_key: some value
some_list_key:
- some list value
some_map_key:
some_subkey: some value
Group
Script Container System
@woeful fiber Pulled up all the tags for you above for explanations, and given you an example of how you could return what you want to return
how do i get it in the npcs name tho
Sets the name of the NPC.
Object
NPCTag
Input
ElementTag
Tags
<NPCTag.name> Returns the name of the entity. This can be a player name, an NPC name, a custom_nam...
Adjust the npc's name whenever someone... changes the world? or whenever you want
!m changes world
Possible Confusion
Did you mean to search for charged?
Possible Confusion
Did you mean to search for command age?
!e changes world
Group
Player
Event Lines
player changes world (from <world>) (to <world>)
Triggers
when a player moves to a different world.
Has Player
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
Context
<context.origin_world> returns the WorldTag that the player was previously on.
<context.destination_world> returns the WorldTag that the player is now in.
Has Known Location
True - this adds switches in:<area> + location_flagged:<flag name>.
automatically
sorry for late response i was at school
but like i mean every time someone joins any of the listed worlds the counter goes up
and how do i name the npc
for example this
its adding up the number of players in all maps (worlds for me)
View the guide page 'Your First World Script' at: https://guide.denizenscript.com/guides/first-steps/world-script.html
use an event
no i dont want it to be an event i want to know how to put it on top of the npcs name
Sets the NPC's hologram line list.
Object
NPCTag
Input
ListTag
Tags
<NPCTag.hologram_lines> Returns the list of hologram lines attached to an NPC.
where do i put this
i dont really understand this cuz im kinda new lol
Name hologram_lines
Object NPCTag
Input ListTag
Related Tags <NPCTag.hologram_lines> Returns the list of hologram lines attached to an NPC.
Description Sets the NPC's hologram line list.
and what do i put
do i put <NPCTag.hologram_lines>?
and where do i put it
!guide mechanisms
View the guide page 'Mechanisms And Properties' at: https://guide.denizenscript.com/guides/basics/mechanisms.html
!guide world script
View the guide page 'Your First World Script' at: https://guide.denizenscript.com/guides/first-steps/world-script.html
ok but i dont get the second part
where do i put <script[worlds_to…
do i put it in the same file?
i dont really get this im really new
i read how to make the first script and i understood how to go to scripts folder
i understood what mechanisms are
but still i need to talk to a human because i dont really get this
like this for example
word_duplicator:
type: world
events:
after player right clicks bedrock with:diamond_sword:
- ratelimit <player> 1h
- define sword <player.item_in_hand>
- adjust def:sword "display:Your Free Duplicate Sword"
- if <player.location> matches lava:
- adjust def:sword "lore:<&c>Forged in lava."
- adjust def:sword durability:0
- give <[sword]>
- narrate "<&b>Sword duplicated!"
u see it has - define and all that stuff
what do i put
We'd love to help, but could you explain what part specifically are you currently having trouble with? or otherwise -
Thread Closing Reminder
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.)
Error: Missing thread owner. Did they leave the Discord? If so, just use </resolved:1028673926114594866> yourself.