#StaffPlus Placeholder [JavaScript]

1 messages ยท Page 1 of 1 (latest)

viral whale
#

for Scoreboard uses

#

Hey there

#

anybody know how to help me with the creation of the JavaScript placeholder?

#

I need for staffplus plugin, example:

Staffmode: On

#

?imgur

rancid latchBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

viral whale
#

like that, its just basic & static

flat jasper
#

could use changeoutput

#

-papi changeoutput

#

bit simpler than javascript

#

smh papi bot doesn't work here

viral whale
#

how can I do that mr Cj

#

Should i write that in chat or?

#

%changeoutput_<options>_input:<input>_matcher:<matcher>_ifmatch:<output-if-matched>_else:<output-if-not-matched>%

#

i put that in TAB config

#

but how i dont understand

flat jasper
viral whale
#

So thic can basicaly

#

if im in /staff [true]

#

It will write True

#

if I type /staff [off]
it will say Off

#

?

verbal brook
# viral whale So thic can basicaly

I think cj might've misunderstood what you want. He thought that there is already a placeholder and you just need to change the output. For example if the placeholder would return true, you would want it to say &3Yes instead.

But if I am correct, StaffPlus doesn't already have a placeholder that returns true or false if the player is in staff mode and you want one made. If this is the case, this isn't really possible with the javascript expansion. At least not since a few versions ago. You can't load java classes anymore. You would need an actual java expansion made for this.

spring raven
#

"It is time. This has to be one of the most requested feature placeholder API support and I finally got around to doing it. Currently there are 3 placeholders.
%staffplus_staff_in_mode%
%staffplus_vanished%
and finally
%staffplus_staff_online%
All of these return the users name. If you can think of more to add just suggest them and what you'd like the actual name of it to be"

#

Maybe you could ask them again in their discord or on their github but i dont feel like they will add it any time soon

verbal brook
#

%staffplus_staff_in_mode% this returns a list of all online people with staff mode enabled?

spring raven
#

Yeah

flat jasper
#

...

spring raven
#

So you can check for a number and if that is higher then 0 you can do some things

verbal brook
#

Wait. Number? Not list?

flat jasper
#

so

spring raven
#

It kinda sucks

flat jasper
#

they implemented it shittily

spring raven
#

yeah very

flat jasper
#

wth

#

lmao

verbal brook
#

So, it doesn't even give you like BlitzOffline, cj for example?

flat jasper
#

I see your github post

verbal brook
#

it gives you 2 instead?

flat jasper
#

you said:

%staffplus_vanish% = Whether the player is vanished.
%staffplus_staff_mode% = Whether the player is in staff-mode.
%staffplus_online_staff% = Amount of online staff.

They said "nah"

spring raven
#

๐Ÿ˜‚

#

@viral whale not sure anymore what %staffplus_staff_in_mode% gives as a return but you can maybe try something with that

flat jasper
#

Ojox test the placeholders and tell us what they return

#

if they return a list like BlitzOffline, cj89898 or a number like 2

spring raven
#

But i think the way I did "fix" this was enabling vanish by SuperVanish when enabling staffmode and when i left staffmode disable vanish. And then check for %supervanish_isvanished% what it returns

viral whale
#

it doesnt have placeholders StaffPlus

spring raven
#

Altough im looking at my config right now which says this:
'%staffplus_is_vanished%':
"true": '&aEnabled'
"false": '&cDisabled'

#

So it could be it has a right placeholder

flat jasper
#

I don't see anything about placeholderapi either

#

in the source code

#

well, about providing placeholders*

#

but it was mentioned in the update that Florens copied

#

this one is the one they quoted

viral whale
viral whale
flat jasper
#

the github hasn't been updated i see

viral whale
#

thats why I thought If its possible through JavaScript

spring raven
#

@viral whale did you try %staffplus_staff_in_mode%

#

?

viral whale
viral whale
#

gimme a sec

flat jasper
#

oh wait

#

it says is_in_mode is a placeholder

#

in the latest version

spring raven
#

lol

flat jasper
#

%staffplus_is_in_mode% should return true/false

#

maybe

spring raven
#

probably

flat jasper
#

i had to decompile the source to check lol

#

sad they can't even use papi booleans yes/no

spring raven
#

o yeah

#

display-condition: '%staffplus_is_in_mode%=true'

flat jasper
#
    if (params.equalsIgnoreCase("staff_in_mode")) {
      StringBuilder sb = new StringBuilder();
      sb.append("Staff currently in mode: ");
      (StaffPlus.get()).modeCoordinator.getModeUsers().stream().forEach(user -> sb.append(Bukkit.getPlayer(user).getName() + ", "));
      return sb.toString();
    } 

this is probably the stupidest placeholder I've seen

spring raven
#

I have this in my last server' config

flat jasper
#

"in mode"

viral whale
#

so... It's possible?

#

Ooh and thanks guys for the fast support ๐Ÿ”ฅ

#

gonna try it in a few mins

spring raven
spring raven
#

had to go back joining that discord server but found it lol

flat jasper
#

staff_in_mode - list of staff in mode
vanished - list of users in vanish
num_vanished - number of users in vanish
staff_online - list of staff online
num_staff_online - number of staff online
online - users online (excluding vanished)
num_online - number of users online excluding vanished
rank_prefix - rank prefix
is_in_mode - true/false if user is in mode
is_vanished - true/false if user is in vanish

spring raven
#

Are those all the placeholders they have?

flat jasper
#

ya

spring raven
#

Ill ask if they can add them to their page

flat jasper
#

or update the github

#

2 years since they pushed it

#

(both would be nice) ๐Ÿ˜‚

viral whale
#

xdddd

#

Okay gonna try it

#

@flat jasper so %is_in_mode% is for staffmode?

spring raven
#

%staffplus_is_in_mode%

#

sorry i had staff while it was staffplus ofc

viral whale
#

its okay no worries

#

and how about the number online

#

%staffplus_is_vanished%

spring raven
viral whale
#

@spring raven btw it works ๐Ÿ™‚

spring raven
#

Nice

viral whale
#

nope

viral whale
#

it doesnt work

viral whale
spring raven
viral whale
spring raven
#

Like only staff or only players or both?

viral whale
#

it just displays the %placeholder%

#

%staffplus_num_staff_online% <- it displays it like that

spring raven
#

%staffplus_num_staff_online%

#

That should be it

#

It maybe could be that it does not work. Not all my configs are 100% ๐Ÿ˜‚

viral whale
#

everything works only this doesnt

#

for the placeholders

#
      - ''
      - ' &6โ–Ž &eAdministration'
      - ' &6โ–Ž &7Staffmode: &f%staffplus_is_in_mode%'
      - ' &6โ–Ž &7Rank: &f%vault_group%'
      - ' &6โ–Ž &7Online: &f%staffplus_num_staff_online%'
      - ' &6โ–Ž &7Vanished: &f%staffplus_is_vanished%'
      - ''
spring raven
#

I mentioned it in the staffplus discord. Lets see what the dev is gonna do.

viral whale
spring raven
#

Can't do much about that. CJ is already helping you and he can help you better then I can.

viral whale
#

Okay bosses, you know how things go! ๐Ÿ”ฅ

#

Oh yea ik, but I'm so excited 'bout that feature I mean honestly looks dope

spring raven
#

It for sure looks cool, that's why I asked to them if they could add placeholders x)

viral whale
#

you guys are amazing, really ๐Ÿ”ฅ

spring raven
#

looks sick ๐Ÿ™‚

#

Which tab plugin are you using?

viral whale
#

This is the error to the placeholder

spring raven
#

the one by ZNAMY

viral whale
spring raven
#

or the scoreboard i mean

viral whale
#

He is from my country

spring raven
#

Nice and good dev

viral whale
#

no seriously rlly thankful

spring raven
#

You can change the values if you want btw

spring raven
#

instead of false or true

#

its nice this way so it doesnt really matter but yeah

viral whale
#

or in StaffPlus

spring raven
#

In the tab plugin

#

placeholder-output-replacements:
'%staffplus_is_vanished%':
"true": '&aEnabled'
"false": '&cDisabled'

#

Like i had this for example

spring raven
#

We are going off topic here i dont know if thats a problem? @flat jasper

viral whale
#

Yep I see

#

thanks bro ๐Ÿ”ฅ

viral whale
#

I think its not a problem

spring raven
#

Most of the time forum posts are there so people that have the same issue can find an answer while looking on the internet

#

So then its nice to not go off topic but this is discord

viral whale
#

I understand it's okay โœ…

viral whale
#

Anything new about the online placeholser

flat jasper
#

I'd be checking the staffPlus discord to see if the dev responded to Florens

#

Dev won't be posting here