#help-development

1 messages Β· Page 920 of 1

worthy yarrow
#

@sand spire

sand spire
#

no

#

i'm just coding for myself

worthy yarrow
#

Then it should be public

#

so you can get better help

sand spire
#

and i can hardcode most of the things

worthy yarrow
#

Make a git repo

sand spire
#

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

worthy yarrow
#

I mean

#

core basically is the server

sand spire
#

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

worthy yarrow
#

Any permissions plugin would be

#

but also you could design your own permissions system

#

That's a bit more on the complex side however

solar geyser
#

Hi, how to install with VPS some resource from the spigot?

in wget, curl etc..

solar geyser
#

Czech. πŸ˜‚

sullen canyon
#

😭

solar geyser
#

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 πŸ˜‚

sullen canyon
#

πŸ€—πŸ€—

remote swallow
#

eg for https://www.spigotmc.org/resources/simplechatgames.108655/ the id is 108655

solar geyser
#

Sry, thanks ⭐

solar geyser
# remote swallow in the url

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

remote swallow
#

you have to change the id

#

each plugin gets a different id

#

its in the url

solar geyser
#

Yes, but if it gets the id, how do I always capture the correct id?

remote swallow
#

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

solar geyser
#

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

remote swallow
#

you have to change the name

#

you cant tell it to download hubkick with simplechatgames id

solar geyser
#

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

remote swallow
#

no

solar geyser
#

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

remote swallow
#

download?version=

#

each version gets its own id

young knoll
#

I thought we were using spiget

solar geyser
#

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);
?>

solar geyser
remote swallow
#

that isnt spiget

solar geyser
#

i using.

remote swallow
#

thats spigot

solar geyser
#

oh

#

oh

#

oh

#

iam

#

fucking idiot

#

πŸ€¦β€β™‚οΈ

remote swallow
#

also your probably getting blocked by cloudflare

#

thats where spiget comes in

solar geyser
#

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

remote swallow
#

that isnt a valid spiget api endpoint

solar geyser
#

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

remote swallow
young knoll
#

That gets info about SimpleChatGames

solar geyser
#

oh shit

young knoll
#

Add /download to the end to download it

solar geyser
#

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"

young knoll
#

Looks right to me

solar geyser
remote swallow
#

you dont need a param on there

solar geyser
#

Spiget says:
Parameters
(required)
number
Resource ID

#

oh

#

okay

young knoll
#

Oh

#

They already have a spoonfeed for it

#

Actually that is just a query not a download, but yeah

solar geyser
#

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!

young knoll
#

You should set a user agent

solar geyser
#

What do you mean by Access Control?

#

in the header

eternal night
#

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

solar geyser
#

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.

worthy yarrow
lean pumice
#

[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?

sullen marlin
#

?nocode

undone axleBOT
#

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.

lean pumice
# sullen marlin ?nocode
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();
        }
lean pumice
worthy yarrow
#

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
sullen marlin
#

put the display and offset in an object in one list/map/whatever

#

Thread.sleep(1000);

eternal night
#

al the cool kids hate pastebins

lean pumice
#

use caps

eternal night
#

for the love of god

#

?paste

undone axleBOT
sullen marlin
#

and whats the error

stark moss
shadow night
#

Java isn't python, it's not a scripting language

#

and it's also not slow

worthy yarrow
#

Other than the performance concern what else could be improved code wise? I know the creativity is a bit bland

lean pumice
#

dont go πŸ™‚

shadow night
#

As long as it runs fine, let it be, unless it can be a mess to rewrite in the future

worthy yarrow
#

I mean it's pretty straight forward, probably just some error handling is needed. Any of you got some creative resources involving text displays?

stark moss
stark moss
#

how so

lean pumice
#

is not a message start the loading...

stark moss
#

?

lean pumice
# stark moss ?

you can put "loaded commands!" after the loading of the commands

stark moss
#

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

lean pumice
stark moss
#

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?

lean pumice
stark moss
#

no its not. that worked fine before i added the scoreboards and the plugin and previous commands worked fine

stark moss
#

no

lean pumice
stark moss
#

"An internal error occured while attempting to preform this command"

stark moss
#

wtf do you mean?

stark moss
lean pumice
#

dont in chat

stark moss
#

oh alr

#

didnt understand. mb

#

using /hudload

inner mulch
#

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)

stark moss
inner mulch
dry hazel
#

"yes"

#

ART runs dalvik bytecode

inner mulch
#

so new project and later i can run taht on my phone? no further config needed?

dry hazel
#

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

inner mulch
#

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?

dry hazel
#

jb compose is multiplatform if you don't mind kotlin

inner mulch
#

java > kotlin

umbral ridge
#

zwei schnitzel bitte und ein bier

#

danke

inner mulch
#

no

umbral ridge
#

schnitzel mit rice

#

pls

rough ibex
#

kotlin is great

inner mulch
#

ayoo

dry hazel
inner mulch
#

no

stark moss
inner mulch
hazy parrot
#

Don't sleep main thread pls

#

And what is even that loop

inner mulch
#

for every player

#

1 secodns after another

hazy parrot
#

Does it matter

#

That loop always runs exactly one time

rough drift
#

Also, Bukkit.dispatchCommand(player, "command");

inner mulch
#

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

rough drift
#

scoreboards are pain, reject scoreboards embrace chat

#

(this post was made by the satirical scoreboard hate gang)

inner mulch
stark moss
stark moss
inner mulch
#

we see

#

yeah there is something wrong with your scoreboard

inner mulch
#

it stops minecraft in ur case

stark moss
#

oh

#

what should i do then

inner mulch
#

Score quarters = obj.getScore(quarter);
quarters.setScore(2);
this causes your error btw

#

i dont know what quarter is tho

stark moss
#

its a string

#

i have it in another script

inner mulch
inner mulch
stark moss
#
    public static String quarter = null;
inner mulch
#

yes thats the problem its null

stark moss
#

is that why everything broke

inner mulch
#

yes

stark moss
#

good to know good to know

inner mulch
#

but NEVER call thread.sleep

#

its illegal

#

at least on main thread

stark moss
#

Alr thanks

stark moss
young knoll
#

?scheduling

undone axleBOT
stark moss
#

so that it updates for every player every second or so

slim gate
#

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);
            }
        }
    }
inner mulch
#

okay, but its okay not on main thread

#

if he really needs to

stark moss
inner mulch
#

?scheduling

undone axleBOT
stark moss
#

that only has mentioned finite delays

inner mulch
stark moss
#

"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:"

inner mulch
stark moss
#

bc it uses commands to edit it frequently

#

so it needs to update no?

#

or does it automatically reload for me

inner mulch
#

and pls dont use commands to update your scoreboard

stark moss
stark moss
#

the arguments used from said commands is what i am using

inner mulch
stark moss
#

its for a game inside minecraft

inner mulch
#

if you think so

stark moss
#

so the "referees" of the game have to edit the scoreboard and I cant think of many other ways

inner mulch
stark moss
#

its not a playercount

inner mulch
#

why are you arguing about this useless stuff? it is useful, and thats it.

inner mulch
#

idk what you update bro

stark moss
#

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

inner mulch
#

idk there is not much to see there

stark moss
#

just the for loop

inner mulch
#

and what is it supposed to do?

stark moss
#

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

inner mulch
#

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?

slim gate
inner mulch
undone axleBOT
#

"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.

umbral ridge
#

which event is fired when you left click on the itemframe? PlayerInteractEntityEvent isn't for som reason... only fires for right hand

slim gate
stark moss
#

should i send the code for these commands

inner mulch
#

dont use commands, internal error prob comes from one of your null constants?

stark moss
#

where would that be

undone axleBOT
slim gate
#

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);
            }
        }
    }
stark moss
#

its a string set by a command argument. im making an american football plugin and i need a way to set the quarters

inner mulch
#

quarter is one of his null constants

inner mulch
stark moss
inner mulch
slim gate
stark moss
#

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

inner mulch
stark moss
#

i know basic java

#

im still learning it

#

i just have fumbled at scoreboards here

#

i am

inner mulch
#

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

stark moss
#

alr

#

it works

#

thanks for the help ig

tardy delta
#

we would just need const like in kotlin

inner mulch
#

like getting your drivers license?

#

static license?

umbral ridge
#

XD

#

how do you check if player is shifting

#

wasn't there player#isShifting()

#

where did it go

young knoll
#

Isn’t it isSneaking

#

Idk check the javadocs

chrome beacon
#

Yeah it is

umbral ridge
nimble mason
#

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?

young knoll
#

Pretty sure that only controls if the name is always visible or only visible when the player is looking at the zombie

nimble mason
#

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

chrome beacon
#

Use PDC

nimble mason
#

i'm not sure if theres a better way to keep track of that than by setting custom name tho

chrome beacon
#

?pdc

nimble mason
#

ok tysm

umbral ridge
#

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...

chrome beacon
#

I recommend using PDC instead of the old metadata api

slim gate
#

oh entities have pdc now?

#

I use it for items

#

but never have for entities

young knoll
#

Entities have had PDC since PDC was added

slim gate
umbral ridge
#

XD

#

I'll try it

slim gate
#

anyway why isn't EntityDamageByEntityEvent fired when player is damaged by a firework?

remote swallow
#

idk why i pasted there

umbral ridge
remote swallow
#

id just do a 0-inv side loop then

umbral ridge
#

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

hollow beacon
#

weird formatting sorry

lost matrix
#

If only spigot had methods for this. πŸ˜‰

umbral ridge
#

found out a minute ago

lost matrix
#

Yes i know...

hollow beacon
#

enlighten me

umbral ridge
#

javadocs were hiding them

umbral ridge
quaint mantle
#
    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```
lost matrix
quaint mantle
#
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);
    }
}
hollow beacon
#

did you add PlaceholderAPI to your depend?

quaint mantle
#

is that the problem

#

@hollow beacon

hollow beacon
#

try adding it, i suspect your plugin loads before placeholderapi

quaint mantle
#

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;
^

jagged bobcat
#

Code block thx

quaint mantle
young knoll
#

You are trying to set the variable to itself

#

Which isn’t initialized because you are currently trying to initialize it

young knoll
#

Pass a plugin instance to that constructor

#

?di

undone axleBOT
quaint mantle
quaint mantle
quaint mantle
slender elbow
#

looks good

quaint mantle
#

@young knoll help

lost matrix
undone axleBOT
umbral ridge
#

What event do I use for when cactus is hurting a player

young knoll
#

EntityDamageEvent

#

Most specifically EntityDamageByBlockEvent

hoary tiger
#
    @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
umbral ridge
lost matrix
quaint mantle
#

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);
    }
}```
quaint mantle
lost matrix
quaint mantle
#

@lost matrix

lost matrix
# quaint mantle nope

Add some debug messages and check if each lines get called and if the Strings contains what you expect

lost matrix
#

Are you... asking on how to add debug messages?

lost matrix
#

Just print it to std::out or use the logger

quaint mantle
lost matrix
#

This prints to std::err

quaint mantle
quaint mantle
quaint mantle
# lost matrix https://duckduckgo.com/?q=java+how+to+print+to+stdout&t=ffab&ia=web

[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

lost matrix
umbral ridge
#

How do you check if a sign has persistentdatacontainer data?

#

(any data)

quaint mantle
# 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);
}

lost matrix
quaint mantle
# lost matrix 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

lost matrix
#

This code doesnt correlate to your debug output. Nothing i can help you with.

quaint mantle
# lost matrix This code doesnt correlate to your debug output. Nothing i can help you with.
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);
    }
}
agile anvil
#

Instead of overcomplicating your debugging, why not comment every line and just let one line to check the placeholders?

umbral ridge
agile anvil
#

It makes it way easier to read and we will find more quickly the error

quaint mantle
lost matrix
agile anvil
lost matrix
#

im out, bb

umbral ridge
#

xDD

agile anvil
quaint mantle
agile anvil
#

Ok so can you list the one that don't work ?

quaint mantle
#

those are the ones

agile anvil
#

I mean, the placeholders themselves

#

%...%

umbral ridge
quaint mantle
agile anvil
#

I want the list of the one that don't work

#

Under the format

#

%...%

quaint mantle
#

objective.getScore(PlaceholderAPI.setPlaceholders(player, "#F80000\uD83D\uDDE1 Β§fα΄‹Ιͺʟʟs: #F80000%statistic_player_kills%")).setScore(4);

agile anvil
#

Cool

#

now go to your server

quaint mantle
#

objective.getScore(PlaceholderAPI.setPlaceholders(player, "#8AF313Β§l$ Β§fᴍᴏɴᴇʏ: #8AF313%vault_eco_balance_formatted%")).setScore(6);

agile anvil
#

and type the command:

#

/papi parse me Money=%vault_eco_balance_formatted% ; Kill=%statistic_player_kills%

#

And tell me what happens

quaint mantle
#

vault i need to reinstall

agile anvil
#

So

quaint mantle
#

so

agile anvil
#

If the money doesn't work you have your problem

#

: you need to reinstall vault

quaint mantle
#

the kills are not loading

#

expain that

agile anvil
young knoll
#

Yes

agile anvil
#

Can you paste your class here:

#

?paste

undone axleBOT
young knoll
#

Where were you on the night of February 17th

agile anvil
#

Aren't you supposed to be my lawyer ?

quaint mantle
agile anvil
kind hatch
# quaint mantle

Are you trying to create your own placeholder or are you using a placeholder from another plugin?

quaint mantle
kind hatch
#

Taken from the wiki itself.

quaint mantle
#

all of the plugins installed

#

the code

agile anvil
quaint mantle
#

the plugin is paided dont have the plugin

agile anvil
#

so

quaint mantle
#

f

agile anvil
#

Try in your updateScoreboard method to debug this (output the result)

String stringToDebug = PlaceholderAPI.setPlaceholders(player, "%vault_eco_balance_formatted%");
agile anvil
#

In human language ?

kind hatch
quaint mantle
agile anvil
#

yes

quaint mantle
agile anvil
#

Where did you put it in the code?

#

Can you repaste your class?

#

?paste

undone axleBOT
quaint mantle
kind hatch
#

πŸ’€

agile anvil
#

OUT OF THE CLASS LMAO

#

sorry

#

You have to put it

#

in

quaint mantle
#

fixed it

agile anvil
#

updateScoreboard

quaint mantle
#

how to print it

agile anvil
quaint mantle
agile anvil
#

mb

#

morning eyes are almost closed

quaint mantle
agile anvil
#

So you need to print yes

quaint mantle
#

that

agile anvil
#

Yeah maybe, try it

quaint mantle
agile anvil
#

Ok just do System.out.println(stringToDebug)

quaint mantle
#

[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).

agile anvil
#

So now

#

replace your String by this:

#
String stringToDebug = PlaceholderAPI.setPlaceholders(player, "#8AF313Β§l$ Β§fᴍᴏɴᴇʏ: #8AF313%vault_eco_balance_formatted%");
#

And redo the printing

quaint mantle
agile anvil
#

So as you can see, your string is correct

#

Then the problem comes from the way you set the objective

quaint mantle
#

@agile anvil

agile anvil
#

bro

#

I'm not ChatGPT

quaint mantle
#

πŸ’€ ;

agile anvil
#
  • I'm studying for an exam
quaint mantle
#

πŸ‘

agile anvil
#

So give me time

quaint mantle
#

l

agile anvil
#

Ok so one of my hypothesis is that the line is maybe too long

agile anvil
#

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

quaint mantle
agile anvil
#

what's your version ?

quaint mantle
#

@agile anvil

agile anvil
#

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

agile anvil
#

You may do your own research or find someone that is used to do sidebars

quaint mantle
#

so i found this on papermc yaml

young knoll
#

None of that says scoreboard

#

Also those are well above your line length anyway

#

Alsox2

#

?whereami

quaint mantle
#

sorry

grave vigil
#

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;
}     
young knoll
#

You’d almost certainly need NMS for that

#

Bukkits inventory system isn’t really designed for special inventories

grave vigil
#

any ideas as to where I can start, if I am learning it specifically to fix this?

young knoll
#

@river oracle is the inventory nerd, maybe he can help

grave vigil
#

alr, ty

river oracle
#

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

river oracle
#

oh wait you're using paper

#

use paperweight lol mb

river oracle
#

since I assume you're on gradle

grave vigil
river oracle
#

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

young knoll
#

There’s technically a userdev maven version

#

Idk if it works tho, kek

river oracle
#

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 pepe_laugh conver to Pineapple

young knoll
#

Mehhhh

#

Maybe I’ll just do everything with packets from now on

#

Just to annoy MD

river oracle
#

packets are πŸ‘Ž

#

much less fun than my API

#

why do all the hardwork when mojang already did it for you :P

young knoll
#

Idk manually constructing packets with a byte buffer is kinda fun

grave vigil
river oracle
#

fairrr

grave vigil
#

pom.xml whatever

river oracle
#

click the little maven tab and press the little circle do thing

grave vigil
river oracle
#

that is in the steps that you are supposed to do

young knoll
#

I mean

grave vigil
#

let me try it again

young knoll
#

You need the paper version if you’re gonna use paper api

river oracle
#

they only add stuff you can pretty much ignore it

#

that'd require him to change build systems too

silent quiver
#

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```
young knoll
#

Try calling BookMeta.author() with the spigot api then

#

:p

grave vigil
#

alright I got it with no errors

river oracle
#

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)

young knoll
#

(Choco components plz)

grave vigil
river oracle
#

@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

young knoll
#

Average Patrick enjoyer

grave vigil
river oracle
#

Shrug idfk tbh

#

ask in paper

river oracle
young knoll
#

No idea

#

MD keeps the dev stuff private and I cba to set it up myself so idk what the changes look like

river oracle
#

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

young knoll
#

We already convert it all into objects anyway

river oracle
#

yk CabernetMC wouldn't have had these issues, but the CMarco dev had to deny our merger request so we shut down

young knoll
#

So it shouldn’t actually be that bad

river oracle
#

you hear me!!!!

young knoll
#

I mean

#

If the world is a simulation and is running in an OOP style system

#

Im probably already one

grave vigil
#

What's a command I can run to see if I even have nms installed

young knoll
#

Uhh

river oracle
#

ask paper?

manic canopy
#

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

young knoll
#

import net.minecraft

grave vigil
#

yeah looks like ima have to ask paper

ivory sleet
river oracle
# young knoll I mean
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;
  }
}
young knoll
#

I am 10cm tall but weight 100kg

#

Fear my density

river oracle
#

dense!

#

you're dense (not dumb you're just impressively dense wtf!)

young knoll
#

Do you think the simulation has UUIDs for all of us

#

I wonder what mine is

river oracle
#

I wonder if the race who simulates us is in a simulation too

#

the simulation paradox

young knoll
#

Imma start a fortune telling scam for nerds that reads your uuid

river oracle
#

genius

#

UUID.randomUUID() and add it to a database πŸ—£οΈ

young knoll
#

What if you get a conflict

#

Then you get exposed and your business collapses!

young knoll
#

Laughing my ass off, waluigi

ivory sleet
#

so we can just remove coll if we want also, love it: Coll1234567.INSTANCE = null

ivory sleet
young knoll
#

Oh no I’m not final

#

existential crisis intensifies

rough ibex
#

or wario

young knoll
#

Everyone knows waluigi is better

rough ibex
#

truth

river oracle
young knoll
#

Not if it’s a capital L

river oracle
dusk moth
#

Hey guys, I just wanted to ask if we could check if a world already exists in a server

agile anvil
#

Check by its name you mean?

dusk moth
#

Ye, in the server folder

#

Or the server itself

agile anvil
#

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

rough ibex
#

Bukkit.getWorld(String name) != null

#

you have a lot of options

river oracle
#

@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

dusk moth
#

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!");
}
glad prawn
#

?

dusk moth
#

To check if a world already exists in the server.

eternal oxide
#

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)

rough harness
#

how do i add a image like this

dusk moth
#

Wait I meant Bukkit.getWorld().getName() == newWorld

eternal oxide
#

!= null

#

Its going to be a world not a String if it returns

rough ibex
#

or custom GUI

rough harness
#

ya i know how to do resource pack but how do i make it apply to the gui

rough ibex
#

you use a font character

rough harness
#

example

agile anvil
#

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

rough harness
#

where do i find font characters at

agile anvil
rough harness
agile anvil
rough ibex
#

you don't need to include the entire negative space font by the way

rough harness
rough ibex
#

<please don't>

young knoll
#

Do you not have a need for -8000 pixel offsets

agile anvil
trim lake
#

Hi, Is possible to iterate true block in BoundingBox?

agile anvil
#

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

median bronze
#

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

eternal oxide
#

I'd use Bukkits Structure API

#

over WorldEdit

agile anvil
#

Is there a particular reason?

eternal oxide
#

Its built in while no better nor worse.

agile anvil
#

fair

trim lake
agile anvil
#

Can you share your code?

#

?paste

undone axleBOT
trim lake
#

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

eternal oxide
#

?nocode

undone axleBOT
#

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.

agile anvil
#
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

trim lake
dawn flower
#

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

rough ibex
#

you can try spawning it somewhere far away, making it invis, and then teleporting.

eternal oxide
#

use teh spawn method that takes a Consumer

dawn flower
eternal oxide
#

in the Consumer you set all it's configuration

#

yes there is

dawn flower
#

    @NotNull Entity spawnEntity(@NotNull Location var1, @NotNull EntityType var2, boolean var3);```
#

are the only ones

#

nvm

#

spawn exists

dawn flower
#

so i just do ```java
ArmorStand armorStand = (ArmorStand) location.getWorld().spawn(location.add(randomX, randomY, randomZ), ArmorStand.class, (as) -> as.setInvisible(true));

#

?

eternal oxide
#

yes

dawn flower
#

alright

#

πŸ‘

#

tysm

#

looks way cleaner now

rough ibex
#

spawn and spawnEntity how confusing

worthy yarrow
#

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...

GitHub

DamageHolograms. Contribute to NukeCaps/DamageHolograms development by creating an account on GitHub.

fallen lily
#

Create interfaces blud

#

Heres an example of an API for spigot

#

You can also utilise the java Services API

worthy yarrow
#

Will do thank you

stark moss
#

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.

shadow night
#

By using code

stark moss
#

No shot

#

I cant find documentation on it. Could I have a basic idea?

valid burrow
#

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

valid burrow
#

the point of docus is to understand the classes provided by for example spigot

quaint mantle
#

Hi , how to send message onlineplayers ?

agile anvil
valid burrow
eternal oxide
#

or just broadcast

valid burrow
agile anvil
#

It's of no use if you start to impose conditions on the receivers. Otherwise this is exactly similar

eternal oxide
#

If you are sending to everyone

quaint mantle
stark moss
#

Alr thanks

candid inlet
#

yes

quaint mantle
#

Hi , what is method of send money for vault ?

proud badge
#

use vault api

quaint mantle
#

and i am asking for vault

proud badge
#

you should read vault docs

quaint mantle
dreamy chasm
#

have you googled exactly what you typed into here, I am certain the first link will have the answer?

dreamy chasm
#

well that does have your answer

quaint mantle
worthy yarrow
#

youtube exists too

#

I remember watching a video on implementation of vault and made a whole vault compatible coins plugin

lost matrix
drowsy helm
quaint mantle
#

my balance is bugged i think

drowsy helm
#

So your economy plugin is broken

quaint mantle
#

yeah

worthy yarrow
#

?nocode

undone axleBOT
#

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.

quaint mantle
#

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

worthy yarrow
#

Yes

smoky anchor
quaint mantle
#

usually i hate youtube and i always use discord or spigot wiki or wiki of api :/

agile anvil
worthy yarrow
worthy yarrow
agile anvil
#

That looks cool good luck with that

quaint mantle
#

before i need use a economy plugin instead esstensialx

worthy yarrow
#

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
agile anvil
#

zack is right you should start working as a real project, opening issues and PR and working feature wise

quaint mantle
#

i fear some others be bad , i need a recommended

worthy yarrow
#

I mean... this wasn't meant to be anything like that haha

agile anvil
#

There are plenty of tut of how to "Contribute" on github. That should help you start

worthy yarrow
#

Well yeah I was gonna watch some github stuff tomorrow

agile anvil
#

I wish I learned it before when I was only playing with MC

quaint mantle
median trench
#

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.

worthy yarrow
#

@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

echo basalt
median trench
worthy yarrow
median trench
echo basalt
#

Then yeah you need to listen to the bundle packet and unpack it

median trench
#

it is contained in .extraPackets?

echo basalt
#

maybe

median trench
#

okay ty will try to log it

echo basalt
#

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

median trench
median trench
#

Bundle has subPackets() method, will try to log that then

native ruin
#

@echo basalt can you drop me that link of that copy pasta?

echo basalt
#

which

native ruin
#

The one you sent me

#

I think it was spigot spefific coding or smth

echo basalt
#

which one

#

I sent 3

#

.

native ruin
#

Just send me all of em then

echo basalt
#

.

native ruin
#

Ait great thanks

echo basalt
#

damn I linked entity twice

#

.

median trench
dapper flower
#

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

dapper flower
#

that has nothing to do with my problem

grim ice
quiet ice
#

All praise the holy recaf

BUT: DO NOT ASK HOW TO COMPILE WITH ERRORS; YOU DO NOT

grim ice
#

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

quiet ice
#

Well that is why the assembler exists

dawn flower
#

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);
           }
       }
   }```
echo basalt
#

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 disappointment

dawn flower
echo basalt
#

exactly

dawn flower
#

since 'removePlayer' also saves the stuff

echo basalt
#

Then make a command to reload the configs and not the entire plugin?

dawn flower
#

just cuz

echo basalt
#

that's on them

dawn flower
#

:-:

#

nvm got it fixed so they dont screw themself up if they reload

#

just had to sync stuff abit

tranquil ferry
#

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 :)

wet breach
#

there should be a button to switch the view

#

then you can see the bbcode related stuff and remove it

echo basalt
#

fixed

#

just woke up cut me some slack

inner mulch
#

reloading is not supported by spigot

next iron
#

how can i get nbt data from an entity?

eternal night
#

what nbt data

next iron
eternal night
#

why?

lost matrix
next iron
#

the kind you get with /data get

eternal night
#

generally, that stuff is abstracted away

#

you don't access the entire nbt tag

next iron
#

that being its name

eternal night
#

its custom name?

#

or the bukkit values thing

next iron
#

the bukkit values thing

eternal night
#

Yea

next iron
#

its type

eternal night
#

that is the PDC

lost matrix
#

?pdc

next iron
#

oh

#

alr ill check that out

#

ty

eternal night
#

πŸ‘

lost matrix
#

But why not use the mythicmob api?

eternal night
#

ActiveMob mythicMob = MythicBukkit.inst().getMobManager().getActiveMob(bukkitEntity.getUniqueId()).orElse(null);
if(mythicMob != null && mythicMob.getMobType().equals("SkeletalKnight")){
// do something with mob
}

#

yea like kekwhyper

#

that seems a lot easier and future proof

next iron
eternal night
#

they have a wiki

lost matrix
next iron
#

ill try

inner mulch
#

how do i set an optionals value?

dire marsh
#

you don't

#

the value is final

inner mulch
#

yes but i dont know how to set the final value in the first place

drowsy helm
#

.of

#

Optional<T>.of(T)

worldly ingot
#

or ofNullable() if the value could be null

#

or empty() if you want nothing

inner mulch
#

okay

#

thanks :)

#

why is this yellow :(?

#

what does intellij want to save me from

dire marsh
#

it's against convention supposedly

inner mulch
#

why's that?

inner mulch
#

i still dont quite get it, how do i get rid of the yellow?

eternal oxide
#

Do you understand what final means?

inner mulch
#

yes but final didnt fix it

#

:(

#

and its not supposed to be final either

eternal oxide
#

its already final

#

you can't reassign something that is final

inner mulch
#

its not final

#

i can reassign whenever i want :)

eternal oxide
#

you can't

inner mulch
#

ic an

#

private void setTarget(@Nullable UUID uuid) {
this.target = Optional.ofNullable(uuid);
}

#

😏

hybrid turret
#

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?

inner mulch
#

okay nice but that has nothing to do with my thing

#

im not extending anything here

eternal oxide
#

it has everything to do with your issue

inner mulch
#

okay then fix my yellow

#

tell me what to do

eternal night
#

replace it with a nullable UUID

inner mulch
worldly ingot
#

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

inner mulch
#

okay fixxed it thank you :)

hybrid turret
eternal oxide
late sonnet
eternal oxide
#

Player UUIDs don't change so no neeed to record all, or change them

echo basalt
#

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

eternal oxide
#

Quite pointless really

#

Unless you are running your server on a Pi or some other device with REALLY restricted memory

echo basalt
#

it was for disk space p sure

eternal oxide
#

It would have to be a LOT of UUIDs to even bother with optimising

worldly ingot
#

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

echo basalt
#

Prob billions honestly

worldly ingot
#

The indexing speeds may be quicker as well

echo basalt
#

Dude said it was something like 30% less

worldly ingot
#

Not to mention that some people store UUIDs as strings πŸ’€

#

Then you're really looking to kill your database's storage and lookup speeds

echo basalt
#

Let me see what coreprotect does

#

p sure it's just a sqlite .db

worldly ingot
#

It is, yes. You can use a remote MySQL DB as well, but by default it's SQLite

echo basalt
#

I mean the table format

#

I don't have a .db file to look at

worldly ingot
#

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 PES_HyperReee

eternal night
echo basalt
#

user varchar(100) this starts well

worldly ingot
#

oh dear

echo basalt
#

"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

late sonnet
#

πŸ‘€

quiet ice
worldly ingot
#

Yeah, CoPo's database structure is notoriously terrible and slow

#

This is a well known thing lol

echo basalt
#

let's make a mysql proxy

worldly ingot
#

I'm almost certain your CoPo would perform way better if you adjusted how the table was structured

echo basalt
#

yuh

worldly ingot
#

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

echo basalt
#

Make a proxy server that intercepts calls and reworks how the data is sent

#

:3

quiet ice
#

Wouldn't that be even more overhead?

echo basalt
#

more latency less disk space

quiet ice
#

Data consumption as in?

worldly ingot
#

Wouldn't increase the lookup speeds though

#
  • you also have a table on top of things so you're increasing storage space :p
echo basalt
#

let's see what's better

worldly ingot
#

Oh, sorry, my mistake, misread your proxy idea

echo basalt
#

making a uuid lookup table or

worldly ingot
#

but probably won't improve lookup times because you still have to deal with the fact that the base table still exists