Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Tablist stuff.

Open JavierKasunic opened this issue 10 years ago • 14 comments

Hey Bensku, if you have used the expression:

[the] (player|tab)[ ]list name[s] of %players%
%players%'[s] (player|tab)[ ]list name[s]

For set the name of the player in the tablist, if you put a name more longer than 16 characters, the name is shortened to the max character limit.

If you can fix this, because I don't want install other addon like SkRayFall or Skellett only for this fixed feature.

Image 2016-08-10_12 25 54

And also, a way for set the header and footer of the tablist ?)

If any want the the script I'm using in that image, here is it: https://www.spigotmc.org/resources/tab-1-3-skquery-skrayfall.27486/

JavierKasunic avatar Aug 10 '16 15:08 JavierKasunic

Interesting. I'll see if this can be fixed using Spigot API.

bensku avatar Aug 10 '16 18:08 bensku

It is not possible to send tablist name that is longer than 16 characters. See https://www.spigotmc.org/threads/max-tablist-name-length.150818 for explanation.

However, using scoreboards you can skip this limitation. Team name length is unlimited. Sadly Skript has not support for scoreboards and will not get it by me in near future.

If someone wants to hack around this (using no NMS code ofc), help is welcome.

bensku avatar Aug 11 '16 14:08 bensku

You should check the class of SkRayFall or Skellett: https://github.com/eyesniper2/skRayFall/blob/master/src/main/java/net/rayfall/eyesniper2/skrayfall/generaleffects/EffSetPlayerListName.java

https://github.com/TheLimeGlass/Skellett/blob/master/src/com/gmail/thelimeglass/Effects/EffSetTabName.java

JavierKasunic avatar Aug 11 '16 17:08 JavierKasunic

Both use same Bukkit API method as Skript does. At least it looks like this when checking code.

bensku avatar Aug 12 '16 13:08 bensku

Sorry if I'm wrong (I'm unfamiliar with Java) but comparing the codes:

#Skript code
((Player) o).setPlayerListName(s == null ? "" : s.length() > 16 ? s.substring(0, 16) : s);

#Others
player.getSingle(evt).setPlayerListName(name.getSingle(evt).replace("\"", ""));

The thing is, In the Skript code is the substring(0, 16) method, so, this is limiting the name to 16 characters. @bensku

JavierKasunic avatar Aug 12 '16 14:08 JavierKasunic

Oops. Sorry, checked too quickly. Apparently this method is used in more than on places in Skript.

bensku avatar Aug 12 '16 16:08 bensku

So it's possibly to solve?

Also sorry for close and open the thread, clicked on the wrong button haha.

JavierKasunic avatar Aug 12 '16 16:08 JavierKasunic

It's fixed on the dev19, so I close the issue.

JavierKasunic avatar Aug 16 '16 21:08 JavierKasunic

I reopen the issue because you can't set the tablist name of a variable, for example:

function animatedTabName(player: player, name: text):
    loop length of {_name} times:
        set {_name::*} to subtext of {_name} from 1 to loop-num
    while {_player} is online:
        loop {_name::*}:
            if loop-value is "&":
                delete {_name::%loop-index%}
            else:
                set tablist name of {_player} to colored loop-value
            wait 3 ticks

But it return:

the player list name of {_player} can't be set to anything.

I don't know why, I never used that effect because the first bug I've said on this issue. If you can fix it @bensku .

JavierKasunic avatar Aug 23 '16 14:08 JavierKasunic

MundoSk has this now.

TheLimeGlass avatar Aug 26 '16 02:08 TheLimeGlass

Oh, really? I'll see it (Don't joined to the forums a long time ago u.u)

JavierKasunic avatar Aug 26 '16 03:08 JavierKasunic

@bensku the dev20 is out but the bug explained above (can't set the player's tablist name if the player is a variable), if you can fix it...

JavierKasunic avatar Sep 13 '16 15:09 JavierKasunic

This isn't fixed at all yet, as @JKGamerxD reported a while ago, you can't set the tablist name of a player variable. This gets fixed if you parse the variable as a player then set their name like this:

set {_test} to first element out of all players
set ({_test} parsed as player)'s tablist name to "testing"

But that shouldn't be the case.

Snow-Pyon avatar Sep 09 '17 15:09 Snow-Pyon

Closing this since the bug explained here isn't related to this expression specifically (it is a parser bug).

Snow-Pyon avatar Apr 25 '18 00:04 Snow-Pyon