#placeholder-api
150650 messages · Page 33 of 151
or if all you need is imports then its just import me.clip.placeholderapi.PlaceholderAPI;
appreciate
god this is confusing
actually..
Is it possible from within the Javascript PAPI extension to get data from localhost?
ugh I think you can get data from files that are in plugins/placeholderAPI/javascripts/javascript_data
but I'm not sure if any files or just special named ones
Because I could do something like
/* PAPI CRAP fgHEUEIU */
const player = "%player_name%"
const lvl = data('../../grakkit/storage/survival/stats.json').player.lvl;
const dataLoc = "%player_name%.level";
function survivalLevel() {
Data.set(DataLoc, lvl);
Placeholder.saveData();
return lvl;
}
survivalLevel()```
I think this is how papi handles crap based on the wiki
is there an equivalent to js const lvl = data('../../grakkit/storage/survival/stats.json').player.lvl; in PAPI tho?
Where's that in the docs
am I able to pull data from other directories?
Like a json file I have on Grakkit that stores the user's level and progression
const is not a thing in nashroon btw.
so you probably can load a file somehow
alr
Okay, perhaps the way I'm wording this is confusing
and also i suck at js
so..
Say I have a script that checks the value of Potatoes.
The number of Potatoes are located in /plugins/grakkit/storage/potatoes.json
In PlaceholderAPI, am I able to read that json file?
hi
im trying to use placeholderapi to get placeholders for deluxehub
what placeholder should i use for the rank
I am trying to use the expansion OtherPlayer and it keeps giving a output of PNF
ugh that's on the wiki ... https://wiki.lewisdev.fun/free-resources/deluxehub/placeholderapi
ok im back for the 3rd time
I made a simple script that imports data from a json
but when I parse the placeholder it complains that it expected an operand but found import
import * as data from '../test.json';
function survivalLevel () {
return data.name;
}
survivalLevel();```
#test.json
{
"name": "potato"
}
expected output: "potato"
ugh import is not a thing in javascript. or is that the thing you're using?
oh it isn't?
well ill just go ahead and f**k myself then @turbid tide
Is there an "alternative"?
ik require() isn't a thing, that's from NodeJS and multiple people suggested it 😦
is their any expansion that tracks the number of diamonds mined?
Wait.. So java-based expansions can access the internet and stuff but we can't do the same with js?
I mean its javascript. idk for sure what the limitations are.
statistic
idk It's just annoying bc I can't think of any way to access another file and considered using a url or something
but even that wont owork
Hi
I'm trying to make a custom menu to show if a player has a specific group but i can't figure how i'd get the placeholder to work for the player name that's entered
i know /papi parse <username> %luckperms_in_group_<group>% gives me what i need for the username but i need a way to have it show without the command
@dense burrow use this expansion ^
thanks
@turbid tide does the player have to be online?
@dense burrow,
yes
^
most placeholders require an online player
very few added offline support. mostly because its impossible without saving the data somewhere.
okay thanks, sorry for that tag btw
trying to use the placeholder %pingerplayers<ip>:<port>% but its not showing players online on one of my servers
What's the placeholder for the number of votes a player has?
what voting plugin?
https://paste.helpch.at/lohagebivo.pl This is the config, its not showing players online on said server??
it says 0 for me when I use the exact same placeholder
so are you sure you've downloaded the pinger expansion?
on that server?
yes
like /papi ecloud download Pinger /papi reload
and go to plugins/PlaceholderAPI/config.yml
and change pinger update time to 1 second
instead of 30
then do /papi relaod
can you also join the server? to see if it updates for me
or if its stuck at 0
can someone come in clutch with the essentials eco balance placeholder?
ugh just use vault
blitz 😅
wanna come in clutch with the vault placeholders?
I can't find the
please blitz ily
k new question
whats tyhe vault money prefix that has the k and M?
so like 1M
or 20k
formatted
Is there anyway to use placeholders like %vault_eco_top_balance_commas_#% %vault_eco_top_player_#% without the need of having an economy plugin, i was told you need one but like i just have essentials and vault the /baltop message i wanna json it and limit it, this is the easy part but i cant use those placeholders without the need of a 3rd plugin correct?
You can code one if you want.
what
if u have vault and essentials u dont need anything else (if were excluding placeholderapi as its kinda seperate)
true too
tbh what ever u do, even tho if u limit the top players, you can't reduce the lag from it.
just download the vault expansion
/papi ecloud download vault
/papi reload
He wants to limit it, so it causes less lag I think
Tho no one can limit that, unless you increase the delay of which balance top rearranges.
Is there a placeholder for user ping? Because I saw in some servers when you hoover your mouse over a person's name with Deluxechat, it shows their ping.
%player_ping% i think
yeah. make sure to run the commands at the bottom of the embed @austere hawk
Okay thanks
https://imgur.com/a/qCiQ2Fr %discordsrv_user_islinked%
How do I replace yes and no with my own values?
Tried this, it didn't work:
yes: '&6DL'
check_interval: 30
no: '&aDUL'```
Everything works with pinger
@warm topaz @wise goblet
I don't use discordsrv
how do i get tps percentage like if tps equals 20 it'll say 0% if tps equals 1 or something it'll say 100% how can i do that?
use maths @quick relic
my math is not enough for that
;-;
So there's a value swap, no?
idk I never used discordsrv
he meant the math expansion + the server expansion
it is basically, 100-(tps/20*100)
oh ok
yea
ugh that is changed from plugins/PlaceholderAPI/config.yml but it will change it for all placeholders that return yes/no
if you want to change it just for that placeholder then make your own javascript placeholder: https://github.com/PlaceholderAPI/Javascript-Expansion/wiki
Strange, pinger works like this
offline: '&6●'
check_interval: 30
online: '&a●'```
well because that's pinger
it has its own way to change that
but discorsrv most likely uses the PAPI boolean option
boolean:
'true': 'yes'
'false': 'no'
this is what you have to change ^
IIRC there is a permission check for each player to see if they can be in the baltop
Maybe if you negate this permission, it would be more efficient since it doesn't request the balance of every player
Although this does seem to check for Essentials as well so I don't really know
%math_100-({server_tps}/20*100)% i am trying this but its not working server and math expansions downloaded
@quick relic define 'not working', what is is showing?
@wise goblet whose server?
Dark's
says provided value is invalid
and unkown unary operator ' at position 6
i am sending you ip from dms
If you are checking for permissions, then that just removes the purpose of balance top
Yeah but didn't he want to disable it?
Use server_tps_1
He wanted to limit it.
In the papi config or in the discordsrv extension?
@pseudo dawn,
PAPI
In config.ynl?
yes
'true': 'yes'
'false': 'no'
expansions:
discordsrv:
yes: '&6DL'
check_interval: 30
no: '&aDUL'
Is that how it works?
nooo ..
boolean:
'true': 'yes'
'false': 'no'```
change yes
and no
to whatever you want to be instead
Thx!
you can request in #794429923698802708 or #794429922454142986 if you still haven't found anything. Or you can use math 🙂
k 🙂 that's good
How do I remove zeros after a point in math?
[precision:0]
Thanks!
What's wrong with what i got here?
/papi parse me killstreak
/papi parse me %identifier_killstreak%
/papi parse me %killstreak%
Good day,
I have a server on 1.7.10 where I host Annihilation.
And when I want to display motd on the lobby via Pinger, it throws me out motd what is set in server.properties. It does not want to show motd which is modified by that plugin
In Math, can we get rid of floats?
yes, add [precision:0] to the placeholder and itll remove the decimals
I have all the extensions needed to download but this is what is happening.
Essentials is doing currently /baltop, and vault isnt storing any data when i do %vault_eco_top_balance_commas_1% it just says "0" like first place has no money, but its cuz it doesnt have any data.
where can i ask help for DeluxMenus?
thanks
Is there a placeholder about how long a player has been online since they joined and didn't leave?
Probably not, I've seen quite a bit of people asking around, you can request it in #794429923698802708 or #794429922454142986
Do you know if there is a variable that counts from 30 seconds to 1 second? I want to put something to tell you how much time the players have left before I remove them from the server if they don't log in?
hi
%vault_eco_top_rank% does not work for me
i've downloaded vault papi package
expansion i mean
and whilst some of the placeholders work swell
others don
don't
i have the newest vault 1.7.3 version
papi 2.10.9
too
%vault_eco_balance% works great
%vault_eco_top_rank% shows as text
%vault_eco_top_balance_1% shows as 0.0
%vault_eco_top_player_1% comes empty
as in no text
my baltop is far from empty
and the top eco should be 1,535.25$
any ideas about the source of the problem?
if anybody has any solution or idea, please @ me
where do you place this placeholders?
In the holographic display
You must have Holographic Display, Holographic Extension & Requirements such as ProtocolLib & PlaceholderAPI
I have them, Thats why some of the placeholders work i think
Its just these „top” ones dont display
This Displays perfectly
what is your server version
Incompatible I mean
Player placeholder, ping_color doesn't work for some reason. I see it in the PlaceholderAPI config, but colors don't work when using the %player_ping
What's wrong with this?
In plugin.yml
softdepend: [PlaceholderAPI]
In onEnable:
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null)
this.getServer().getPluginManager().registerEvents(new PlaceholderRegister(), this);
you seem to be implementing a listener
in the same class
that sounds a bit dumb
i would separate them into separate classes
But this line of code needs it:
this.getServer().getPluginManager().registerEvents(new PlaceholderRegister(), this);
Because its registering events
i dont think u need to register it tho
yeah i just checked one of my old projects
it doesnt need a listener
Removing it doesnt fix it 😦
/papi parse me %xphill_kills%
Gives me:
%xphill_kills%
?paste
https://paste.helpch.at/upifunolih.php an example from their github
Oh
https://paste.helpch.at/elekujugeb.java u want this one
@Override
public String onPlaceholderRequest(Player player, String identifier){
}
this is the function u need
@quiet gulch ty it works now
np
Could a kind stranger help with this?
All info in pastebin:
https://paste.helpch.at/jisefacasi.cs
KDR is the issue, rest work fine
what is on line 636
oof
kdr is null
double kdr;
thats null
ya can't have it as null
@rain roost read ^
@quiet gulch
kills = Main.data.getConfig().getInt("Players." + player.getUniqueId().toString() + ".TotalKills");```
This is the error line
It cant find kills/deaths
well something there is null
i would, personally, split that line up into multiple lines, so u know exactly what is returning null
Its kills thats returning null
& deaths
those 2 lines are giving null values
I think its because of the player
but idk how I would define player in this situation
Hey
I need a bit help, so I want to create a javascript placeholder that returns the amount of players in AFK from essentials, how can I achieve that?
Get a list of the online players using the onlinePlayers() method, loop thru it, use the isAFK method or just parset the essentials afk placeholder for each and if they are afk add them or their name better to a list then display that list.
Okay I will try that, thanks
Advice:
Make a list
Use the AfkStatusChangeEvent, add if afk, remove if not afk.
He's using the js expansion. not making a plugin xD
;-;, hey super, make a plugin instead
Hey guys! My server onlinemode=false, players have nicknames that contain " _ " and similar characters. I made some commands through mycommand and other plugins. So, when trying to output any message, I get an error, for my own command I need to get data from mycommand using placeholder: %mycommand_playerdatafor_$arg1_name%, $arg1 is %player_name%, which the plugin gets when you click on the menu (DeluxeMenus). If a player with the nickname test executes the command, it will be executed correctly. If the player with the nickname te_st, then the command will not be executed, I understand why the command stops working - because the plugin receives the command in this way %mycommand_playerdatafor_te_st_name%, but how do I make it ignore this and execute the command as usual?
Since your server is cracked, just go disallow _ from ign's
I have players on the server with " _ " and I don't want to lose them because of this
yeah but there isn't any other option I'm afraid. use their UUID instead of their name
Smart
why offline mode ;-;
I thought this server doesn't support pirating .-.
hello, is a placeholder to see if player in online in a specific server, I tried with pinger but idk
you want to see a list of online players or a counter?
no I want to see if the player is already in that specific server, to show something like Already Connect to the Server
a specific player
ah not possible then. well not with the placeholders I know.
you probably need something custom
ok thanks 
can i get the placeholder expansion
❓
its not downloading placeholder automatically
i aactully deleted the placeholders
now its not downloading
@silver minnow
can i get that ecloud
/papi ecloud download Bedwars1058 Not working
oh you don't need to download that
It'll work as long as you have the plugin
i think
Do you have the bedwars1058 plugin?
ofc
unknown command
i cant paste img here
@marsh ridge,
-_-
sorry man thanks
t
Hey,
I'm trying to make a javascript placeholder, but I'm stuck. How can I parse a placeholder as another player? E.g %essentials_afk%, I want to calculate an amount of players afking on the server, to do that I need to parse the placeholder to each player to see if they are afking or not.
if you're doing it in a javascript expansion you have 2 options. either the one you can use otuside so basically the ParseOther expansion (%parseother_{player}_{placeholder}%) or use PlaceholderAPI's method PlaceholderAPI.static.setPlaceholders(PLAYER, "%placeholder%")
Cool and where is this documented?
anygood place holder api level plugins?
ugh documentation about what?
if you mean about the parseother expansion, its on the wiki with all the others
if you mean the method
that's all there is to it
PlaceholderAPI.static.setPlaceholders(player, string)
can I see the javascript?
hmm that's weird
what's your server version and PlaceholderAPI version? @elder stump
because this code 100% works for me
1.12.2 and 2.10.6
I can't as some of my plugins use the older version
but I can test it on my test server
to check if that's the problem
Tested on test server with latest dev jar, not working
what the hell. I'm using the exact same code you do and it works
Okay, now it "works", I just needed to update the JavaScript expansion
the problem now is that it returns 0
which is an issue because players are actually in AFK
hmm
but if I parse on a player that is actually in afk (I did it on myself) it returns the amount of active players on the server
what if you parse %essentials_afk% for an afk person?
it returns yes
and what if you do it for a non AFK person?
it returns no
ok let me recheck the code
%bungee_<servername>% doesn't work for me
have you downloaded the Bungee expansion?
and are you sure you're using the correct server name?
yes its the server name i gave in the bungeeplugin right?
in the bungee config.yml
so for example %bungee_lobby% for a server named lobby
its also case sensitive
so if you named it Lobby you have to use Lobby not lobby
placeholder API for network levels?
ugh have you read the spigot page of NetworkLevels? https://i.imgur.com/pyxYNFb.png
its all on there.
is there like /papi ecloud ...
I mean you could ask that first... xD
no there is not.
it probably comes with the plugin directly
so there is no need for a download command
hmmm didnt seem to work
?startuplog
send your startup log please ^
didnt have any erros
u 100% sure?
I mean you could just send it over just in case you missed it but if you don't want to... then id
idk*
ill try mdvwplaceholderapi
those placeholders will only work in MVDW's plugins
yeah it supports scoreboard revision
Can you look into the script please?
is there a better levels plugin
I did and can't seem to find anything that would break it.
The problem must be var afk = PlaceholderAPI.static.setPlaceholders(onlinePlayers[i], "%essentials_afk%"); because if I ran the parse command on myself it returns 0 (because I'm not afk), but if I parse on a player that is afk it returns the amount of players online
so it doesn't check each player one by one
it only checks that single player
this is the issue, but I don't know what method solves that
I see hmm give me few minutes to think what could be done.
Okay
@elder stump can you send the latest version of the script?
Easy fix is likely to change "%essentials_afk%" to "%" + "essentials_afk%"
Hacky AF but it will work
Because placeholderapi replaces all placeholders up front
oh I seee
And this prevents that
checking
here you go this 100% works
var count = 0
var onlinePlayers = BukkitServer.getOnlinePlayers()
for (var i = 0; i < onlinePlayers.length; i++) {
var player = onlinePlayers[i]
if (PlaceholderAPI.static.setPlaceholders(player , "%essentials_afk" + "%") == "yes" ) count++
}
count.toFixed(0)```
just tested it
yeah I forgot about that and its not the first time it happens to me xD
I keep forgetting
Why is this working like this?
because it was parsing the placeholder
for you
for the person the javacscript was parsed for
like it parses all strings first then it does the rest I guess
count += PlaceholderAPI.static.setPlaceholders(onlinePlayers[i], "%essentials_afk" + "%") == "yes";
😎
ugh but that returns a string. not a number.
I still not understand the logic behind this, but cool because it works
Fixed it, stupid iPad keyboard
ah
I see edited
here even smaller js var count = 0 var onlinePlayers = BukkitServer.getOnlinePlayers() for (var i = 0; i < onlinePlayers.length; i++) { count += PlaceholderAPI.static.setPlaceholders(onlinePlayers[i], "%essentials_afk" + "%") == "yes" } count.toFixed(0)
Thanks for helping out guys
is there a way to subtract 2 placeholders inside of a string
I have a scoreboard where I want to put 'NPC Kills: %placeholder1% - %placeholder2%'
Hello blitz, I would like to create a script that removes the ftop value placeholder if the player has no ftop value.
what does it currently show? and what is the exact placeholder?
math
expansion
%math_[precision:0]{placeholder1}-{placeholder2}%
it shows player kills and total kills
didn't see a way to put in npc kills so i was just trying to subtract player kills from kills
well yeah math placeholder. and the other message was for Exotic
Any suggestion which api will help me to make balance top and playedtime top. In balance i used %vault_eco_top_player_#% but it was working like in screen
https://i.gyazo.com/7f70166fdcaf429e80b9bb8789d91cbf.png
vault top was disabled on latest Vault expansion version
you'll have to download an older version
do /papi ecloud download Vault 1.6.0
it can be enabled in config
It s impossible for me to use other version of vault coz i use 1.16
i will check it
papi config
This is def a long shot but is there a way to have a placeholder check if you are whitelisted on another server?
EX
I parse the placeholder %whitelist_1.1.1.1:25566% on lobby. that ip is the game server ip. It would check if the player is whitelisted and if they are it would return yes and if not it returns no
Do i need to enable cloud_allow_unverified_expansions
?
vault:
formatting:
thousands: k
trillions: T
quadrillions: Q
billions: B
millions: M
baltop:
check_delay: 60
cache_size: 100
enabled: true```
the option is right there for me
placeholderapi config
enabled: true
im not seeing any placeholders for even seeing if a player is whitelisted, let alone in an another server, so doesnt look like it
u can check the full list here - https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders
My bad, everything works)
👍
but what about play time?
u would probably need a more advanced solution for that, such as the LeaderHeads plugin
in essentials u can find with /whois how much he played
yeah but if you want a leaderboard you need LeaderHeads
Essentials doesn't have a leaderboard for playtime
you can remove everything after point but that's all
don't think there is way to limit decimals
math?
hahah, how i can remove then
well I guess js.
but not directly from the top placeholders
%vault_eco_top_balance_fixed_#%
kek
ty
Hello, I have a problem. I would like to set the number of players on the server on scoreboard, I put placeholder %server_online% but it doesn't work.
I have a PlaceholderAPI plugin for this. Please help!
if u do /papi parse me %server_online% what does it return?
@eternal wedge
/papi ecloud download server
/papi reload
Thank you for help i go sleep but i try it after 😀
[PlaceholderAPI] expansion class SemperChatExpansion is outdated:
Failed to load due to a [NoClassDefFoundError], attempted to use ru/SemperAnte/Chat/SemperChatPlaceholders
Why can this happen?
Where did that expansion come from exactly?
Could anyone give me a hand with a script. Please message me
just do it here ;-;
So I'm trying to write a script that changes the ftop value in chat from n/a to nothing. ( When a faction doesn't have any value it shows the faction ftop as n/a in chat and on featherboard) basically I don't know where or how to start
This is mine, it already works fine on my one server 1.8.8, but when I try to run it now on another server, I get an error
Send the jar to me ;-;
%skript_ftopf::ftopaddon_faction_rank%
%skript_ftopf::player%
on placeholder request with prefix "ftopaddon_faction_rank":
if the identifier is "n/a":
if the player prefix is "n/a"
set the result to " "
else:
set the result to "%ftopaddon_faction_rank%"
``` I know its wrong but could i get a hand on how to do it
a couple of minutes, I guess what the problem is
@Override
public boolean canRegister(){
return (semperchat = (SemperChatPlaceholders) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null;
}
I don’t know why it didn’t work, I deleted it and it worked, maybe it was due to some kind of logic change in Paper 1.12.2
Since I don't need this check, everything is fine)
hm
no, it didn't work xD
@wise goblet sent to private messages jars
@Override
public boolean canRegister(){
return true;
}
tried it this way
but got an error in the console
https://pastebin.com/CWG9jfyd
I will check on that later... Since I am not on my pc rn
😖
@wise goblet Sorry, I already understood what the problem is .. After a bunch of hours it came to light that in the plugin API I turned off the plugin in the config
These might do the trick
The firstInit() function will always triggered once when you first evaluating the script
And the JSON getter
I think more people in here would be able to help if you used PlaceholderAPI Javascript placeholders instead of Skript
im new to coding so please explain how to
This should have some basic info
okay i read all that and understand var and functions now.
Do i something wrong or is it the gradient some not work https://paste.helpch.at/ohatibafel.apache
I'm not familiar with that expansion, but I think it's because somewhere in the argument that you're supposed to use a number
It say "%gradient_message_{#hex1}_{#hex2}_message with colors% * Returns the supplied message with each letter colorized by the gradient" , do you think on %gradient_percent_{#hex1}_{#hex2}_{percentage:0..100}% * Returns a hex value by percentage between two colors ?
Edit discord change my paste.
I´m not expert on the code, but when i look in it, it seams it miss some of parts of code (not 100 complete), so probably abandoned project.
@turbid tide in case you're into this: #placeholder-api message
@rare lily,
o
I have a Question when i try like /papi ecloud download Essentials it dosn Work
did you do /papi reload after?
Then it say No expansions found
my mc server is on 1.16.4
^
Ty
Hello, so I have this plugin called Items Adder which allows you to use custom images in text, gui, signs, ... There is an integration for it to work with Placeholder API. I only recently discovered this but default players see %img_imagenamehere% instead of say the image of a heart emoji.
I can see all the placeholders with no issue. So this must be a permissions thing. Players also have custom image prefix so it's an actual image of PLAYER playername >> Hey guys This seems to work fine but when it comes to placeholders, they can't see them.
Using an image in chat is different than using it in a hologram, you'd use : heart : (no spaces) and it will show the image. But holograms like NPC's names require placeholder
I'm pretty sure there is permissions you can give from ItemsAdder.
to allow placeholders use
%redprotect_player_total_blocks%, its require no download https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders#redprotect
[16:34:56 INFO]: RedProtect version 7.7.2
[16:34:56 INFO]: Allows players to define fields to protect their houses.
[16:34:56 INFO]: Author: FabioZumbi12```
yes. there is no expansion download required. it comes directly with the plugin.
but it doesnt work
papi parse fuki21 %redprotect_player_used_blocks%
[16:36:24 INFO]: %redprotect_player_used_blocks%```
is this the correct page for report this kind of bug ?
Well see another weird thing is that yes, there is a permission for that it's ia.user.image.use.imagename so for example ia.user.image.use.heart DOES WORK, while ia.user.image.use.player DOESN'T
I'm using an addon called Betterranks. The default emoji's that come with the plugin work but the ones i added don't, at least not in placeholders
and you're sure you've used it correctly? also you can set up permissions for each yourself
did you set them?
and you got the plugin installed 100% ?
The betterranks config file allows you to set a permission so it would be betterranks.player Doesn't work when added
hmm I'm not really that experienced with IA. Used it a bit but not a lot. They do have a discord server tho where you can ask for help. because I'm not fully aware of how their stuff works.
I see
I was looking right at it hehe
I've tried everything
you could join to see if you spot anything
ain't got that much time rn.
all good
that's why I suggested going to their discord because I know IA is not that popular in here and I ain't got time to look into this anymore xD
[16:34:56 INFO]: RedProtect version 7.7.2
[16:34:56 INFO]: Allows players to define fields to protect their houses.
[16:34:56 INFO]: Author: FabioZumbi12``` yea ofc, and this what i got from /about redprotect
@zenith bane,
can you send a startup log?
?Startuplog
this is how you get the startup log ^
i cant send a file in here
like these ones ^
[RedProtect] PlaceHolderAPI found. Hooked and registered some chat placeholders. as you can see it hooked. so I guess you'll have to contact their support because its most likely a problem on their part. I can't see any other errors
Anyone help me with this js? So I basically wanna make like money needed to rank up and it'll display how much you need to well, obviously rankup. So it'll minus your money from the price needed to rankup. But if they have the amount or more then it'll say /rankup
It'd obv need to be erm, js
function rankup() {
if (args.length == 0) {
return ""
}
let cost = parseInt(args[0]) || -1
if (cost <= 0) {
return "cost is <= than 0"
}
let balance = parseInt("%vault_eco_fixed%")
if (balance >= cost) {
return "You can rankup!"
}
return balance - cost
}
rankup()```
Try this @tranquil sapphire `%javascript_identifier_200%`
Hold on. To double check. I put this in the js folder right
under wotever name and then use the placeholder to identify it?
using this placeholder? %javascript_identifier_200%
identifier is whatever name you gave it on javascripts config
Like
oh @vivid sparrow let is not a thing in nashorn
that's the problem
1 sec let me fix
So it'd give you an exact amount that you need to rankup
function rankup() {
if (args.length == 0) {
return ""
}
var cost = parseInt(args[0]) || -1
if (cost <= 0) {
return "cost is <= than 0"
}
var balance = parseInt("%vault_eco_fixed%")
if (balance >= cost) {
return "You can rankup!"
}
return balance - cost
}
rankup()```
this is it
he used let instead of var
so basically you'll use it like this %javascript_identifier_{cost_placeholder}%
I wanna use %ezrankspro_cost% and the players balance to get the exact amount they need to rankup
ugh that's what the javascript does for you
just do %javascript_identifier_{ezrankspro_cost}%
function rankup() {
var cost = parseInt("%ezrankspro_cost%")
if (cost <= 0) {
return "cost is <= than 0"
}
var balance = parseInt("%vault_eco_fixed%")
if (balance >= cost) {
return "You can rankup!"
}
return cost - balance
}
rankup()```
there
and it will cacluate automatically
Anyone know why this placeholder does not work? The output is nothing...
%parseother_{iridiumskyblock_island_top_owner_1}_{iridiumskyblock_island_members}%The placeholder %iridiumskyblock_island_top_owner_1% does give a playername in its output 🙂
it should work, just tested it
you're using the latest that gaby gave?
show the placeholder that you're using
yeah and %javascript_identifier_rankup%
ugh...
{placeholder.here}
rankup is not a placeholder
from PAPI
%javascript_identifier_{ezrankspro_cost}% I think this should work
arguments arent needed
is just %javascript_scriptNameHere%
Ok ill give it a whirl
oh also @vivid sparrow the vault placeholder
seemed of but had to check
it also has the balance word in it
true
function rankup() {
var cost = parseInt("%ezrankspro_cost%")
if (cost <= 0) {
return "cost is <= than 0"
}
var balance = parseInt("%vault_eco_balance_fixed%")
if (balance >= cost) {
return "You can rankup!"
}
return cost - balance
}
rankup()``` @tranquil sapphire
https://prnt.sc/wjw324 still the same with the new code and with the placeholder %javascript_rankup%
what if you do /papi parse me %javascript_rankup% ?
ok now /papi parse me %ezrankspro_cost%
0
I am opped
/papi parse me %ezrankspro_cost% works on an alt
Gives the correct amount
ok and if you parse the javascript on the alt. does it return anything?
nope
ok send a screenshot of how your javascript_placeholders.yml looks
and then a screenshot of how your rankup.js file looks
javascript_placeholders.yml ???
oh
The file isn't there..
isnt so simple like
rankup:
file: rankup.js
engine: nashorn
javascript_placeholders: https://paste.helpch.at/ivosuqirug.shell
rankup.js: https://paste.helpch.at/ulibehalay.js
where is that rankup.js located in?
hmm I'm confused because it seems to work for me. of course I don't use the cost placeholder just a random number
I only have 2 tasks on the to-do list of JS-Exp
o
Which is editing wiki and find a way to support all users
and it all works? I mean what you've added so far
support all users?
what does that mean?
Erm... don't mention that 
But the functionality, it's all gucci
I finished the debug
How to remove the How to remove the decimal in
papi ecloud download math?
like 1.000 -> 1
i think i know the issue, when i /papi reload papi didnt hooked to the redprotect plugin but when i do /rp reload again it worked
@zenith bane,
Hey, how do I retrieve values from a sql database and parse it into a placeholder?
I forgot the term for this, but is it possible to do this with parsing placeholders inside eachother?:%placeholder_{placeholder2_{placeholder3}}%
99.999999999999999999999999999% sure it's only possible with a specific expansion
it works if the expansion supports parsing placeholders within its own placeholders, yeah
for example, the %math_...% placeholder support placeholders with {} but %bungee_% doesn't
Sombody knows which expansion this is %javascript_rewards-delay_OpenDelay_5% . Please tag me <
uh
Yes but they are not working anymore for me
@rustic wharf,
Bonjour,
What's the current latest version of Papi,
https://api.extendedclip.com/expansions/playtime/
says 2.20+ while I'm running 2.10.9
Last update was in 2017, is probably a typo
what placeholder can asynchronously get the prefix of an offline player?
swear?
js expansion is not yet compatible with java 15
%parseother_{nickname}_{vault_prefix}%
Caused by: java.lang.RuntimeException: The operation to load user data for '87803417-1311-3f9b-b275-27fdb1e63a42' was cancelled by LuckPerms. This is NOT a bug.
The lookup request was made on the main server thread. It is not safe to execute a request to
load data for offline players from the database in this context.
If you are a plugin author, please consider making your request asynchronously.
Alternatively, server admins can disable this catch by setting 'vault-unsafe-lookups' to true
in the LP config, but should consider the consequences (lag) before doing so.
@vocal folio a placeholder can't be 'asynchronous', the API doesn't work with any kind of callbacks or promises
What I mean by this is that it all depends on who's calling the placeholder
So if your plugin fetches it from PlaceholderAPI on an async thread, it will be async
'/papi parse' fetches it on an async or sync thread?
Hi. Is there even a way to push wiki changes to JS-Exp though?
function getRank() {
if RANK !== " "{
return RANK !== " " ? [${RANK}];
}
}
getRank()
``` could anyone help with this?
are you trying to return [rank] if they have a rank and an empty string if they don't ?
so when they dont have any ftop value to return an empty string, once they do have value for the [rank] to return at the start of the prefixes
var rank = "%ftopaddon_faction_rank%"
function getRank() {
rank != "" ? "[" + rank + "]" : ""
}
getRank()``` this should do it then
@balmy marten do you have access to give him access to the JS-Expansion wiki? he's the one working on it now and wants to update the wiki. thanks
Ok accepted
Updated the script, although ftop in chat still doesnt update with the brackets once it has a value, is there anything i need to change on DeluxeChat for it to register?
Also messed around with a value but still to no luck
can you do /papi parse me %ftopaddon_faction_rank%TEST when you have a rank and when you don't and send a screenshot of both outputs?
Sure just give me a sec to install a screenshot software.
^With
https://gyazo.com/f079a8fc2e95429273be73533583f65d
^Without
can you do without again but this time this: /papi parse me TEST%ftopaddon_faction_rank%TEST
ahh guess so
try this then js var rank = "%ftopaddon_faction_rank%" function getRank() { return rank == " " ? "" : "[" + rank + "]" } getRank()
also in my old script I forgot to add return xD
ahh lol, didnt even pick up on that lol
https://gyazo.com/801f3f23a9d0795f028286c53c35e5b4 <-- So the value shows, but no brackets around it
not sure, but i believe so, my mate set all that stuff up and jut asked me to do the code
looking at it, looks like he used the ftopaddon placeholder
anyone know of a way to print a number string of the number of players with x permission?
so close :(
would appreciate an @ if anyone figures this out <3
use this expansion ^
here's the full wiki: https://github.com/Tanguygab/PlaceholderAPI-PlayerList-Expansion/wiki
blitz had a look into the js placeholders for fac and stuff, and none of them seem to have a fac rank or anything
is there any way around this or alternatively we switch it up and not use factop instead some map points style thing
what is fac?
faction
so can anyone help with the %Server_countdown% placeholder? I'm trying to get a countdown to 05:00 each day, but parsing %server_countdown_HH:mm_05:00% seems to just return 0. Is there a way to do this? I can get a countdown to a date to work fine, just not a time
this is probably a common one, but I cant seem to find an explanation of how it works fully to identify what im doing wrong
So I've had a good search, and all I can find is this https://github.com/PlaceholderAPI/Server-Expansion/issues/5 which states that a feature to do this was added in 2.2.2, except there isnt any documentation explaining how this new feature works, as far as I can tell
Can I get any help with this?
You can always request a custom plugin 
well, apparently this is a feature in the Server expansion
but there isnt an explanation of how to use it
ohh okay
I'm confused on what you're asking ;-;
wait
countdown for local time?
👀
effectively
but the only feature ive found that does this
is the one added in 2.2.2
but neither the issue, nor the github seems to explain how to "use placeholders inside of the placeholder"
What placeholders did you try already?
so the notes state you can use %server_time%
2 secs, ill grab the thing im working with
%server_countdown_dd.MM.yyyy.HH:mm:ss_{%server_time_dd.MM.yyyy%}.05:00:00%
fucking formatting
%server_countdown_dd.MM.yyyy.HH:mm:ss_{%server_time_dd.MM.yyyy%}.05:00:00%
so, in theory, i should be able to somehow include the placeholder in {}
does it support putting placeholders in placeholders?
according to the release notes for 2.2.2 and the issue
oh i see what you mean
hmm
yeah
ive no idea
tried {} () .. _ _
tried just using %%
none of them seem to work
If you can't find anything in a few days I recommend requesting a custom plugin though
I would do it (for free) but I don't have time 😐
maybe later if you can't find a solution
thanks, hopefully someone will know how to use a feature included in the expansion
🙂
You need to add papi_server_time, etc.
Where are you displaying the info?
I'm not sure, sorry
Guys, am I using PlaceholderAPI correctly?
String huis = PlaceholderAPI.setPlaceholders(player, "§fБаланс§8:§e%JavaScript_money%§8§e%JavaScript_credits%");
Score money = obj.getScore(huis);```
?
%server_ram_free% doesn't seem to work. it looks like a countdown from 5.3k to 2.7k that restarts back to 5.3k
Ofc thats how garbage collectors work
Its being displayed in TAB atm - how do I actually insert the papi_server_time into the placeholder though?
is this responding to me? lol
Yep
then i'm confused on what you meant, @novel moss. i don't know what garbage collectors are XD
Anyone knows this error?
I can't seem to load mysql and player
only the Mysql folder gets generated
when i download it from /papi ecloud download
the factions MCore expansion isnt working... any ideas as to why?
Do you have MassiveCore and Faction on your plugin list?
@thick ginkgo Given up on FX
help with?
I'm using deluxechat but papi doesn't work. Can you help me?
https://iphoto.net/i/ekran-alintisi.SkXoK
may I ask when did you purchase deluxechat?
I dont remember
In fact, this is the case for almost all chatformat plugins, not just for deluxechat.
you bought the plugin over an hour ago? because if you did you were not found in the database
@west pond #spigot-linking please. thank you
will do gimme a sec
i have been trying many plugins and i used pirated plugin to try this @turbid tide z
i have the same problem with every plugin
Yikes
why do i have to verify if im asking for support with PAPI which is free?
but my problem is has nothing to do with it
the jar is owned by my friend and not me 🤔
the problem is not deluxechat the problem is papi does not work in any format plugin, but it works with plugins for other purposes
🔨 It has come to my attention that a user was using a leaked plugin, they have been... well let's say.. dealt with.
YML ```
factionChat:
file: factionChat.js
engine: nashorn
js:
```js
function chat() {
var faction = '%factionsuuid_faction_name%'
if (faction.length != 0)
return '%rel_factionsuuid_relation_color%%factionsuuid_player_role%%factionsuuid_faction_name% &8&l⎹';
else return ''
}
chat();```
https://solos.only-fans.club/g8XHOawb
var
1 sec
okay
what's your JavaScript Expansion version?
i just downloaded it so i believe its the latest
try this then js function chat() { var faction = '%factionsuuid_faction_name%' return faction == "" ? "" : "%rel_factionsuuid_relation_color%%factionsuuid_player_role%%factionsuuid_faction_name% &8&l⎹" } chat()
but that's literally the same? ill try it anyways
didnt workhttps://solos.only-fans.club/38QP7RZC
can it be that '%factionsuuid_faction_name%' returns a color code even if the player is not in a faction
its not, replaced the script with js function chat() { var faction = '%factionsuuid_faction_name%' return "Test" return faction == "" ? "" : "%rel_factionsuuid_relation_color%%factionsuuid_player_role%%factionsuuid_faction_name% &8&l⎹" } chat()
to test and it didn't return anything
I think that's not gonna work...
what won't work 🤔
function chat() {
var faction = '%factionsuuid_faction_name%'
return faction == "" ? "" : "%rel_factionsuuid_relation_color%%factionsuuid_player_role%%factionsuuid_faction_name% &8&l⎹"
}
chat()```
i mean the script itself isn't working
Any errors on console?
ooop shouldve prob checked that earlier
[14:47:00 INFO]: [PlaceholderAPI] Successfully registered expansion: luckperms
[14:47:00 INFO]: [PlaceholderAPI] Successfully registered expansion: vault
[14:47:00 ERROR]: [PlaceholderAPI] Failed to init placeholder expansion from class: com.extendedclip.papi.expansion.factions.MCoreFactionsExpansion
[14:47:00 ERROR]: [PlaceholderAPI] com/massivecraft/factions/RelationParticipator
[14:47:00 INFO]: [PlaceholderAPI] Successfully registered expansion: player
[14:47:00 WARN]: [PAPI] [Javascript-Expansion] File: example.js for Javascript placeholder: example is empty
[14:47:00 INFO]: [PAPI] [Javascript-Expansion] 0 script loaded!
[14:47:00 INFO]: [PlaceholderAPI] Successfully registered expansion: javascript
[14:47:01 INFO]: ***fdhfgh <Pedolo> asd
[14:47:02 INFO]: Pedolo issued server command: /papi parse me %javascript_factionchat% | %factionsuuid_faction_name%
[14:47:54 INFO]: Pedolo issued server command: /version PlaceholderAPI
wait i think im dumb
yea fixed it
thanks alot ❤️
I just updated Papi and it still crashes /papi ecloud list if I have my expansion installed, is it my expansion?
Still not sure if anyone's answered, but how are you supposed to use other placeholders inside the %server_countdown% from the Server expansion, as per 2.2.2?
what do you mean by that?
this? %server_countdown_<SimpleDateFormat>_<ActualDateAndTimeBasedOnSDFSpecified>%
Also, why are you on 2.2.2 when the latest is 2.4.0?
Good evening, I have a problem with the placeholders, when I install the placeholder Player, it works fine but all the others don't work ...
@storm sorrel if you have the latest Papi make sure your expansions are up to date
I have the last papi but precisely when I do / papi ecloud download Vault I have all the versions of Vault that appear except the one I use
Any other options other then pinger placerholder, as can't really use it on my network
yes
then just type /papi ecloud download vault
and press enter
you don't need a version, that's the EXPANSION version not the PLUGIN version
if you don't put a version it downloads the latest
I suggest downloading the latest for all expansions if you're on the latest version
I am using the latest version of my plugins but when I download an extension with the command, the expansion does not work (even in the download version), in fact it is as if there is no expansion in the file while they are there
that should work
in fact it is as if there is no expansion in the file while they are there
are you saying there IS a file, but it's acting like there isn't?
What I meant is that the expansions get downloaded to the "expansions" folder but don't work, even when downloading them manually ^^ '
and you reloaded right?
make sure you don't have multi of the same expansion, just slightly different names
^ only have one of each
Yes, i reloaded but not work
/papi dump
what does /papi dump do?
did you just paste a paste link
try using the dev build of papi linked here https://ci.extendedclip.com/job/PlaceholderAPI/
it seems functional again, thanks to you!
👍
I'm running dev-122 and things seem to work but when I reload papi the e cloud list stop working
hmm, might be an issue for github?
everything works fine on fresh boot of server
only break ecloud list when I have the Statz expansion
release 2.2.2 added a feature where you can apparently pass the %server_time% placeholder into the countdown one, to create a local countdown to like 6AM each day, but I cant find exactly how you pass the server time to the countdown
@lean crystal,
So in theory, I would set the countdown datetime format to dd.MM.yyyy.HH:mm:ss then pass it %server_time_dd.MM.yyyy%.06:00:00%
damn, its curly braces without percentages
yep
ye most placeholders in placeholders work like that
since PAPI offers a method for it so its easy to implement
I thought it was something like that, but was just missing the part where % isnt needed
thanks
a ton
thought I was going mad
👍
Okay, so that is now parsing, which is a big step, but its being parsed as 0
%server_countdown_dd.MM.yyyy.HH:mm:ss_{server_time_dd.MM.yyyy}.05:00:00%
what's the time for you rn?
when the server date time is 11/01/2021 18:25:30
this doesn't calcualte for the next day
2 hours of sleep
how can I point it do the next day on from current date?
if that is possible
hmm that's a good question.
I would recommend you make a javascript for that because I don't think you can do placeholder in placeholder in placeholder
hmmm, okay
this is where you learn how to create one: https://github.com/PlaceholderAPI/Javascript-Expansion/wiki
ty
I'll make the placeholder for you
oh, thanks!
hmm now that I think about it its going to be a bit more complicated xD
its never straightforward
the problem is if I just add 1 to day it will just break when its last day I guess.
last day in month I mean
ahh right, for the months, yeah
wait I can just use day of the year instead
I'm going to pretend to understand what you mean and agree
ugh day of year so 1-365
riight
until then make a javascript file and all that stuff
shall do
Placeholder to use now: %server_countdown_DD.yyyy.HH:mm:ss_{javascript_time}.05:00:00%, Code to use: ```js
function time() {
var day = parseInt("%server_time_DD%")+1
var year = "%server_time_yyyy%"
if (day+1 > 365) day = 1
return day + "." + year
}
time()
you're a lifesaver, shall try it now
btw change {javascript_time} to your {javascript_identifier} so basically whatever you named the javascript, change time to that
can you parse just the javascript? /papi parse me %javascript_identifier%
i think there's a % missing
yep
Okay
parses correctly, gives 12.2021
okay
that whole placeholder parses fine
but shows as "invalid date" in TAB
looks like a TAB problem then
tyvm though
ugh don't think its a TAB problem
oh?
do /papi parse me %server_countdown_DD.yyyy.HH:mm:ss_{javascript_time}.05:00:00%,
well, where the placeholder is in the TAB config, it just says "invalid date"
but when parsing with /papi parse, the countdown works fine
so thats what shows on TAB
'&5Server restarts in &f%server_countdown_DD.yyyy.HH:mm:ss_{javascript_time}.05:00:00%' line in the config
ye no idea then.
I cant see anything wrong with the placeholder
if it parses fine in /papi parse
yeah, ill take it up with the TAB lads
I don't know why it would error in tab tho as well