#placeholder-api
1 messages · Page 151 of 1
Might be outdated, since it references BukkitServer and the error references CraftServer
true.
CraftServer is the bukkit object
however
I'm using GraalVM, and this code was written in js8 I'm assuming
however it's still javascript.
to be honest dude
I can't figure out how to register custom placeholders through papi's api
You'd need to do that in Java, I presume
so i was literally just going to create a papi script that executes my code in-game
I use Javascript
I dont know java lol
Well to integrate the API of PAPI, you need to create a plugin using java
Not exactly
???
I use something called grakkit
what the fuck
Okay well there's no guarantees anything works with that
Well
I would definitely bite the bullet and just learn Java
It's very similar, JS was after all copied nearly identically from Java
This script extracts placeholders from PlaceholderAPI
I assigned it to a global variable
and in-game i can run /js papi.parse(self, '%playtime_time%') to evaluate the playtime and send it back to my script
hmm
:/
didn't work
actually
I have a question
There is no time to wait! Ask your question @paper grail!
lol
Is there a PAPI extension that literally just runs a command and gives the output of it?
lile
%command_say_hi%
er
%command_seen_brayjamin%
idk
watch;
that sounded rude sirry
const server = BukkitServer;
function GetUUID () => {
const uuid = server.getPlayer('%player%').getUniqueId();
server.dispatchCommand(server.getConsoleSender(), `/msg %player% ok so ur uuid is like ${uuid}!`);
}
GetUUID();```
This should just work
unless that's sus that i'm running a command using a placeholder
that may be hacky but that definitely should be possible...
wait
do i have to instantiate a new java object of BukkitServer, maybe?
nope
this sucksss
Make an actual placeholder, this shouldn't be done in js
^ An expansion that does this doesn't sound to hard to make
number.toFixed(0) is bugged in javascript, is random if it read toFixed(0) properly, I can relod js many times and it give a random result when use toFixed(0) some times it remove .55 some times it print like 158.48 .(when it should bee 158). It break my boolean check in dm menu.
%math_{bungee_serverName2}+{bungee_serverName2}[precision:0] why it doenst work in 1.16.5?
math has update [precision:0] (if you use newest version). So they remove precision (has not time to look up how you use it).
bro my api for staff facilities doesn't seem to work, can somone help?
Are you trying to make the extension for PAPI for that plugin?
no the ecloud and stuff
You're having trouble using the extension in your own thing?
yea i think so i downloaded the ecloud and i use %stafffacilities_staffonline% but it doesn't work
Does it just not replace the placeholder?
What versions of both the plugin and the extension do you have?
stafffacilities is 4.something and placeholder i just updated
Any reason not to use Staff Facilities 5.0?
no problem!
Hi, I just read the documentation of PAPI to know how can I create custom placeholders from my plugin to be used everywhere.
Tell me if I'm wrong, but if I have well understood, I have to do this:
- Create my own plugin with every datas I need to create inside that will be stored in the plugin folder
- Create another plugin that will be an expansion of PAPI
plugins\PlaceholderAPI\expansionsthat will gather all datas of my main plugin.- Register the expansion on the
ecloud
Thanks in advance ^^
And a custom placeholder like %mycustomplaceholder% can be used everywhere else ?
if its a placeholderapi placeholder and its application supports placeholderapi then yes
I removed the expansion from ecloud and it is still in my plugins and all of its commands still work
?
I install luckperms with papi ecloud and i removed it from the files and it is still in my plugins list
I didnt install the actual plugin
ok not too sure why ud download the expansion then
but have u restarted the server since removing the jar from the expansions folder?
or reloaded the plugin
wait, what "commands" are working btw? if u dont have the luckperms plugin, then how is the luckperms expansion ever going to work?
it should be throwing a billion errors too
Am not getting a single error, every coammnd s working
I can install it without it doing anything (the plugin is luckperms)
help
Is there a way to get bungee information (player count) into a bukkit place holder for use in a message?
%bungee_total% will give u the total player count
Yes but how do i register others?
Like create my own
How do i get the data from bungee to bukkit
if u want to register ur own placeholders then u will have to create ur own papi expansion
Does Placeholder API support messages in spigot.yml and paper.yml files?
%math_0
Thanks :)
Hello guys
The redisbungee expansion is not working, i have tried with 3 diferent versions of papi and redisbungee but nothing
Can someone help me with that please?
statistic expansion
alternatively, ajLeaderboards
alternatively, my plugin 😊
whats your plugin? 👀
its like 99% done
what does it do?
presumably tracks statistics and allows you to make leaderboards
just combat related stats kek, i wouldnt try to replace leaderheads 
ah too bad
ive been slowly chipping away at it for ages now and rewritten it before even releasing it 🙃
if u wanna see the repo i can link, written in kotlin ofc
i mean yeah that'd be cute
AJ already beat you to it, anyway with ajLeaderboards 🙃
😩
i mean bungeecord slots (global slots)
Please respect the rules, be patient and don't ping staff members!
?imgur
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
Is there any way to display papi on a bot
Like player specific papi
Like mybe
+stats {username}
Is there any api for that
That display papi
I don't think you're allowed to have spaces in placeholders?
oh
are you including formatting inside of a placeholder, and another placeholder?
oh on the exaple you can
what example wtf
%rel_relcon_viewer_tooltip.staff_{nl}&8&l&m {nl}&6&lJailed &8&l» &7{essentials_jailed}_ %
you have the expansion and did /papi reload?
try removing the trailing _ maybe?
the end _?
yea
same thing, i think i should have the _ at the end as it has that on the example
Please respect the rules, be patient and don't ping staff members!
i think the expansion owner is @bronze bison
Please respect the rules, be patient and don't ping staff members!
well yeah but Blitz is an expert in solving things
Is it possible to put placeholder inside a placeholder?
if that specific placeholder supports it, yes
then u can do %placeholder_{inner_placeholder}%
is there a way to get the population for a town in advanced towny?
This is a known bug. I thought it was fixed already but apparently not. Can you download latest PlaceholderAPI dev build and also latest version of that expansion? I can't guarantee it will fix it but its something you can try.
?papi-builds
You can find the latest PlaceholderAPI dev builds here: https://ci.extendedclip.com/job/PlaceholderAPI/
you can get the latest dev build of PAPI from here ^
ty but I have a bug when it's not calculating at all the delay like the kit is claimed but it's not apearing I'm gonna try
all their tags are listed here: https://github.com/TownyAdvanced/Towny/wiki/Placeholders. You'll have to test them yourself since I don't have the time to do so. I did find these 2 these which l think look like its what you want. https://i.imgur.com/iJBEvDh.png
oh now it's solvet but for this it's still don't working https://imgur.com/a/GWmJjTA I claimed this kit and when I try to claim it againt it show me how much time I have to wait but in placeholder not...
what placeholder are you using to display that?
%essentials_kit_time_until_available_monthly%
Am I blind or is there no placeholder option available for fetching the Global maximum players for a bungee network?
You can use Pinger for individual servers, but not the overall max network players
you can use math + pinger to sum them up
You can use Pinger for individual servers, but not the overall max network players
%math_0:_{pinger...first-server}+{pinger...second-server}+...+{pinger...last-server}%
well that's the only way
Ah ok, thats what I was thinking but I thought theres gotta be some placeholder available for it. I wonder why there isnt - Seems like a fundamental placeholder which should have been part of the "Bungee" placeholder expansion
probably bccz they'd have to do the same thing.
and they'd have to know what all your servers are
I dunno how the underlying code works for the Placeholder API, but the minecraft query protocol returns all sorts of useful information including the currently connected player amount as well as max allowed
So I feel like these values wouldnt be that hard to poll... Idk 🤷♂️
the expansion is OS so if you feel like you can add it or know someone that can then feel free to do so
I've never touched the Bukkit API (I don't develop mc plugins), so I wouldn't have a clue for how to go about it 😁
also the Bungee expansion uses the Plugin Messages feature. Which only gets sent when someone is on that server. So even if it could pull the data it won't be able to get it unless there's someone one all servers at all times
Anyone know why after updating PAPI my chat is now all lowercase
u using ChatInjector?
then that's the problem. ChatInjector + PAPI 2.10.7 (or higher) does that.
I don't think there's a fix. you can either not use ChatInjector or use PAPI 2.10.6
so it's a bug?
it looks like it. What if you try to get the kit using /kit? Does it show the correct delay?
yep
anyone know why %world_nearbyEntities_<radius>% isnt working for me? i downloaded the world thing for papi
i have the underscores between nearbyEntites
%world_nearbyEntities_10%
So uhm, What is placeholder api?
a bunch of placeholders for a lot of plugins
HELP none of my the placeholders in the world section work for me
have you done /papi ecloud download world ?
Did anyone reply with a fix for it?
%rel_relcon_viewer_tps.staff_&fTPS: &3{server_tps}_%
What is the difference between PlaceholderAPI-2.10.9 (released two days ago) and PlaceholderAPI-2.10.10-DEV-109 (released in September 2020, it means a half year ago)?
Because in case PlaceholderAPI-2.10.9 there is some error with papi parse command again. Something similar was in September: #placeholder-api message
2.10.9 was released on August 2020, wdym? @fathom peak
See https://ci.extendedclip.com/view/Plugins/job/PlaceholderAPI/110/ - and note "DEV" in the name of file.
2.10.10 DEV works but 2.10.9 not.
Please respect the rules, be patient and don't ping staff members!
Please respect the rules, be patient and don't ping staff members!
Note the number of the file? 10 is greater than 9 lol
But on console I have since several weeks this:
[06:39:09 INFO]: [PlaceholderAPI] An update for PlaceholderAPI (v2.10.9) is available at:
[06:39:09 INFO]: [PlaceholderAPI] https://www.spigotmc.org/resources/placeholderapi.6245/
Earlier I didn't notice it. So maybe I really didn't notice it OR the message began to appear several weeks ago.
You are right. There was no newer update 2.10.9 and I really for many months ignored message about newer ("older") version. And several weeks ago I suddenly noticed this message on console. So sorry for the confusion.
Any way to change %essentials_afk% to output [AFK] or nothing instead of Yes and No?
Any placeholders that show dealt damage amount? (that resets to 0.0 after 10 seconds
What placeholder, is on the player head in the inventory?
%player_name%
None. You'll probably need a custom expansion for this.
or a custom javascript placeholder
use the javascript expansion to change the output. https://github.com/PlaceholderAPI/Javascript-Expansion/wiki
can u make me one plz D:
dealt damage and recieved damage
thx
nope. ain't got time. Try #827055635052888075 or #827055634586271775
kk
No of the name, but of the player head.
there isn't a placeholder for that.
what plugin do you use to put the head in the inventory?
I will send you picture in pm.
yeah but that doesn't tell me what plugin you use tho.
there is no placeholder for that
anyway the short answer is there is no placeholder for player's skin/head.
Placeholderapi
well that's not what placeholder api is for
pm
well if I tell you its not possible why do you ask again? The simple answer is: "you can't do that with placeholderapi"
Allright then. Then you don't know a plugin for this or something like that?
I think the plugin called ItemJoin has it. Not 100% sure but you can try reading their wiki and see if it does. This is the spigot page: https://www.spigotmc.org/resources/itemjoin.12661/
Hmm, okey.
Noob
?
xd
Which type of issue do I have to open to get my minecraftplugin added to the supportet ones of PlacholderAPI?
"If your plugin isn't shown here and you want it to be added, open an issue and we will add it!"
Ohh so you added placeholders you just want them listed on the wiki?
No, both
well you need to add the placeholders yourself in your plugin following the instructions at the link I sent then you need to make a Pull Request to the wiki to list them there.
Thanks
function afk(){
if(afk == "yes"){
return "[AFK]";
}
return "";
}
afk();```
Iam not great at this but i tried that but now it outputs True or False and iam not sure how to make it output [AFK] and nothing
how did it change from yes and no to true or false?
which one? /papi parse me %essentials_afk% ?
or /papi parse me %javascript_<identifier>% ?
iam using this to put [AFK] next to player names in DiscordSRV when u send playerlist to send u the playerlist, so it puts true or false next to their name in playerlist
yeah but are you using the javascript placeholder or are you using the essentials one?
essentials one but iam trying to change output
well you can't change the output. you need to make the js placeholder. That's an entirely new placeholder that you have to use.
it doesn't actually change the output of the essentials one
So %essentials_afk% outputs yes or no depending on if player is afk, i cant change the yes to output [AFK] and no to output nothing?
well you can make a custom js placeholder. which you did, didn't you?
just use that placeholder
instead of the essetials one
yes
anyone know how I would use this placeholder?
%rel_relcon_viewer_tps.staff_&fTPS: &3{server_tps}_%
It’s not working for me
@silver minnow Unknown expansion.
@fluid chasm
uh
And I think my placeholder should work, but it’s not
%rel_relcon_viewer_tps.staff_&fTPS: &3{server_tps}_%
whats the placeholder for the server time?
%world_time_<world>%
i want it hour-minute-second
do u want the real time or ingame time?
real time
%server_time_<SimpleDateFormat>% use this then
what do i type in the simpledataformat
Anyone know how I can use relcon placeholders?
i dont get it
i want it like that
you know how to make it?
HH:mm:ss
thanks
what does this placeholder parse then?
Please respect the rules, be patient and don't ping staff members!
can you do /papi dump and send the paste link it generates here?
also why the _ at the end?
why not just &fTPS:&3{server_tps}%
That's what I said but he said the example had it 🤷♂️
Its a relational placeholder, so papi parse might not work correctly with iy
is it possible to use a math placeholder inside a math placeholder?
ping me if you guys have answers
@smoky spoke yes but you will have to use {} instead of %%
here you go https://paste.helpch.at/noyageleba
Please respect the rules, be patient and don't ping staff members!
oh ill try it on a plugin then
you can use /papi parserel <player1> <player2> <placeholder>
yeah isnt working on a plugin
https://media.discordapp.net/attachments/474687862189588490/829333649194221618/unknown.png
I make the console parse %checkitem_remove%. Is there a way to prevent this from giving output?
I don't think there is I'm afraid.
;-;
I mean if you edit the code you could make it return an empty line
but that's the best you'll get
ok
code is here btw: https://github.com/PlaceholderAPI/CheckItem-Expansion
how can i ecloud craftingstore papi?
There is no ecloud expansion. It comes with the plugin. So if you install the plugin on your server with PlaceholderAPI as well it will just work
commandNPC doesn't have placeholders. It just supports them. So there is no expansion at all. Not in the plugin and not on the ecloud. Also you can use this website: https://api.extendedclip.com/all/ to see which expansions you can download
if its not there then it either comes with the plugin or it doesn't exist
never test it like that. test it using /papi parse me %placeholder%
if it doesn't work with that command then its broken
if it does but doesn't work in your hologram or other stuff it means that plugin doesn't support the placeholder
also if that is HolographicDisplay you need to also install HolographicExtension and ProtocolLib.
and always use this command to test placeholders /papi parse me %placeholder%
did that andi got a blank message in resturn
means there's no one in the #1 spot
but if it returns something else other than the %placeholder% itself
then it works
no problem
how do i parse a placeholder inside another placeholder again? i forgot sorry for the shit question
in code or just ingame?
in game
if the placeholder supports it, u can use %placeholder_{inner_placeholder}%
Whenever someone has the chance, could they add me to the "PrisonRanksX" channel?
To what
Ah, I see.
Hello it's possible to use placeholdersapi with gradle?
yeah. there should be a tutorial on the wiki
do you have a link?
ho thank you
does placeholderapi support Unicode
since this is happening to me with the Prisons plugin
you sure it's the same character?
well it seems to be working now
It’s a permission based placeholder, so it should just work on regular papi parse
%rel_relcon_viewer_tps.staff_&fTPS: &3{server_tps}_%
how do you want it to work ? it's a relational placeholder
it requires 2 players
normal parse uses 1 while parserel uses 2, it's even in the name, parserelational x)
i am using holographic displays, insatalled the expansion player of placeholder api but still the %player_name% is not working
- '&dBenvenuto &7%player_name% &dsu &a&lIT&f&lAPI&4&lXEL'
I see %player_name% and not the actual name
Hey! https://pastebin.com/3MX20dGR when I start my server reload the plugin I get thist error, how can I fix it?
you have to download Holographic Extension aswell as ProtocolLib for PlaceholderAPI support on Holographic Displays' holograms
I think that the Config Expansion couldn't get registered, or something like that
idk what you could do, maybe try to redownload it
show your papi config @vestal granite
aah
ok
when using something like %statistic_kill_entity:<MobType>% how would i do all mobs
I think its just %statistic_kill_entity%
so the math one would be something like %math_0:_{statistic_player_kills}+{statistic_kill_entity}%
it tells me i need a thing added when i just try %statistic_kill_entity%
hmm 1 sec then I think there's another one.
ok
ah its just %statistic_mob_kills%
statistics updated to 1.16.5?
they should work on 1.16.5
statistic_smoker_interaction
statistic_blast_furnace_interaction
or
statistic_interact_with_smoker
statistic_interact_with_blast_furnace
doesn't work
can you do /papi info statistic and tell me the version please?
[12:36:48 INFO]: Placeholder expansion info for: statistic
Status: Registered
Author: clip
Version: 2.0.0
I'm using an even older version (1.9.2) and %statistic_interact_with_smoker% works
so does blast furnace
seriously
Blitz....
what?
That's creenshot
what about it? I was showing him it works for me. And should for him as well since the expansion just uppercases the input and finds the Statistic enum with that name.
Is PAPI bungeecompatible?
no
thanks
how to remove .000 in expression math?
%math_0:_math here%
thank
Hi, is there a placeholder to indicate the number of players in a Multiverse world? I can't find anything on the placeholder list
Is there a way to use placeholders in a bungee proxy? Like I have bungeechat and need it to display prefix
I thought it was based off of permissions
Like if the player has permission, they can see the text in the placeholder and if not they can’t

Hey guys, can I please have some help with using a placeholder in my code? I am trying to get the server to send a message to the console if the top Island (%iridiumskyblock_island_top_name_1%). However, all I know how to do is this method: PlaceholderAPI.setPlaceholders(Player, "%iridiumskyblock_island_top_name_1%"); But who is the Player in this case since the placeholder doesn't return a player and no one will be executing a command / triggering an event
So Im not sure what to do when the placeholder doesn't require a player
is there a way to shrink a placeholder? Im trying to add a placeholder to my scoreboard but the placeholder is counting towards the 32 char limit
How to use GraalVM with the javascript expansion?
because nashorn is removed from java 15
it's relational and based on permissions, but still relational
set the engine to graal.js
you could maybe do that with javascript
already tried it but you have to do %javascript_(script)% so its just as long
I think you can just use null if it's a server placeholder =if it doesn't require any player
uh, only the output is counted, not the raw placeholder
and if the raw placeholder is counted, then your scoreboard plugin does something wrong
Ya it was a free one. Thinking about getting featherboard but not sure if 19$ is worth for a scoreboard haha
can you disable the Tab names? I use CMI for it
yeah, you can disable everything and only keep scoreboard
Might go that route thanks
Thx
Hi, any idea was papi saying
[02:03:16] [Craft Scheduler Thread - 253 - PlaceholderAPI/WARN]: Returning offline Player UUID for : the_ronpaul on startup ?
sounds like that player was offline that you tried to lookup with a %player_<something>% placeholder
no, it just means that that player isn't online
great, thank you
There's a %server_online_<WORLD-NAME>% placeholder I think. Use that one
Thx
The only way is to have a bridge like the TAB plugin has.
you can put null there as well. If the expansion takes that it will work.
hello
i have a problem..
i importet the papi dependencie
with gradle
and did it like in the tutorial in the github wiki
acceptText = PlaceholderAPI.setPlaceholders(event.getPlayer(), data.acceptText);
and this error shows up
=paste
Please use a paste service to share configs, errors, code and long logs.
• HelpChat Paste
wait
you might want to make a check if data.acceptText == null
^^^
yeye
Anyone know how I can not remove enchanted items with checkitem remove
Im noticing that it removes my enchanted items and non enchanted
Hi! I made a new placeholder extension for one of my plugins and would like to upload it to the cloud, but I can't make an account as registration is locked. Can I make an account? 🙂
Ah, I had a look through - looks like I need to contact an admin 😅 It seems like they all have friend requests and DMs turned off, though. Sorry for being annoying, perhaps a support could help me contact them? @mint fable
Please respect the rules, be patient and don't ping staff members!
@balmy marten 
Dm me a username and email you want
Thanks, all sorted 👍
We use simple score for our scoreboard plugin and it uses placeholder api and we use rankgrant+ for our ranks. I already asked the rankgrant+ guys and Simple score and they all said to ask you guys. We basically want to have it show your rank on the side. Anyone know how to?
so with towny, the town/nation placeholder is empty if you are not in a town/nation. is there a way i can make it say something like 'no town' instead of there being an empty line on my scoreboard?
bridge?
Please respect the rules, be patient and don't ping staff members!
Isn’t RankGrant+ just an easier way of using other permission plugins?
So what permission plugin do you use
is there like a spigotbridge plugin
can someone help me out when i use papi with any economy plugin this spams my console
Exception in thread "Craft Scheduler Thread - 9"
it also says 1,12,14,13,15,16 in the following lines
it seems to be as soon as the plugin starts saving data
Hi! Does anybody know a placeholder to get the number of players in a dimension (not by world)? So for example, if there are 10 players in the End dimension, it should display so, regardless of the world's name (which is the issue I have with retrieving by world - the world file's name constantly changes and I need to manually update placeholders every time)
Please @mention me when you reply, and thank you in advance :)
also it only happenes when using yaml text not using mysql or sqlite databases
thats all it says in console those lines over and over with different numbers
i mean i have tried 3 economy plugins and when papi and the economy plugin is in the plugins folder it shows t hat
so its incompatability most likely?
i can also just completely block the message from console if its a harmless error
bump
javascript, I might've done it myself in the past so let me have a look
okay thank you
function jsonTowny() {
if ("%townyadvanced_town%" !== "") {
return "&7[&3%townyadvanced_town%&7] ";
} else {
return "";
}
}
jsonTowny();
so adapted for your use case, it would be something like:
function jsonTowny() {
if ("%townyadvanced_town%" !== "") {
return "%townyadvanced_town%";
} else {
return "No Town";
}
}
jsonTowny();
aha
figure out what placeholder instead of %townyadvanced_town%
quick instructions:
- install javascript papi extension
- create a folder in the PlaceholderAPI one called "javascripts"
- make a new file in javascripts called "townyprefix.js"
- paste this code into there:
function townyPrefix() {
if ("%townyadvanced_town%" !== "") {
return "%townyadvanced_town%";
} else {
return "No Town";
}
}
townyPrefix();
- make a file in PlaceholderAPI folder called "javascript_placeholders.yml"
- put this in the file:
townyprefix:
file: townyprefix.js
- use the placeholder %javascript_townyprefix%
yw
How can I use my placeholder from placeholderapi on plugins like featherboard that use mvdwplaceholderapi?
{placeholderapi_<placeholderapi_placeholder_here>}
Thanks
Bump
This part of it too
Wanted to bump this message (get the number of players in a dimension regardless of worldname)
Why does the world name change?
Paste the entire error
can i create Placeholder?
If you make an extension
Or are you making a plugin? You can natively include placeholders if you are
So I want to program a plugin
What about using mvdwplaceholders in placeholderapi?
%mvdw_{mvdw_placeholder}%
alright thanks
HI?
anyone in here active?
i need Deluxe Menus to use my Tokens plugin as the Economy
since i want to make a backpacks GUI but i need it to check to see if they have the right amount of tokens or not
what tokens plugin?
Tokens
and i got it working but how do i get the math placeholder to output a formated output
it would be really helpfull if i can directly show pictures here https://i.imgur.com/m5EW30U.png
Tokens
afaik you'd need the javascript placeholder to add formatting to the math's output
javascript isn't the same as java, but it's really not too bad
here's some examples: https://github.com/PlaceholderAPI/Javascript-Expansion/wiki/Community-Scripts
you make a javascript file that calculates that and returns it formatted
function numberWithCommas(x) {
return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
}```
just do that to whatever the result of your math placeholder is
so i would have to duplicate that java script 2 more times for what i need?
well you can use that function as many times as you want
i have no expeirence in java or javascript lol
how would i be able to make it pull the players token balance
you can resolve placeholders
still doesent really translate to me lol do you know how to do it?
parseInt('%player_health%')
o ok but i dont even know where to start unless i should use one of the premade scripts on the github
Making custom placeholders
https://paste.helpch.at/uhiwamoqer.js
Sometimes this parses the permission, sometimes it parses nothing?
so this is rounded playerhealth how do i change that to minus 75000 off the token balance
function hp() {
return Math.round(parseInt('%player_health%') * 100) / 100;
}
hp();
so i get rid of .round and 75,000 - parsein?
if so how do i add whats above in
i have this rn but theres a red x and adobe brackets "function hp() {
return Math 75000 - (parseInt('%Stars_balance_format%');
}
hp();"
function numberWithCommas(x) {
return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
}
function displayTokens() {
return numberWithCommas(parseInt('%stars_balance_format%') - 75000);
}
displayTokens();```
something like that
o ok intresting
so would Adobe Brackets let me preview or should i just upload that
the text editor brackets?
yes
i copy and pasted that and its complaing about errors with it lol
with line 2
as theres an big x there
function numberWithCommas(x) {
return x.toString().replace("/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g", ",");
}
function displayTokens() {
return numberWithCommas(parseInt('%stars_balance_format%') - 75000);
}
displayTokens();```
I verified in VSCode it looks good
though I've also never written a JS papi script
so who knows
notepad++ doesent complain
notepad++ doesn't do linting
o ok
so do i use the filename when useing %javascript_<your placeholder identifier>% or displaytokens?
filename afaik
is displaytokens the identifier?
i dident yet
you didn't set it up in the javascript file?
well you'd use the identifier, I believe it says what to use in the javascript yml as well
ah yes you'd do like
file: displaytokens.js``` or whatever you named it
yeah
kk thanks
%javascript_displayTokens% is the placeholder?
yeah, whatever you make the identifier
displayTokens:
file: displayTokens.js
engine: nashorn
displayTokens in this case ^
i saw this in console
<eval>:2:65 \B(?<!.\d*)(?=(\d{3})+(?!\d)) near index 3
\B
return x.toString().replace(/\B(?<!.\d*)(?=(\d{3})+(?!\d))/g, ",");
^ in <eval> at line number 2 at column number 65
copy paste my new code
since discord messed it up
Please use a paste service to share configs, errors, code and long logs.
• HelpChat Paste
function numberWithCommas(x) {
return x.toString().replace("/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g", ",");
}
function displayTokens() {
return numberWithCommas(parseInt('%stars_balance_format%') - 75000);
}
displayTokens();```
put that in
ok so it returned -74970 without commas and kk
o this would be flipped since the msg only shows if the player cannot afford it numberWithCommas(parseInt('%stars_balance_format%') - 75000);
so the player will always have below 75000 when they see the msg
sorry so you want it to return whether or not they have 75000 tokens?
so it should be 75,000 minus there tokens balance
okay, so swap it
yea
so im reading your java script i think i can understand what its doing lol
so the top part would replace all those symbols with ,
and you put it below so it is able to use that function
the top function is a very complicated regex I stole from the internet that slaps in commas every 3 numbers in front of the decimal, yeah
o ok
so uh, I don't know what's wrong with this lmao it works like 40% of the time
that is such a terrible function I do not want to look at it, but try looking at what permissions don't work when it doesn't return anything
is it as easy as just moving the parse bit to the right and 75,000 to the left?
since none of them must be set, or something
how could I improve that function
return numberWithCommas(75000 - parseInt('%stars_balance_format%'));
check what the last character of that permission is
then have a switch statement based on that, and not 16 variabels
so when i do "papi parse me %javascript_displayTokens%" it does not show commas?
did you put quotation marks around the regex
yeah idk
regex?
the (())())( thing
i literally just told you lol, what don't you know
im going to have to say say prob not?
o ok
like I am not an expert any any form of coding/java scripting 😂 I don't even know where to begin to check for a certain part of that permission
does the x next to numberwithcommas have anything to do with it?
substring, use the index of the last char
no that's the argument variable, turns out the regex no worky so hold on
o ok
im going to have alot to learn when i go to college as i know there going to go over javascript lol
javascript is quite easy, I assure you
kk thats good
i never really spent the time to learn any codeing language but i do want to learn it
i found this on google" function numberWithCommas(x) {
x = x.toString();
var pattern = /(-?\d+)(\d{3})/;
while (pattern.test(x))
x = x.replace(pattern, "$1,$2");
return x;
}
on a site called stack overflow "How to print a number with commas as thousands separators in JavaScript
"
it works
function displayTokens() {
var nf = new Intl.NumberFormat();
return nf.format(parseInt('%stars_balance_format%') - 75000);
}
displayTokens();
try that
this outputs a script error
[02:00:45 ERROR]: [PAPI] [Javascript-Expansion] An error occurred while executing the script 'displayTokens':
ReferenceError: "Intl" is not defined in <eval> at line number 2
okay I guess this version of JS doesn't support that
whatever, use your regex thing lol
var permission = "%luckperms_has_permission_ardor.prefix.format%";
var p = permission.substring(19);
this for the variables Star?
var permission = "%luckperms_has_permission_ardor.prefix.format%";
var p = permission.substring(45);
function permission() {
if (p.indexOf(".1"); === "true") {
return "ardor.prefix.format.1"
}
maybe?
well I tried this lol, probably not any better than before, also doesn't work
https://paste.helpch.at/sufihedepe.js
I mean, the only reason I'm trying to make this placeholder is so I can set and unset permissions for the colors in a GUI without having to unset every option each time, I'm sure there's a better way to do that..
iirc the placeholder is directly parsed when it's in a string
try something like var permission = "%" + "luckperms......";
hmm
then parse it with PlaceholderAPI.static.setPlaceholders(BukkitPlayer, "placeholder here")
well I'm not using java, just javascript
works as well here
and also, I'm not quite sure how your script works x)
p.indexOf(".1")
you're checking if the % is equal to .1? 😅
since p = permission.substring(45)
and that would return the % in the permission string
var permission = "%"+"luckperms_has_permission_ardor.prefix.format.";
var list = ["1","2","3","4","5","6","7","8","9","0","a","b","c","d","e","f"];
function permission() {
for (var i=0;i<list.length;i++) {
var p = PlaceholderAPI.static.setPlaceholders(BukkitPlayer,permission+list[i]+"%");
if (p == "true") {
return "ardor.prefix.format."+list[i];
}
}
}
permission();
try that
oh wait
yup
but excellent, that's exactly what I was talking about!
Is there a way I can do %checkitem_give% for mob spawners?
I'm not exactly sure the new 1.16 way to get mob spawners with a mob inside lol
or if anyone knows a /give command to get a mob spawner with a mob let me know, ive been searching for like 15 minutes lol
ah
not sure that works anymore
I tried this but I must've done it wrong or something
idk if this is added in there but if not wdym lol
I really just recommend using a plugin for this. But you can try /minecraft:give spawner{SpawnData:{id:zombie}}
Hi, I have a problem and it is that when I put the placeholderapi it turns out that the chestcommand I can't open it, I can't find the holderapi if it needs it, what solution is there?
Is there a way to make it so the date format displays am/pm?
any one knows why this output doesnt return %math_[precision:0]100/1000000*{vault_eco_balance}%%
probably because you have 2 % 🤷
nah
oh
what does it return instead?
Does it just return the placeholder itself?
ahhh can you do /papi info Math and tell me the version?
1.2.0
yeah ok use this instead: yml %math_0:_100/1000000*{vault_eco_balance}%%
thanks
Anybody knows if there's a placeholder to get total mob kills?
Or should I use math expansion and manually sum all of them up?
%statistic_mob_kills%
yeah I know. There's quite a few that are not listed there I think
I'm having an issue, I have a checkitem remove placeholder to remove a piece of armor but it removes enchanted armor too
so if someone wants to sell netherite armor, but they are wearing it too, its going to sell the enchanted one first :(
did you add the dependency to your maven/gradle?
Hello, there is an error in deluxemenus about the PAPI-TokenEnchant api, does anyone know how to solve this error?
the server is 1.8
Paste Services
When asking for help with a config/menu/code issue please use one of these:
(However we do prefer if you used our paste :))
• HelpChat Paste - Usage
• Hastebin
says it doesn't recognize Token expansion
I have a photo only, how can I send it?
?paste
Paste Services
When asking for help with a config/menu/code issue please use one of these:
(However we do prefer if you used our paste :))
• HelpChat Paste - Usage
• Hastebin
1.8.8
1.12.2
1.13.2
1.14.4
1.15.2
1.16.4
v1.10.5
v1.13.3 - Latest
v1.13.3 - Latest
v1.13.3 - Latest
v1.13.3 - Latest
v1.13.3 - Latest
wrong version of deluxemenus for 1.8 ^
also the problem is that one of the token enchant placeholders is just broken
and returns null
so it breaks the menu
what is the correct version for 1.8?
Look at the list sent by Barry
Is there a placeholder for the total number of blocks broken in a world
And how can I put it in a leaderboard
Help
This is urgent
In a world no.
Just in total
%statistic_mine_block%
and you can make a leaderboard by using a plugin like LeaderHeads or ajLeaderHeads
well I guess it will
pinned messages
you need to download it from here: https://github.com/Altruiis/skript-expansion/releases/
oh it got pinned
okay thanks
what’s the free version?
Please respect the rules, be patient and don't ping staff members!
it’s the reply thing sorry
ajLeaderHeads is free
can i get a link?
you said you'll use SimpleScore. That should work
i hope.
Hi, when I try to get the MySQL expansion working I get this error - https://paste.helpch.at/diqulidobo.pl
I've tried with the latest version as well as the 1.3.0 version from 2019 (second latest release)
All expansions are loaded on server start, then when I log online everything breaks
ugh yeah that expansion is broken. 1 sec I remember their being a more updated one somewhere
Nope nvm. I guess no one fixed it.
Its also weird that the ecloud one was updated in February but the original one on github was only udpated 5 months ago.
Oh nvm it still is the same. He just updated it later
yeah so I think the only thing you can do is contact the developer and ask him to update it. This is his github: https://github.com/SuperRonanCraft
When i do %player_server% it returns the value Now available in the server expansion thought i have player and server downloaded
wdym?
I want to display the name of the server the plyer is currently in
(bungeecord server name)
what's the output for %player_server%?
(/papi parse me %player_server%)
Now available in the server expansion thought i have player and server downloaded
oh
i feel like that doesn’t need placeholder api cause you could just put the server name?
then its not scalable?
screenshot?
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
im confused
^
and you're running this command?
OH
cmon bot
there we go
%server_name%
seems to show the MOTD
o
A Minecraft Server i get
hm
placeholder api should go on just bungee or all servers?
ideas?
thanks tho
Tried it now but it doesnt work
If I were to make an addon, how could I get it to be in the ecloud library
Hey @errant iron, very sorry to ping but, you got any follow up on this?
oh yeah he added it lol
ah
could you assist me further on it?
it provides an error
current code: https://paste.helpch.at/jupepekoza.php (haven't really changed anything)
error: https://paste.helpch.at/uloyideveq.bash
basically says it's line 12 "permission();" is not a function
seems like an easy fix I just am not experienced enough lol
Did you add the config code to javascript_placeholders.yml?
yeah
Hastebin your javascript_placeholders.yml
and the file prefixcolor_permission.js is in the /plugins/placeholderapi/javascripts/ folder?
yes
nice
Switch to IJ
did you add it to gradle/maven
i just simply add it as a external JARs
oh boy
where i can see what i added to gradle/maven
in your pom.xml or build.gradle file lol
.
yeah you won't get any help in Eclipse lol
oh
Doubt anyone here uses eclipse, so I've no idea how it works
how can i add external jars in ij
You use gradle/maven
okay now swap to gradle
:kek:
changed to gradle
Method does not override method from its superclass
🥲
so how can i add external jars in ij
what do you mean ,
i know how to link papi
but there are some jars that not on internet
repositories {
maven {
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
}
}
dependencies {
compileOnly 'me.clip:placeholderapi:{VERSION}'
}```
you do that
oh I see hold on let me get it
in local
implementation(fileTree("lib")) its that for the kotlin syntax
i forget what it's like for groovy bois
implementation files('libs/something_local.jar')
that's it for groovy
oh ok
do i need to like install anything to make this one work
or is this placeholder built in
/papi ecloud download Statistic then /papi reload
kk
its jsut showing 10
nothing else
wait i spoke to soon
wait
When I break a block, it goes up by 2
yeah it keeps going up by 2
wait some blocks are 1 some are two
is your server 1.8 by any chance?
p sure it keeps track of blocks mined
how can i make it like work?
It does. But per block. Statistic calculates the total.
I don't think there's anything you can do
I know this was a problem on 1.8 as well bcz GRASS was counted twice. As soil and as grass as well
now my 50 person event wont work as i wanted it too
so it might be the same thing here
I mean, they're all mining the same amount of blocks right?
50 players are mining the blocks in 1 area
they dont all mint he same amount
they
one can mine 100 one can mine 50
oh well as long as the numbering is consistent, you can set your goal or whatever right?
well yeah but like if you're tracking number of stone mined or something up to a total you know how many each stone is worth right?
its grass, stone, wood, leaves
what Star is saying use the per material count and then use the math expansion to calculate them. If they're just like 3-4 of them
%math_0:_{statistic_mine_block:grass_block}+{statistic_mine_block:stone}+{statistic_mine_block:oak_log}+{statistic_mine_block:oak_leaves}%```
or something like that
idk if I used the correct material names
that you can't with PAPI
ugh
is there a way i can like define the most popular blocks
dn the ones i haven’t a
just get added on, even if it isnt exact
????
actually with this, could i make like grass plus stone, and then for stuff like leaves i half it?
*other way round
yeah how do i do divided by 2
%math_0:_{statistic_mine_block}/2%
?
.
wahts divide 2
ugh /2
Contact funnycube#0001 to make you an ecloud account.
Ok I got it too work
i thoguht it was so compalicted symbol
&7%math_0:_{statistic_mine_block}/2%"
That actually all works
Leaves cout as 1 now
Blocks coutna s 1
Yeah im good
Ty
does papi work with essentials x
no it does not
you can't use PAPI placeholders in essentials. Tho there are some workarounds like using ChatInjector (plugin)
Ok thanks 🙂
actually I think his DMs are blocked
@balmy marten when you wake up can you help this man out? ^
what time?
