#development

1 messages · Page 54 of 1

sterile hinge
#

which still means you should avoid them as they may break, so thanks for proving yourself wrong lmao

lyric hound
#

fat fingers XD

lyric hound
tired olive
worn jasper
#

its tony being tony, ignore him

#

he's toxic with everyone

proud pebble
#

deprecated just means pending removal, doesnt mean you cant use it but you probably shouldnt

#

or means d9nt use this use this other one

#

like with paper and sendMessage deprecated if using string instead of component

tired olive
proud pebble
tired olive
#

yeah but it doesnt have to be pending removal or be superseded

minor summit
#

deprecation ≠ for removal

tired olive
#

^

minor summit
#

it can

tired olive
#

@Deprecated(forRemoval = true) does tho

#

yeah, deprecation just means that you shouldnt use the api. sometimes that can be because its going to be removed

sonic nebula
#

for example in 1.8 to set item durability aka data

balmy wagon
#

Hello guys!

Could anyone tell me how to I can create a Placeholder in my Plugin, for example %job%. It should be a string i declared earlier.

sonic nebula
#

only desperate ways

sonic nebula
#

there a full guide on their GIT

#

really user friendly

#

u create extension and register

balmy wagon
sonic nebula
#

and make sure ur plugin is softdepend

#

hmm what u did understand

#

what part

balmy wagon
sonic nebula
#

its a string

#

or a value

#

it resets everytime upon the avable data in the plugin

#

u dont have to update it

#

like for example if its from hashmap

balmy wagon
#

so like that? PlaceholderAPI.setPlaceholders(event.player, "placeholder val")

proud pebble
#

you dont use that to create your own placeholders

balmy wagon
#

and how i can create my own?

proud pebble
#

you use that

proud pebble
#

its telling you exactly what you need to know

nimble vale
#

can you use Thread.sleep() in a spigot plugin in onDisable method

#

its for waiting unfinished async processes on stop

proud pebble
#

no

#

force the tasks to run sync if yohr disabling

hoary scarab
nimble vale
#

yeah now it sounds bad

#

it would be nice to have a safe stop command actually

#

i can give a timeout like a minute and wait for tasks to end

dusty frost
#

i mean what kind of async tasks can you not cancel safely on shutdown lol

nova minnow
#

Hello,
I want to add a String into my List, but it always throws a NullPointerException.

    final String lower = "§7-------------------------------";
    final FileConfiguration cfg = Citizenship.getMain().getConfig();
    final String OWNER = "§bOwner: §f";
    final String MEMBER = "§bMember: §f";
    final String PREFIX = "§8[§bRegion§8] §f";
    public static List<String> regions;
    public static String chunk;
    final Plugin pl = Citizenship.getMain();


    final double costs = 250;
    final double sell = 200;

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player p = (Player) sender;
        chunk = regionMethods.getChunkString(p);



         
        regions = (List<String>) cfg.getList(p.getUniqueId() + ".Regions"); <-- When I am trying to add something into this List, it won't recognize it

#
     regions.add(chunk);

     playerManager.getPlayerConfig().set(p.getUniqueId() + ".Regions", regions);
     playerManager.savePlayerConfig();

}

Here in context

merry knoll
minor summit
#

the error being there suggests that cfg is null

nova minnow
hoary scarab
#

What is the alternative for ChatComponentText in 1.20?

dense drift
#

Component

merry knoll
hoary scarab
dense drift
#

net.kyori.adventure.text.Component

hoary scarab
#

Ugggg. Ok thx

dense drift
#

jk idk what that is, Ig smth from minecraft?

dense drift
lyric gyro
#

I need help, once in a while my placeholders stop working and i have to redownload them
any idea why?

nova minnow
worn jasper
#

how would I go about setting the inventory of a person to another inventory?

#

aka I have the player's inv object and I wanna set it to another inventory obj

dense drift
#

what are you trying to accomplish?

merry knoll
hoary scarab
merry knoll
#

might wanna cache the original contents somewhere if you want to keep em

hazy nimbus
hoary scarab
#

If the server was exited by SIGINT
It wouldn't be running onDisable then

worn jasper
#

Also, best way to serialize a PlayerInventory object?

dense drift
#

I think most people use base64. If you are using paper, make sure to use their (de)serialization methods from the ItemStack clash over bukkit's hacky BukkitObjectStream thingy

minor summit
#

the server has signal handlers for safe shutdown

hoary scarab
worn jasper
dusky harness
#

which minecraft itself uses to store the inventory

minor summit
#

the inventory itself is not serializable and has never been

worn jasper
#

what's paper's method?

minor summit
#

itemstack.serializeasbytes

worn jasper
#

itemstack being an item of the inventory? so I would have to serialize each item right?

minor summit
#

sure

#

you need to keep track of the index, array size etc yourself tho

hoary scarab
#

Pretty sure spigot can serialize contents. Doesn't look good though.

worn jasper
hoary scarab
#

Just how its looks in a yaml is bad

river solstice
#

just base64 it

#

kinda based approach if I say so myself

dusky harness
#

ig yeah the PlayerInventory itself isn't

#

oops

worn jasper
#

One of the plugins have configurate, but like, tf?

dusty frost
#

base64 if you want to store it easily in a string format

#

paper serializeAsBytes if you want to store it efficiently

worn jasper
minor summit
#

i mean even if you want to store it as base64 you're gonna use serializeAsBytes anyway

river solstice
#

when in doubt, base64

hoary scarab
#

Don't forget PDC and NBT 😉

minor summit
river solstice
minor summit
worn jasper
minor summit
#

how is that cringer lol

#

that is not what caused the error tho

#

the error is using paper-plugin.yml but declaring api-version 1.18, that would've never worked since paper plugins have only existed since api-version 1.19

lyric gyro
#

if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
PlaceholderAPI.registerPlaceholderHook("timerplugin", new TimerPlaceholderHook(this));
}

'registerPlaceholderHook(java.lang.String, me.clip.placeholderapi.PlaceholderHook)' is scheduled for removal in version 2.13.0 it count as error

proud pebble
dapper jackal
#

hello, to make an "avance" gui system I looked https://github.com/Flo0/GUITutorial but I don't really like the system.

So I preferred to do this:
I no longer use button classes (everything is done directly in the menu class itself) the same for click events, everything is defined in the gui class

Is it a good idea ?

warm steppe
warm spear
#

Hello, can someone answer my question. When someone create for example a skywars plugin, they have to create 2 different plugins ? a SkywarsLobby that will send players to skywars servers + retrieve database stats and a SkywarsGame plugin which will be the game core ?

merry knoll
#

"have to" no, they can be kept in the same jar

sonic nebula
#

they dont have too anything

#

dumb question , he can make u also sperate lobby jar or both with config

merry knoll
#

that's what i am typing, please dont ping unnecessarily

sonic nebula
#

Ig the invisible mode does not have features of do not disturb 🫥

worn jasper
#

any ideas why Arrays.copyOf(inv.getContents(), inv.getContents().length) might not be copying properly? for instance, I copy the inventory and save it in ram, and display it in a gui, here's the thing, the guy update every time I remove an item from my inventory??? shouldn't it be a copy instead of the actual inventory?

#

#clone() does the same

#

so I am a bit confused

river solstice
#

Clone the itemstacks as well

#

Might be still referencing the same items, no?

#

My best guess

worn jasper
#

yeah it was

#

also, if I set keys in a section (yaml), do I need to also set the section again or will setting the keys in the section obj already be enough?

#

unsure if I explained it correctly but yeah

dense drift
#

setting section.bla.key will create all parents in order to set key.

river solstice
sonic nebula
worn jasper
#

And that library supports both json and yml, so the section also works in json in this case

#

lol

minor summit
#

the concept of "sections" foo.bar.baz like that is not really a yaml thing, that's purely a bukkit config construct

#

so asking that question and saying "but im using this other library" can backfire hard if you don't know it well

river solstice
#

manz destroyed by fax and logistics

sonic nebula
hazy nimbus
#

real men use .properties for configuration

warm steppe
#

nah

#

real men hardcode configuration

sonic nebula
sonic nebula
hoary scarab
#

Probably simple but why is

return new ClientboundPlayerInfoUpdatePacket(actions, Collections.singletonList(npc.getEntity()));
```Showing an error in the compiler but```java
Collection collection = Collections.singletonList(npc.getEntity());
return new ClientboundPlayerInfoUpdatePacket(actions, collection);
```isn't?
dense drift
#

maybe because of the Collection instead of Collection<T>?

hoary scarab
craggy pelican
#

Hi, what is the reason of this error ?

#
[13:43:36 ERROR]: Task BungeeTask(sched=net.md_5.bungee.scheduler.BungeeScheduler@9573b3b, id=1, owner=fr.stormas82.bungeequeue.Main@6548bb7d, task=fr.stormas82.bungeequeue.Main$1@6b5f8707, delay=1000, period=3000, running=true) encountered an exception
java.util.ConcurrentModificationException: null
        at java.util.HashMap$HashIterator.nextNode(HashMap.java:1469) ~[?:1.8.0_362]
        at java.util.HashMap$KeyIterator.next(HashMap.java:1493) ~[?:1.8.0_362]
        at fr.stormas82.bungeequeue.Main$1.run(Main.java:27) ~[?:?]
        at net.md_5.bungee.scheduler.BungeeTask.run(BungeeTask.java:66) ~[Flamecord.jar:git:Travertine-Bootstrap:1.16-R0.4-SNAPSHOT:4d67d99:unknown]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_362]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_362]
        at java.lang.Thread.run(Thread.java:750) [?:1.8.0_362]
#

here is my code

#

im trying to make a bungeequeue

#
getProxy().getScheduler().schedule(this, new Runnable() {
            @Override
            public void run() {
                for (ProxiedPlayer i : queueFaction.keySet()) {
                    i.sendMessage(new TextComponent("You are: "+queueFaction.get(i)));
                    if (queueFaction.get(i) <= 1) {
                        if (i.getServer().getInfo().getName().equalsIgnoreCase("Faction")) {
                            queueFaction.remove(i);
                            for (ProxiedPlayer p : queueFaction.keySet()) {
                                queueFaction.put(p, queueFaction.get(p)-1);
                            }
                        }else {
                            ServerInfo server = ProxyServer.getInstance().getServerInfo("Faction");
                            i.connect(server);
                        }                        
                    }
                }
            }
        }, 1, 3, TimeUnit.SECONDS);
sonic nebula
#

null

craggy pelican
#

a cause of what is happening?

sonic nebula
#

its nulll

craggy pelican
#

bcs its working well but spamming this error

sonic nebula
#

please do java homework on what is null 😉

dawn viper
#

pretty sure that isn't the issue

#

it's a ConcurrentModificationException

sonic nebula
#

null

#

java.util.ConcurrentModificationException: null

dawn viper
#

which means you're interacting with a map or collection that was edited while your code ran

#

happens with async tasks

craggy pelican
#

ho ok thx

dawn viper
#

I'm guessing it may be your queueFaction map

#

since you're removing values inside of the for loop

craggy pelican
#

yeah is forgot to use async im stupid

sonic nebula
#

hm yeah

#

add to list

#

that u remove from

#

outside of for (p : p.)

#

still a null error

#

how ever

dawn viper
#
List<ProxiedPlayer> queuedPlayers = new ArrayList(queueFaction.keySet());
#

add that before the loop

#

and use queuedPlayers instead of queueFaction.keySet()

sonic nebula
#

and not just spoon feed

dawn viper
craggy pelican
#

ok thx i'll try

dawn viper
sonic nebula
#

stormas read this carefully you need it because you stupid

dawn viper
#

you're not helping nor bringing any important info to this topic

craggy pelican
#

the guy is so bitter

dawn viper
#

nor even trying to help or giving relevant information

craggy pelican
#

yeah

sonic nebula
#

Tanguygab are you mentally unstable? just spoon feeding maybe volunteer to code for others ?

craggy pelican
#

this guy is trash

dawn viper
#

Because you're modifying the map while iterating over it (accessing it with the for loop), it throws a ConcurrentModificationException.
To avoid this, you have to save the keyset in a variable that's independent from your map

dense drift
sonic nebula
hoary scarab
dawn viper
#

am I mentally unstable because I help others?

sonic nebula
#

it was a question are you?

dawn viper
#

then that means that everytime I encountered a bug, all the people that tried to help me were mentally unstable as well

craggy pelican
#

talking to TonyFalk is a waste of time

#

thx for your help Tanguygab i'll try

dawn viper
#

yeah, anyways

sonic nebula
#

stormas make sure to write credit to tanguygab

broken elbow
#

how about you all stop insulting eacho ther? Thanks.

dawn viper
#

and won't throw an error

hoary scarab
#

Nothing wrong with spoonfeeding. If the user doesn't want to learn from the code provided thats on them.

dawn viper
#

in this case, they did, and that's why I provided info on what I did

sonic nebula
hoary scarab
dawn viper
#

sync/async stuff can be quite tricky, even I have issues with it to this day

sonic nebula
#

and he legit got a clear stacktrace

dawn viper
#

you got confused as well and thought it was an NPE

sonic nebula
#

i hate beggers what keep them alive are those who give them money instead of a job

#

didnt say its null pointer expec

#

i said null

dawn viper
#

what is null then?

sonic nebula
#

java.util.ConcurrentModificationException: null < hint

dawn viper
#

yeah, so what's null?

hoary scarab
lyric gyro
hoary scarab
sonic nebula
#

java.util.ConcurrentModificationException: null < thats the error code

sonic nebula
#

since he remove something mid of loop

#

from a list he loops in

#

like wtf

dawn viper
#

but dw Yap, already helped them

hoary scarab
# dawn viper here

Object removed from the list as you're looping through it. Making it null when the loop reaches it.

dawn viper
#

that's a better explanation than null

hoary scarab
#

🤷

sonic nebula
#

its null

hoary scarab
#

^^^

dawn viper
#

yeah but what is null

sonic nebula
#

you want me to define null?

#

for who

dawn viper
#

you just say "null" without saying which element is null

#

how is that helping ?

sonic nebula
#

for the guy who would just beg till we recode his code so he can say i did it my self?

dawn viper
#

eh, anyways, I'm done here

sonic nebula
#

which element can be in his loop?

#

you would better send him a guide on how to read stacktraces and a link to java for beginners book guide in amazon

#

maybe he would be able to finish his plugin

minor summit
#

that null there is just there was no specific error message

#

an exception without message will say null

proud pebble
#

how to avoid concurrentmodificationexception: loop backwards instead of forwards

#

or just use the iterator and modify with that

#

tho in this case the loop backwards wouldnt work since they arent removing based on the position of the set

#

also i understand what this piece of code is doing, keeping track of the player's position in the queue and then if they get transferred remove them from the map and update everyones position

#

personally id split this up into two loops, have an integer variable that keeps track of how many people were removed from the keyset, then if its above 0 then to do the update of the objects in the map

#

i was gunna say to have a boolean that acts like a flag if any player was removed from the map but the counter would do the exact same

#

it would mean your not looping through the map more then twice per run

#

and using the map's iterator would stop the concurrentmodificationexception

hoary scarab
#

Or... use concurrent objects.

minor summit
#

or just use an actual Queue

#

and just .poll

icy shadow
#

Or remove mutability entirely

proud pebble
#

ooo java has Queue stuff built in, interesting

lyric gyro
minor summit
#

mfw it doesn't have a concurrent linked hash map

pulsar ferry
#

It makes me so sad 😔

minor summit
#

caffeine 😌

sterile hinge
#

it also has no trie implementation afaik

minor summit
#

yeah I was just thinking that too

proud pebble
#

theres probably tons of stuff built into java that i dont know about

dense drift
#

+1

icy shadow
#

It does not have an immutable lazy cons list either

#

unfortunately

sterile hinge
#

funnily, javac has a singly linked list implementation that is used basically everywhere

#

*immutable

#

but not lazy :(

craggy stump
sharp hemlock
#

So ye

#

It’s malware

shell moon
#

is Player#getStatistic heavy to use for example in Block break event?

dusky harness
#

In like a map

#

So I don't think so

shell moon
#

Good to hear! fingerguns

dusk crypt
#

Anyone knows any better option rather than using parseother in checking other players stats? Decided to create a GUI that shows the data of a said player when tying /playerinfo [playername] and sending the playername from the parseother placeholder but looks like it only checks if the player is online. Looking for ways to make it work even if the player is offline

dense drift
#

Wrong channel.

gleaming stone
#

aw

#

i need helpp

minor summit
#

If I check for Packet class... Other methods with parameters that extend packet will be found.

how is that an issue? param == Packet.class will be true if the parameter type is Packet, not subclasses

#

also what happens if there are two methods with the same parameters lol

sterile hinge
#
                if(methodParams[i] instanceof Object);
                    continue;

which IDE are you using and why doesn't it scream at you?

#

also, MethodHandles >>>

dense drift
#

you can as well do an if (true == true) 🤣

sterile hinge
#

I mean, the if doesn't do anything

#

it just always continues

#

wait you're really using Eclipse? Are you compiling with Eclipse too?

#

Because that code doesn't even compile

sterile hinge
#

well your compiler compiles code that isn't valid Java

minor summit
#

how is that a good thing lmao

sterile hinge
#
  1. the first if has an empty body (;)
  2. something instanceof Object is equal to a null check
  3. the second if is unreachable
#

this whole loop does exactly nothing

minor summit
#

you do

icy shadow
#

perhaps the better question is why do you have a ; at the end of an if?

sterile hinge
#

...

dense drift
#

yeah sadly tenor let me down this time

sterile hinge
#

also still, getParameterTypes returns an array of nonnull entries

sterile hinge
#

and if you want to reimplement method selection, you should take a look at the JLS I guess

minor summit
#

uh.. how is this any different than Class::getDeclaredMethod(String name, Class<?>... paramTypes)

dense drift
#

hold on, there is a reason

sterile hinge
#

it takes a return type I guess

dense drift
#

yeah I think it was that

#

Because Arrays.equals(Method.getParameterTypes(), parameterTypes) are not equal. One contains Ball and the method contains Object. (Don't ask me why)
whatareyoudoing

#

no I mean, why is that a problem

#

it is clearly a miss-use of Class::getDeclaredMethod

minor summit
#
for(int i = 0; i < methodParams.length; i++) {
    if(methodParams[i] instanceof Object)
        continue;
    if(!methodParams[i].equals(parameterTypes[i]))
        continue methodLoop;
}

this will always fall into the first continue
getParameterTypes returns Class<?>[] where the elements are valid Classes, a valid Class instance is instanceof Object

sterile hinge
#

public void a(Ball b, Object o), public void a(Object o, Ball b), what does getMethodByParameterTypes(<location>, a, null, Ball.class, Ball.class); return?

hazy nimbus
#

allow me to introduce you a staggering concept

#

the debugger

minor summit
#

you are misunderstanding what instanceof does

#

instanceof checks that the live object reference is an instance of the type on the rhs

#

clearly you don't

#

because you're using it wrong

#

a Class object will always be an instanceof Object

#

then stop doing things wrong lmao

#

the first step towards accepting help is stop thinking you know better

minor summit
#
println(Object.class instanceof Object)
println("hello" instanceof Object)
println(List.class instanceof Object)
println(new ArrayList<>() instanceof Object)

all of these print true

#

this will always be true

#

then the entire loop is completely useless

#

if all it does on every single iteration is continue; then there is no point in having it altogether

#

that is not what that code checks for

minor summit
#

clazz instanceof Object is not the same as clazz == Object.class

#

all and every of the parameter classes will always be instanceof Object, rendering the whole for loop useless as it will only just continue;

#

a Class object is always an instanceof Object

#

the type it represents might not be Object itself, now that is what you want to check

worn jasper
#

wait a minute

#

why is emily yellow

#

that's new

minor summit
#

i have digivolved

worn jasper
#

🎉

sterile hinge
#

you describe a == Object.class here, which is totally different from instanceof

minor summit
#

or

#

crazy idea

#

== Object.class

sterile hinge
#

getGenericParameterTypes might be helpful

dense drift
#

generics like T turn into Object.class if you use getMethod from what I've seen, probabably with other methods and checks you can get the generic type, idk

dense drift
#

why aren't you checking for PacketPlayInBoatMove.class or ServerboundPongPacket.class directly?

#

well, time for a new method for parameterised types

#

or well to turn your method into that and use Class#getDeclaredMethod for the rest of the methods

#

👍

cloud panther
#

How to change the mob inside the mob spawner to something like a undead zombie horse?

pearl topaz
#

does anyone know a way to disable break progress for specific blocks in a world for players, so instead of the blockbreakevent being cancelled the block is just treated like bedrock? I would never even think this to be possible but hypixel seems to do it in their skyblock mines.

if anyone has any idea please ping me

upper jasper
pearl topaz
#

good idea

#

ill try it

proud pebble
#

ofcourse make sure if they break the block normally to cancel it

#

since on some blocks depending on the tool used it you can still break the block in a somewhat decent time

#

like efficiency 5 shears on leaves

merry knoll
proud pebble
#

theres gotta be a reason why hypixel does mining fatigue, tho they are running 1.7 so it wouldnt suprise me if you dont need mining fatigue anymore for it to work

merry knoll
#

so it shows as broken then pops back up

proud pebble
#

like with shears mining leaves instances

merry knoll
#

ye, most likely

cloud panther
#

how do you change the little mob inside the mob spawner?

merry knoll
merry knoll
cloud panther
merry knoll
#

it should be fine with any entity afaik

#

takes these as type

cloud panther
#

ah cheers!

sullen creek
#

hey anyone see anything wrong with my PLugin.yml or where it is in my project? Plugin builds fine just get plugin.yml not found when it tries to start

https://imgur.com/yUdmqfz

#

Can send full yml if needed

proud pebble
sullen creek
#

Its plugin.yml not found

proud pebble
#

the full thing

sullen creek
#

Let me grab it

#

One sec

proud pebble
#

then post the link here

leaden sinew
# merry knoll reason?

Player side you’ll get halfway through breaking a block before the break progress is reset to 0

proud pebble
sullen creek
#

I have built it multiple times

#

Same error

#

idk why its doing this

sullen creek
#

Anyone else have any ideas?

#

Because I see nothing wrong

#

Ok yeah thats what it is

#

Build was messed up

#

So plugin.yml error is gone but the plugin still doesnt show up when I do /plugins and I see no errors in console when I start the server

#

Here is what I get when I start server

#

Did I mess up my vault dependency thing?

#

Is that maybe what it is?

#

@proud pebble thoughts?

leaden sinew
#

Also make sure you aren’t shading vault

sullen creek
sullen creek
leaden sinew
leaden sinew
leaden sinew
#

It looks fine as far as I can tell

#

Try checking your jar

sullen creek
#

This is jar

#

It goes jar>net>milkbowl>vault

leaden sinew
#

Yeah you’re shading it

sullen creek
#

Ah ok

#

How do I unshade it

#

I have the vault.jar chilling in my downloads is that the problem maybe?

#

Idk where it got the net folder from tbh

leaden sinew
#

Try looking up how to make dependencies compile only in Maven, idk how because I use Gradle

sullen creek
#

Will google a bit

#

Thxx

pulsar ferry
#

It's already correct on the pom, provided does exactly that

sullen creek
pulsar ferry
#

Not sure, how are you building the jar?

sullen creek
#

Intellij build artifacts thing

#

One sec can get a screenshot

pulsar ferry
#

That is probably the issue, you should build with maven

sullen creek
#

Can I do that through Intellij?

proud pebble
#

yes

sullen creek
#

W ok

#

Will google that

proud pebble
#

just create a maven configuration and run clean package

sullen creek
#

One sec sending pic

sullen creek
#

@proud pebble @pulsar ferry @leaden sinew thoughts?

proud pebble
sullen creek
#

Oh??

proud pebble
#

you should see a box like this on the top right to top middle of intellij

#

tho i think the icon will be different

#

also delete both artifacts you dont need them

#

or go to Run -> edit configurations

#

click the +, then click maven

#

then in the Run box put clean package

#

click apply and then close the window and you should see a green arrow, click it

sullen creek
sullen creek
#

Where does the .jar go though?

#

When built

dense drift
#

M is from maven

pearl topaz
dense drift
sullen creek
dense drift
#

do mvn package, not build

#

Ah nvm, lunaiskey told you to use package too

#

As long you run the configuration and it doesnt fail, you should see a new folder with the jar inside

sullen creek
vestal talon
#

I'm not quiet sure how to register a command without plugin.yml but I tried something like:

for(String page : getPages()) {
            getCommand(page).setExecutor(
                new CommandExecutor(){ 
                    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
                        System.out.println(cmd);
                        System.out.println(args);
                        return true;
                    }
                }
            );
        }

Which defenatly wouldn't work, anyone have idea how can i register commands using string list from config?

sullen creek
#

Had to fix the directory

dense drift
#
  1. Use a command lib
  2. Use a command lib
  3. Look how command libs does it. Technically you need to add the command to the commands map, which is a field on, uh, Server I think.
sullen creek
#
[WARNING] JAR will be empty - no content was marked for inclusion!
#

I was thinking maybe there is some issue in this section but I dont really see any problems

<build>
        <defaultGoal>clean package</defaultGoal>
        <finalName>${project.name}-${project.version}</finalName>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>
vestal talon
sullen creek
#

Wait, got it to compile. Needed to change the path in the pom but now it isnt detecting the plugin.yml. Will decompile the .jar and see if its doing smthn funky again

pearl topaz
#

yeah ik

#

but there is no progress

#

just start and stop

merry knoll
#

yes

pearl topaz
#

and cancelling it does nothing

#

i tried

merry knoll
#

its something else one sec

#

i used it in the past

sullen creek
merry knoll
merry knoll
pearl topaz
#

is it client or server bound

merry knoll
#

hence the fatigue

pearl topaz
#

so it has the same effect as cancelling blockbreakevent

merry knoll
#

ye we were discussing it above, fatigue is for clientside

merry knoll
pearl topaz
#

yeah ok ill play around when i get the chance

#

thanks for your help

merry knoll
#

what i wonder

#

is applying fatigue on interact enough?

#

since i feel with fast breaking blocks, between ticks might be too late

pearl topaz
#

but thats the best ive seen so far

#

i would probably leave minimg fatigue on tho and just do the custom breaking

#

and then i get to set custom tool speeds

#

and i dont think interact can detect stop breaking so id use packets

#

PlayerAction 0 and 1

pearl topaz
#

the folder

pearl topaz
sullen creek
#

U mean MyDog?

pearl topaz
#

yeah

#

sorry

sullen creek
#
public class MyDog extends JavaPlugin {
#

Ye ye

pearl topaz
#

yep ok

#

try puttinf plugin.yml in resources

#

i cqnt type

sullen creek
#

Ok let me try that

#

Hm thats funky

#
org.bukkit.plugin.InvalidPluginException: Cannot find main class `machu.dogplugin'
#
main: machu.dogplugin.MyDog
#

???

pearl topaz
#

wat

#

uhhh

#

show me your project

#

qnd the folder structure

#

@sullen creek

sullen creek
#

One sec

pearl topaz
#

send the plugin .yml again

#

in pastebin

sullen creek
pearl topaz
#

um

#

what is the package

#

for MyDog

#

at the top

#

is it package machu.dogplugin;

#

@sullen creek

sullen creek
#

package machu.dogplugin;

#

Yup

pearl topaz
#

yeah ok

#

thats funky

#

i have no idea

#

sorry

#

i hope you work it out

proud pebble
sullen creek
proud pebble
sullen creek
#

Was not used to that but it is useful

proud pebble
#

just change the details to your stuff if you couldnt get your pom to work correctly

sullen creek
#

When I extract the .jar it shows that the MyDog main file is in there

#

But I am still getting the error

proud pebble
#

not machu.dogplugin.MyDog

sullen creek
#

Ye but idk why

#

Since my plugin.yml says machu.dogplugin.MyDog

proud pebble
#

also really you're supposed to do me.machu.dogplugin.MyDog

#

since that complies with the java naming conventions

sullen creek
#

Ah ok

proud pebble
sullen creek
#

Just the .jar?

proud pebble
#

yep

sullen creek
#

Or a zip of the project

#

Ok

proud pebble
#

apparently its not

sullen creek
#

??????

proud pebble
#

if it is try just restarting intellij and try again

sullen creek
#

Will try restarting

sullen creek
#

is it a build thing then?

proud pebble
#

ofcourse change it

#

i say to try that cus it could be a pom.xml problem and i see some differences from mine to yours but i know that mine definitly gives a valid yaml file

sullen creek
#

Got it

#
[ERROR] Failed to execute goal on project dogplugin: Could not resolve dependencies for project machu.dogplugin:dogplugin:jar:1.0-SNAPSHOT: Could not find artifact org.spigotmc:spigot:jar:1.12.2-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/) -> [Help 1]
#
            <version>1.12.2-R0.1-SNAPSHOT</version>
#

This line looks like the one id have to change but it looks right to me

#

Lmk if I messed something up here

#

One sec I think Ik the problem here

#

Need to put the .jar for that version of spigot into my dependencies folder (I think)

north snow
#

i need some help with my discord server

#

anyone here ready to help?

sullen creek
sullen creek
north snow
#

so basically i was with my friends on our discord server and suddenly we got all kicked out and the server is closed is there posiballity to send a screen shot in here to make it easy

sullen creek
#

Use imgur to upload pic

#

But I cant say that I fully understand ur problem here

north snow
#

there is no info or anything just a "!" on the icon of the server

#

what is imugur

icy shadow
#

?not-discord

neat pierBOT
#
FAQ Answer:

Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.

icy shadow
#

discord server outage, very much nothing we can do

north snow
#

oh okey i thought it is a discord help chat hahha

#

i am sorry

sullen creek
#

W Brister Mitter

#

Thx

icy shadow
#

it's ok i forgive you

icy shadow
north snow
#

sorry guys have a good one bye!

icy shadow
#

np np

#

u too

sullen creek
#

Idk if I downloaded the wrong .jar or something

#

But I cant get this to work at all

#

Ok got it to build again

#

Current pom

#

Same issue

org.bukkit.plugin.InvalidPluginException: Cannot find main class machu.dogplugin'`
#

Absolutely no idea why it stil thinks its machu.dogplugin

#

plugin.yml says machu.dogplugin.MyDog

#

Ok so this is odd

#

Even when I delete the plugin.yml all together I still get the same error

#

So idk what is happening here

#

Ok so had to change the resources directory in my pom

#

But now I just get the error

org.bukkit.plugin.InvalidPluginException: Cannot find main class machu.dogplugin.MyDog'`
#

Which makes like no sense because the MyDog.java file is there in the .jar

tight junco
#

what is the actual path to the file

sullen creek
#
/Users/matt/IdeaProjects/DogPlugin/src/main/java/machu/dogplugin
tight junco
#

then the file is not actually located within the java file

sullen creek
#

Huh?

tight junco
#

nope thats not english

#

the java file is not located in the .jar

sullen creek
#

It is tho

tight junco
#

Are you able to send me the jar file in my dms

sullen creek
#

Ye

#

One min

tight junco
#

i can confirm

#

your jar is all sorts of weirdge

icy shadow
#

why does your jar file contain .java files 😵‍💫

sullen creek
#

Is it not supposed to??

#

How did I fuxk this up this bad lmao

tight junco
#

its supposed to contain class files

#

Class is the compiled version of each file

sullen creek
#

I see

#

So why does it have .java???

icy shadow
#

thats a very good question

sullen creek
#

I am not familiar with Maven building so this is very new to me lmao

icy shadow
#

how specifically are you creating the jar?

tight junco
#

top 10 reasons to not build with maven <3

sullen creek
sullen creek
#

I have no idea how its making the .jar files or how to not make it do that tbh

#

Maybe its something with my pom?

tight junco
#

Are you able to create install task

#

mvn install

#

whatever it is like

pulsar ferry
#

It'd be mvn clean package for building the jar

sullen creek
#

Right now its just package

tight junco
#

would it

#

i dont know maven its kinda stupid

#

i think i always did install

sullen creek
#

Will send screenshot in sec

pulsar ferry
#

Package creates the jar, install also publishes it to maven local, which most of the times you don't really care for

tight junco
#

o

#

i will do nothing with that information

#

but thank you

sullen creek
#

@pulsar ferry

#

I get the same thing by doing this

sullen creek
#

Here is my Pom stuff for build

#

I see zero issue here

#

I fucked something up

haughty basin
#

when i hot swap my plugin it doesn't use the remapped jar from special sources, how do i fix this

warm steppe
#

restart server

pulsar ferry
# sullen creek Here is my Pom stuff for build

Seems like you are missing the compiler plugin

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.10.0</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>

Adjust the version, source, and target according to what you're using, this snippet is pretty outdated

stuck canopy
#

When was ItemMeta#setCustomModelData method added to Spigot Minecraft?

dense drift
#

1.14

stuck canopy
#

thanks

haughty basin
surreal kelp
#

my server keeps crashing

#

can someone help

warm steppe
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

warm steppe
#

send logs

#

dude cmon

surreal kelp
#

/home/minecraft/signal/start_cmd: line 1: 572 Killed /opt/java/17/bin/java -Xmx${SERVER_RAM} -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -DIReallyKnowWhatIAmDoingISwear -Djline.terminal=jline.UnsupportedTerminal -jar server.jar

#

@warm steppe

#

i bought more ram

warm steppe
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

warm steppe
#

send ur logs

surreal kelp
#

hold on

#

@warm steppe

warm steppe
#

okay ur actually trolling rn

surreal kelp
#

what

#

im so confused what you want me to do

#

i sent the error thing

#

do oyu want me to send intire logs

#

@warm steppe

warm steppe
#

you literally didnt send me any errors

surreal kelp
#

is that good

#

wait

#

let me start server rq

#

@warm steppe

#

its taking like an hour to start up

#

Server starting, setting up fifo connections and writing server ready.
Downloading mojang_1.19.4.jar

pulsar ferry
#

This is not the right channel for that btw

surreal kelp
#

what channel

pulsar ferry
surreal kelp
#

ok can we finish tho

pulsar ferry
#

Yeah

surreal kelp
#

@warm steppe thats the latest log

#

is that better?

chrome hedge
#

quick question, is it efficient to be querying an SQLite database every time onPlaceholderRequest is called?

pulsar ferry
#

Defnitely not

minor summit
#

i mean sqlite is pretty fast

#

but an in-memory cache is faster fingerguns

warm steppe
#

@minor summit isn't like mysql generally faster and more efficient than sqlite ?

minor summit
#

a) not necessarily b) whether you use mysql or sqlite solves different problems

proud pebble
proud pebble
#

lets say i wanted to store a boolean value at a coordinates, would i be better of having multiple nested maps of integer or use a tuple

#

id assume nested maps would be faster since it wpuldnt have to loop over every value till you find it

#

since it wouldnt have duplicate single values

#

for example 1,2,2 and 1,3,4

wind reef
chrome hedge
wind reef
#

hmmm

worn jasper
#

coordinates? why not use arrays?

#

you can do like array[x][y][z]

wind reef
#

yeah that could aslo be a good option

dusky harness
#

Out of memory error incoming

#

🥲

#

I think?

#

Ya

hoary scarab
#

Think he meant int[] coord = new int[x,y,z];
Not nested.

worn jasper
#

actually I did mean nested, didn't know the above existed

#

and good to know that could be a memory issue

dense drift
#

coord[99999, 25, 99999] = true 😵

sterile hinge
sullen creek
#

Hey not sure if this is a question for this kinda server but u know how in MC when u hit a mob like a pig or cow it begins running from the player. Is there a way to summon in the entity so that is in a constant state of fleeing or running?

proud pebble
#

also considered making a byte array to save on space otherwise there would be tons of wasted bits

sterile hinge
#

Well if you only need one bit per coordinate, you can use BitSet

#

Then it depends on whether you have a fixed bounding box

proud pebble
#

yep, a single full block

sterile hinge
#

Then you can just linearize the coordinate and use it as index for a BitSet

#

If it’s sparse, there might be even better solutions, but that is really heavily use case dependent

proud pebble
#

the usecase of this is deciding on if the block as said coordinate has been modified by a player for figuring out if the block should give xp or not, so preventing just breaking and placing the same block to gain xp

hoary scarab
proud pebble
#

i dont know, im just considering if there isnt already a system for that

sterile hinge
#

In that case a sparse bitset implementation might make sense, depending on the size and how much you care about memory usage

dense drift
#

There is MetaData, that you can set with a plugin to a block, can you not use that?

proud pebble
#

would using a byte[] require less memory then a bitset? i would assume yes but ive never tested it

proud pebble
dense drift
#

you can just set a bite and then check Block#hasMetadata(key)

proud pebble
#

that looks pretty useful

#

tho ig if i wanted to reduce memory usage for my specific usecase then a byte[] or bitset might work better

lyric gyro
#

it works the same way kinda

edgy lintel
#

whats the packet that get sent when the player is initially spawned

dense drift
#

Ig the same you use to spawn npcs? So smth like world entity add

edgy lintel
#

just checked its playerinfoupdate for removing and spawning players
and spawnplayer packet for updating whenever coming to visible range

#

thx for help tho

edgy lintel
#

where is com.mojang.authlib.GameProfile in 1.17+ jars? i cant find it anywhere in the nms jar

#

nvm found it in authlib.jar

gleaming tide
#

I have a problem with PlaceHolderAPI: Caused by: org.bukkit.plugin.UnknownDependencyException: PlaceHolderAPI

dense drift
#

Because it is PlaceholderAPI 🙂

spiral mural
#

For some reason my HikariCP connections are insane slow which means I messed something up...
both SQLite and MySQL is super slow. and when I reload (I know I shouldn't) server I get [18:30:38 ERROR]: Could not generate table(s) reason: [SQLITE_BUSY] The database file is locked (database is locked)

The SQLite thing, the onDisable() is just source.close(), so shouldn't be an issue? when I connect and load the data it delays the login super slow too.

        File file = new File(homes.getDataFolder(), "storage.db");
        if(!file.exists()) {
            try {
                boolean fileCreated = file.createNewFile();
                if (!fileCreated) {
                    throw new IOException("Tried making a new config, but it already exists. It's a non issue, but shouldn't happen regardless.");
                }
            } catch(IOException e) {
                Bukkit.getLogger().severe("Could not generate 'storage.db' reason: " + e.getMessage());
                homes.getServer().getPluginManager().disablePlugin(homes);
            }
        }
        HikariConfig config = new HikariConfig();
        config.setDriverClassName("org.sqlite.JDBC");
        config.setJdbcUrl("jdbc:sqlite:" + file);
        config.setMaximumPoolSize(1);
        config.setAutoCommit(false);
        dataSource = new HikariDataSource(config);
    }```
#

tried setting the pool higher

dense drift
#

You don't need hikari for sqlite

spiral mural
#

I know, but the plugin has a toggle feature between MySQL and sqlite

#

open source / public

dense drift
#

F

minor summit
dense drift
#

dont you also need to commit changes since auto commit is disabled?

spiral mural
#

could you elaborate Emily, by rouge what do you mean? I should move the statement inside the brackets?

dense drift
#

No, she means you need to use try-with-resources when using Hikari, to close the connection after you are done. Like in the code snippet she sent.

spiral mural
#

It fixed the problem yea 😛

minor summit
cerulean birch
#

what’s the difference between nbt and pdc? is pdc just more flexible and nbt just pointless?

#

making a pickaxe customization system and wondering whether to use nbt or pdc

edgy lintel
#

nbt is the native and internal way of minecraft dealing with data, while PDC is a spigot wrapper for NBT with more flexibility and easy to use API. NBT is just hard to use and it can get very messy in cases
Depending on what you need but mostly PDC is enough. You can use NBT if you need a bit more customization for your pickaxe though, or if in certain cases you need your own implementations for the data stored (nested nbt and stuffs?).

(someone may have a better explanation than me)

graceful hedge
#

and sometimes its just nice as opposed to implementing ur own storage code

icy shadow
#

they are the same thing

#

pdc is just a frontend to nbt in the spigot api

#

there should be no functional difference

#

unless you specifically need to edit a “hardcoded” nbt tag

dense drift
#

yeah, and you can not have nested tags though

warm steppe
#

can't*

minor summit
dense drift
#

yeah, compounds or how are they called

minor summit
#

you can do that

minor summit
#

yeah

dense drift
#

cool, but I think this wasn't possible at some point D:

#

good to know AyeAyeCap

minor summit
dense drift
hazy nimbus
minor summit
#

pretty neat, unfortunately outdated riesad

dense drift
#

yeah F

dense drift
#

How can I set a different language level for the test module? I get this error with the following configuration

    compileTestJava {
        sourceCompatibility = "17"
        targetCompatibility = "17"
    }```
`Cause: invalid source release: 17`
#

I'm testing some things for a plugin on the test module, through a class with a main method

minor summit
#

assuming the project's java toolchain version is < 17?

dense drift
#

yeah pensive_polar_bear

minor summit
#

well there's your issue

#

set the toolchain version to >= 17

#

the test compile release flag to 17 and the regular compile release flag to <= 17

dense drift
#

aight, that worked, thanks em

minor summit
#

not

hazy nimbus
#

:(

dense drift
#

@dusty frost to use transaction, did you had to set allowMultiQueries=true? Without that option, it complains about this

START TRANSACTION;

SET @AMOUNT_TO_BUY = ?;
SET @ITEM_ID = ?;
-- the rest of the transaction
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET @AMOUNT_TO_BUY = 4;
SET @ITEM_ID = 'test_item_1';```
#

I mean, it would make sense to require that, I just want to make sure xD

pulsar ferry
#

Oh boy raw sql transactions, you don't have an orm or some other framework to handle that for you? Will make your life so much easier

dense drift
#

nah, I got only a few queries anyways

#

although I might look into that java library, was it ormlite?

hazy nimbus
hazy nimbus
dusty frost
pulsar ferry
#

That's why I found odd to see it being used raw

dense drift
#

hmm

hazy nimbus
#

See

#

Probably a bit outdated, but should work

dense drift
#

Interesting

hazy nimbus
#

It's not like the JDBC API changes often, if ever

dusty frost
pulsar ferry
#

This ^

dense drift
#

nah it is for a mc plugin

pulsar ferry
#

All database access being exclusive to microservices 😌

hazy nimbus
pulsar ferry
#

That should not be a problem

dusty frost
dense drift
#

maybe for a bigger project I would consider that, but doing everything on a single 'service' is fine for this use case.

dusty frost
#

k8s is still beyond the pale for me lol

boreal drift
#

Hey, I made a PersistentDataType of a MerchantRecipe list and it's working when the results and ingredients for the merchant recipes are ItemStacks. But when I try to use it with a subclass of ItemStack an error is thrown: https://pastebin.com/zxCrjs3L . Here's my MerchantRecipeListDataType class: https://pastebin.com/jBv1qQ0M. Does anybody know how to solve it?

hazy nimbus
pulsar ferry
#

Depends on the data and where it's used

dense drift
#

I use transactions for the stock of a shop, mc plugin as I've said.

#

Although I still need a local cache. Since mysql blocks rows used in transactions, how would I do the same for a local cache (smth like a Map<Item, Integer>)? Do I just slap a synchronous on the cache 🤣?

minor summit
#

It Depends™️

dense drift
#

Well the cache would be used when players try to buy an item from the shop that has a limited stock. Sadly I don't know how to process 'requests' for the same item one by one 😦

hazy nimbus
#

You could have a lock for the item

dense drift
#

Good point

minor summit
#

why do you need to process them one by one? thonk

dense drift
#

Well not necessarily one by one, but in the order the players try to purchase an item. E.g. if there's 5 item X left in stock, and player A tries to purchase 4 at the same time with player B which tries to purchase 3, the first one would get his items, but the second won't be able to purchase, unless they change the quantity.

hazy nimbus
#

Can you guarantee that the players will be on the same server?

minor summit
#

surely you can alter the amount in bulk for however many items a player tries to purchase without doing it one by one, no?

hazy nimbus
dense drift
minor summit
#

if a player tries to purchase 4 of an item, do you get the 4 requests one after the other individually or as a single request?

dense drift
#

A single request, 4 items of the same type

hazy nimbus
minor summit
#

cuz like, for a local cache, with compute/merge/computeIfPresent etc you don't even need to do any locking yourself so long as you're using a concurrent map

dense drift
#

That sounds nice jeb_think

dense drift
#

And I wouldn't mind to ditch transactions, for now at least 🤣

somber gale
#

Is there some way to make Gson's fromJson return a default value should parsing not work (Return null)?
Like, I have this rn

try{
    // cacheFile is a Path instance
    BufferedReader reader = Files.newBufferedReader(cacheFile);
    
    // cachedPlayers is an ArrayList<CachedPlayer>
    // and listType is TypeToken<ArrayList<CachedPlayer>>(){}.getType()
    cachedPlayers = gson.fromJson(reader, listType);
    
    reader.close();
}catch(IOException ex){
    return;
}

// ... do stuff

What I hate here is, that Gson can return null for the cachedPlayers, which makes later stuff a lil more annoying to work with.
Is there a way to tell Gson to return a default should it fail to parse JSON?

dense drift
#

Optional#ofNullable and then #orElse maybe?

somber gale
#

Isn't Optional crap?

dense drift
#

Annoying to use sometimes? yes
Crap? NO

somber gale
#

Okay.... Doesn't seem to work

#

IJ yells at me that it needs a List yet I give it an Object

dense drift
#

?

#

You probably need to cast fromJson as List<>

somber gale
#

I just do an if check after doing the fromJson...

minor summit
#

that will only be null if the source is completely empty (an empty file/only whitespaces) or it's the null literal json value

#

don't know in what situations you'd end up with either of those cases unless the user just manually deletes the file contents without deleting the file; the second case is even funnier, typing null as the whole file content

icy shadow
stuck canopy
#

why is MaterialData deprecated but ItemStack#setData not deprecated?

stuck canopy
#

in Spigot I mean

icy shadow
#

Spigot
that's why

minor summit
#

kek

#

pretty much yes

stuck canopy
#

aight ig

grave thorn
#

Hi, does anyone know if Bukkit.getPlayer(uuid) works for players joining via Geyser (bedrock edition)?

hazy nimbus
hoary scarab
gleaming stone
#

Guys can somebody tell me whats better for minecraft

#

Typescript or javascript

#

Im focousing on makeing a minecraft client

pulsar ferry
#

That's a very confusing question, TS and JS main difference is for the programmer, TS is a lot nicer to code in
But that being said .. javascript .. for minecraft client? Huh?

#

@gleaming stone forgot to ping ^

gleaming stone
#

oh

gleaming stone
pulsar ferry
#

You can, but not very well and probably much much harder
Why not use Java?

gleaming stone
#

really?

#

I thought javascript was easier

pulsar ferry
#

Well if Minecraft was written in Javascript then maybe

gleaming stone
#

hmm makes sense

#

ALso why your here

pulsar ferry
#

Unless you mean launcher instead of client

gleaming stone
#

Can you help me with something?

gleaming stone
gleaming stone
pulsar ferry
#

Depends on the something

gleaming stone
pulsar ferry
#

No

gleaming stone
#

deluxe menu

#

ok

#

bru

boreal drift
#

hey, does anybody know how items from the plugin AdvancedEnchancements are identified? I mean, how can I check if an item is from that plugin?

dense drift
#

What are you trying to do?

#

I don't know if there's an api method to, e.g. check if an item is a book, but items have some NBT tags set that you can use.

stuck canopy
#

I am looking for a maintained Inventory library with 1.8-1.20 support. any suggestions?

worn jasper
stuck canopy
#

whats Vision tho?

#

I mean I can't find it

worn jasper
#

on the works

#

but yeah, quite promising

#

but it's paper only

stuck canopy
#

ah, I want it for Spigot

worn jasper
#

then triumph is your best bet

#

although, why xd

hazy nimbus
#

Spigot 💀

stuck canopy
#

wait, so if the library is made on papermc, will it work on spigot server?

hazy nimbus
#

No

stuck canopy
#

thats the reason

#

and spigot plugins work on papermc right?

#

coz papermc is a fork of spigot

hazy nimbus
#

Should

#

I still don't see a reason to support spigot on newer versions

stuck canopy
#

coz im creating the plugins to publish them

hazy nimbus
#

And?

stuck canopy
#

and not everyone uses papermc ig

worn jasper
#

over 80% of servers on 1.20 are using paper

#

and in all versions, over 70% are on paper or its forks

#

soo yeah...

hazy nimbus
stuck canopy
#

what

#

Are most of the premium plugins made on papermc?

hazy nimbus
#

I don't use proprietary plugins

#

So idk

#

I, as a developer, liberated myself from supporting legacy versions

#

I use Java 17 and a modern Paper API

#

Never been happier

#

If some people don't want to upgrade to a normal version, they don't get to use the plugin

stuck canopy
#

are those plugins for personal use or for marketing?

hazy nimbus
#

Free and open source plugins

#

Or, plugin, to be exact

#

No DRM, no obfuscation, no bullshit

worn jasper
#

fuck premium

#

max, freemium

nimble vale
#

whats the equivalent of the AsyncPlayerChatEvent#setFormat method for AsyncChatEvent with components

#

there is a thing called renderer but i really couldn't figured out that

small arrow
#

https://pastes.dev/KXpZmmvR20
The plugin idea:
Randomly every 1-24hrs a players effect changes. These can be any of the buff or debuff effects in minecraft.
You can craft a Chaos Orb that will give you a permanent positive effect which is also random until you die. You can have an unlimited amount of chaos orbs in your inventory at a time. Meaning you can stack these permanent effects. However if you die the item is permanently removed from the game and there is no way to get it back. Meaning if someone kills you they don’t get the Chaos orb either.
The way to craft a chaos orb is like so 4 diamond blocks, 4 netherite ingots, and a splash potion of water. It does not matter how they are placed in the crafting table.
The Material for the Chaos orb is a snowball. Please edit the name of the snowball to display Chaos Orb in Red Bolded text.
If a player dies to another player the player who died has a 50/50 at a negative effect when they respawn which is permanent or losing 1-3 hearts on respawn.
If a player kills another player, the killer gets the same permanent positive effect as the Chaos orb or you gain 1-3 permanent hearts. This should be a 50/50 chance as well.

The Issue:
It appears to be that none of my Events are working at all. Is there any reason for this? I am yet to implement every single feature into the plugin but I mainly added in the important ones. Only thing that works is the ShapedRecipe.

void orchid
small arrow
#

done

void orchid
#

How do you know that the events are not working? Have you tried adding debug messages?

small arrow
#

The events don’t execute when they should be prompted to

#

Wait nvm I think it’s a stupid mistake by me

#

I have a condition which shouldn’t be there

void orchid
#

Try verifying your assumptions, trust me it'd help a lot

small arrow
#

yeah ik

#

i just added in some sout texts to debug to see if the events are being ran or not

#

yup got it to work basically i had a stupid condition that checked to see if a player had the ChaosOrb in their inv but that wasnt needed and I was using the wrong method to give the player a random effect

#

tysm for your help 😄

void orchid
#

you're welcome :)

muted ruin
#

what would be the easiest way to make dropped items only appear to some players?

leaden sinew
#

Packets

muted ruin
leaden sinew
#

Use packets to hide them from other players

muted ruin
#

u can do that????

leaden sinew
#

Yeah just send the destroy packet

muted ruin
#

is protocollib used for packets?

leaden sinew
#

Yeah

muted ruin
# leaden sinew Yeah

they seem to re-appear after a few seconds, am i doing something wrong?

final ProtocolManager manager = ProtocolLibrary.getProtocolManager();
final PacketContainer packet = manager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
packet.getIntLists().write(0, Collections.singletonList(item.getEntityId()));
for (final Player player : players) manager.sendServerPacket(player, packet);
```*fired right after item is spawned*
leaden sinew
#

Listen to the entity spawn packet, and then you can remove it

muted ruin
#

gotcha

sonic nebula
#

im back

#

hm guys how would u make prefiix and suffix to players? at the moment i use scoreboardpackets