#help-development
1 messages Β· Page 920 of 1
and i can hardcode most of the things
Make a git repo
i'm not like coding a skyblock core i'm just coding an entire server if I wanted to make another gamemode I would make it in the same project
the problem right now is that there are no problems, I was just asking about why I should use LP and if it was compatible with my goals
Any permissions plugin would be
but also you could design your own permissions system
That's a bit more on the complex side however
Hi, how to install with VPS some resource from the spigot?
in wget, curl etc..
π΅π±

Czech. π
π
I try spiget (api) and where is resource id π in the apiu.spiget.org/v2/resources doesn resource id, is not id, not name, where resource id π
π€π€
in the url
eg for https://www.spigotmc.org/resources/simplechatgames.108655/ the id is 108655
oj, yea, aj find
For example: If I would download your resource it would be replaced by "73323"
https://www.spigotmc.org/members/devcubehd.73323/
Sry, thanks β
Yea, this is a problem, doesnt work. :/
<?php
$url = "https://www.spigotmc.org/resources/hubkick.2/download?resource=108655";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
file_put_contents("downloaded_file.jar", $data);
echo "Downloaded";
} else {
echo "Error: $httpCode";
}
curl_close($ch);
?>
Error: 403
Yes, but if it gets the id, how do I always capture the correct id?
108655 is this id because it says simplechatgames.108655 but lets say veinminer it would be something else because its a different resource
https://www.spigotmc.org/resources/veinminer.12038/ here on veinminer it says 12038 after the dot in the name
Well, of course, but now I'm just trying to get it to download the .jar file in the PHP script, but I'm not succeeding, I deliberately put the simplychatgames resource id there
you have to change the name
you cant tell it to download hubkick with simplechatgames id
like this?
<?php
$url = "https://www.spigotmc.org/resources/hubkick.2/download?resource=simplechatgames.108655";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
file_put_contents("downloaded_file.jar", $data);
echo "Downloaded";
} else {
echo "Error: $httpCode";
}
curl_close($ch);
?>
oh
no
iam idiot
ye
π
<?php
$url = "https://www.spigotmc.org/resources/simplechatgames.108655/download?resource=108655";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
file_put_contents("downloaded_file.jar", $data);
echo "Downloaded";
} else {
echo "Error: $httpCode";
}
curl_close($ch);
?>
Error: 403
I thought we were using spiget
bro
this is not working with version
<?php
$url = "https://www.spigotmc.org/resources/hubkick.2/download?version=203285";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
file_put_contents("downloaded_file.jar", $data);
echo "Downloaded";
} else {
echo "Error: $httpCode";
}
curl_close($ch);
?>
yes
that isnt spiget
i using.
thats spigot
like this not working, maybe iam idiot or why doesnt work
<?php
$url = "https://api.spiget.org/resources/simplechatgames.108655/download?resource=108655";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
file_put_contents("downloaded_file.jar", $data);
echo "Downloaded";
} else {
echo "Error: $httpCode";
}
curl_close($ch);
?>
error 404
that isnt a valid spiget api endpoint
Resource Download
GET /resources/{resource}/download
Download a resource This either redirects to spiget's CDN server (cdn.spiget.org) for a direct download of files hosted on spigotmc.org or to the URL of externally hosted resources The external field of a resource should be checked before downloading, to not receive any unexpected data
read their docs https://spiget.org/documentation/
oh shit
Add /download to the end to download it
downlaed
downloaded
oh
yea
<?php
$url = "https://api.spiget.org/v2/resources/108655/download";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
file_put_contents("downloaded_file.jar", $data);
echo "Downloaded";
} else {
echo "Error: $httpCode";
}
curl_close($ch);
?>
Like this, bcs web says "Downloaded"
Looks right to me
sorry, like this
$url = "https://api.spiget.org/v2/resources/108655/download?resource=108655";
you dont need a param on there
Oh
They already have a spoonfeed for it
Actually that is just a query not a download, but yeah
I see, no problem, it's already working thanks to you, so thank you! I'll just add it to my plugin system, thanks a lot!
<?php
$url = "https://api.spiget.org/v2/resources/108655/download";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
file_put_contents("downloaded_file.jar", $data);
echo "Downloaded";
} else {
echo "Error: $httpCode";
}
curl_close($ch);
?>
β
Works!
You should set a user agent
curl_setopt($ch, CURLOPT_USERAGENT, $USER_AGENT); // Set User-Agent
this bit
change it to something that uniquely identifies your application
or well, you have to add the line
Yes, I have it, I have it in the plugin system, all that was left for me was the installation. I mean, I had to download those plugins externally π Since I have hosting and I try to do everything myself.
https://github.com/NukeCaps/DamageHolograms
How could I optimize the damageEventListener so that I don't create a list every instance of player damaging an entity and having to pass that list to hologramCreation?
[19:44:47 WARN]: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "4w.3Z%3DfS7nAW592lDk%5EVAvEd@192.168.1.189:3306"'.
why this error?
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
try {
HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://u8_PKi9Vge6s9:4w.3Z%3DfS7nAW592lDk%5EVAvEd@192.168.1.189:3306/s8_kitpvp");
config.setUsername("u8_PKi9Vge6s9");
config.setPassword("4w.3Z=fS7nAW592lDk^VAvEd");
config.setMaximumPoolSize(10);
dataSource = new HikariDataSource(config);
DatabaseUtil.createTables();
if (dataSource == null) {
plugin.getLogger().severe("Failed to get the database connection.");
}
} catch (Exception e) {
e.printStackTrace();
}
...
???
Ok yeah I didn't really think so,
public void teleportHologram(Location newLocation) {
for (int i = 0; i < textDisplays.size(); i++) {
Location offset = offsets.get(i);
Location displayLocation = newLocation.clone().add(offset);
textDisplays.get(i).teleport(displayLocation);
}
}```
How's my method for teleporting the display? Could this be improved
put the display and offset in an object in one list/map/whatever
Thread.sleep(1000);
al the cool kids hate pastebins
use caps
and whats the error
wym
Other than the performance concern what else could be improved code wise? I know the creativity is a bit bland
dont go π
As long as it runs fine, let it be, unless it can be a mess to rewrite in the future
I mean it's pretty straight forward, probably just some error handling is needed. Any of you got some creative resources involving text displays?
Im having an error when the commands of my plugin just do not work and the plugin is in red with /pl
This is my code. Most likely it is my Scoreboard stuff as it worked fine before
McPluginMain:
https://pastebin.com/QiV3wLJk
loadScoreboardOnPlayerJoin:
https://pastebin.com/LcmrqpM4
Scoreboard:
https://pastebin.com/VWu1fEFb
the main class is wrong
how so
is not a message start the loading...
?
you can put "loaded commands!" after the loading of the commands
thats just console stuff
it was there before i added scoreboards and it works fine
it is to print to the console that the plugin has started
I know, but it's not nice to see
oh well irdc about quality of life shit i have an error and i need help with it
do you know what the error is?
is in the cosole
no its not. that worked fine before i added the scoreboards and the plugin and previous commands worked fine
you can vc?
no
ee, i cant resove it if i dont see the error
"An internal error occured while attempting to preform this command"
CONSOLE ERROR
wtf do you mean?
??
guys can i theoretically run my java projects on mobiles too, as its translated to bytecode?
(not talking bout plugins, but java apps in general)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
as long as you have a jvm, yea
do android phones have that?
so new project and later i can run taht on my phone? no further config needed?
no
it depends on what your project does - some apis are not available in android and if you use a native-backed lib, it needs to have the appropriate natives
i want a project that is compatible with pc and mobile as i dont wnat to write a version for both applications
test project
no goal
wouldnt this lead to me coding the same thing 2 times?
jb compose is multiplatform if you don't mind kotlin
kotlin is bad
java > kotlin
no
kotlin is great
ayoo
your loss
no
Im having an error when the commands of my plugin just do not work and the plugin is in red with /pl
This is my code. Most likely it is my Scoreboard stuff as it worked fine before
McPluginMain:
https://pastebin.com/QiV3wLJk
loadScoreboardOnPlayerJoin:
https://pastebin.com/LcmrqpM4
Scoreboard:
https://pastebin.com/VWu1fEFb
This is the console error:
https://pastebin.com/HPTPbCR7
one question not regarding the problem, why are you faking your loading progress messages?
he is updating the scoreboard
for every player
1 secodns after another
Also, Bukkit.dispatchCommand(player, "command");
idk this code seems like he is a real beginner
but he is accessing entries of a scoreboard that dont exist as far as i see
scoreboards are pain, reject scoreboards embrace chat
(this post was made by the satirical scoreboard hate gang)
embrace chat?
its temporary bc i cant be asked
i am a beginner
dont ever call thread.sleep on the main thread
it stops minecraft in ur case
Score quarters = obj.getScore(quarter);
quarters.setScore(2);
this causes your error btw
i dont know what quarter is tho
why are you even calling thread.sleep in the first place
how is it defined
public static String quarter = null;
yes thats the problem its null
ah
is that why everything broke
yes
good to know good to know
Alr thanks
what do i replace with thread.sleep?
?scheduling
so that it updates for every player every second or so
Hey, why doesn't this work anymore?
FireworkHandler.EntityDamageByEntityEvent is only printed when im damaged by skeletons but not when fireworks
@EventHandler
public void EntityDamageByEntityEvent(EntityDamageByEntityEvent e) {
System.out.println("FireworkHandler.EntityDamageByEntityEvent");
if (e.getDamager() instanceof Firework fw) {
System.out.println("FireworkHandler.EntityDamageByEntityEvent1");
if (fw.hasMetadata("nodamage")) {
System.out.println("FireworkHandler.EntityDamageByEntityEvent2");
e.setCancelled(true);
}
}
}
what should i use instead then.
?scheduling
that only has mentioned finite delays
?
"Scheduling a Repeating Task
Repeating tasks are tasks that can reschedule themselves.
Let's say you want to schedule a task to run 10 seconds later then after that it should repeat itself a finite amount of times with an interval of 5 seconds between each consecutive run:"
it can be infinite, but in general updating it infinitely for everyone is not a good idea, when you want to update a player count on the scoreboard why not just only update when a player joins?
bc it uses commands to edit it frequently
so it needs to update no?
or does it automatically reload for me
okay, but why not auto update when the thing happens you wanna update?
and pls dont use commands to update your scoreboard
oh true had never thought about that
not even custom commands?
the arguments used from said commands is what i am using
no you can just edit it in your code, i guess if you want to edit it as a player use commands, but i dont see the reason
its for a game inside minecraft
if you think so
so the "referees" of the game have to edit the scoreboard and I cant think of many other ways
dont use commands, if you have a player join and you want to update the line with the player count just get the scoreboard and set the line with updated values
its not a playercount
why are you arguing about this useless stuff? it is useful, and thats it.
alr
if(args.length == 2){
team1score = args[0];
team2score = args[1];
for(Player player : Bukkit.getOnlinePlayers()){
player.chat("/hudload");
}
would this work?
in one of the commands' scripts
idk there is not much to see there
just the for loop
and what is it supposed to do?
reload the scoreboard when a command that is updating it is sent
e.g. /setscore 32 6 would then update the scoreboard for everyone to have the score display 32-6
dont use commands for that unless that crucial to your game or whatever, whenever you change something just change it with code and not with a command thats performed by every player
okay so tell me how to stop a thread without thread.sleep
there may be reasons, so why argue?
is my question so invalid i cant get a response
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
which event is fired when you left click on the itemframe? PlayerInteractEntityEvent isn't for som reason... only fires for right hand
I did specify what didn't work...
so everything else works but i still get the "An internal error occured while trying to execute this command" error with /hudload
/setscore
etc. etc.
should i send the code for these commands
dont use commands, internal error prob comes from one of your null constants?
I need help, FireworkHandler.EntityDamageByEntityEvent is only printed when im damaged by skeletons but not when fireworks
and I would like it to cancel if it's fireworks and has metadata nodamage
@EventHandler
public void EntityDamageByEntityEvent(EntityDamageByEntityEvent e) {
System.out.println("FireworkHandler.EntityDamageByEntityEvent");
if (e.getDamager() instanceof Firework fw) {
System.out.println("FireworkHandler.EntityDamageByEntityEvent1");
if (fw.hasMetadata("nodamage")) {
System.out.println("FireworkHandler.EntityDamageByEntityEvent2");
e.setCancelled(true);
}
}
}
its a string set by a command argument. im making an american football plugin and i need a way to set the quarters
quarter is one of his null constants
he has this
hmm why still null tho?
This worked before, nothing should have changed.
i swear quarter = args[0];set the value
e
ok
should i do that for all the other stuff
so players can edit them easily
also its how i was asked to do it
who told you?
a friend
i know basic java
im still learning it
i just have fumbled at scoreboards here
i am
im sorry, but public non final nulled string constants arent very principled
yes but when static abuse why null it?
static somewhat useful but when you have it as null it kinda loses its point
we all start somewhere probably did this myself, but @stark moss you should really look into principles
we would just need const like in kotlin
drivers license yes
XD
how do you check if player is shifting
wasn't there player#isShifting()
where did it go
Yeah it is

i'm making a plugin that implements 4 seasons and in the winter, zombies will turn into winter zombies.
@EventHandler
public void onMobSpawn(EntitySpawnEvent e) {
Entity entity = e.getEntity();
// Spawn a "winterized" zombie in winter
if (entity instanceof Zombie && seasonManager.getCurrentSeason() == Season.WINTER) {
((Zombie) entity).getEquipment().setArmorContents(new ItemStack[]{
colorLeatherArmor(Material.LEATHER_BOOTS, Color.BLACK),
colorLeatherArmor(Material.LEATHER_LEGGINGS, Color.BLACK),
colorLeatherArmor(Material.LEATHER_CHESTPLATE, Color.BLUE),
colorLeatherArmor(Material.LEATHER_HELMET, Color.AQUA)
});
entity.setCustomName(winterZombieName);
entity.setCustomNameVisible(false);
}
}
public ItemStack colorLeatherArmor(Material material, Color color) {
ItemStack itemStack = new ItemStack(material);
LeatherArmorMeta meta = (LeatherArmorMeta) itemStack.getItemMeta();
if (meta != null) {
meta.setColor(color);
}
itemStack.setItemMeta(meta);
return itemStack;
}
I set the custom name visible of the zombie to false, but the custom name is still being displayed in game. i'm not sure what the problem is, can someone help please?
Pretty sure that only controls if the name is always visible or only visible when the player is looking at the zombie
ohh ok
is there a way to make it never visible, even if the player is looking at it
i'm only setting the custom name for identification purposes, such as here:
@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
Entity damager = e.getDamager();
Entity entity = e.getEntity();
// If player is hit by a winter zombie, make the player have slowness
if (Objects.equals(damager.getCustomName(), winterZombieName) && entity instanceof Player) {
((Player) entity).addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 200, 1));
}
}
so i can know if the mob is a winter zombie or not
Use PDC
i'm not sure if theres a better way to keep track of that than by setting custom name tho
?pdc
ok tysm
Is there a better way ... or even a way to count up the blocks of specific type in a player's inventory? and then remove them all? because with this.. I don't even know at which slot index items are...
bump
I recommend using PDC instead of the old metadata api
Inventory is iterable, so you can loop over it directly
Entities have had PDC since PDC was added
I didn't know
I'm not the best with iterators
XD
I'll try it
anyway why isn't EntityDamageByEntityEvent fired when player is damaged by a firework?
for (ItemStack stack : inventory)
idk why i pasted there
Yea but how do I know at which slot I'm currently iterating
id just do a 0-inv side loop then
can I do a for loop, save itemstacks in an array and then do something like inventory.removeItem(... - items) ?
that's kinda nice and easy to understand
I'm pretty sure it did before
why not do this:
int count = 0;
for (ItemStack content : player.getInventory().getContents()) {
if (content == null || content.getType() == Material.AIR) continue;
if (content.getType() != Material.DIAMOND_BLOCK) continue;
count += content.getAmount();
content.setAmount(0);
}
weird formatting sorry
If only spigot had methods for this. π
It has
found out a minute ago
Yes i know...
enlighten me
javadocs were hiding them
It's only us that know
at org.japlic.core.scoreboard.onJoin(scoreboard.java:24) ~[japlic-1.0-SNAPSHOT.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor10.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:git-Paper-196]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.1.jar:git-Paper-196]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.1.jar:git-Paper-196]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:339) ~[paper-1.20.1.jar:git-Paper-196]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.placeNewPlayer(ServerLoginPacketListenerImpl.java:202) ~[?:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.handleAcceptedLogin(ServerLoginPacketListenerImpl.java:183) ~[?:?]
at net.minecraft.server.network.ServerLoginPacketListenerImpl.tick(ServerLoginPacketListenerImpl.java:85) ~[?:?]
at net.minecraft.network.Connection.tick(Connection.java:602) ~[?:?]
at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:234) ~[?:?]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1586) ~[paper-1.20.1.jar:git-Paper-196]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446) ~[paper-1.20.1.jar:git-Paper-196]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1393) ~[paper-1.20.1.jar:git-Paper-196]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1170) ~[paper-1.20.1.jar:git-Paper-196]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.20.1.jar:git-Paper-196]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ClassNotFoundException: me.clip.placeholderapi.PlaceholderAPI
at io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader.loadClass(PaperPluginClassLoader.java:142) ~[paper-1.20.1.jar:git-Paper-196]
at io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader.loadClass(PaperPluginClassLoader.java:103) ~[paper-1.20.1.jar:git-Paper-196]
at java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
... 20 more```
You need to install PlaceholderAPI on your server.
Also: Dont shade it. Set the scope to provided in your pom.xml
package org.japlic.core;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import me.clip.placeholderapi.PlaceholderAPI;
public class scoreboard implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
e.setJoinMessage("Β§lΒ§7[Β§a+Β§lΒ§aΒ§7]Β§3 " + p.getDisplayName());
Scoreboard board = (Scoreboard) Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = board.registerNewObjective("abcd", "abcd");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
// Use PlaceholderAPI placeholders
objective.getScore(PlaceholderAPI.setPlaceholders(p, "#8AF313Β§l$ &fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%")).setScore(10);
objective.getScore(PlaceholderAPI.setPlaceholders(p, "Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%")).setScore(9);
objective.getScore(PlaceholderAPI.setPlaceholders(p, "#F80000\uD83D\uDDE1 &fα΄ΙͺΚΚs: #F80000%statistic_player_kills%")).setScore(8);
objective.getScore(PlaceholderAPI.setPlaceholders(p, "Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6%statistic_deaths%")).setScore(7);
objective.getScore(PlaceholderAPI.setPlaceholders(p, "Β§e\uD83D\uDD5C Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &e%statistic_time_played:days%d %statistic_time_played:hours%h")).setScore(6);
objective.getScore(PlaceholderAPI.setPlaceholders(p, "Β§7Europe (Β§b%player_ping%Β§7)")).setScore(5);
objective.getScore("").setScore(4);
objective.getScore("").setScore(3);
objective.getScore("").setScore(2);
objective.getScore("").setScore(1);
p.setScoreboard(board);
}
}
i did
declaration: package: org.bukkit.inventory, interface: Inventory
that
did you add PlaceholderAPI to your depend?
not useing maven
woah
no
is that the problem
@hollow beacon
try adding it, i suspect your plugin loads before placeholderapi
ok
package org.japlic.core;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import me.clip.placeholderapi.PlaceholderAPI;
public class ScoreboardUpdater implements Listener {
private final Plugin plugin;
public ScoreboardUpdater() {
this.plugin = plugin;
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
e.setJoinMessage("Β§lΒ§7[Β§a+Β§lΒ§aΒ§7]Β§3 " + p.getDisplayName());
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = board.registerNewObjective("abcd", "abcd");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
p.setScoreboard(board);
// Schedule a task to update the scoreboard every tick
new BukkitRunnable() {
@Override
public void run() {
updateScoreboard(p, objective);
}
}.runTaskTimer(plugin, 0, 1);
}
private void updateScoreboard(Player player, Objective objective) {
// Use PlaceholderAPI placeholders to update scores
objective.getScore(PlaceholderAPI.setPlaceholders(player, "#8AF313Β§l$ &fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%")).setScore(10);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%")).setScore(9);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "#F80000\uD83D\uDDE1 &fα΄ΙͺΚΚs: #F80000%statistic_player_kills%")).setScore(8);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6%statistic_deaths%")).setScore(7);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§e\uD83D\uDD5C Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &e%statistic_time_played:days%d %statistic_time_played:hours%h")).setScore(6);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§7Europe (Β§b%player_ping%Β§7)")).setScore(5);
objective.getScore("").setScore(4);
objective.getScore("").setScore(3);
objective.getScore("").setScore(2);
objective.getScore("").setScore(1);
}
}
ok i made this to update the score and i dont understand error: variable plugin might not have been initialized
this.plugin = plugin;
^
Code block thx
?
You are trying to set the variable to itself
Which isnβt initialized because you are currently trying to initialize it
can u fix it
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
idfk
i use this public class PlayerListener implements Listener {
private final PlayerStatsPlugin plugin;
public PlayerListener(PlayerStatsPlugin plugin) {
this.plugin = plugin;
}
can u fix it
looks good
@young knoll help
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
What event do I use for when cactus is hurting a player
@EventHandler
public void onClickEntity(PlayerInteractAtEntityEvent event) {
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(, () -> {
int x = 0, y = 0, z = 0;
// world editing
}, 60L);``` Hello, thisi s a snippet of my code and I am trying to change some block states 3 seconds after the event. I heared that changing things Asyncronously was bad and there is an error for the first parameter for scheduleSyncDelayedTask where "this" which was usually there wouldn't work as a plugin
thanks!
The first argument expects an Object of type JavaPlugin. Pass your own JavaPlugin instance to this.
some of the objects not loading
package org.japlic.core;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import me.clip.placeholderapi.PlaceholderAPI;
import java.util.Objects;
public class ScoreboardUpdater implements Listener {
private final Plugin plugin;
public ScoreboardUpdater(Plugin plugin) {
this.plugin = plugin;
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
e.setJoinMessage("Β§lΒ§7[Β§a+Β§lΒ§aΒ§7]Β§3 " + p.getDisplayName());
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = board.registerNewObjective("Β§lΒ§4FireΒ§cSMP", "");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
p.setScoreboard(board);
// Schedule a task to update the scoreboard every tick
new BukkitRunnable() {
@Override
public void run() {
updateScoreboard(p, objective);
}
}.runTaskTimer(plugin, 0, 40);
}
private void updateScoreboard(Player player, Objective objective) {
// Clear the existing scores before updating
for (String entry : Objects.requireNonNull(objective.getScoreboard()).getEntries()) {
objective.getScoreboard().resetScores(entry);
}
// Use PlaceholderAPI placeholders to update scores
objective.getScore(PlaceholderAPI.setPlaceholders(player, "#8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%")).setScore(6);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%")).setScore(5);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "#F80000\uD83D\uDDE1 Β§fα΄ΙͺΚΚs: #F80000%statistic_player_kills%")).setScore(4);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6%statistic_deaths%")).setScore(3);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§e\uD83D\uDD5C Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &e%statistic_time_played:days%d %statistic_time_played:hours%h")).setScore(2);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§7Europe (Β§b%player_ping%Β§7)")).setScore(1);
}
}```
ohhh thank you!
Any exceptions in console?
Add some debug messages and check if each lines get called and if the Strings contains what you expect
how
Are you... asking on how to add debug messages?
yes
System.err.println(str)
This prints to std::err
its giveing me a error
Cannot resolve symbol 'str'
DuckDuckGo. Privacy, Simplified.
doing rn
[20:25:37 INFO]: Stormyzzs[/:] logged in with entity id 664 at ([world]47.75477539131053, 65.9005410004672, 172.74381179692293)
[20:25:37 INFO]: [STDOUT] Money Placeholder: #8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%
[20:25:37 WARN]: Nag author(s): '[]' of 'Firecore v1.0-SNAPSHOT' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
[20:25:37 INFO]: [STDOUT] Shards Placeholder: Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%
[20:25:37 INFO]: [STDOUT] Kills Placeholder: #F80000π‘ Β§fα΄ΙͺΚΚs: #F800000
[20:25:37 INFO]: [STDOUT] Deaths Placeholder: Β§6β Β§fα΄
α΄α΄α΄Κs: Β§612
[20:25:37 INFO]: [STDOUT] Playtime Placeholder: Β§eπ Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &e0d 7h
[20:25:37 INFO]: [STDOUT] Ping Placeholder: Β§7Europe (Β§b0Β§7)
[20:25:39 INFO]: [STDOUT] Money Placeholder: #8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%
[20:25:39 INFO]: [STDOUT] Shards Placeholder: Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%
[20:25:39 INFO]: [STDOUT] Kills Placeholder: #F80000π‘ Β§fα΄ΙͺΚΚs: #F800000
[20:25:39 INFO]: [STDOUT] Deaths Placeholder: Β§6β Β§fα΄
α΄α΄α΄Κs: Β§612
[20:25:39 INFO]: [STDOUT] Playtime Placeholder: Β§eπ Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &e0d 7h
[20:25:39 INFO]: [STDOUT] Ping Placeholder: Β§7Europe (Β§b0Β§7)
[20:25:39 INFO]: Stormyzzs lost connection: Disconnected
[20:25:39 INFO]: Stormyzzs left the game
[20:25:41 INFO]: [STDOUT] Money Placeholder: #8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%
[20:25:41 INFO]: [STDOUT] Shards Placeholder: Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%
[20:25:41 INFO]: [STDOUT] Kills Placeholder: #F80000π‘ Β§fα΄ΙͺΚΚs: #F80000
[20:25:41 INFO]: [STDOUT] Deaths Placeholder: Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6
[20:25:41 INFO]: [STDOUT] Playtime Placeholder: Β§eπ Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &ed h
[20:25:41 INFO]: [STDOUT] Ping Placeholder: Β§7Europe (Β§bΒ§7)
[20:25:43 INFO]: [STDOUT] Money Placeholder: #8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%
[20:25:43 INFO]: [STDOUT] Shards Placeholder: Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%
[20:25:43 INFO]: [STDOUT] Kills Placeholder: #F80000π‘ Β§fα΄ΙͺΚΚs: #F80000
[20:25:43 INFO]: [STDOUT] Deaths Placeholder: Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6
[20:25:43 INFO]: [STDOUT] Playtime Placeholder: Β§eπ Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &ed h
[20:25:43 INFO]: [STDOUT] Ping Placeholder: Β§7Europe (Β§bΒ§7)
[20:25:45 INFO]: [STDOUT] Money Placeholder: #8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%
[20:25:45 INFO]: [STDOUT] Shards Placeholder: Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%
[20:25:45 INFO]: [STDOUT] Kills Placeholder: #F80000π‘ Β§fα΄ΙͺΚΚs: #F80000
[20:25:45 INFO]: [STDOUT] Deaths Placeholder: Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6
[20:25:45 INFO]: [STDOUT] Playtime Placeholder: Β§eπ Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &ed h
[20:25:45 INFO]: [STDOUT] Ping Placeholder: Β§7Europe (Β§bΒ§7)
[20:25:47 INFO]: [STDOUT] Money Placeholder: #8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%
[20:25:47 INFO]: [STDOUT] Shards Placeholder: Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%
[20:25:47 INFO]: [STDOUT] Kills Placeholder: #F80000π‘ Β§fα΄ΙͺΚΚs: #F80000
[20:25:47 INFO]: [STDOUT] Deaths Placeholder: Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6
[20:25:47 INFO]: [STDOUT] Playtime Placeholder: Β§eπ Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &ed h
[20:25:47 INFO]: [STDOUT] Ping Placeholder: Β§7Europe (Β§bΒ§7)
@lost matrix
Show your updateScoreboard method
private void updateScoreboard(Player player, Objective objective) {
// Clear the existing scores before updating
for (String entry : Objects.requireNonNull(objective.getScoreboard()).getEntries()) {
objective.getScoreboard().resetScores(entry);
}
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
nice!
Should i... guess how the rest of the method looks like?
some of the objects not loading
package org.japlic.core;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import me.clip.placeholderapi.PlaceholderAPI;
import java.util.Objects;
public class ScoreboardUpdater implements Listener {
private final Plugin plugin;
public ScoreboardUpdater(Plugin plugin) {
this.plugin = plugin;
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
e.setJoinMessage("Β§lΒ§7[Β§a+Β§lΒ§aΒ§7]Β§3 " + p.getDisplayName());
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = board.registerNewObjective("Β§lΒ§4FireΒ§cSMP", "");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
p.setScoreboard(board);
// Schedule a task to update the scoreboard every tick
new BukkitRunnable() {
@Override
public void run() {
updateScoreboard(p, objective);
}
}.runTaskTimer(plugin, 0, 40);
}
private void updateScoreboard(Player player, Objective objective) {
// Clear the existing scores before updating
for (String entry : Objects.requireNonNull(objective.getScoreboard()).getEntries()) {
objective.getScoreboard().resetScores(entry);
}
// Use PlaceholderAPI placeholders to update scores
objective.getScore(PlaceholderAPI.setPlaceholders(player, "#8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%")).setScore(6);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%")).setScore(5);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "#F80000\uD83D\uDDE1 Β§fα΄ΙͺΚΚs: #F80000%statistic_player_kills%")).setScore(4);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6%statistic_deaths%")).setScore(3);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§e\uD83D\uDD5C Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &e%statistic_time_played:days%d %statistic_time_played:hours%h")).setScore(2);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "Β§7Europe (Β§b%player_ping%Β§7)")).setScore(1);
}
}```
the code
This code doesnt correlate to your debug output. Nothing i can help you with.
heres my new code
package org.japlic.core;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import me.clip.placeholderapi.PlaceholderAPI;
import java.util.Objects;
public class ScoreboardUpdater implements Listener {
private final Plugin plugin;
public ScoreboardUpdater(Plugin plugin) {
this.plugin = plugin;
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
e.setJoinMessage("Β§lΒ§7[Β§a+Β§lΒ§aΒ§7]Β§3 " + p.getDisplayName());
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = board.registerNewObjective("Β§lΒ§4FireΒ§cSMP", "");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
p.setScoreboard(board);
// Schedule a task to update the scoreboard every tick
new BukkitRunnable() {
@Override
public void run() {
updateScoreboard(p, objective);
}
}.runTaskTimer(plugin, 0, 40);
}
private void updateScoreboard(Player player, Objective objective) {
// Clear the existing scores before updating
for (String entry : Objects.requireNonNull(objective.getScoreboard()).getEntries()) {
objective.getScoreboard().resetScores(entry);
}
// Use PlaceholderAPI placeholders to update scores
String moneyPlaceholder = "#8AF313Β§lΒ§ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%";
String shardsPlaceholder = "Β§dβ
Β§fsΚα΄Κα΄
s: Β§d%shards_value%";
String killsPlaceholder = "#F80000\uD83D\uDDE1 Β§fα΄ΙͺΚΚs: #F80000%statistic_player_kills%";
String deathsPlaceholder = "Β§6β Β§fα΄
α΄α΄α΄Κs: Β§6%statistic_deaths%";
String playtimePlaceholder = "Β§e\uD83D\uDD5C Β§fα΄Κα΄Κα΄Ιͺα΄α΄: &e%statistic_time_played:days%d %statistic_time_played:hours%h";
String pingPlaceholder = "Β§7Europe (Β§b%player_ping%Β§7)";
// Debug messages to check placeholder values
System.out.println("Money Placeholder: " + PlaceholderAPI.setPlaceholders(player, moneyPlaceholder));
System.out.println("Shards Placeholder: " + PlaceholderAPI.setPlaceholders(player, shardsPlaceholder));
System.out.println("Kills Placeholder: " + PlaceholderAPI.setPlaceholders(player, killsPlaceholder));
System.out.println("Deaths Placeholder: " + PlaceholderAPI.setPlaceholders(player, deathsPlaceholder));
System.out.println("Playtime Placeholder: " + PlaceholderAPI.setPlaceholders(player, playtimePlaceholder));
System.out.println("Ping Placeholder: " + PlaceholderAPI.setPlaceholders(player, pingPlaceholder));
// Update scoreboard with placeholders
objective.getScore(PlaceholderAPI.setPlaceholders(player, moneyPlaceholder)).setScore(6);
objective.getScore(PlaceholderAPI.setPlaceholders(player, shardsPlaceholder)).setScore(5);
objective.getScore(PlaceholderAPI.setPlaceholders(player, killsPlaceholder)).setScore(4);
objective.getScore(PlaceholderAPI.setPlaceholders(player, deathsPlaceholder)).setScore(3);
objective.getScore(PlaceholderAPI.setPlaceholders(player, playtimePlaceholder)).setScore(2);
objective.getScore(PlaceholderAPI.setPlaceholders(player, pingPlaceholder)).setScore(1);
}
}
Instead of overcomplicating your debugging, why not comment every line and just let one line to check the placeholders?
I can put Sign to include all sign types right? and then from there check the pdc
It makes it way easier to read and we will find more quickly the error
do you see the error
You take them on. Im pretty much done.
I'm still in the morning and I have lots of energy. Go take a break
Yes, there is only one Sign BlockState
im out, bb
xDD
So if I understand well, your problem is that the placeholders don't get replaced by the value ?
umm do u see the the score is not loading some of them like Kills,Money
Ok so can you list the one that don't work ?
kills,money
those are the ones
for hanging signs it doesnt work
whats the problem
money is not a placeholder. The placeholder is %...money...something...idk%
I want the list of the one that don't work
Under the format
%...%
objective.getScore(PlaceholderAPI.setPlaceholders(player, "#F80000\uD83D\uDDE1 Β§fα΄ΙͺΚΚs: #F80000%statistic_player_kills%")).setScore(4);
objective.getScore(PlaceholderAPI.setPlaceholders(player, "#8AF313Β§l$ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%")).setScore(6);
and type the command:
/papi parse me Money=%vault_eco_balance_formatted% ; Kill=%statistic_player_kills%
And tell me what happens
So
so
Am I in a court .
Yes
Where were you on the night of February 17th
Aren't you supposed to be my lawyer ?
what class?
The one where there is all your scoreboard code
Are you trying to create your own placeholder or are you using a placeholder from another plugin?
so the whole code
useing
Taken from the wiki itself.
i did
all of the plugins installed
the code
To recap there are two problems:
- One of them is the one you pointed (with %shards_value%...)
- The second is that two objectives don't appear on the sidebar
yes
shard worked
the plugin is paided dont have the plugin
f
Try in your updateScoreboard method to debug this (output the result)
String stringToDebug = PlaceholderAPI.setPlaceholders(player, "%vault_eco_balance_formatted%");
now what its in the code
In human language ?
test it
ok i print it
yes
Cannot resolve symbol 'player'
π
fixed it
updateScoreboard
how to print it
Oh you want me to fix it?
?
i put in the scoreboard
So you need to print yes
Yeah maybe, try it
no suitable method found for info(no arguments)
getLogger().info();
Ok just do System.out.println(stringToDebug)
20:54:41 INFO]: [STDOUT] 0
[20:54:42 INFO]: [STDOUT] 0
[20:54:43 INFO]: [STDOUT] 0
[20:54:45 INFO]: [STDOUT] 0
[20:54:47 INFO]: [STDOUT] 0
[20:54:49 INFO]: [STDOUT] 0
[20:54:51 INFO]: [STDOUT] 0
[20:54:53 INFO]: [STDOUT] 0
[20:54:38 WARN]: Nag author(s): '[]' of 'Firecore v1.0-SNAPSHOT' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
we don't care don't worry
So now
replace your String by this:
String stringToDebug = PlaceholderAPI.setPlaceholders(player, "#8AF313Β§l$ Β§fα΄α΄Ι΄α΄Κ: #8AF313%vault_eco_balance_formatted%");
And redo the printing
[20:57:03 INFO]: [STDOUT] #8AF313Β§l$ Β§fα΄α΄Ι΄α΄Κ: #8AF3130
So as you can see, your string is correct
Then the problem comes from the way you set the objective
ok so how do i fix?
@agile anvil
π ;
- I'm studying for an exam
π
So give me time
l
Ok so one of my hypothesis is that the line is maybe too long
how can i fix
first let's check this is the correct hypothesis
try to reduce the size of the line
by deleting some characters
and check if the line appears
your right how can i bypass this liment
what's your version ?
Actually it shouldn't be a problem since it seems that 1.14+ versions don't have a scoreboard size limit
But I'm no pro in that
then why is not loading
You may do your own research or find someone that is used to do sidebars
so u cant help
item-validation:
display-name: 8192
lore-line: 8192
resolve-selectors-in-books: false
book:
author: 8192
page: 16384
title: 8192
book-size:
page-max: 2560
total-multiplier: 0.98
so i found this on papermc yaml
None of that says scoreboard
Also those are well above your line length anyway
Alsox2
?whereami
I'm experimenting with using lecterns over books for a GUI that allows players to submit books, click them, and then open them to see their contents. When I open a Lectern with Bukkit#createInventory() and add a written book ItemStack with more than one page, the user is unable to turn the page. Here is the code I am using to test it:
if(strings.length == 1 && strings[0].equals("test")){
Inventory inventory = Bukkit.createInventory(p.getPlayer(), InventoryType.LECTERN, Component.text("title"));
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
BookMeta book_meta = (BookMeta) book.getItemMeta();
book_meta.author(Component.text(p.getName()));
book_meta.title(Component.text("hi"));
book_meta.addPages(Component.text("page 1"), Component.text("page 2"));
book.setItemMeta(book_meta);
inventory.addItem(book);
p.openInventory(inventory);
return true;
}
Youβd almost certainly need NMS for that
Bukkits inventory system isnβt really designed for special inventories
yeah that was my fear π
guess it's time for me to learn nms lol
any ideas as to where I can start, if I am learning it specifically to fix this?
@river oracle is the inventory nerd, maybe he can help
alr, ty
what's up
what kind of inventory help
oh Lecterns that's fun and new
hey way to spice it up friend
?nms @grave vigil once you have this setup lmk I can guide you to finish it with minimal NMS interaction
alrighty
use paperweight instead if you're going to use the paper API
since I assume you're on gradle
maven, if that's an issue I guess i could switch
oh no if you're using maven you'll have to use special sources
so the link I had the bot put out should work
I'm a big fan of the fact this person is not asking for help with an Anvil Menu
Lectern Menu is much more interesting
@young knoll when are you going to use my amazing custom menu API
conver to Pineapple
packets are π
much less fun than my API
why do all the hardwork when mojang already did it for you :P
Idk manually constructing packets with a byte buffer is kinda fun
alright I got it put in my maven
fairrr
pom.xml whatever
if you're using intellij refresh your maven install and see if you can access net.minecraft packages
click the little maven tab and press the little circle do thing
ruh roh
Could not find artifact org.spigotmc:spigotπ«remapped-mojang:1.20.4-R0.1-SNAPSHOT in papermc-repo (https://repo.papermc.io/repository/maven-public/)
did you run buildtools (WITH REMAPPED)?
that is in the steps that you are supposed to do
I mean
let me try it again
You need the paper version if youβre gonna use paper api
not really
they only add stuff you can pretty much ignore it
that'd require him to change build systems too
some1 body works with maven, know solve this problem:
Errors running builder 'Maven Project Builder' on project 'VoxyPhysics'.
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:3.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.3.1
Plugin org.apache.maven.plugins:maven-resources-plugin:3.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.3.1
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:3.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.3.1
Plugin org.apache.maven.plugins:maven-resources-plugin:3.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.3.1```
alright I got it with no errors
oh I good point
okay chance of plans since you use paper you need to switch to gradle or Cope that spigot doesn't have components and join the dark side
I forgot that paper sugs
(sorry lynx I lub you)
(Choco components plz)
alright, never used gradle lol. Is there something I can follow to do that? Server uses paper so can't switch I'm afraid
@grave vigil I got a proposition for you head over to discord.gg/papermc ask them how to setup userdev and I can help you once you get that all set up π I don't know the first thing about Userdev paper shenanigans etc
The only thing I know are Menus
Average Patrick enjoyer
Is there any way that this can work using maven by chance xD
Unfortunately I feel we are on a PR merge freeze until 1.20.5 since mojang felt extra breaky wakey
this update
No idea
MD keeps the dev stuff private and I cba to set it up myself so idk what the changes look like
well the ItemStack stuff is pretty rough I'd assume
that's probably going to make MD cry a good bit. I sure would be crying with the state of ItemMeta
We already convert it all into objects anyway
yk CabernetMC wouldn't have had these issues, but the CMarco dev had to deny our merger request so we shut down
So it shouldnβt actually be that bad
I'm going to convert you into an object
you hear me!!!!
I mean
If the world is a simulation and is running in an OOP style system
Im probably already one
What's a command I can run to see if I even have nms installed
Uhh
ask paper?
Hello I have a koth plugin , all run good but when I start him that mean " koth starting " and we can't capture him. (region is good) I have koth plugin / spigot 1.8.9 server
import net.minecraft
yeah looks like ima have to ask paper
maybe youβre actually stored in some static reference, who knows π
public class Coll1234567 {
public static Coll1234567 INSTANCE = new Coll1234567();
private final byte iq;
private final int height; // height in centimeters
private final int weight; // weight in kilos or whatever non americans use
private final int codingSkill; // coding skill from 0 to 10
private final int spigotPrsOpened;
private Coll1234567() {
this.iq = 5;
this.height = 10;
this.weight = 100;
this.codingSkill = 0;
this.spigotPrsOpened = Integer.MAX_VALUE;
}
}
that'd be cool
I wonder if the race who simulates us is in a simulation too
the simulation paradox
Imma start a fortune telling scam for nerds that reads your uuid
Lmaow
Laughing my ass off, waluigi
so we can just remove coll if we want also, love it: Coll1234567.INSTANCE = null

or wario
Everyone knows waluigi is better
truth
they shoulda named waluigi luigi since luigi wht the first letter upside down is luigi
Not if itβs a capital L
Λ₯ uigi
Hey guys, I just wanted to ask if we could check if a world already exists in a server
Check by its name you mean?
You can whether check on the server's folder to check if a folder name corresponds to your world
Or check in the loaded world if the name of the world corresponds to your world
The latter one could omit a world that is not loaded
@grave vigil not exactly sure what happened, but I can help you with the NMS stuff I'm heading to bed now but I can give you some code when I awaken from my slumber
Or wait can we do this:
//A command argument for creating the world, for example: /plworld create test
String newWorld = args[1];
if (Bukkit.getWorld(newWorld)) {
player.sendMessage("The world with the name '" + newWorld + "' already exists!");
} else {
Bukkit.createWorld(newWorld);
player.sendMessage("World '" + newWorld + "' has been created!");
}
?
To check if a world already exists in the server.
if (Bukkit.getWorld(newWorld)) is wrong
It will always return something, even if it's null.
you have no boolean check there
if (Bukkit.getWorld(newWorld) != null)
how do i add a image like this
Wait I meant Bukkit.getWorld().getName() == newWorld
Ok thx
ya i know how to do resource pack but how do i make it apply to the gui
you use a font character
example
some font characters are making the text move right or left or top or down
By combining them with font characters where you put the inventory texture, it will make your inventory like a mod
where do i find font characters at
thanks never done this before
This is really fun and fancy, but can be a bit tiring at some point
you don't need to include the entire negative space font by the way
trying to use this with excellent crates
<please don't>
Do you not have a need for -8000 pixel offsets
Don't you use 8k image characters? (jk)
thanks
Hi, Is possible to iterate true block in BoundingBox?
Don't know if there is a built in method. But you can make it simple using a 3-for loop
each loop iterates a coordinate
and this you have a boundingbox, you know the min and the max of each x y z
Any recommendations on how I should load island 'schematics' in a skyblock core? Previously saved schematics, put it in the resourses folder and then loaded used worldedit api, but wasnt sure if there was a better way to do it or not
Is there a particular reason?
Its built in while no better nor worse.
fair
Is not, trying to create my own Iterator but its crashing my server for some reason
I take that from other plugin (not mine) and there is all fine, instead of looking at it I will probably just use 3 for loops, lol. I need to check only 5 block radius of player
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Location loc1 = /* First extremity */;
Location loc2 = /* Second extremity */;
int minX = Math.min(loc1.getX(), loc2.getX());
int minY = Math.min(loc1.getY(), loc2.getY());
int minZ = Math.min(loc1.getZ(), loc2.getZ());
int maxX = Math.max(loc1.getX(), loc2.getX());
int maxY = Math.max(loc1.getY(), loc2.getY());
int maxZ = Math.max(loc1.getZ(), loc2.getZ());
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
for (int z = minZ; z <= maxZ; z++) {
}
}
}
The idea
ofc you can make it an iterator if needed
thanks, I had kinda something similar in mind, but I guess I will go with this... bcs I already spend so much time with this
how do i summon an armor stand that's invisible automatically so it doesnt show the armor stand for a split second
ArmorStand armorStand = (ArmorStand) location.getWorld().spawnEntity(location.add(randomX, randomY, randomZ), EntityType.ARMOR_STAND);
armorStand.setInvisible(true);```
this shows the armorstand for a split second then it disappears
i think you can do it with nms but i dont think i need nms for smthing like that
you can try spawning it somewhere far away, making it invis, and then teleporting.
use teh spawn method that takes a Consumer
there isnt?
@NotNull Entity spawnEntity(@NotNull Location var1, @NotNull EntityType var2, boolean var3);```
are the only ones
nvm
spawn exists
so i just do ```java
ArmorStand armorStand = (ArmorStand) location.getWorld().spawn(location.add(randomX, randomY, randomZ), ArmorStand.class, (as) -> as.setInvisible(true));
?
yes
spawn and spawnEntity how confusing
Something I wanna do but never have for some reason: Creating an API, https://github.com/NukeCaps/DamageHolograms/tree/master
I feel like this is a good project to do so with as I think I'm like half way there sorta with the holograms... Anyone have some suggestions on how I could implement an api for this? I really only want the hologramCreation class to be accessed...
Create interfaces blud
Heres an example of an API for spigot
You can also utilise the java Services API
Will do thank you
Does anyone know how to make a bossbar that has a countdown on it. I want to make it so it is always set to 8 minutes and it can't be changed. And the timer can be paused with /pauseclock for example.
By using code
just register a task
convert your 8 minutes into ticks
or wait
i need to reread
ah yes okay
sp
so
make your Bossbar class
and
well easiest would probably be to have a hashmap with all players
on each tick
you either change, remove or reset the bossbar depending on what you wanna do
@stark moss
just make a bossbar, show it to everyone, update the progress
declaration: package: org.bukkit.boss, interface: BossBar
declaration: package: org.bukkit, class: Bukkit
you will never find documentations of implementations
the point of docus is to understand the classes provided by for example spigot
Hi , how to send message onlineplayers ?
- Get your onlineplayers
- apply the sendMessage method
for (Player player : bukkit.getOnlinePlayers){
player.sendMessage();
}
or just broadcast
no clue why but i got a deep hatred against broadcast
It's of no use if you start to impose conditions on the receivers. Otherwise this is exactly similar
If you are sending to everyone
please send a example for this
Alr thanks
yes
Hi , what is method of send money for vault ?
use vault api
i know i am using vault api
and i am asking for vault
you should read vault docs
i read it but i don't found it
have you googled exactly what you typed into here, I am certain the first link will have the answer?
yes , i was reading this https://milkbowl.github.io/VaultAPI/net/milkbowl/vault/economy/Economy.html
well that does have your answer
:/
youtube exists too
I remember watching a video on implementation of vault and made a whole vault compatible coins plugin
Did you get the damage holograms working? π
Use depositPlayer
Yes, https://github.com/NukeCaps/DamageHolograms/tree/master
https://gyazo.com/718d9e94cdc83cd6a8a9675695c258a8
bro even in the game i used command '/pay' but even i don't get any money
my balance is bugged i think
So your economy plugin is broken
yeah
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
i used youtube and i seen others used esstensialx at first time i think my plugin is bug so i join the server and i used /pay and i see even commands is broken for me
Yes
I believe this will break if: you leave spawn chunks, hit a mob and disconnect right after that
When you log in, the damage indicator text will still exist but will cease to be tracked by the plugin
- an entity will be in your list, but that entity will no longer exist in the world, so memory leak
usually i hate youtube and i always use discord or spigot wiki or wiki of api :/
What's your next goal then? (still haven't figured out what to give you)
Api for the hologramCreation class
- more methods for hologram modification
That looks cool good luck with that
will look into it thank you
before i need use a economy plugin instead esstensialx
What's it leak
idk I just push the whole project anytime I put something on github
I don't look at all the file selection lol
Elaborate branches
@quaint mantle sorry for anything , so what do i use instead ?
zack is right you should start working as a real project, opening issues and PR and working feature wise
i fear some others be bad , i need a recommended
I mean... this wasn't meant to be anything like that haha
There are plenty of tut of how to "Contribute" on github. That should help you start
Well yeah I was gonna watch some github stuff tomorrow
I wish I learned it before when I was only playing with MC

hey sorry to bother again, I am unable to find the "ClientboundAddEntityPacket" packet that is called when a player drops an item. I am even logging all packets and can't find it. (Strange enough: using "/summon sheep" didn't call the packet either...)
I am not logging extra packets because I don't know which packet has it as an extra packet if any.
@agile anvil If you have any other project suggestions I'm always open to em, I have a hard time finding the inspiration as it were
Is your listener registered in the first place?
yup, even if not I am logging them all before I call the listeners anyways (from the channel)
How could I test this by chance?
Dropping an item just shoots these
Then yeah you need to listen to the bundle packet and unpack it
it is contained in .extraPackets?
maybe
okay ty will try to log it
The delimiter for a bundle of packets. When received, the client should store every subsequent packet it receives, and wait until another delimiter is received. Once that happens, the client is guaranteed to process every packet in the bundle on the same tick, and the client should stop storing packets
not in extra packets
read that, but that doesn't tell the packets are in the bundle one as it is empty technically, and the metadata packet is outside of it as well
Bundle has subPackets() method, will try to log that then
@echo basalt can you drop me that link of that copy pasta?
Just send me all of em then
.
Ait great thanks
it was in subPackets π ty
I have a plugin that i dont have access to the source code, there is a feature that needs fix however i have no idea how to recompile it back, how do I do it? I tried javac but no idea how to specify the dependencies
that has nothing to do with my problem
id just hire someone to do it for like 10 bucks
I recommend using recaf
All praise the holy recaf
BUT: DO NOT ASK HOW TO COMPILE WITH ERRORS; YOU DO NOT
if he doesn't know how to compile a spigot plugin he most likely wouldnt know how to fix the errors that he would get from decompiling
Well that is why the assembler exists
https://paste.md-5.net/sunasolidi.bash <-- it throws this exception when the plugin is reloaded
@Override
public void onDisable() {
for (Player player : Bukkit.getOnlinePlayers()) {
playerManager.removePlayer(player);
}```
```java
public void removePlayer(Player player) {
ExecutablePlayer ep = getPlayer(player.getUniqueId());
if (ep != null) {
players.remove(ep);
for (Pet pet : ep.getPets()) {
char c = 'C';
switch (pet.getRarity()) {
case UNCOMMON -> c = 'U';
case RARE -> c = 'R';
case EPIC -> c = 'E';
case LEGENDARY -> c = 'L';
}
String path = "players." + player.getUniqueId() + ".pets." + pet.getName() + c;
ExecutablePets.setInStorage(path + ".level", pet.getLevel());
ExecutablePets.setInStorage(path + ".xp", pet.getXp());
ExecutablePets.setInStorage(path + ".requiredxp", pet.getRequiredXp());
}
if (ep.getEquipped() != null) {
ep.getEquipped().onUnequip(player);
char c = 'C';
switch (ep.getEquipped().getRarity()) {
case UNCOMMON -> c = 'U';
case RARE -> c = 'R';
case EPIC -> c = 'E';
case LEGENDARY -> c = 'L';
}
ExecutablePets.setInStorage("players." + player.getUniqueId() + ".equipped", ep.getEquipped().getName() + c);
} else {
ExecutablePets.setInStorage("players." + player.getUniqueId() + ".equipped", null);
}
}
}```
something something you updated the jar and stuff couldn't class load
you shouldn't reload in the first place and instead just restart your server 
sometimes it loads and sometimes it doesn't
exactly
it's a public plugin and i dont think someone would like the data being lost because he reloaded
since 'removePlayer' also saves the stuff
Then make a command to reload the configs and not the entire plugin?
what if they just type /reload confirm
just cuz
that's on them
:-:
nvm got it fixed so they dont screw themself up if they reload
just had to sync stuff abit
one of my image through link stopped working and i want to remove it but i cant see it in edit options
Someone help please :)
change the editor type
there should be a button to switch the view
then you can see the bbcode related stuff and remove it
reloading is not supported by spigot
how can i get nbt data from an entity?
what nbt data
https://i.imgur.com/n7ZXIfV.png
this stuff
why?
the kind you get with /data get
im trying to get a certain nbt tag from a mythicmobs mob
that being its name
the bukkit values thing
Yea
its type
that is the PDC
?pdc
π
But why not use the mythicmob api?
ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null);
if(mythicMob != null && mythicMob.getMobType().equals("SkeletalKnight")){
// do something with mob
}
yea like 
that seems a lot easier and future proof
i dont know how apis work
Time to learn it then π
ill try
how do i set an optionals value?
yes but i dont know how to set the final value in the first place
it's against convention supposedly
why's that?
i still dont quite get it, how do i get rid of the yellow?
Do you understand what final means?
you can't
ic an
private void setTarget(@Nullable UUID uuid) {
this.target = Optional.ofNullable(uuid);
}
π
Say I want to have an SQLite-DB with a table for e.g. a ban list.
Does it make sense to log player uuids to their own table and add them as a foreign key to the ban list table?
Or does it make more sense to just use the player-uuid as a primary key for the ban list table?
it has everything to do with your issue
replace it with a nullable UUID
okay
Optionals are really only meant to be used as a method return type
They're a utility class that "supercedes" null
For lack of a better word
okay fixxed it thank you :)
Ping me on an answer later please :))
second option
i the player table what can has?
only the uuid or any other info?
if is only for banlist then onlyy need one table i think
the second only is valid if you wanna a banlist and not an banlist history
Player UUIDs don't change so no neeed to record all, or change them
wasn't there some guy claiming insane compression ratios by just indexing uuids with coreprotect?
so instead of saving 2 longs per entry they'd save an int or whatever
Quite pointless really
Unless you are running your server on a Pi or some other device with REALLY restricted memory
it was for disk space p sure
It would have to be a LOT of UUIDs to even bother with optimising
I mean regardless, you should do that if you're storing millions of records of UUIDs
If not in an integer, at least in a serialized binary format which will take at least half the amount of space
Yes you're talking about maybe only 2MB of storage saved over a million entries, but you're still saving 2MB of storage over a million etnries lol
Prob billions honestly
The indexing speeds may be quicker as well
Dude said it was something like 30% less
Not to mention that some people store UUIDs as strings π
Then you're really looking to kill your database's storage and lookup speeds
It is, yes. You can use a remote MySQL DB as well, but by default it's SQLite
If not for storage space, for index speeds alone, an integer is going to be faster when performing lookups (as core protect does often) over either 2 longs or a hashed string
Your index size will also likely be smaller
DESIGN YOUR SQL TABLES PROPERLY TO BEGIN WITH, PEOPLE 

user varchar(100) this starts well
oh dear
"user(rowid int NOT NULL AUTO_INCREMENT,PRIMARY KEY(rowid),time int,user varchar(100),uuid varchar(64)" + index + ") ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4"
uuid varchar(64) what the fuck
π
UUIDv9 just dropped
Yeah, CoPo's database structure is notoriously terrible and slow
This is a well known thing lol
I'm almost certain your CoPo would perform way better if you adjusted how the table was structured
yuh
and how the data was sent. If I remember correctly they're just queueing single update operations
They do it in bulk, but in separate statements
At least that's what I remember
Wouldn't that be even more overhead?
more latency less disk space
Data consumption as in?
Wouldn't increase the lookup speeds though
- you also have a table on top of things so you're increasing storage space :p
let's see what's better
Oh, sorry, my mistake, misread your proxy idea
making a uuid lookup table or
but probably won't improve lookup times because you still have to deal with the fact that the base table still exists
bitte und ein bier
idfk tbh
