Forum rules: Do not post bugs or feature requests here! Report bugs to our Issue Tracker and suggestions to Suggest a Feature.

This site is not for solicitation of services or 'purchasing' development. Please do not post requesting side mods/plugins and so on. Your thread will be removed, and you will receive a warning.
By AnonymousDolphin
#205810 Hi!

I was wondering if anyone knew how to make scoreboards containing pixelmon data?

To be spesific, I want to have a scoreboard that displays the total amount of pokemon each player has defeated.

If not possible, are there any pixelmon spesific data (pokeball throws, pokemon caught, gyms defeated etc.) other than the typical stats.craftItem or stats.useItem?

Thank you for checking out my post, have a great day! :)

By AnonymousDolphin
#205819 I found a way using command blocks and the advancement for defeating your first wild pokemon.

First I made a scoreboard named Kills, with the objective trigger (scoreboard objectives add Kills trigger)

Then I enabled all players to trigger the scoreboard with a command block on repeat:

scoreboard players enable @a Kills

Afterwards I put three command blocks in a chain.

1 - advancement test name pixelmon:wild_battle_victories/wild_battle_victory_trigger
//This one checks if the given player/players have the advancement

2 - execute name 513 56 -1758 trigger Killsadd 1
//This one adds +1 to the scoreboard for the given player. The coordinates I do not know if matter, but apperantly I had to add them for the command block to work (it is the cords of the command block)

3 - advancement revoke name only pixelmon:wild_battle_victories/wild_battle_victory_trigger
//This one removes the advancement for the given player, so that they can kill another pokemon and gain the advancement anew.

I found this method works, but is very clunky.
User avatar
By NatNATTO
#243911 I found a great way...

Pixelmon stores lots of data in its langage file "en_us.json" however it has no hooks to be able to use it in game, it has frustrated me to no end... then I found this! https://www.spigotmc.org/resources/bukk ... rs.105174/
It is extra placeholder API for pixelmon so you'll also need https://www.spigotmc.org/resources/placeholderapi.6245/
It adds hooks for pixelmon statuses that you can call on to parse/display those stats in different commands.
For example you would enter this on the scoreboard display

Code: Select all%pixelmon_slot_1_IVs%


and the scoreboard would display the corresponding IVs

I use this for Win/Loss ratio because it has
Code: Select all%pixelmon_party_size_ableonly%


I made a whiteout mechanic using placeholderAPI aka papi and run a cmdparse to make a hook displayable to a command, then apply the hook in the right part of ANY command like this...

Code: Select allpapi cmdparse @a scoreboard players set @s battleResults %pixelmon_party_size_ableonly%


This will store %pixelmon_party_size_ableonly% (the number of live pokemon in a players party) as a score on the scoreboard objective battleResults

From there you have what most people are trying to get, and you can create some scoreboard objectives to kill the player if their score goes above 0, then reset their score to 0, then use a chain command block or function file to "respawn them" when they whiteout. If you want to KEEP the score for statistic reasons, add battleResults objective's current total to another totalResults objective and display that one instead, it'll count up for every score battleResults gets but wont reset.

Feel free to ask any questions you need to know :D
-Nat
JOIN THE TEAM