#help-development

1 messages · Page 1103 of 1

molten hearth
#

code flows through his blood

grim ice
#

lmao

void sigil
#

Then you need basic information, be a prompt demon and know how to release them

magic drift
#

Whats The Best version to Make Plugins for

grim ice
#

latest

eternal oxide
#

depends what you main goal is

grim ice
#

but there's no truly "best"

molten hearth
#

1.8

hybrid turret
#

do NOT

magic drift
#

ima just download all of them

molten hearth
#

Trust

magic drift
#

or i should download them by invoice

void sigil
grim ice
magic drift
#

build tools

grim ice
#

you're gonna download the jars?

#

use maven

remote swallow
#

(gradle >>>>)

magic drift
#

why maven

hybrid turret
#

maven >>>>>

remote swallow
#

build system doesnt matter

#

its personal preference

grim ice
remote swallow
#

just dont break stuff and the caches are fine

grim ice
#

I have to clear them every once in a while for things to not simply break

magic drift
#

You guys are confusing me

hybrid turret
remote swallow
#

the only time ive had to clear them is when a plugin set something as caching when it shouldnt cache

grim ice
eternal oxide
#

Maven is simpler

#

I find it most reliable

hybrid turret
#

agreed

molten hearth
#

it is technically the most documented

#

when you Google any bukkit question you'll get like a reply for 1.8 from 2014

grim ice
#

age =/= documentation

#

1.14+ has more documentation than 1.8 for sure

magic drift
#

is 1.20.6 good for plugin making for the fist time

grim ice
#

it literally doesn't matter

magic drift
#

alr

hybrid turret
#

ig most functionality and QoL

eternal oxide
#

1.8 only account for around 5% of the player base

hybrid turret
#

tbf when it comes to plugin making, you won't be getting super rich

molten hearth
#

Debatable

hybrid turret
#

who still uses spigot these days?

#

like bfr

molten hearth
#

I've never once had specifically 1.14 show up as a question reply

hybrid turret
#

tbh does it make that much of a difference? there's this discord and the docs

eternal oxide
#

You can make a lot of money making plugins, but mostly they will be private commissions. And thats not going to happen unless you are Really good

hybrid turret
#

exactly

molten hearth
hybrid turret
#

what's the average age of someone commissioning a spigot plugin?

#

or any minecraft plugin?

molten hearth
#

11.5

grim ice
#

even by just posting premium plugins

#

but it's pretty rare

hybrid turret
molten hearth
#

😭

grim ice
grim ice
#

just work at hypixel

#

easy right

hybrid turret
molten hearth
#

just give up on plugin development and create your own courses

grim ice
molten hearth
#

cough cough

grim ice
#

🤔

molten hearth
#

cause that looks uglier

#

and depressing

hybrid turret
grim ice
#

10^-3 looks a lot prettier

molten hearth
#

true

#

nice and compressed

grim ice
#

they should add latex to discord

magic drift
#

bro im hosting a mc server on my computer now

#

thats wild

hybrid turret
hybrid turret
magic drift
tardy delta
#

download more

magic drift
#

can you get me a Free ram download file

coarse lotus
#

how big of a difference is it between coding in 1.20 to 1.8 for example, im new and just wanna know

remote swallow
#

id say its a quite a large difference

coarse lotus
#

will you sturggle with 1.8 if u learn 1.20?

eternal oxide
#

depends what the plugin does

coarse lotus
#

ok

eternal oxide
#

a 1.8 plugin "could" run on 1.20

magic drift
#

HOW DO I CLOSE THE SERVER

chrome beacon
#

/stop

eternal oxide
#

type stop in console

magic drift
#

oh

#

it doesent work when i was on in

stuck oar
eternal oxide
#

or need adjustments to run correctly

coarse lotus
#

but like its the sort of thing where if ur decently expeirenced it wont be a problem coding in different versions right?

eternal oxide
#

if you are targeting 1.8 learn the api for 1.8

grim ice
#

and ask for help efficiently

#

and then you wouldn't care which version or api you're using 🤷🏻

sterile breach
#

my plugin generate a lot of lag but idk where its from exactly, its possible to locate it with a tool like spark?

eternal oxide
#

yes

sterile breach
#

well Ihv start a /spark profiler start and /spark profiler stop in the pannel where can I go to see it?

remote swallow
#

if should give you a link

sterile breach
#

I obviously can't reproduce the bug when I need to,I'll send it as soon as I can 👍

magic drift
#

I need Help

#

Gradel Or maven

eternal oxide
#

you are a beginner so maven

#

follow a tutorial

magic drift
#

ok

#

Hows This For Plugin Code

#

import org.bukkit.plugin.java.JavaPlugin;

public final class MyFirstPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic

        System.out.println("Hello World");


    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic

        System.out.println("Goodbye World");


    }
}
grim ice
#

that's the default code for the mc dev plugin

#

you didn't write anything

eternal night
#

Well they just started

#

so

#

yes, looks good ™️

magic drift
#

i added the Print

#

rn im really just Fucking around and Finding out

grim ice
magic drift
#

best way to figure stuff out

grim ice
eternal night
#

The kind way of "why are you an asshole to someone that literally started getting into java and making their first plugin like an hour ago"

grim ice
#

not sure if im being an asshole

eternal night
#

not sure what looks good, the intellij plugin code?
is rather uh

grim ice
#

because the question is absurd

#

when you were first learning java or spigot

#

did you do this?

eternal night
#

did your first ever running plugin look better?

grim ice
#

Nope, not at all

#

however I didn't send default code and ask people to rate it

#

and in fact, I did just that, I rated it based on what it was, empty compliments won't make him better or feel better about themselves

eternal night
#

okay 👍

magic drift
#

i cant run it

eternal night
#

you'll want to compile it to a .jar file

grim ice
#

then put the jar file in the plugins folder

magic drift
#

alr

eternal night
#

given you are using maven, find the maven tab and the package task

#

output will be in the target folder

magic drift
#

Got the target folder now what

grim ice
#

then open with file explorer

magic drift
grim ice
magic drift
#

theres no jar

grim ice
#

because you're not inside the target folder?

magic drift
grim ice
#

you didn't compile your plugin

eternal night
#

looks like you did not run package

grim ice
#

do as lynx said to do

magic drift
#

ok i ran package in the terminal

eternal night
#

in the terminal?

magic drift
#

wait where do i run package

eternal night
#

you can run it in a terminal, but it would be mvn package

magic drift
#

ok

grim ice
#

and you dont have maven installed

#

so you can't do that

eternal night
#

yeea probably not lol

magic drift
#

how do i install maven

grim ice
#

google it, there are tons of resources

#

click the "m"

magic drift
grim ice
#

good

#

now do what lynx told you to do

magic drift
#

Whitch one do i add to the plugins folder

#

original or bigger one

grim ice
#

cool

magic drift
#

ok it works now

#

so now i just need to figure out the player join event

grim ice
#

did you try watching a youtube video

#

or just using google in general

magic drift
grim ice
#

yes, kodys tutorial is pretty good

magic drift
#

im watching as many as i can today and tonight

#

bruh if i waited 10 secs he would have told me what to do

#

💀

echo basalt
#

why does every damn programming tutorial use a 1440p screen so everything is tiny

#

but then zoom in the text so you can only see half a method

#

and bring their build tab all the way up

peak depot
#

bc why not

#

annoy the people

tardy delta
rough drift
#

it saves time tbh

grim ice
#

the default is 13p which is super small ngl

echo basalt
#

yeah I just use default

grim ice
#

you're insane

echo basalt
#

1440p is fine

grim ice
#

it looks so ugly

echo basalt
#

I have a 24 inch 1440p monitor and it looks tiny

grim ice
#

im on 1080p 27 inch

#

font size is 16p

#

could even go 18p for more comfort

magic drift
#

Why cant i Build This ```package me.echo145642.newFirst;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.w3c.dom.ls.LSOutput;

import java.net.http.WebSocket;

public final class NewFirst extends JavaPlugin implements Listener {

@Override
public void onEnable() {
    // Plugin startup logic
    System.out.println("The plugin is On");

    getServer().getPluginManager().registerEvents(this,this );
}

@EventHandler
public void onPlayerJoin(PlayerJoinEvent event){

    System.out.println("Welcome <Player>");
}

}```

grim ice
#

you can

magic drift
#

its Grayed out

grim ice
#

what are these imports for

magic drift
#

those Appered When i added the implements Listener

grim ice
#

okay man

#

just

#

?java

eternal oxide
#

no they didn't

grim ice
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

grim ice
#

I feel like you really need to get some basics

magic drift
#

The Video has it too

grim ice
#

it quite literally doesn't have this

#

you're using the wrong imports

magic drift
#

ok i will try to fix it

grim ice
#

or just learn java

magic drift
#

im trying

echo basalt
grim ice
#

😭

#

default theme default font size is psychopathic

echo basalt
grim ice
#

look at this

echo basalt
#

you're officially old

#

even my laptop is 1440p :)

grim ice
#

idk i dont see the point of 1440

echo basalt
#

you don't see.

grim ice
#

1080 is good enough for basically everything i do

eternal oxide
#

I hate 1080 for dev work

echo basalt
#

until you get a 1440p monitor and all of a sudden it fits 10x more

eternal oxide
#

1440p is perfect. 4k is too much

wind sorrel
#

I'm using AlessioDP's fork of libby to download dependencies at runtime (I know that Spigot now has a feature which solves this problem but that wouldn't work in Bukkit and other servers unrelated to Spigot). Someone has any idea on how to use this library? I can't find much detailed information on how to use it and some examples confuse me

grim ice
#

coding in 4k is insanity

echo basalt
#

never tried 4k but id prob squint

#

4k 24 inch go brr

magic drift
#

i dont think this is working

pliant topaz
#

the listener should be a new instance of your listener class

#

not the plugin instance itself

eternal oxide
#

that code is fine, your main class is your listener

chrome beacon
#

^^

pliant topaz
#

oh yea, that could be

chrome beacon
#

?paste

pliant topaz
#

sorry (my brain aint braining)

undone axleBOT
magic drift
remote swallow
#

did you run package again and copy the jar

magic drift
#

i cant run package

#

thats the problem

remote swallow
#

how did you get the jar the last time

magic drift
#

last time i was able to

remote swallow
#

pressing package on the right side of your screen is the same as running package

eternal oxide
#

open maven window on teh right of yoru screen. The drill down to find package

magic drift
#

Its Grayed out

near furnace
#

should i switch to gradle?

chrome beacon
near furnace
#

select the

chrome beacon
#

and then find pacakge

near furnace
#

newfirst

#

no no no

#

just select the newfirst

magic drift
#

oh now i can

#

ty

chrome beacon
near furnace
#

its already is designed to do clean, package

#

in the pom.xml

eternal oxide
#

or likely not

onyx fjord
#

how would i go about serializing a World through GSON? When i try to serialize it as it is i just get a bunch of reflection exceptions

near furnace
# magic drift

i got worried when i saw that gray button too, but after a few hours of fiddling with it, i found out you gotta select the folder

magic drift
#

Yeah tysm

near furnace
#

@magic drift im a beginner too, lets learn together :)

#

are you following kody's tutorial?

magic drift
magic drift
near furnace
#

yeah me too

#

im on the 11th episode

#

video number 16

chrome beacon
magic drift
#

Im on the number 6 episode

onyx fjord
#

thats unfortunate

chrome beacon
#

so GSON knows what to serialize and what not to

pseudo hazel
#

does anyone know how to fix a "No matching tests found in any candidate test task."? I am trying to test some stuff with JUnit in intellij, but it does not want me running the test

near furnace
paper viper
near furnace
#

jk

paper viper
#

and just get it back

onyx fjord
#

this mf was trying to serialize a logger lol

magic drift
#

how do i make it wait like 2 seconds before doing the souf

#

Sout*

onyx fjord
#

actually nvm that wouldnt work either

#

because it couldnt serialize

paper viper
#

just store it with a String

#

and create an adapter

#

dont make it more complicated

onyx fjord
#

could you visualize it for me (pseudo code or something)

#

idk if i fully get your idea

near furnace
#

wait sout?

magic drift
#

What about wait(1000);

worthy yarrow
#

Please don’t tell me that’s a thread

near furnace
#

use a thread.sleep()

worthy yarrow
#

Do not

near furnace
#

i used that in a java program but not in spigot

near furnace
eternal oxide
#

never use wait nor sleep

#

not in a plugins main thread

paper viper
# onyx fjord idk if i fully get your idea

Implement JsonSerializer/JsonDeserializer

public final class WorldAdapter
    implements JsonSerializer<World>, JsonDeserializer<World> {

In the respective overriden deserialize/serialize methods, create a World or get the world name. For example, deserialize, you would use JsonElement#get and then use getAsString

near furnace
#

but cant you use Bukkit.getScheduler.runTaskLater then Bukkit.getLogger("yooo")

worthy yarrow
#

Just do a bukkit task like mentioned before

eternal oxide
#

all you are doing is freezing the whole server

near furnace
near furnace
#

yes exactly

paper viper
#

its not async so you can access api

onyx fjord
#

tysm

paper viper
#

np

onyx fjord
#

i forgot it handles objects in objects well

magic drift
#

so fahi you said you wanted to learn together

worthy yarrow
#

Even if it was async, .runTaskAsync exists

near furnace
magic drift
#

can you vc

near furnace
onyx fjord
#

another thing, im not that advanced in async programming but whats the reason thrown exceptions dont show up when thrown from async thread?

paper viper
#

it suppresses them if not handled

onyx fjord
#

i see yea

#

or i guess i could use my logger

#

but thats not always ideal

paper viper
#

well usually for async stuff you have some sort of Result which can store an exception

#

you would just handle it that way

magic drift
#

@near furnace Join General 2

#

why Does it not reconize Bukkit

near furnace
#

me forgor english

onyx fjord
#

i cant register the adapter once gson is initialized right?

lost matrix
#

Sadly not. I wrapped mine and rebuilt it every time it changes.

onyx fjord
#

that sucks

#

because i need the gson instance itself in one adapter

#

i guess ill have to live with more gsons

#

cba to learn jackson

wary harness
lost matrix
# wary harness

How about you just use the spigot api to set a texture on a head

onyx fjord
#

he needs it on 1.8

onyx fjord
lost matrix
onyx fjord
#

and my implementation takes a World and a bunch of doubles

lost matrix
#

Are you trying to serialize a Location?

onyx fjord
#

World

lost matrix
#

And what are the doubles for?

onyx fjord
#

min max x,y,z

lost matrix
#

So... A BoundingBox?

onyx fjord
#

the idea is to support different implementations like WorldGuard

#

eventually make it abstract

lost matrix
#

Whats the plugin for that you need a WorldGuard interface?

onyx fjord
#

defining special areas where players enter a minigame state

#

their inv replaces & stuff

lost matrix
#

I see, ok

onyx fjord
#

but yea the only thing that isnt primitive is bukkit World

pseudo hazel
#

why not write a wrapper

#

or well nvm

#

i guess that would be the type adapter thingy

lost matrix
magic drift
#

How do i make it so it auto downloads the jar to my plugins folder

onyx fjord
#

i just followed some baeldung guide

magic drift
#

My plugin jar

lost matrix
magic drift
#

Intellij

lost matrix
#

Ah, thats what he means by "download"

onyx fjord
pseudo hazel
#

iirc just extracting out the registration portion mostly

onyx fjord
#

it just straight up ignores my world adapter

pseudo hazel
#

wdym ignores

onyx fjord
#

like it does the reflection method instead

lost matrix
lost matrix
#

The runtime type is CraftWorld, but you have the adapter registered for org.bukkit.World.
If you register a typeHierarchyAdapter, then it checks the full type hierarchy for CraftWorld, and uses the first adapter
that was found for a type, which will be your WorldAdapter for World.

onyx fjord
#

😄 works

#

you are a genius thank you

#

i still dont understand what you said but whatever

lost matrix
#

lul, glad it works

onyx fjord
#

storing areas as json shouldnt be a bad idea right

#

theyre always in memory anyway

#

i dont see a database in this scenario

#

plus its not that dynamic

#

i load once and save once

#

or rarely at runtime

tardy delta
#

you mean as one json file?

#

i dont see the issue

onyx fjord
#

like using json at all

#

it would only be an issue if areas were modified at runtime frequently

#

because a lot of IO

magic drift
#

Fahi Helped me with this code ```package me.echo145642.newFirst;

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.java.JavaPlugin;

public final class NewFirst extends JavaPlugin implements Listener {

@Override
public void onEnable() {
    // Plugin startup logic
    System.out.println("The plugin is On");

    getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event){

    Player player = event.getPlayer();
    Bukkit.getScheduler().runTaskLater(this, () -> {

        player.sendMessage("Welcome "+player.getName());
    }, 20L);

}

}```

onyx fjord
#

yeah what about it

magic drift
#

what do you think about it

onyx fjord
#

you dont need the sout, im fairly sure plugins send a similar message already

#
  • you wanna use JavaPlugin #getLogger
#

if you run this on paper server they will kill you

magic drift
#

why

eternal oxide
#

system.out in plugins today is for debug

onyx fjord
#

yea never in prod

near furnace
#

Bukkit.getServer().getLogger().info("your message"); <--- is this correct?

onyx fjord
#

no

near furnace
#

then which one

onyx fjord
#

in your plugin class its just getLogger()

near furnace
#

alr

#

but if its outside the plugin

onyx fjord
#

you have to inject your plugin object as dependency in other classes

#

and then they can use this getter

#
    private final YourPlugin plugin;

    public YourOtherClass(YourPlugin plugin) {
        this.plugin = plugin;
    }

    // Can use plugin.getLogger() in your methods
near furnace
#

yes

near furnace
#

and call it in my other classes if needed

#

i dont use the injection method

#

the call method is waaaay easier and faster imo

onyx fjord
#

you mean a static getter

pseudo hazel
#

or use static log functions xD

#

like I have

#

but its virtually the same thing

onyx fjord
#

nvm for loggers its okay

#

you are right

#

or make different loggers for certain classes

#

its easier to find a root cause of an issue if you use these

#

you immedietaly know where an error came from for example

pseudo hazel
#

yeah

#

I have a bug(String message, Class<?> source) function too

#

which logs the message alongside where it came from (usually always this)

#

and adds a (please report!) at the end

slender elbow
#

i have a bug(String) function as well but i never call it because i don't want bugs in my code

pseudo hazel
#

based

#

unfortunately I am not that good

#

im still trying to find the bug()s and remove them

#

but each time I remove one, 2 more show up

#

might be a virus ngl

onyx fjord
#

debugging iceberg

#

?paste

undone axleBOT
magic drift
#

is javadocs a Good reacorce

pseudo hazel
#

yes

#

probably one of the first resources you should use if you get stuck

#

like actually

pseudo hazel
#

i feel like im missing a step but idk which

hazy parrot
pseudo hazel
#

No matching tests found in any candidate test task.
Requested tests:
Test pattern SimpleTest in task :BingoReloaded:test

#

?paste

undone axleBOT
pseudo hazel
#

and its in the little test folder

hazy parrot
#

hmm

#

do you have little run icon near test method

pseudo hazel
#

yeah

#

same error

sterile breach
#

whats exactly simulation render distance? it mean that client accept chunk loading in this distance but dont show them?

pseudo hazel
#

well it says test pattern SimpleTest.firstTest obv

chrome beacon
#

You should also be able to run the entire class as a test

hazy parrot
pseudo hazel
#

yeah there like a double arrow

#

but that gives same error

chrome beacon
#

🤔

chrome beacon
#

if it doesn't help could you share your build.gradle

pseudo hazel
chrome beacon
#

Add;

test{
useJUnitPlatform()
}

#

Also set junit to testImplementation

hazy parrot
#

oh, i assumed that was default configuration

pseudo hazel
#

awesome that works

#

tbh it might have been in the default build file

#

but I prolly removed that

#

because "why would I ever need tests"

#

and now im making a system that would benefit from just testing it the proper way xD

#

anyways, thanks

magic drift
#

What do i do if im trying to put a EventHandler On a Tnt Minecart

#
    public void```
eternal oxide
#

depends what you are trying to do

magic drift
#

When Ignited I need to Kill it

tardy delta
#

EntityInteractEvent?

#

or wdym

tardy delta
#

"need to kill it" as "its a game and kill it as quickly as possible" or remove it

magic drift
#

like remove it

#

like Kill @e[type=tnt_minecart]

eternal oxide
#

event.getEntity().remove()

magic drift
#

3 errors now

tardy delta
#

its a function ;-;

lost matrix
eternal oxide
#

same as you did for the listener before

magic drift
#

you know instead of telling me what i did wrong you could you know help me

eternal oxide
#

do the same as you did before for the onPlayerJoin event

mild socket
golden garden
#

Hi, I'm using PlayerTeleportEvent to check if player leaves THE END dimension. Problem is after numerous changes and searching, function #getCause() returns UNKNOWN. This only happens when leaving end dimension, and if I join end dimension it returns END_PORTAL.

#

Anyone got idea why?

chrome beacon
#

Minecraft despawns the player when entering the end portal

#

to play the end credits

#

It's then respawned in the Overworld

eternal oxide
#

check the from/to locations., the World type

golden garden
magic drift
#

now i got ```package me.echo145642.tntMinecartNoMore;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public final class TntMinecartNoMore extends JavaPlugin implements Listener {

@Override
public void onEnable() {
    // Plugin startup logic

}

@EventHandler
public void onexplosionprimeevent(){


}

}

eternal oxide
#

yes

golden garden
#

Well, in my case that is problem

magic drift
#

how

eternal oxide
#

You only stated you were using teh teleport event to detect leaving the End

chrome beacon
magic drift
#

Not helping

chrome beacon
#

We're not here to write it for you

kind hatch
#

Who’s gonna hit him with the learn Java?

eternal oxide
#

just go look at teh code you already wrote for onPlayerJoin

golden garden
#

True, but I asked about this UNKNOWN issue and how to handle it

chrome beacon
mild socket
# magic drift Not helping
package me.echo145642.tntMinecartNoMore;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public final class TntMinecartNoMore extends JavaPlugin implements Listener  {

    @Override
    public void onEnable() {
        // Plugin startup logic

    }

    @EventHandler
    public void onexplosionprimeevent(ExplosionPrimeEvent e){


    }
}
eternal oxide
#

You have already written a Listener

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

magic drift
mild socket
#

cancel the event

eternal oxide
#

no

#

he wants to remove the cart

#

I already posted how to do it

magic drift
eternal oxide
#

yes

wary harness
#

why is this not working

#

am I doing something wrong

#

textrue value is eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHBzOi8vdGV4dHVyZXMubW5jLnNraW4vY3VzdG9tU2tpbkxpbmsifX19

#

what

magic drift
#

well what are you trying to do

chrome beacon
#

also that's not a valid texture value

#

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

magic drift
#

so what do i do to make event.getEntity().remove(); To work

lost matrix
# wary harness

Here is what your Base64 String looks like decoded:
Input

eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHBzOi8vdGV4dHVyZXMubW5jLnNraW4vY3VzdG9tU2tpbkxpbmsifX19

Output

{"textures":{"SKIN":{"url":"https://textures.mnc.skin/customSkinLink"}}}

Appending all of that to your URL makes no sense

mild socket
magic drift
hazy parrot
undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

floral drum
#

A lot of people jump into spigot programming without knowing much java

mild socket
eternal oxide
#

use descriptive variables. So event rather than e

magic drift
#

ok now it works

pseudo hazel
#

actually I have another Q about tests, can I include stuff like Material?

magic drift
#

i cant connect to my Minecraft test server now

pseudo hazel
chrome beacon
#

Try changing to implementation instead of compileOnly

#

for the paper dep

pseudo hazel
#

okay that workded thanks

#

but why

#

i dont really understand the actual difference

#

i it bad for the plugin to keep implementation?

#

or do I switch back to compileOnly for the release

magic drift
#

It doesent Kill The tnt Minecart fast enough so now the explosion still apperes

chrome beacon
magic drift
#

No i kinda forgot how to do that

pseudo hazel
#

oop, it is bundling it for sure

#

35 mb

chrome beacon
#

not during runtime

#

Meaning it will be missing if you run your tests

pseudo hazel
#

ah

#

that makes sense

#

do you know how to add the api as exception to the shadow?

chrome beacon
#

If you want you can add the dependency twice

#

once as compileOnly and a second entry as testImplementation

pseudo hazel
#

oh

#

thats a good idea

mild socket
chrome beacon
magic drift
chrome beacon
mild socket
slender elbow
#

imagine using paper

pseudo hazel
#

what does that do

slender elbow
#

all my homies use CameratitMC

pseudo hazel
#

what does userdev do

eternal night
#

CaspariMC truely is the best fork

pseudo hazel
#

is it just nms stuff?

magic drift
#

The Explosion still happens

lost matrix
chrome beacon
# pseudo hazel is it just nms stuff?

It does help with nms and such and when you combine it with the run paper and resource factory you can run the server and generate your plugin.yml directly from gradle

pseudo hazel
#

and now explain in plain english xD

#

I dont use nms

#

so

magic drift
pseudo hazel
#

if its just useful for that idc

eternal night
blazing ocean
chrome beacon
lost matrix
magic drift
#

Damn Your right

magic drift
# lost matrix You forgot to register your Listener

how bout now ```package me.echo145642.tntMinecartNoMore;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.plugin.java.JavaPlugin;

public final class TntMinecartNoMore extends JavaPlugin implements Listener {

@Override
public void onEnable() {
    // Plugin startup logic

    
    
    getServer().getPluginManager().registerEvents(this, this);
    
}


    
}

@EventHandler
public void onexplosionprimeevent(ExplosionPrimeEvent event){

    event.setCancelled(true);

    event.getEntity().remove();



  

}

}

lost matrix
river oracle
#

I've made 100 million in ad revenue

shadow night
mild socket
#

what capitalization?

chrome beacon
shadow night
#

Is this about paperweight

chrome beacon
#

yes

shadow night
#

Or whatever it was called

#

Can we get spigotweight

pseudo hazel
#

oh

#

hmm

#

maybe that is something I need

#

haha

shadow night
#

I wanted to call it spigot loom

#

But that all isn't very creative

nova notch
#

How about faucet

spare hazel
#

I no longer do mc server stuff but i wanted to say something: minestom is THE new meta

eternal night
spare hazel
#

like damn so much customizability?

golden garden
#

Am I missing something or when setting new spawn location of PlayerRespawnEvent or PlayerPortalEvent, functions #setTo and #setRespawnLocation, if player doesnt have bed, server sends message: You have no home be or charged respawn anchor, or it was obstructed.

#

I also saw this in #news on spigot page:

#

Mojang recently released Minecraft 1.21 and the first builds of Spigot for this version are now available. As expected given the short time since 1.20.6, this release mainly just moves the experimental 1.20.6 features into the main server. There are however some underlying changes which you should keep an eye out for, particularly to teleportation between worlds which may have some as of yet undiscovered bugs.

#

help

grim hound
#

does anyone know how I can control when exactly (when it contains certain symbols) it should say that the command is invalid and when it's valid?

orchid trout
#

just check for in in tabcompleter

grim hound
#

I'm not using a tab completer

eternal night
#

pretty sure the brig string reader has it hardcoded what chars are valid

grim hound
#

I'm using the brigadier api

grim hound
eternal night
#

(in an unquoted string that is)

upper hazel
#

how fix "clazz.getConstructor().newInstance();" not can see lombok @NoArgsConstructor

eternal night
#

could write your own StringArgument KEKW not that it would work

grim hound
upper hazel
grim hound
#

pretty sure the client would need to have a mod for that

chrome beacon
#

Make sure you're compiling with lombok correctly

#

so the constructor is generated

grim hound
#

but pretty sure GREEDY_PHRASE would fix it

#

it just doesn't look as cool

grim hound
#

like have the first argument be in yellow and the second in aqua?

eternal night
#

no, basically all of that is client side

grim hound
#

damn

#

alright

#

thanks lynx

#

hmm, none of these would quite work, right?

eternal night
#

if you want to follow a PR

upper hazel
eternal night
#

(hmm, this PR author look familiar)

upper hazel
chrome beacon
grim hound
eternal night
#

Ye xD

grim hound
#

I'd know if I weren't banned from paper's discord

eternal night
grim hound
#

how is the guy a paper and a brigadier dev?

upper hazel
grim hound
#

he just made a pr

#

aight

eternal night
#

yea lol

#

if owen is a brig dev, we'd be in trouble

grim hound
#

why? xD

eternal night
#

owenangry @finite compass

eternal night
# grim hound why? xD

We make him merge all the PRs to paper that will break something and then blame him

grim hound
eternal night
#

if you have to work with owen as long as I had to, you just need such an emoji to display your feelings

#

(jkjk, best owen pepe_hand_heart_2)

grim hound
chrome beacon
#

adding the delombok plugin is also recommended

#

See the lombok guide

grim hound
eternal night
#

indeed, but he likes it

grim hound
#

so a masochist

#

paired with sadists

#

sounds about right

eternal night
#

an ohio resident

#

at that point you kinda have to be

grim hound
grim hound
eternal night
#

tbf, that applies to probably every large project xD

onyx fjord
#

does java freak out when i have a static method that uses class that is not on the classpath?

#

even tho the method isnt used anywhere

eternal night
#

no, classloads won't occur till needed

lost matrix
#

Depends if you use the fully qualified classpath in your method or import it

#

*If the package is also not on the classpath

onyx fjord
#

i use imports

#

but the class is unused

#

(the class with imports)

#

I just have a soft-dep and a util method for it, but the method is only used when the dependency is loaded (the class that uses the util method isnt imported anywhere)

grim hound
#

probably because no child argument should follow

grim hound
#

oh I guess I can just merge the name

quiet ice
grim hound
#

silly me

quiet ice
#

The JVM has no way of tracing that info

grim hound
#

since I'd like it to be a separate arg

chrome beacon
#

Some of them are optional

tardy delta
#

passwords in plain text, yum

chrome beacon
#

not sure about dataSourceClassName

finite compass
chrome beacon
#

port too

tardy delta
#

wondering why people use HikariConfig if all its methods are present on HikariDataSource

chrome beacon
#

Might want to double check if username is optional

#

Might be required

grim hound
eternal night
#

it does not matter what or how you import

#

if your method has an invokestatic using a class not in the classpath, that will only be an issue when that invokestatic is actually executed

river oracle
#

@blazing ocean this is my hot kotlin take, bitshifting is worse

blazing ocean
#

wdym

#

they are yea

eternal night
#

y2k just salty he has to read english

#

over & and |

blazing ocean
#

fr

#

lynx defending kotlin first time???

#

crazy

river oracle
#

I think

((x.toLong()) shl 32) or ((z.toLong()) and 0xFFFFFFFFL)

is worse than

((long) x << 32 | (((long)z) & 0xFFFFFFFFL))
blazing ocean
#

both are shit lmao

river oracle
#

I find the latter much easier to read as far as logical operators go its more clear imho

blazing ocean
#

both unreadable

river oracle
#

get gud

blazing ocean
#

no u

grim hound
#

and

#

you writing an essay?

river oracle
#

no

lost matrix
#

The latter is easier to read if you come from other languages like C as well

eternal night
lost matrix
river oracle
#

thanks guys 😭

blazing ocean
#

based

river oracle
#

go me 32 bytes of memory saved 💃

eternal night
#

I'd argue you did not

#

after you converting z to a long

#

just to then bitmask it

river oracle
#

yeah I didn't uncast it after I fixed my code

#

I didn't bitmask before

rough ibex
#

once you understand shl and shr as << >> its not that hard

grim hound
#

are you gonna replace List<Object> with List diamondLeft Object diamondRight

river oracle
#

bro hating for no reason kekw

eternal night
lost matrix
#

Fun fact, you could write an infix function and have fun like

((x.toLong()) do_a_left_shift 32) bitwise_or ((z.toLong()) bitwise_and 0xFFFFFFFFL)
#

🤡 kotlin

eternal night
grim hound
#

I am so confused right now

river oracle
#

I want a variable called mashed potato and makes its value like three

grim hound
lost matrix
#

Did you reload or restart?

grim hound
#

like now I'm scared that my other config options won't be read correctly

#

like wtf

grim hound
#

I mean

#

restart

#

config changes apply on reloads as well

lost matrix
#

Sure, but you are throwing it in a static variable, meaning you have no control over when it changes

chrome beacon
#

^^

#

supportAllChars will only be set once

grim hound
#

I restarted

#

properly

eternal night
#

Well depends on what type of reload

torn shuttle
#

it finally happened, I'm finally starting to get tired

#

program 21 hours a day, not a problem, edit a video 15 hours a day for 3 days and I'm left feeling exhausted

grim hound
torn shuttle
#

yeah I was wondering too

#

I don't know

#

I think it's the second guessing myself that has me tired

#

I'm not one to usually hesitate but I've just not done enough video work

blazing ocean
#

so you could ```kt
((x.toLong()) << 32) | ((z.toLong()) & 0xFFFFFFFFL)

torn shuttle
#

I think that if I knew what I was doing with this video I could easily be big chillin'

lost matrix
#

What are you creating videos for?

echo basalt
#

x ⏮ 4

#

get fucked

blazing ocean
#

oh hell nah

#

x ←← 4 ez

torn shuttle
#

mr beast more like mr loser

lost matrix
#

Hm?

torn shuttle
#

in a more serious answer it's a part of my business strategy going into 2025

eternal oxide
#

wait for the stock market to collapse then buy cheap

lost matrix
#

Buy DogeUpMoonCoin. All on one card. (trust)

torn shuttle
#

I just need a good platform for showing the work I do, plus I'm very interested by the dev sphere of youtube and I want to try it myself though it is absolutely grueling work even by my standards

#

at least to do the things that matter to me

torn shuttle
grim hound
#

what did the guy do?

torn shuttle
#

he made a video where he was crying saying that it's not fair someone as cool as myself is allowed to start making youtube videos and that he's afraid he'll lose his following once I start uploading

eternal oxide
#

best to not discuss it unless you like getting sued

torn shuttle
#

I fear no beast

eternal oxide
#

ah in dream land 🙂

grim hound
#

and I ain't watch 20x 1 hour exposing videos

torn shuttle
#

how come this system was working up until the moment I wanted to record it for b-roll

eternal oxide
#

yeah not discussing RL drama in here

torn shuttle
#

come on

#

mr beast broke my code

#

it's industrial sabotage

#

I swear I thought this was working

grim hound
#

just with fuckin config.yml

grim hound
torn shuttle
#

I doubt that

grim hound
#

aaaaand now my plugin crashes every user when it's not on paper

#

I'm so done

blazing ocean
#

just don't support spigot run

torn shuttle
#

spigot? never heard of it

blazing ocean
#

we use craftbukkit over here

torn shuttle
#

you mean you're not decompiling and modifying the server jar you got from the backdoor you installed into a random mojang computer?

#

wait how are you guys doing it then?

blazing ocean
#

you mean you're not using singleplayer?

#

you're not opening to lan and getting everybody to your house?

torn shuttle
#

opening lan? wait, you're using network equipment? I just forged my own

blazing ocean
#

wait, you're using the internet?

torn shuttle
#

what's that?

blazing ocean
#

what's a computer

torn shuttle
#

I'm just yelling 0s and 1s into a solo cup that has a wire drawn off to somwhere, not sure where

runic kraken
#

hey, I would like to ask if one of the advanced programmers could help me or tell me how to block the mod called "Player health indicators"

river oracle
#

you really can't

#

Blocking mods is extremely difficult

runic kraken
#

I want to create the effect like on a pvplegacy server, i.e. to constantly show that every player has half of his heart in the mod

river oracle
#

while Forge and Fabric will give the server a mods list, Mod name can also be arbitrarily changed

runic kraken
river oracle
#

you could send the client wrong health information about an entity, but I'd imagine that could cause desync

#

maybe above is the right way to go about it

runic kraken
river oracle
#

I'd just try throwing out a packet and seeing

runic kraken
river oracle
#

throw out a packet and change the players health client side

rocky pond
stuck oar
#

Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.czr.hh.Hh.getCommand(String)" is null

anyone know why this isnt working?

blazing ocean
#

do you have the command set in your plugin.yml

stuck oar
#

omds

#

thanks

#

lmaa

torn shuttle
#

fixed it, she's a beaut

blazing ocean
#

those arrows are

#

slightly cursed

torn shuttle
#

shut your face

blazing ocean
#

damn

torn shuttle
#

what do you know about arrows

#

where is your arrow phd

#

huh?

#

HUH?!

#

I thought so

blazing ocean
#

mbmb 😔

torn shuttle
#

never talk to me or my arrows ever again

blazing ocean
#

:(

torn shuttle
river oracle
torn shuttle
blazing ocean
#

models have animations

echo basalt
#

how the fuck does intellij know

river oracle
torn shuttle
eternal oxide
blazing ocean
#

sign curve

#

crazy

torn shuttle
#

it's a sine wave you plebian

blazing ocean
blazing ocean
#

but it's fully client side and you don't need any complex plugins

stuck oar
#
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {
            Player p = ((Player) sender).getPlayer();
            Configuration config = plugin.getConfig();

            List<String> mobs = new ArrayList();
            mobs.add("Pig");
            mobs.add("Sheep");
            mobs.add("Endermite");
            mobs.add("Rabbit");
            mobs.add("Cow");
            mobs.add("Slime");
            mobs.add("MagmaCube");
            mobs.add("Zombie");

            for (String entry : config.getStringList("mobs")) {

                p.getInventory().addItem(setHead(new ItemStack(Material.SKULL_ITEM, 64, (byte) 3), config.getString(entry + ".playername"), entry));


            }


            return true;
        }
        return true;
    }``` anyone know why this is only giving me 4/8 heads
torn shuttle
#

I want the server to decide what is happening not the client

blazing ocean
#

no overcomplications nobitches

eternal oxide
blazing ocean
#

you said sign curve

eternal oxide
#

yes

#

oh sign, I see

#

yeah didn;t see I even typed it like that

#

sine

echo basalt
#

🤔 how the fuck is this targeting the place I'm looking at instead of me

torn shuttle
#

how would that target you instead of player.getTargetBlock

#

is it supposed to start from a block you're looking at then target the player that was looking at the block?

young knoll
#

The constructor is where you are looking and then you call target with where you are

#

Idk what the constructor does but yeah

echo basalt
#

spawns a laser at that position lmao

young knoll
#

Did you accidentally reverse it

echo basalt
#

maybe

#

I just copied some code that I decompiled

#

goofy ass code

torn shuttle
#

well stop eating your piza and lock in

#

well

#

what is that even

#

is that some display jank?

echo basalt
#

yes

#

trying to make a laser that goes from A to B

#

looks fine on this guy's plugin but when I reverse engineer the code it's no longer good

torn shuttle
#

naughty naughty

#

stealing his code

echo basalt
#

I tried coming up with my own solution for like

#

hours

torn shuttle
#

what a weird implementation

#

guess it works

#

not how I would've done it

#

there's a mildly better looking trick

echo basalt
#

I mean given block displays have half the problems that item displays have I guess I could give it another try

#

but at the same time I want to use item displays as leather horse armor is tintable

torn shuttle
#

hey, he's jacking my style

#

which I in turn jacked from someone else

echo basalt
#

I just suck at quaternion math :/

torn shuttle
#

have you tried joml

#

I mean I have and it didn't work but I still think I probably did something wrong while trying it out

torn shuttle
echo basalt
#

fixing it rn don't worry ab it

torn shuttle
#

but then how will I procrastinate on fixing these models I fucked up making a year ago?

echo basalt
#

man I have a tiny tiny urge to crack paperweight's head open

#

run server, stop server, run server again

#

"file already exists error"

torn shuttle
#

you know what I'll fix the code and not the model, this is bs

blazing ocean
#

works for me

torn shuttle
#

works on your machine? ticket closed

echo basalt
#

ngl that's the kind of shit they'd pull

#

I once had a weird paperweight issue so they pinged some random guy to help and he was just like "nah I ain't doing it" and I got ignored for like 4 hours

echo basalt
#

they just told me to nuke my 45gb .gradle folder

torn shuttle
#

we can all learn from this gigachad

blazing ocean
#

i did that today

tepid silo
#

hey, does someone have the repo and the dependency of the bungeecord 1.21 version?

runic kraken
#
            // Directly accessing food level and saturation level
                FoodMetaData foodData = nmsPlayer.getFoodData();
            int foodLevel = foodData.getFoodLevel();  // Proper method to get food level
            float saturationLevel = foodData.getSaturationLevel();  // Proper method to get saturation level
#

how can I do it correctly?

#

spigot 1.18.2

runic kraken
#

I think I know what's wrong

stuck oar
#
  - pig
  - sheep
  - endermite
  - rabbit
  - cow
  - slime
  - magmacube
  - zombie


PlayerLevels:
Levels:
  0:
    xp: 500
  1:
    xp: 1000
  2:
    xp: 2000

test: 100


pig:
  sellprice: 1999999
  tier: "basic"
  displayname: "§d§nPig Head"
  lore1: "§d§l* §7Required Level: §d1"
  lore2: "§d§l* §7Head Price: §d$2"
  playername: "MHF_Pig"

sheep:
  sellprice: 1999999
  tier: "basic"
  displayname: "§d§nSheep Head"
  lore1: "§d§l* §7Required Level: §d2"
  lore2: "§d§l* §7Head Price: §d$4"
  playername: "MHF_Sheep"

endermite:
  sellprice: 1999999
  tier: "basic"
  displayname: "§d§nEndermite Head"
  lore1: "§d§l* §7Required Level: §d3"
  lore2: "§d§l* §7Head Price: §d$5"
  playername: "MHF_Cow"

rabbit:
  sellprice: 1999999
  tier: "basic"
  displayname: "§d§nRabbit Head"
  lore1: "§d§l* §7Required Level: §d4"
  lore2: "§d§l* §7Head Price: §d$7"
  playername: "MHF_Rabbit"

cow:
  sellprice: 1999999
  tier: "basic"
  displayname: "§d§nCow Head"
  lore1: "§d§l* §7Required Level: §d5"
  lore2: "§d§l* §7Head Price: §d$8"
  playername: "MHF_Cow"

slime:
  sellprice: 199
  tier: "advanced"
  displayname: "§d§nSlime Head"
  lore1: "§d§l* §7Required Level: §d6"
  lore2: "§d§l* §7Head Price: §d$9"
  playername: "MHF_Slime"

magmacube:
  sellprice: 199
  tier: "advanced"
  displayname: "§d§nMagma Cube Head"
  lore1: "§d§l* §7Required Level: §d7"
  lore2: "§d§l* §7Head Price: §d$10"
  playername: "MHF_LavaSlime"

zombie:
  sellprice: 199
  tier: "advanced"
  displayname: "§d§nZombie Head"
  lore1: "§d§l* §7Required Level: §d8"
  lore2: "§d§l* §7Head Price: §d$13"
  playername: "MHF_Zombie"```
runic kraken
stuck oar
#

it gives me mob heads

#

it gives me 4 out of 8 of them

runic kraken
#
for (String entry : config.getStringList("mobs")) {
    ItemStack head = setHead(new ItemStack(Material.SKULL_ITEM, 64, (byte) 3), config.getString(entry + ".playername"), entry);
    HashMap<Integer, ItemStack> leftovers = p.getInventory().addItem(head);
    
    if (leftovers.isEmpty()) {
        p.sendMessage("Successfully added head for: " + entry);
    } else {
        p.sendMessage("Could not fully add head for: " + entry + ". Leftover items: " + leftovers.size());
    }
}
#

check this

stuck oar
#

alright

#

which one

runic kraken
#
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

    if (sender instanceof Player) {
        Player p = (Player) sender;
        Configuration config = plugin.getConfig();

        List<String> mobs = config.getStringList("mobs");

        for (String entry : mobs) {
            String playerName = config.getString(entry + ".playername");
            if (playerName == null) {
                p.sendMessage("Error: No player name found for " + entry);
                continue;
            }

            ItemStack head = setHead(new ItemStack(Material.SKULL_ITEM, 64, (byte) 3), playerName, entry);
            HashMap<Integer, ItemStack> leftovers = p.getInventory().addItem(head);

            if (leftovers.isEmpty()) {
                p.sendMessage("Added head for: " + entry);
            } else {
                p.sendMessage("Could not fully add head for: " + entry + ". Leftover items: " + leftovers.size());
            }
        }

        return true;
    }

    return true;
}
runic kraken
stuck oar
#

alr 1s

runic kraken
stuck oar
#

didnt work

#

it says added head for : pig,sheep,endermite,rabbit

#

not the other 54

#

4

#

it didnt say the else part

#

i dont think its looping properly

runic kraken
#

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

if (sender instanceof Player) {
    Player p = (Player) sender;
    Configuration config = plugin.getConfig();

    List<String> mobs = config.getStringList("mobs");

    for (String entry : mobs) {
        p.sendMessage("Processing entry: " + entry);

        // Check if the configuration contains the necessary data
        if (!config.contains(entry + ".playername")) {
            p.sendMessage("Error: Missing playername for " + entry);
            continue;
        }

        String playerName = config.getString(entry + ".playername");
        p.sendMessage("Player name for " + entry + " is " + playerName);

        // Ensure we have valid data before proceeding
        if (playerName == null || playerName.isEmpty()) {
            p.sendMessage("Error: Invalid playername for " + entry);
            continue;
        }

        ItemStack head = setHead(new ItemStack(Material.SKULL_ITEM, 64, (byte) 3), playerName, entry);

        // Check if the head was successfully created
        if (head == null) {
            p.sendMessage("Error: Failed to create head for " + entry);
            continue;
        }

        HashMap<Integer, ItemStack> leftovers = p.getInventory().addItem(head);

        // Log whether the item was successfully added
        if (leftovers.isEmpty()) {
            p.sendMessage("Successfully added head for: " + entry);
        } else {
            p.sendMessage("Could not fully add head for: " + entry + ". Leftover items: " + leftovers.size());
        }
    }

    return true;
}

return true;

}

#

check this

#

and check the console

stuck oar
#

ok

runic kraken
stuck oar
#

java.io.IOException: Server returned HTTP response code: 503 for URL: https://api.github.com/repos/EssentialsX/Essentials/compare/2.x...f1a5caf

stuck oar
#

i think somewhere inthe code it bugs out

#

because

#

in config i changed endermite name to cow

#

but it hasnt done it

runic kraken
#
plugin.reloadConfig();
#

Alternatively you can restart the server to ensure the latest configuration is loaded

#
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (sender instanceof Player) {
        Player p = (Player) sender;
        Configuration config = plugin.getConfig();

        List<String> mobs = config.getStringList("mobs");

        p.sendMessage("Mobs in config: " + String.join(", ", mobs));

        for (String entry : mobs) {
            String playerName = config.getString(entry + ".playername");
            p.sendMessage("Config entry: " + entry + ", playername: " + playerName);
stuck oar
#

ill try this

runic kraken
#

is there anyone on the server who could help me with spigot NMS

stuck oar
#

i think that might be it tbh

#

ive just looked at the config file in the acc plugins folder

#

and its not an updated one