#(ARDrag) player count per specified worlds

96 messages · Page 1 of 1 (latest)

woeful fiber
#

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.

hollow elmBOT
#

(ARDrag) player count per specified worlds

hollow elmBOT
#

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>

rotund tide
#

it explicitly depends on how you're applying this NPC's name

#

but:

#

!tag entitytag.world

mossy vigilBOT
rotund tide
#

!tag worldtag.players

mossy vigilBOT
rotund tide
#

!tag listtag.size

mossy vigilBOT
rotund tide
#

<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

woeful fiber
#

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

mellow tartan
#

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

mossy vigilBOT
# mellow tartan !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

mellow tartan
#

!t list.parse

mossy vigilBOT
# mellow tartan !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]>
mellow tartan
#

!t as[

mossy vigilBOT
# mellow tartan !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>, ...

mellow tartan
mossy vigilBOT
# mellow tartan !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>, ...

mellow tartan
#

.>

mossy vigilBOT
# mellow tartan !t object.as

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>"
mellow tartan
#

!t world.players

mossy vigilBOT
mellow tartan
#

!t list.size

mossy vigilBOT
mellow tartan
#

!t list.sum

mossy vigilBOT
mellow tartan
#

!lang data script

mossy vigilBOT
# mellow tartan !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

mellow tartan
woeful fiber
#

how do i get it in the npcs name tho

mellow tartan
mossy vigilBOT
mellow tartan
#

Adjust the npc's name whenever someone... changes the world? or whenever you want

#

!m changes world

mossy vigilBOT
#
Possible Confusion

Did you mean to search for charged?

#
Possible Confusion

Did you mean to search for command age?

mellow tartan
#

!e changes world

mossy vigilBOT
# mellow tartan !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>.

woeful fiber
#

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)

mellow tartan
#

yeah

#

!guide first world script

mellow tartan
#

use an event

woeful fiber
#

no i dont want it to be an event i want to know how to put it on top of the npcs name

mellow tartan
#

setup a hologram

#

!m hologram_lines

mossy vigilBOT
woeful fiber
#

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

mellow tartan
#

!guide mechanisms

mossy vigilBOT
mellow tartan
#

!guide world script

woeful fiber
#

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

woeful fiber
#

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

edgy jasper
#

We'd love to help, but could you explain what part specifically are you currently having trouble with? or otherwise -

autumn trellisBOT
#
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.