#help-development

1 messages · Page 1804 of 1

tender shard
#

I'm sorry I don't find it right now

#

but there definitely is a way in NMS

#

let's wait until someone replies who knows it

sullen marlin
#

has to be done each time you load the world

zealous osprey
#

I was looking aswell, but I cant seem to find anything useful past EntityDeathEvent

tender shard
#

since md_5 is currently here, maybe he knows 😄

sullen marlin
#

what exactly do you mean

tender shard
#

getting an entities loottable

zealous osprey
#

By the type alone preferably

tender shard
#

ah

#

so you don't even have an entity?

#

you just want to get the "generic" loottable e.g. for ANY creeper, for example?

zealous osprey
#

Yes, I do/can get it

sullen marlin
#

LootTables.XXXXX.getLootTable()

tender shard
#

pog

zealous osprey
#

:O

tender shard
#

that was way easier than I expected it to be

#

lol

#

good thing md5 just came around

sullen marlin
#

API 😉

zealous osprey
#

same, thaught I'd needed to create a function similar to that what would be in the NMS

zealous osprey
tender shard
#

yeah md you gotta understand that most of the entity stuff is not inside the API so people don't even try to look there 😄

#

I didnt even know spigot has any API for loot tables 😄

#

awesome

zealous osprey
#

I didnt even consider the posiblity of an outside class for the loottable, rather expected it in EntityType or Entity

sullen marlin
#

it is also in Entity

#

but you said you wanted only type, not actual mob

tender shard
#

is there any better way to get a gameprofiles texture than this?

#
        Field profileField;
        try {
            profileField = headMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            GameProfile profile = (GameProfile) profileField.get(headMeta);
            String texture = profile.getProperties().get("textures").stream().findFirst().get().getValue();
        } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException exception) {
            exception.printStackTrace();
        }
zealous osprey
#

Well type is preferable in my situation rather than the mob itself

sullen marlin
tender shard
#

oh lmao

#

suddenly spigot gets API stuff for everything I need

#

nice

young knoll
#

It’s nice that a new API for heads is finally being worked on

#

I think we owe thanks to choco for that one

sullen marlin
#

its not him doing it

spiral light
tender shard
#

I'd love to contribute sth to the API too one day

#

but I fear I'm not good enough for that rn lol

spiral light
young knoll
sullen marlin
spiral light
#

not complicated enought maybe

young knoll
#

The bigger the PR the longer it takes to review

spiral light
#

its just ... maybe 1500 lines of code or smth like this 😅

young knoll
#

That’s quite a bit

spiral light
tender shard
#

does anyone remember the name of the person with whom I talked to about allatori yesterday?

spiral light
tender shard
#

I sent a .jar for someone to deobfuscate

#

and they wrote a small app in kotlin

spiral light
#

you sended me something about allatori in a pom but dont think you mean this

spiral light
tender shard
#

ah yes I remember, but no I'm not talking about that

astral raven
#

hey there
I'm getting weird errors trying to run BuildTools: Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.3:remap (remap-members) on project spigot: Error creating remapped jar: Could not find artifact org.spigotmc:minecraft-server:csrg:maps-spigot-members:1.18-R0.1-SNAPSHOT in minecraft-libraries (https://libraries.minecraft.net/)
does anybody has an idea?
(also it seems weird that buildtools seeks for a spigot file on a mojang website 🤔)

tender shard
astral raven
tender shard
#

oh wait

astral raven
#

yeah, that's a pretty weird error
I ran the same version of buildtools with the same command yesterday and it worked...

tender shard
#

I just ran that command and I also get an error from it

astral raven
#

lmao

tender shard
#

I'll try again without --generate-docs

astral raven
#

I'm trying without docs and remapped

tender shard
#

lmao indeed it also doesn't work for me now without --generate-docs

#

it used to work fine a few hours ago

peak granite
#

does anyone know how i can send the PacketPlayOutGameStateChange, 5 and 0 nms packet to the player (demo screen)

slim cairn
#

@last temple

tender shard
# tender shard

@sullen marlin sorry again for pinging but what's up with buildtools? it used to work fine

young knoll
astral raven
slim cairn
#

Sup

astral raven
#

BuildTools does not work either with no parameters at all, same error

peak granite
spiral light
astral raven
#

pretty recently, let me check

peak granite
#

yeah i'm on 1.8.8 lol

astral raven
#

yeah, 1.18

spiral light
tender shard
astral raven
peak granite
#

shut up

young knoll
#

One day we’ll be allowed to just kick all the 1.8 people :p

spiral light
tender shard
#

I stopped supporting 1.8 like 3 years ago lol

young knoll
#

I don’t think this discord has ever supported it

tender shard
#

true

#

but also why would it

#

1.8 is dead

young knoll
#

Hell I’m pretty sure 1.8 is older than discord itself :p

spiral light
#

yesterday someone wrote he uses 1.8 because of pvp .-.

tender shard
#

😄

young knoll
#

Or at least close

spiral light
#

discord: 13. Mai 2015

quaint mantle
#

1.8 pvp sucks smh

tender shard
#

also I dont get all the "1.8 pvp is better" thing

spiral light
#

but its already close enought 😄

quaint mantle
#

Skype bro!

tender shard
#

like.... what's worse in 1.9+?

peak granite
#

1.19

tender shard
#

yeah sorry typo

peak granite
#

the hit cooldown

#

is bad

quaint mantle
#

Is good

tender shard
#

why is it bad?

spiral light
#

you can disable the hit cooldown ...

peak granite
#

some people just don't want to accept the change

quaint mantle
#

Makes game less device dependent

tender shard
#

keep spamming leftclick is better than having to actually time your hit?

quaint mantle
#

the timings makes pvp much more technical, combos became much harder and variative

young knoll
#

It also means I can compete against the people with 20 cps

tender shard
visual tide
quaint mantle
#

Fuck shields though

onyx fjord
#

@peak granite it isn't about Pvp

young knoll
#

That most people prefer to be up to date?

onyx fjord
#

It's about software age

young knoll
#

That is very true

onyx fjord
#

And bugs

peak granite
#

yeah ig it's time to switch

onyx fjord
#

If you like old PvP install OCM

tender shard
#

well being "up to date" of course depends

visual tide
onyx fjord
#

We have trillion of plugins for that

visual tide
#

of course it's a massive pain to use or support 1.8

young knoll
#

BStats would disagree

tender shard
quaint mantle
onyx fjord
#

Try latest ocm

tender shard
#

what's ocm?

young knoll
#

Removing the hit cooldown works flawlessly

onyx fjord
#

Old combat mechanics

young knoll
#

Not sure about the other stuff

quaint mantle
#

that is called loud minority

onyx fjord
#

It even has old knockback

tender shard
#

ah thx @onyx fjord

quaint mantle
#

i will try

onyx fjord
#

Old pot effects

#

Old damage

#

Old armor damage

tender shard
#

I'm new to hosting servers so I don't know all the plugins lol

peak granite
#

lmfao

quaint mantle
#

Like, without old kb pvp becomes unplayable trash

#

With OCM

young knoll
visual tide
#

either 1.8 pvp or 1.9 pvp but not the mess that 1.8 pvp on non-legacy plugins create

onyx fjord
#

Alphabetically?

young knoll
#

Sure

onyx fjord
#

Among us minigame

#

Bedwars

#

Chest regen

quaint mantle
#

What about Among Us x????

onyx fjord
#

What

#

👽

quaint mantle
#

eh forget about it

quaint mantle
#

the dream

onyx fjord
#

Dream stan banner

peak granite
#

when mc 2.0??

onyx fjord
#

?eta

undone axleBOT
#

There is no ETA. Having an ETA leads to unrealistic deadlines, false hope, and a bad product. It will be ready when it's ready.

quaint mantle
#

Can I check for the item when a player interacts with my custom ItemStack like: if (event.getItem().equals(myItem)) {

peak granite
#

??

onyx fjord
#

@peak granite Lets move to #general

peak granite
#

no

quaint mantle
young knoll
#

2.0 was fun

quaint mantle
#

Use the pdc to identity your custom items

tender shard
young knoll
tender shard
#

depends on the server. most servers don't have ANY plugins installed

young knoll
#

isSimilar ignores stack size

young knoll
tender shard
#

does isSimilar ignore durability too?

quaint mantle
young knoll
quaint mantle
#

because it would not work fine if player will break or rename your item

#

Or enchant

#

and the pdc is faster. You dont have to compare the entire itemstacks, just check if it has a single tag.

quaint mantle
#

Ok thanks

tender shard
tender shard
young knoll
#

Those are only the ones you use :p

tender shard
#

true but I won't scan my clients files lol

young knoll
#

Real owners can name every single plugin on spigotmc

tender shard
#

btw is LeGuernic still alive?

onyx fjord
#

Oh god

#

1.4.6

tender shard
#

a few months ago, someone messages me, claiming there's a LeGuernic dude on spigotmc who stole his identity / real life picture etc

#

and I was like " yeah of course I know LeGuernic. It's the dude who always claims he's the very famous 1.4.6 dev bla bla" lmao

#

leguernic is a legend troll

#

but he didnt answer in months, maybe he's dead or sth

young knoll
#

Pfft

#

Imma dev for 1.2.5

hexed hatch
#

bold

noble lantern
#

Basically did a fresh install of my pc yesterday when i installed a new NVMe

Now with a fresh install of IntelliJ it feels so clunky?

#

Whenever i click once, it select 20 million freaking lines

#

and then its not finding any classes i create either... even after a restart/invalidating caches

#

And these classes have public access

sterile token
mortal hare
#

is there any way to delay code execution without plugin instance

#

i know i can use something like SingleThreadDelayExecutor

noble lantern
mortal hare
#

but it feels overkill for one lambda expression

noble lantern
#

Just create a static instance like i did in mine

mortal hare
#

i don't have plugin instance

ivory sleet
noble lantern
#

you know what

young knoll
#

Just sleep the main thread

noble lantern
#

yeah

young knoll
#

:D

noble lantern
#

^

ivory sleet
#

give it a low priority also

mortal hare
sterile token
#

is there a way to stop thread lock?

young knoll
#

You’d be surprised how many still do that

ivory sleet
#

or like thread lock as just a lock?

mortal hare
#

Use reentrant locks

ivory sleet
#

well java has some interruption mechanics for awaits

sterile token
#

I have been testing my socket library and my problem is that when a connection its received the new thread (the one who handle the connection) get locked and the data stream never open

mortal hare
#

It just seems so overkill

#

to create separate thread

quaint mantle
#

But why cant you use a plugin, dovidas?

mortal hare
#

for only one line of code

sterile token
#

What do you want to do dovidas?

#

I use a lot labda

mortal hare
#

i need to delay packet and packet future listener still executes too fast

ivory sleet
#

dovidas how is it overkill

#

I mean thats what you need

#

accept it and go on

young knoll
#

Or accept that you need a plugin instance

mortal hare
#

Fine, I was using CraftScheduler's scheduleInternalTask method but that's cursed

#

im using it for different purpose

quaint mantle
#

you could probably use thread pool tho

ivory sleet
#

^

sullen marlin
#

why do people do this

#

I dont understand

mortal hare
#

What about completable future

#

is it a great choice?

sullen marlin
#

the scoreboard API has been a complete replacement of packets forever

young knoll
#

But

#

Uhh

#

It’s too slow

ivory sleet
mortal hare
#

wdym

#

its on CommonForkJoinPool thread pool

ivory sleet
#

not necessarily

mortal hare
#

yea you can provide your own executor

ivory sleet
#

it has an executor which creates a new thread per runnable if the parallelism of the common pool is below 2

mortal hare
#

so what are you saying to me to do

ivory sleet
#

or if it was 1 iirc

quaint mantle
sterile token
#

Is there a page that talk about client server connection packets?

ivory sleet
#

else a single threaded scheduled executor service could suit you

young knoll
#

What would components even do for a scoreboard

mortal hare
#

connection.sendPacket(this.infoRemovePacket)

#

i literally need to execute this

ivory sleet
#

if only temporary, just prepare a thread should be fine?

mortal hare
#

that's everything

#

its not complicated

sterile token
mortal hare
#

i've preconstructed packets inside the class instance

ivory sleet
#

you can optimize the thread a bit if you want to by daemonizing it, lowering its priority etc

mortal hare
#

wdym by temporary

ivory sleet
#

for a short amount of time merely

mortal hare
#

temporary codebase

#

or delay of the task?

ivory sleet
#

the task

ivory sleet
#

is it only gonna be executed once per runtime?

#

or when/how often

mortal hare
#

i really need to delay only by 5/20 th second

#

its often executed

quaint mantle
#

Just send it after a tick 🙂

#

why

#

why so much effort

mortal hare
quaint mantle
#

2 ticks

mortal hare
#

i tried it

young knoll
#

5 ticks

mortal hare
#

2 ticks isnt enough

#

5 ticks is enough

ivory sleet
#

Cached thread pool + single threaded scheduled executor maybe?

#

or (possibly a fork join pool instead of a cached one if you know the blocking coefficient)

mortal hare
#

man im too dumb yet to do complex concurrency

quaint mantle
#

Just send it after 5 ticks

young knoll
#

Then just get a plugin instance?

sterile token
mortal hare
#

i can use thread pool

#

im just too dumb to know what the blocking coefficient means

ivory sleet
#

let me just provide you with a cool example then

young knoll
#

😎

sterile token
young knoll
#

Ew

mortal hare
young knoll
#

Just use JavaPlugin#getPlugin

quaint mantle
#

plugin.getServer().getScheduler().runTaskLater(plugin, () -> {}, 5L);

sterile token
quaint mantle
#

Just pass Plugin in constructor

young knoll
#

That’s also an option

quaint mantle
#

If you need to schedule stuff, you need plugin as well

young knoll
#

I mean you don’t, but it’s the easiest way

quaint mantle
#

And what does it have to do with encapsulation

mortal hare
#

I'm creating instances of classes via factory method

quaint mantle
#

Ok

mortal hare
#

and having separate method in factory class just for this

#

is just dumb

quaint mantle
#

Maybe you shouldnt schedule tasks from those instances if you want to keep them independent??? Single Responsibility principe and bla bla bla

#

Just pass the plugin in your factory

mortal hare
#

it really works without plugin instance its just that the fucking client doesnt catch up with the server that fast

#

so annoying

#

I'm currently setting the PlayerInfo packet for an NPC and removing it after the entity has spawned, since it would hide the NPC from the tablist

#

problem is that Client removes the playerinfo packet first then renders the player skin

#

so i need some sort of delay to compensate that

quaint mantle
#

runTaskLater

ivory sleet
#
ExecutorService executor = Executors.newCachedThreadPool(
  new ThreadPoolBuilder()
    .setDaemon(true)
    .build()
);
ScheduledThreadPoolExecutor scheduler = new ScheduledThreadPoolExecutor(
  1,
  new ThreadPoolBuilder()
    .setDaemon(true)
    .build()
);
scheduler.setRemoveOnCancelPolicy(true);


void execute(Runnable runnable,Duration delay) {
  scheduler.schedule(() -> executor.execute(runnable),delay.toMillis(),TimeUnit.MILLISECONDS);
}

could do smtng similar with executor but with ScheduledThreadPoolExecutor::scheduledAtFixedRate iirc

#

was some time since I touched java's concurrency stuff

#

but that should give u a hint

mortal hare
#

I've previously used connection.a(#Packet<?> packet, #GenericFutureListener<> listener) to delay the packet but still its not enough

quaint mantle
#

runTaskLater
runTaskLater
pass plugin in the constructor
pass plugin in the constructor

young knoll
#

Check the javadocs

#

What, that’s what they are for

ivory sleet
#

👍

#

also

#

might wanna terminate the executors in onDisable

#

(altho they're daemon)

#

but to make sure no new tasks can be submitted

quaint mantle
#

JUST
USE
THE
BUKKIT
SCHEDULER

ivory sleet
#

or well ExecutorService::shutdown (to be specific)

mortal hare
quaint mantle
#

BUT INSTEAD A CUSTOM EXECUTOR WHICH ALSO HAVE TO MAINTAIN?

mortal hare
#

yes.

#

or CommonJoinForkPool

young knoll
#

When in doubt, over complicate

ivory sleet
#

its called the common pool to be picky

#

but yeah

#

great pool

#

altho heavily abused in the spigot community

mortal hare
#

you know that

#

im gonna abuse the internal method

#

just for now

ivory sleet
#

🤢

mortal hare
#

((CraftScheduler)Bukkit.getScheduler()).scheduleInternalTask(() -> connection.sendPacket(this.infoRemovePacket), 5, "npc-tablist-task");

#

doing this rn

#

but this is not ok

#

eh

#

maybe i should change this

#

IDK

#

Today or Tomorrow

#

this will still be removed someday

young knoll
#

That’s what they all say :p

mortal hare
#

😄

quaint mantle
#

and only a single plugin instance will save you from all this shit...

mortal hare
#

you do realise that it does break the whole polymorphism of my class? I need to add useless plugin instance to the class interface which wouldnt be used apart of this implementation since other handler class uses interface to handle that class externally too

#

1/4 of classes would use JavaPlugin instance

#

and only just for this

graceful turret
#

how to rotate entity while sitting on it?

ivory sleet
#

idk if there's a method for it in the api

sullen marlin
#

?

graceful turret
#

i have to pass yaw and pitch yeah?

#

or what

sullen marlin
#

sounds like rotation to me

graceful turret
#

ok

next plume
graceful turret
random isle
#

Hello, is there any existing list of DeclaredFields for HumanEntity at the version of 1.17?

sullen marlin
#

?xy

undone axleBOT
lavish hemlock
#

oh nice I didn't know we had a xy command

random isle
#

uffff help i only wnt to know the DeclerationField for permissions and here are so many people, one of these know that please XD

sullen marlin
#

?xy

undone axleBOT
wispy furnace
#

Hey, I have a basic problem. I tried to import the new jar into my Project but it just doesn't work. It also doesn't work to create a new project with the new spigot.jar but it still works for me with the old 1.17.1 one

iron tundra
#

The jar you should be using is called "spigot-api-1.18-R0.1-SNAPSHOT-shaded"

iron tundra
#
WorldServer world = ((CraftWorld) Bukkit.getWorld(player.getWorld().getName())).getHandle();
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), ChatColor.DARK_AQUA + "" + ChatColor.BOLD + "Ispeakweeb");
EntityPlayer npc = new EntityPlayer(server, world, gameProfile, new PlayerInteractManager (world);

This used to work on later versions of Minecraft, I might just be using really outdated ways of handling this but if you know how I can handle this without getting an error that would be helpful. Error: 'PlayerInteractManager(net.minecraft.server.level.EntityPlayer)' in 'net.minecraft.server.level.PlayerInteractManager' cannot be applied to '(net.minecraft.server.level.WorldServer)'. The usage of this is trying to create a NPC that spawns into the world

late sonnet
iron tundra
wispy furnace
late sonnet
iron tundra
wispy furnace
#

Im also unable to use spigot-1.18.jar for creating a server . I tells me it is unable to open the jar. I already checked that I have java 17 installed. Since it din't work I updated to java 17.0.1 and it still doesn't work.

#

Unable to access jarfile server_latest.jar

late sonnet
peak granite
#

what is iconcrack_155 in java

#

particle name

late sonnet
#

you mean convert bind to enchant or what?

random isle
# late sonnet and why need this?

I would like to test a little bit with it. I have Field f = HumanEntity.class.getDeclaredField("perm"); but hey say thats not correct. The errors are these java.lang.NoSuchFieldException: perm and at java.base/java.lang.Class.getDeclaredField(Class.java:2549)

late sonnet
random isle
#

yeah but i dont know where to search

late sonnet
random isle
#

ok thx i try it

random isle
#

ok i cant find anything and i watched a lot of tutorials XD

dusty sphinx
#

RROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project Matchmaker: Fatal error compiling: invalid flag: --release -> [Help 1]

#

What's going on here? My dependencies aren't compiling now. They did in the past

sullen marlin
#

please answer or no one will help

#

?xy

undone axleBOT
sullen marlin
dusty sphinx
#

uh oh

#

what does jitpack use

#

i need java 16

sullen marlin
#

no idea

#

presumably you can configure it

regal carbon
#
        Bukkit.getLogger().info("World name is: " + worldname);
        Bukkit.unloadWorld(worldname, true);
        WorldCreator worldcreator = new WorldCreator(worldname);
        if (Objects.equals(config.getString("pregame.seed"), "random")) {
            int seed = new Random().nextInt(2000000);
            worldcreator.seed(seed);
            Bukkit.getLogger().info("The seed is: " + seed);
            Bukkit.getLogger().info("The seed gotten from worldcreator is: " + worldcreator.seed());
        } else if (Objects.equals(config.getString("pregame.seed"), "preset")) {
            List<Integer> seeds = config.getIntegerList("pregame.presetseed");
            if (seeds.toArray().length == 1) {
                worldcreator.seed(seeds.get(0));
                Bukkit.getLogger().info("The seed is: " + seeds.get(0));
                Bukkit.getLogger().info("The seed gotten from worldcreator is: " + worldcreator.seed());
            } else {
                int seed = seeds.get(new Random().nextInt(seeds.toArray().length - 1));
                worldcreator.seed(seed);
                Bukkit.getLogger().info("The seed is: " + seed);
                Bukkit.getLogger().info("The seed gotten from worldcreator is: " + worldcreator.seed());
            }
        }
        world = Bukkit.createWorld(worldcreator);
        File oldworld = new File(Bukkit.getWorldContainer().getAbsolutePath() + "/" + worldname);
            if (!FileUtils.deleteQuietly(oldworld)) {
                Bukkit.getLogger().severe("Unable to delete the old world! Sometimes, the problem fixes itself after a server restart. idk why, but try that");
            }
        Bukkit.getLogger().info("regenWorld complete!");```
im trying to delete the current world and remake a new one, but the world sometimes fails to delete, sometimes it works, idk why, also the world seed from /seed doesnt match the worldcreator
next fossil
#

What is the current way to get a Channel from a CraftPlayer entity?

#

It used to be nmsplayer.getHandle().b.a.k;

#

But now I'm using the mojang mapping, what's the Mojang Mapping method for it?

young knoll
#

Use random.nextLong

regal carbon
#

oh ok, but what about the deleting?

young knoll
#

Make sure it’s unloaded

regal carbon
#

"Bukkit.unloadWorld(worldname, true);" this should do it right

young knoll
#

It’s not instant

#

And there isn’t any callback for when it’s done

regal carbon
#

could i use Thread.sleep() ?

young knoll
#

You shouldn’t sleep the main thread

#

Use a runnable and keep going until its unloaded I guess

regal carbon
#

so like loop delete the files until its confirmed deleted?

young knoll
#

Pretty much

#

Not sure if there is a way to check if the world is unloaded, that would probably be more ideal

regal carbon
#

yeah, but thanks

grave hound
#
public class PlayerInteract implements Listener{
    int delay = 0;
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        Block block = event.getClickedBlock();
        ItemStack tool = event.getItem();
        if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
            if(block.getType() == Material.BEDROCK ){
                if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
                    if(delay >= 30){
                        delay = 0;
                        block.setType(Material.AIR);
                    }else{
                        delay += 1;
                    }
                    System.out.println(delay);
                }
            }
        }
    }
}

how do I make the int delay per player rather than per triggered event

young knoll
#

Use a map

grave hound
#

wdym ?

young knoll
#

Use a map to store an int for each player

grave hound
young knoll
#

?learnjava

undone axleBOT
spare marsh
#

Does low RAM affect a server's TPS?

young knoll
#

It can

spare marsh
#

In what way?

young knoll
#

If there isn’t enough space in RAM the server has to spend extra time garbage collecting

spare marsh
#

Ahhhhhh got it

silent vigil
#

for some reason my plugin isnt loading. Its in the plugin file, but the config.jar file doesnt generate, and it just doesnt load.

young knoll
#

Read the startup log

silent vigil
#

its 1183 lines long

#

cant find anything that mentions the plugin

young knoll
#

Well if it’s in the plugins folder and it didn’t load then they’ll be an error

#

Why is your log so long

grave hound
#

I don't think I did the hash map right

public class PlayerInteract implements Listener{
    Map<UUID, Delay> map = new HashMap<UUID, Delay>();
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        map.put(player.getUniqueId(), 0);
        Delay delay = map.get(player.getUniqueId());
        Block block = event.getClickedBlock();
        ItemStack tool = event.getItem();
        if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
            if(block.getType() == Material.BEDROCK ){
                if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
                    if(delay >= 30){
                        map.put(player.getUniqueId(), 0);
                        block.setType(Material.AIR);
                    }else{
                        d = delay+1
                        map.put(player.getUniqueId(), d);
                    }
                    System.out.println(delay);
                }
            }
        }
    }
}```
silent vigil
#

nvm i was spelling it wrong

young knoll
#

Did you make a custom class for this?

grave hound
silent vigil
#

at com.github.ukraine1449.kronteq.Kronteq.<init>(Kronteq.java:26) ~[?:?] does this mean that the error was caused by line 26 in the Kronteq file?

young knoll
#

Yes

silent vigil
#

ok copy ty

young knoll
#

Why not just store an Integer

grave hound
# young knoll Why not just store an Integer

so like this

public class PlayerInteract implements Listener{
    HashMap<UUID, int> map = new HashMap<UUID, int>();
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        map.put(player.getUniqueId(), 0);
        int delay = map.get(player.getUniqueId());
        Block block = event.getClickedBlock();
        ItemStack tool = event.getItem();
        if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
            if(block.getType() == Material.BEDROCK ){
                if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
                    if(delay >= 30){
                        map.put(player.getUniqueId(), 0);
                        block.setType(Material.AIR);
                    }else{
                        int d = delay+1
                        map.put(player.getUniqueId(), d);
                    }
                    System.out.println(delay);
                }
            }
        }
    }
}```
waxen plinth
#

You can't do Map<UUID, int>

#

You have to do Map<UUID, Integer>

grave hound
#

how do I fix
Cannot resolve symbol 'HashMap'
Cannot resolve method 'put(?, int)'
Cannot resolve symbol 'player'
Cannot resolve method 'get(?)'

waxen plinth
#

Have you tried importing HashMap

grave hound
#

how do I import it

waxen plinth
#

Actually wait

#

More private 👍

grave hound
#

I still have Cannot resolve symbol 'player'

fickle helm
silent vigil
#

Hey so I have a slight problem. My plugin does not load, and in the error log it says this Caused by: java.lang.NullPointerException at com.github.ukraine1449.kronteq.Kronteq.<init>(Kronteq.java:26) ~[?:?] that line of code is as follows. ```java
Location defaultStoredLOC = getServer().getWorld("Practice").getSpawnLocation();

#

what should I do?

grave hound
#

if I put map.put(player.getUniqueId(), +1); will it add 1 to the current value

grave hound
quaint mantle
#

map.put(player.getUniqueId(), map.get(player.getUniqueId() + 1));

grave hound
#

its not increasing

#
public class PlayerInteract implements Listener{
    HashMap<UUID, Integer> map = new HashMap<UUID, Integer>();
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        Player player = event.getPlayer();
        map.put(player.getUniqueId(), 0);
        Block block = event.getClickedBlock();
        ItemStack tool = event.getItem();
        if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
            if(block.getType() == Material.BEDROCK ){
                if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
                    if(map.get(player.getUniqueId()) >= 30){
                        map.put(player.getUniqueId(), 0);
                        block.setType(Material.AIR);
                    }else{
                        map.put(player.getUniqueId(), (map.get(player.getUniqueId())+1));
                    }
                    System.out.println(map.get(player.getUniqueId()));
                }
            }
        }
    }
}```
silent vigil
#

how can I get the spawn location of the world I spawn in when I first join the server?

quaint mantle
wicked lake
#
public static boolean isArmor(ItemStack item) {
        return (CraftItemStack.asNMSCopy(item).getItem() instanceof ItemArmor);
    }``` no longer works, is there a sane substitute?
#

Inconvertible types; cannot cast 'net.minecraft.world.item.Item' to 'net.minecraft.world.item.ItemArmor'

proud basin
#

bruh

quaint mantle
#
UUID uuid = player.getUniqueId();

map.put(uuid,
        map.containsKey(uuid)
              ? map.get(uuid) + 1
              : 1
);

@grave hound

grave hound
#

I gtg for now I'll work on this more later

sullen marlin
#

bruh

paper viper
#

lol

young knoll
#

Do we have an armor tag?

sullen marlin
#

1.18 is really bringing shitcode to the fore

#

type armor into the javadocs

wicked lake
#

I'll check it out

sullen marlin
#

EnchantmentTarget.ARMOR.includes(..)

young knoll
#

Kinda weird that it’s an enchantment target

#

But I guess that works

proud basin
#

md_5 your hair looks pretty today

sullen marlin
#

well what other reason do you need to know if something is armor

young knoll
#

Mmm true

wicked lake
young knoll
#

I was just expecting it to be a tag, never thought to look at enchantment target

sullen marlin
#

can ask mojang why there's no tag

#

tags are weird af tbh

#

another odd design choice

jade perch
#

Hullo

young knoll
#

I mean spigot could always make custom tags

sullen marlin
#

thats even sillier

young knoll
#

How so

sullen marlin
#

deciding what tags to add and what to put in them is an API nightmare

young knoll
#

True

#

I guess users can always just make a set

vast kelp
#

Hey, anyone here well-versed with multi-module Maven projects that can lend a hand?

sullen marlin
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!

vast kelp
#

I'll start a thread so not to crowd the chat, then.

sullen marlin
#

probably less likely to get an answer, but you do you

timber whale
#

Hi

#

ok so if i wanted to get the block the entity is standing on would i do

Block bottomEntBlock = entity.getLocation().getBlock().getRelative(BlockFace.UP);```
young knoll
#

No, you want down

timber whale
#

oh ok

#

so

#

How do the blockfaces work

young knoll
#

Down is... down

timber whale
#

yeah but wouldnt it be the top of the block

young knoll
#

No?

timber whale
#

ok so

#

a block has six faces, if i wanted to get the top of the grass block (the green part) I would do BlockFace.DOWN since its the top of the block

#

thats stupid

young knoll
#

But you aren’t getting the face of a block

#

You are getting the block relative to it

timber whale
#

relative to what

young knoll
#

The block you currently have

timber whale
#

can u further explain this

young knoll
#

Block.getRelative(BlockFace.DOWN) gets the block downwards(below) from Block

#

If you will it gets the block touching the downward face of Block

iron tundra
#
ScoreboardTeam team = new ScoreboardTeam(
                ((CraftScoreboard)Bukkit.getScoreboardManager().getMainScoreboard()).getHandle(),player.getName());
team.setNameTagVisibility(ScoreboardTeamBase.EnumNameTagVisibility.b);

Error: Cannot resolve method 'setNameTagVisibility' in 'ScoreboardTeam'
Usage: I am trying to make a specific player and/or entity created to not show it's name tag
If you either know what is wrong or a better method I would appreciate the guidance

young knoll
#

Why craftbukkit

timber whale
#

ty

pliant tundra
#
public class PlayerDeath implements Listener {
    public static void setMaxHealth(Player player, double hearts) {
        player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(hearts);
    }

    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        System.out.println("hi");
        Player killed = event.getEntity();
        Player killer = killed.getKiller();

        if (killer == null) return;

        setMaxHealth(killed, killed.getMaxHealth() - 2);
        setMaxHealth(killed, killer.getMaxHealth() + 2);
    }
}

i have this listener that removes a heart from the killed player and adds a heart to the killer when a player dies
when the killed player respawns, the max health is set to the default value and it takes about a second before it gets set to the correct value
anyone know how i can get around this delay?

young knoll
#

You probably can’t

#

Maybe if you set it in the respawn event instead

vast kelp
#

Even if you do that the client's probably going to show max health for at least a fraction of a second.

spare marsh
#

Does someone know why when I try to build my artifact it says my main class/files don't exist

vast kelp
#

Can't tell in your project view whether or not the MyPlugin class actually exists but if it does try right-click project and Reload from Disk?

vast kelp
#

Maybe delete the import lines and repopulate?

#

Btw it's bad practice to use underscores in your package/class names like that

sullen marlin
#

DO NOT USE NMS FOR SCOREBOARDS

iron tundra
#

I have zero clue what i am doing man

quaint mantle
#

daily md_5 message

sullen marlin
#

ffs

#

you'd think we didn't have a scoreboard api

iron tundra
#

Thank you

young knoll
#

Oh cool it has a wiki page

quaint mantle
#

i like how the

NMS on different versions (without reflection)
wiki uses actionbar NMS to showcase it

sullen marlin
#

kill it

#

kill it with fire

young knoll
#

NMS is the natural enemy of the MD

#

Along with I assume the funnel web spider

quaint mantle
#

this is what happens when md_5 doesn't instantly add support for all the fancy features

sullen marlin
#

but scoreboards have literally had support forever

#

pretty sure action bar has since at least 1.9 too

#

though wouldnt surprise me if it was 1.8

#

I cant remember 6 years ago

quaint mantle
#

how to fake protocol?

#

in client

#

ok i got optifine src

#

gonna fake protocol

#

for some reason my server im playing dont really like 1.8 (which i dont like too, but im pretty good at old combat so i still use it), so i think i have to fake protocol to 1.9

young knoll
#

People probably find old tutorials that use NMS

#

And then they use NMS, and then the cycle continues

quaint mantle
#

md_5 needs to make it so certain parts of NMS just can't be accessed, ezpz

sullen marlin
#

gonna sell it as DLC

vast kelp
#

<cash register ca-ching noise>

quaint mantle
#

Do not provide any mappings at all md_5

young knoll
#

md more like mea

quaint mantle
#

mojang provides mappings, md_5 is just nice enough to make the tool for us to use

#

I'm sure someone else would

sullen marlin
#

silly mojang

quaint mantle
#

how did people even get mojang to provide them

#

was it the mod community

#

Obfuscate the spigot jar two times so even mojang mappings will not hekp md_5

young knoll
#

Not sure

young knoll
#

Originally they were still ARR so nobody could really use them

#

But then Mojang changed the licensing on them

iron tundra
#
public class Scoreboard {
    public void setScoreBoard(Player player) {
        Scoreboard Tab = (Scoreboard) Bukkit.getScoreboardManager().getNewScoreboard();
        Objective obj = Tab.registerNewObjective("ServerName", "dummy", "Build Server");

    }
}

Error: getNewScoreboard is underlined with error "Method invocation 'getNewScoreboard' may produce 'NullPointerException' " and registerNewObjective is underlined with "Cannot resolve method 'registerNewObjective' in 'Scoreboard'"
Okay at this point idk what I am doing wrong because using exactly what you guys say to use it still doesn't work

quaint mantle
#

intellij definitely doesn't have potential NPE as an error, just a warning 🤔 what ide is this

young knoll
#

Well the first one is just a warning

iron tundra
#

Intellij

#

that is the ide

quaint mantle
#

intellij lets you decide if you ignore, warn, or error for everything

#

sounds like he has it on error

#

but you just have to null check then

iron tundra
#

Idk I just used what I was told is best and this is what I got

quaint mantle
#

that cast is also useless(in 1.18)

#

i assume that changed somewhere tho?

iron tundra
#

Man, I am just trying to make an npc not have it's tag get shown

#

I am so confused on why none of this is working

quaint mantle
#

is it possible to make a new custom economy with vault ?

sullen marlin
#

Sure?

quaint mantle
#

hey, someone help me with some math rq

i have an enum for ranks, each rank has its own Index, for example "Owner" is 100, and Member is 0

I'd like to automatically sort them in tab, alphabetically...

so i have a List<String> that is the alphabet, now how should i get their priority in tab? should i start with a loop increasing the number each rank, and .get(the number for each rank that was increased); from the list?

sullen marlin
#

Comparator.thenComparing

#

First rank then name I think

quaint mantle
#

oh

#

i knew there was a Comparator or Collections for that, idk why i didnt think of that

#

thanks md <3 love u

sullen marlin
#

No worries

opal juniper
#

nice pfp md_5

grave hound
#
public class PlayerInteract implements Listener{
    HashMap<UUID, Integer> map = new HashMap<UUID, Integer>();
    @EventHandler
    public void onPlayerInteractEvent(PlayerInteractEvent event){
        Player player = event.getPlayer();
        Block block = event.getClickedBlock();
        ItemStack tool = event.getItem();
        if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
            if(block.getType() == Material.BEDROCK ){
                if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
                    if(map.has(player.getUniqueId())){
                        if(map.get(player.getUniqueId()) >= 30){
                            map.put(player.getUniqueId(), 0);
                            block.setType(Material.AIR);
                        }else{
                            map.put(player.getUniqueId(), map.get(player.getUniqueId())+1);
                        }
                    }else{
                        map.put(player.getUniqueId(), 0);
                    }
                    System.out.println(map.get(player.getUniqueId()));
                }
            }
        }
    }
}```
Cannot resolve method 'has' in 'HashMap'
eternal oxide
#

don;t try and invent methods. You can only use those that actually exist

grave hound
#

I tried map.get(player.getUniqueId()) == null

#

but that ended up giving me an error

vast kelp
#

Think you want HashMap#containsKey

lucid bane
#

Hi,
I added a spigot-1.18.jar to Java Build Path but I can't import any packages for plugin.

spiral light
#

yes

lucid bane
#

*Eclipse

spiral light
#

its a bundler jar now

lucid bane
#

NO,,,

#

sad

spiral light
#

the jars you want to import will be in a bundler-dir when you run the jar at least one time

lucid bane
#

RUN a jar

#

?

quaint mantle
#

Use a proper build tool
Use a proper build tool

spiral light
#

run "spigot-1.18.jar" (start the server)
then a dir named "bundler" will be created with all the libs you want to use

#

or just use maven

lucid bane
spiral light
#

probably.... maybe some of them are never used (by you)

quaint mantle
#

Just

#

Use

#

Maven

unkempt vault
#

quick question - in PlayerDeathEvent, when i call event.getDrops().clear() i still lose my items, but they dont spawn in the overworld

#

is this normal?

spiral light
#

if you clear the drops ? yes they will not spawn

lucid bane
#

actually

spiral light
#

if you want to keep them use something else in the Event called setKeepItems() or smth like this

summer scroll
#

PlayerDeathEvent#setKeepInventory yes

blazing scarab
#

Hello! I wanna share my creations with community, so i need to publish my maven artifacts, so other's can easily depend on my libraries. How could i do this?

#

I already have a server. Should i post it in my own repo, or just use maven central one?

rough basin
#
   
   
    public CustomChicken(org.bukkit.World world) {
        // I like to use the bukkit world since that makes thing easier
        super(EntityTypes.CHICKEN, ((CraftWorld) world).getHandle());
    }
   
    public void spawn(Location loc) {
        this.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
        this.world.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM);
    }
} ```

I found this code in https://www.spigotmc.org/threads/adding-a-custom-entity-into-the-game.415812/. 
i understand most of it but What is EntityChicken? Is it related to NMS?
chrome beacon
#

Yes it's NMS

rough basin
#

Thanks :D

unkempt vault
#

does anyone know why item.getItemMeta().getLocalizedName(); returns an empty string for me?

quaint mantle
#

because the name changed?

tardy delta
#

what's even the difference with the name and the localized name?

quaint mantle
#

localized name i think it is the name in the client

#

language

unkempt vault
#

would it be empty running server-side then

quaint mantle
#

welp ur right

#

then it might not what i think

#

ask md_5 that

tardy delta
#

ah yes i understand, if you use a texturepack with a lang file which replaces the item name

eternal oxide
#

pretty sure that only returns a String if a custom name has been set

tardy delta
#

so client side iirc

unkempt vault
#

how would i get the localized name server-side then?

eternal oxide
#

Plugins should check that hasLocalizedName() returns true before calling this method.```
grim ice
#

why is this painful

#

audio clips run fine in my ide

#

and not as a jar

#

ive tried everything in stackoverflow

#

literally everything

eternal oxide
#

same path?

#

once its in the jar it needs to be accessed as a resource via the ClassLoader

rough basin
#

What happens if you give LivingEntity NoAI and use a loop to specify a target like Player?

eternal oxide
#

nothing

rough basin
#

Then, is it possible to make a LivingEntity immobile without using NoAI?

#

I sucks at minecraft too

eternal oxide
#

custom AI or add it as a passenger to an invisible object

rough basin
#

Thanks :D

grim ice
#

after some debugging

#

it seems

#

getClass().getResourceAsStream("/jitter.wav")

#

is null

#

h o w

eternal oxide
#

remove teh /

#

is the resource in the root of your jar?

grim ice
#

same thing

#

yeah

#

its the same level as src

#

and in my src

#

and literally with my classes

eternal oxide
#

open teh jar and physically check

grim ice
#

how

#

do i decompile or what

eternal oxide
#

7zip

quaint mantle
#

sounds like common problem you can find on stackoverflow

grim ice
#

ok il ltry 7zip

eternal oxide
#

a jar is just a zip folder

#

My guess is you have not included them

grim ice
#

dunno lemme try

#

so i installed 7zip

#

now uh

eternal oxide
#

right click jar and open with 7zip

quaint mantle
#

how to fake protocol client-side?(not spigot-related question btw)

#

i wanna fake protocol to have some more permission in a server that only give you if you use 1.9+

#

i see something like C00HandShake

sullen marlin
#

Idk about the / but getClass usually means it has to be in the same folder as the class

grim ice
#

shit

#

there isnt

sullen marlin
#

Try getClass.getClassLoader.getResource instead

grim ice
#

anything

#

only my classes

sullen marlin
#

Or that hah

eternal oxide
#

yep, you have to specify what to include when you export

grim ice
#

:0

#

how

eternal oxide
#

depends on how you are exporting

grim ice
#

im using maven if thats what you mean

eternal oxide
#

if maven, use the resources folder

grim ice
#

i have no resource folder

#

where do i create it

#

under what directory

spiral light
eternal oxide
#

good question, I usually spcify mine

grim ice
#

wait

#

i have a resources folder nvm

#

im dumb af

#

ok

#

i copied it there

pastel mauve
#

I have a problem with my Chunkloading system, idk how to set the ChunkGenerator again after a restart using the world variable :/

Code:

@Override
    public void onEnable() {
        getCommand("plot").setExecutor(new p());

        new java.util.Timer().schedule(
                new java.util.TimerTask() {
                    @Override
                    public void run() {
                        int worldInt = 0;
                        while(getConfig().isSet("Plotwelt" + worldInt)) worldInt++;

                        Bukkit.getServer().broadcastMessage("ConfigWorlds: " + worldInt);

                        int serverWorldInt = 0;
                        for(int i = 0; i<worldInt; i++) {
                            World world = Bukkit.getServer().getWorld("Plotwelt" + i);
                            if(world != null) {
                                serverWorldInt++;

                                WorldCreator creator = new WorldCreator("Plotwelt" + i);
                                creator.generateStructures(false)
                                        .type(WorldType.FLAT);

                                ChunkGenerator chunkGen = new CustomGenerator();
                                creator.generator(chunkGen);
                            }
                        }

                        Bukkit.getServer().broadcastMessage("ServerWorlds: " + serverWorldInt);
                    }
                },
                3000
        );
    }```
I appreciate your help! 🙂
grim ice
#

so

eternal oxide
#

everything in resources shoudl auto be dumped in the root of yoru jar

#

you can control it ```xml
<build>
<defaultGoal>clean package</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<resources>
<!-- Include all resources -->
<resource>
<directory>resources</directory>
<filtering>true</filtering>
<includes>
<include>.yml</include>
<include>
.txt</include>
<include>.json</include>
<include>
.properties</include>
</includes>
</resource>
</resources>

</build>```
spiral light
pastel mauve
#

I was the german guy again xD

spiral light
#

i know but this is english-chat

pastel mauve
#

@spiral light i use a scheduler because the plugin is getting loaded before the worlds are getting loaded

#

thats why i use a 3 second delay

spiral light
#

is this intended ? a delay for that is terrible solution... you could start the plugin later in the plugin.yml - load: POSTWORLD
or smth like this

eternal oxide
#

?paste your pom

undone axleBOT
grim ice
#

1s

eternal oxide
#

using that you will probably have to alter the <directory>resources</directory> Thats just a sample from one of my projects, its resources is in a different place

grim ice
#

o

#

i dont really get what im supposed to do :0

eternal oxide
#

probably main/resources

grim ice
#

yeah but do i add that to my pom xml? if so where

eternal oxide
#

its already in yoru pom

#

but its pointing to the wrong location for resources

grim ice
#

oh

#

right

#

should i add

#

<include>*.wav</include>

#

or smth

eternal oxide
#

yes

grim ice
#

when i decompile there isnt even a

#

resources

#

folder

eternal oxide
#

there won't be

#

the contents of resources is copied to teh root of yoru jar, IF your pom is correct

grim ice
#

when i run with my ide, its still null

#

and when i use the jar, nothing happens

eternal oxide
#

run with ide will use a different path to running as a jar

#

with IDE your wav files are in the resources folder

grim ice
#

should i send u my class cuz maybe i fucked up somewhere

grim ice
#

i just tried with cmd

#

and its still null

#

?Paste

#

?paste

undone axleBOT
grim ice
#

ignore that its messy, ive tried like 12 different methods from stack overflow

#

s = getClass().getClassLoader().getResourceAsStream("jitter.wav");

#

this is null

eternal oxide
#

if that is in your ide you will need ClassLoader.getResourceAsStream("./resources/jitter.wav")

grim ice
#

oh right mb

spiral light
#

@grim ice i did this to load a language translation file for my server

grim ice
#

s = getClass().getClassLoader().getResourceAsStream("./resources/jitter.wav");

#

still null

spiral light
#

the "en_us.json" is already in the resources-dir

tardy delta
#

is there a guava Cache<T> class but not for a map, just a list?

spiral light
#

s = getClass().getClassLoader().getResourceAsStream("/jitter.wav");

did you try this ?

eternal oxide
#

try ./src/main/resources/jitter.wav

eternal oxide
grim ice
#

okay

grim ice
#

lol

#

and didnt work

eternal oxide
#

it will never work outside yoru ide as you havn;t yet got your includes correct

#

sec let me test in my ide

grim ice
#

btw still null

spiral light
#

do you have this ?

grim ice
#

yeah

#

and same thing

ivory sleet
grim ice
#

s

tardy delta
#

i'm using a Cache<UUID, Long> now where i use long objects as dummy values

ivory sleet
#

Ugh

#

Use Boolean if it’s for just a dummy value

grim ice
#

i just tried

#

InputStream s = getClass().getClassLoader().getResourceAsStream("./jitter.wav");

#

but

#

it doesnt return null anymore

#

but the audio just doesnt play @eternal oxide

tardy delta
#

what do they mean?

copper scaffold
#

how can i edit this to something else?

tardy delta
#

AsyncPlayerChatEvent

copper scaffold
#

okay

#

how do i change it the with set format?

tardy delta
#

ah found it cant unbox null

#

event.setFormat()

grim ice
#

im getting a

#

UnsupportedAudioFileException

#

gg

#

i suck

quaint mantle
#

xd gamer arent you on paper

smoky oak
#

should i use 'spigot-api' or just 'spigot' as the artifact-id for the dependency in the pom.xml?

smoky oak
#

k thanks

spiral light
#

both if you wanne do nms and stuff like this

grim ice
#
at main.java.Util.play(Util.java:25)


        Clip clip = AudioSystem.getClip();
        InputStream s = getClass().getClassLoader().getResourceAsStream("./jitter.wav");
        AudioInputStream aInputStream = AudioSystem.getAudioInputStream(s); // this is line 25```
#

UnsupportedAudioFileException: could not get audio input stream from input stream

#

btw

tardy delta
#

wav not supported?

grim ice
#

idk

#

but it is wav

smoky oak
#

hey i found out what the issue with my javadoc is

#

the argument --generate-javadoc might produce a ...-javadoc.jar file in the target folder

#

but it's actually at users/<you>/.m2/org/spigot/<what you're building>

#

or rather only that file actually contains javadoc

regal carbon
#
        WorldCreator worldcreator = new WorldCreator(worldname);
        if (Objects.equals(config.getString("pregame.seed"), "random")) {
            long seed = new Random().nextLong();
            worldcreator.seed(seed);
            Bukkit.getLogger().info("The seed is: " + seed);
            Bukkit.getLogger().info("The seed gotten from worldcreator is: " + worldcreator.seed());
        } else if (Objects.equals(config.getString("pregame.seed"), "preset")) {
            List<Long> seeds = config.getLongList("pregame.presetseed");
            if (seeds.toArray().length == 1) {
                worldcreator.seed(seeds.get(0));
                Bukkit.getLogger().info("The seed is: " + seeds.get(0));
            } else {
                long seed = seeds.get(new Random().nextInt(seeds.toArray().length - 1));
                worldcreator.seed(seed);
                Bukkit.getLogger().info("The seed is: " + seed);
            }
            Bukkit.getLogger().info("The seed gotten from worldcreator is: " + worldcreator.seed());
        }
        world = Bukkit.createWorld(worldcreator);

im trying to create a new world, but the seed from worldcreator doesnt match up with the actual world being generated. the world itself is regenerated, but the seed of it doesnt change, whats wrong

grim ice
#

w

tardy delta
random isle
mighty pier
#

how do i get the ip a player connected with?

chrome beacon
charred wind
#
SELECT *, CAST(JSON_EXTRACT(stats, '$.points') AS UNSIGNED INTEGER) AS points, RANK() OVER(ORDER BY points DESC) AS 'ranking' FROM lifetime_stats```

Is there a way, to get the same result as with that query, without using JSON_EXTRACT?
manic furnace
#

Hey Guy i need help with color-codes!
I saved the color-codes to a file, but they look like this:

tardy delta
#

save them as &a

#

not §a

random isle
manic furnace
#

I saved uuids to, but when i get the name of the player with this uuid later, i get a NullPointerException

mighty pier
#

k

mighty pier
tardy delta
random isle
#

Yeah

tardy delta
#

oh wait

#

InetSocketAdress

mighty pier
tardy delta
#

that wont work with getAdress iirc

mighty pier
#

i found this proxiedPlayer.getConnection().getVirtualHost().getHostString() but idk how to get the proxiedPlayer

tardy delta
#

((InitialHandler) player.getPendingConnection()).getHandshake().getHost()

eternal oxide
#

ProxiedPlayer is Bungee

mighty pier
#

oh

tardy delta
#

nvm mine doesnt work

grim ice
#

which is supported too

eternal oxide
#

Sorry I got taken away

grim ice
#

and ditn work

#

didnt

#

its fine

tardy delta
#

is this the right way of getting the uuid of the shooter of an arrow in the entity damage by entity event?
((Player) ((Arrow) event.getDamager()).getShooter()).getUniqueId()

visual tide
noble lantern
#

Anyone got maven tips for why this happens?

#

These repos 100% exists, i just pulled this project over from my other pc to my newer one

#

Was just working on this project 2 days ago as well, it imported JitPack dependencies

#

But it wont install anything from any other repo, eg citizens, spigot, paper etc

i dont get why maven has to go full blown retard all the time, this happens to me at least once or twice a week, getting rather god damned annoying cause there is absolutely no fix for this bs

snow compass
#

I have a odd Issue, when I remap the spigot I not get right type of vanilla files (I get with spigot naming, i not suspect so big change to vanilla ). Is it possible get with vanilla name or do it work if open spigot jar?

pastel arrow
#

hey, im trying to add a potion effect to a player every x seconds. im doing it with a scheduler. in public void run(), i want to add the potion effect but idk how. can someone help me?

regal carbon
tardy delta
#

no need for a scheduler i think

#

as it stays

eternal oxide
pastel arrow
tardy delta
#

are you making a command?

pastel arrow
#

no just a scheduler that gives you jump boost every x seconds

tardy delta
#

and where do you start it?

pastel arrow
#

in the main class?

tardy delta
#

so in onEnable?

#

or a listener?

regal carbon
# eternal oxide Are you actually deleting the old world? If not WorldCreator will read that worl...
        Bukkit.getLogger().info("World name is: " + worldname);
        assert worldname != null;
        for (int i = 1; true; i++) {
            Bukkit.unloadWorld(worldname, true);
            File oldworld = new File(Bukkit.getWorldContainer().getAbsolutePath() + "/" + worldname);
            FileUtils.deleteQuietly(oldworld);
            if (!oldworld.exists()) {
                Bukkit.getLogger().info("World successfully deleted! Only took: " + i + " attempts");
                break;
            }
        }```
this should do it right?
pastel arrow
#

in onEnable yes

tardy delta
#

i guess you're looping Bukkit.getOnlinePlayers?

regal carbon
eternal oxide
#

I hope you are not trying to delete teh overworld

tardy delta
#

i should do that in the PlayerJoinEvent

pastel arrow
tardy delta
#

i think what you are trying to achieve is starting a task when a player joins, which adds a potioneffect for x seconds and then removes it

regal carbon
eternal oxide
tardy delta
#

and do you want to repeat it?

#

like enable it 3 seconds, remove it, enable it back

pastel arrow
regal carbon
dusty kindle
#

Hello I have a problem so i am making chat system and its working with Default mc colors... How can i add HexColor support?
this is the format:

@EventHandler
    public void onChat(AsyncPlayerChatEvent event) {
        Player p = event.getPlayer();
        event.setFormat(ChatColor.translateAlternateColorCodes('&', VaultUtils.getChat().getPlayerPrefix(p )).split("&")[0]+" "+ p.getName()+ChatColor.WHITE+ ": " + ChatColor.GRAY+event.getMessage());
    }```
eternal oxide
#

The only time you can delete teh overworld and nether is at startup, in onLoad before any worlds are loaded

burnt current
#

Hey I have a quick question about attribute modifers. I try to change the attack speed of a sword in the ItemMeta with an attribute modifier. Unfortunately, based on what I found on the Internet, I still don't understand how it actually works or how I have to specify everything there. Anyone who happens to be able to help me with an example?

spiral light
#

someone here who wanne test if a compass on a loadstone still works in vanilla minecraft 1.18 and on servers in 1.18 ?

tardy delta
#
@EventHandler
public void onJoin(PlayerJoinEvent event) {
  Bukkit.getScheduler().runTaskTimer(pluginInstance, () -> {
    event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, amountOfSecondsTheEffectWillStay * 20, 1);
}, 1, amountOfSecondsToWaitBeforeRerunningIt * 20)
}```
#

something liek this

#

the 1 is just start it after one tick

regal carbon
tardy delta
#

one tick = 1/20 second

eternal oxide
#

Just let yoru plugin load as normal, no need to specify the load condition

#

onLoad fires before worlds are loaded, onEnable runs after, if all is default

#

your code will fail if its a restart

regal carbon
tardy delta
#

or you can just write it here

eternal oxide
#

reload

tardy delta
#

it can also help other people

noble lantern
#

^

regal carbon
#

alright, thanks for the help

pastel arrow
noble lantern
#

Wait

tardy delta
#

no

noble lantern
#

Why are you applying potion effects in a Runnable

tardy delta
#

you can just use the scheduler

#

because he wants to repeat it

noble lantern
#

He can just set the time to Integer.MAX_VALUE

#

for the potion effect time

tardy delta
#

then it stays forever

#

i dunno he wants to have it removed

noble lantern
#

indeed, and he can just use events to know when to remove it, eg if they enter and area he can just cancel them

pastel arrow
#

my idea was that the player gets a random strength of jump boost every x seconds

noble lantern
#

ohh fair enough then

gritty urchin
#

Hello, how can I get the position all portal blocks in a portal from the position of 1?

smoky oak
#

why does the PersistentDataType class doc contain only fields for the same field type twice? Can i create a PersistentDataType<String, Integer> or no?

tardy delta
#

if you want to set the strength, work with a random for the amplifier

eternal oxide
smoky oak
#

do i have to implement a new class?

eternal oxide
#

There is a full example included in the javadoc

pastel arrow
eternal oxide
tardy delta
#

?scheduling

undone axleBOT
smoky oak
#

what's @literal

eternal oxide
#

ignore it

gritty urchin
grim ice
#

rate

smoky oak
#

uh what is the conversion from one data type into the other for? Does that mean the PersitentDataType is supposed to store one value in two different formats?

tardy delta
#

storing the server ip in the database?

#

what if the user creates a new server?

noble lantern
#

they can just remove your authentication code comepletly

sacred ice
#

you can do something else btw

noble lantern
#

probably be 10x more easier, unless your sending an authentication requests every single action

young knoll
noble lantern
#

In all honestly you will never stop someone from leaking your code if they really want to

sacred ice
#

store access in the binary jar itself

smoky oak
#

ah im using integer anyways so just do implements PDC<Int, Int> ... return Integer.class ... return other_field ?

pastel arrow
tardy delta
#

the instance for your main class

young knoll
tardy delta
#

probably looking for dependency injection

eternal oxide
smoky oak
#

oh the fields

#

how exactly do i use them

eternal oxide
tardy delta
#

like java public class MyPlugin extends JavaPlugin { public void onEnable() { getServer().getPluginManager().registerEvents(new MyListener(this)); } }

public class MyListener implements Listener {
  private final MyPlugin plugin;
  public MyListener(MyPlugin plugin) {
    this.plugin = plugin;
}
}```
grim ice
#

no spacing be like:

noble lantern
#

embrace passing plugin instances through constructors

Reject static plugin instances

warm cloak
#

does anyone have experience with votifier api ?