#help-development
1 messages · Page 1084 of 1
-_
so when you all say that there are already great rust mc servers out there, Why no one uses them and Spigot/Paper is still the Standard
Because they're reimplementations and incomplete, spigot is just an extension over the official server software and behaves mostly like an official server
there's no reason to use them
spigot is the standard, nobody is brave enough to go and change it
i wanna hear lynx opinion on this
yeah most of them are build with the goal of incompletion, So you have to only enable what you need like in valence, Most people dont like this approche and don't want to build everything them self
I don't see how you can disagree with that though
Most people don't know and don't care about server reimplementations and use spigot or paper
ig you could say paper?
he's a paper dev yea
paper is the dominant server software, that's for sure
I can't recall the last time I ran /version and the server wasn't paper
Iirc ~60% of servers use paper
Performance, Security, Scalability. I think you already know the Performance issues of normal Java Servers. The Rust Server can startup in under 1ms. Also important for Large Server to minimize down time and get a good performance with large player count. The Paper team tries to this by Creating Folia.
also uses less resources
Minestom is great if you want something different
And yet you don't see anybody use folia, do you?
security?
I can't imagine many scenarios in which 1ms startup is that important
sure it sounds amazing
in regards to servers, start up times are not really relevant

but most of the time you won't be starting up your servers every minute
imagine, minigames server or privat player servers
Wait we need the thing
I rarely restarted my MC servers
The Rust Server can startup in under 1ms. Also important for Large Server to minimize down time and get a good performance with large player count. The Paper team tries to this by Creating Folia.
Have you heard about GraalVM's native-image?
they would stay up for 30 days or more at a time
CloudNet is also there for a reason
so why would I care about a 10 minute startup time when 99% of the rest of that time its always on
Some unofficial reimplementation of the server can take ages to update to update to a newer version, while official software gets updated with the release of a new version
you can get plenty of performance with java
still waiting on the security part
not entirely sure what they mean by that
I may not follow exact conversation, but how will mc server written in rust help scalability ?
how is the coding language going to make your server software more secure?
Well, you see, with c you could easilyl fuck up and have people uh, like, uh
well yea the server is in java but ehm
rust makes it easy to prevent the loved nullpointerreference errors
for example
that isn't security?
Security under Java will probably be better tbh - there isn't all that much you can f up aside from path traversal attacks but that can be easily mitigated and is a non-issue
that isn't security
So does Java
this could crash your server more easier
Crashing is a non-issue in the grand scheme of things
so whats security for you ?
Java actually does a pretty good job when compiling to let you know about Nulls and a decent IDE would let you know before compiling
Rust server reimplementations have a major downside of being just not exactly like the original server implementation, which by itself could cause quite a lot to break
not security, and unless your devs don't know how to handle NPEs idk how that can be a major issue
you don't always know them these error can accour
for example an command could crash your server
Not being easily exploited?
I'd call security to be the safety of server data and server hardware. Log4J was a security exploit. You crashing a server isn't really. Not that NPEs are common in the first place
Commands are handled async so the server by default gracefully recovers here
security has to do with in memory tampering and whether or not the language detects that. Catching or preventing buffer overflows or underflows
The only time when comparing with hypixel is actually useful
What is buffer underflow
gonna send me a nice msg command to get some ACE going on papermc 
going the opposite way of what a overflow does
so an overflow makes it reset going higher
underflow goes in the other direction
Certainly possible in java 
There are two choices:
A. Use a patched version of the official server both of which (original and patched) update almost immediately after a new version and have been tested by time, existing for more than ten years
or
B. Some random persons reimplementation of the server in rust that hasn't been tested by a single person
Pfft comparing to hypixel is always useful
basically an array access with a negative index
Doesn’t that just underflow to the highest possible stack pointer
Or does it start trying to reference whatever is before the stack

What
So for you buffer overflows or underflows = security issue.
but nullpointerreference = yeah its fine ?
I mean, accessing memory you aren’t supposed to is a bit of an issue
It's absolutely fine in java land
Well one is a crash of the JVM, the other may allow you to actually run some malicious code
In c at least
In the kernel that might be another issue
Scary red text in console is just whatever
overflow is accessing memory beyond the end of the buffer. Underflow is accessing memory before the beginning of the buffer. It is more common to happen in caching for example of a underflow happening
Java is so far away from that issue, it does not matter
I guess it depends on how the stack pointer is stored
If it’s unsigned it would wrap back to the top
no this wouldn't happen
the memory address of a negative that is beyond what is allowed would end up being a completely different memory address
and does not wrap back
I wish java had unsigned numbers
The stack on the NES wrapped back :p
char
Lmao
but I still can't unsign a long
Well I'd rather have 128-bit CAS than unsigned numbers
long long
u could use a lib that makes a fake unsigned type lol
Let’s make a language where each o added to the word long is another 8 bits
unsigned long long long
backs it up with a larger signed type
thought of that before
just use BigNumber at that point
long is 64 bits
loong is 72 bits
looong is 80 bits
loooooooooong
Wasn't there a language that supported 0-bit ints?
so, 0?
if you ran build tools, all the decompiled classes should be in the work directory
Run buildtools and then look into the work directory for the decompiled source
yes
actually, 1-bit ints would be great
are cpu processes ran LIFO?
boolean?
yes
define processes
that would result in a very poor scheduler
uhh buffer underflow just means that whatever is reading a buffer is reading more bytes than the writer wrote, and that can still be within the bounds of the buffer, e.g. i have a 128 bytes buffer, i write 32 bytes and you try to read 64 bytes, that's "legal" but that's a buffer underflow or underrun; not that it can't be a security issue tho
all processes except system ones
since it doesnt make sense for system processes to be ran like that
right okay, got it. any way to see that in Mojang mappings? do i just enable that flag when running and the latest decompile folder will update with the mappings?
or is that not possible
Yes
why would processes be run lifo?
Uh, obviously no - since otherwise a 4 Core CPU would instantly freeze the system when trying to run more than 4 applications at the same time
should be no security issue as teh SP just goes to zero
fair
i have no idea
only with malloc'd memory though, no?
stack pointer goes to zero?
ie, base of the stack. It can;t go below
Wouldn’t that depend on the language
i mean what is it supposed to do?
crash?
if i do that, is it just the work folder that has the moj mappings? or can i work with them in my CB directory as well?
Just the work folder
ah coll fucky ou
that's my gif 😡
The cb code is like
ah in the way that you read over the whole buffer and start reading from the stack
i get it
😬
i'm having such a headache trying to navigate all that's required to contribute
anyway, thanks!
right it can also occur if the rate at which bytes being written is slower then what is being read
comparing to hypixel is a great tutorial on how to start good and continue not so good
37531 at least :cope:
i feel like hypixel players are bots
does anyone know why this error happens?
[13:02:56 ERROR]: Paper Async Command Builder Thread Pool - 1
java.util.ConcurrentModificationException: null
at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:1023) ~[?:?]
at java.base/java.util.LinkedHashMap$LinkedValueIterator.next(LinkedHashMap.java:1052) ~[?:?]
at net.minecraft.commands.Commands.fillUsableCommands(Commands.java:537) ~[paper-1.21.jar:1.21-123-0a1be9a]
at net.minecraft.commands.Commands.sendAsync(Commands.java:496) ~[paper-1.21.jar:1.21-123-0a1be9a]
at net.minecraft.commands.Commands.lambda$sendCommands$6(Commands.java:475) ~[paper-1.21.jar:1.21-123-0a1be9a]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1570) ~[?:?]```
for context i did /reload confirm with my plugin on the server
i can confidently say that isn't a spigot issue 🤓
how do you know emily?
i have a hunch
my bad
there is an open issue on the paper github for that ^ but yea, not the right discord
true
ah too late 
ah okay so nothing to worry about?
not my code doing a freaky time?
nah
@eternal night what did you break
smh lynx

There you go. How about you absolutely never do that again.
why you hating on /reload confirm so much
Read the message displayed when you try to reload. Then youll know.
but why give the option then?
Its an artifact from the past
starts of soft, and then it turns into the devil
plugin.yml
core:
description: The main core commajnd
usage: /core
permission: simplecore.core```
commands/core.java
```package work.constt.simpleCore.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class core implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
return false;
}
}
simplecore.java
import org.bukkit.plugin.java.JavaPlugin;
import work.constt.simpleCore.commands.core;
public final class SimpleCore extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
this.getCommand("core").setExecutor(new core());
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
why cant i type /core
the funniest error ever
i mean i've encountered those issues before
Be more specific. The answer to "why cant i type /core" could be "maybe your keyboard is broken".
Phrase it like this:
I expect X to happen
In actuality Y happens
Here is my implementation, what could be the cause:
const? as in the dude from event alerts?
yes
i gave myself perms too and like i doesnt work, i cant type /core it doesnt exist and the perms doesnt exist too. like even tho i did everythiing right ?
wait what u doing here lol
yourpackageshouldlooklikethisbtw, AndYourClassLikeThis
ive been here for years 😭
Alright, since you dont want to provide any more info we'll go about this in a heuristic way...
Type in /pl is your plugin enabled?
yes
what more info i gave u code and what i did
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
wait a minute
how do i do it so when i execute the command it says something ib chat?
or like how do i declare the player variable?
look at the CommandExecutor signature
where
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] strings) {
sender.sendMessage("You have used a command");
return true;
}
thx
so i can see the plugin in /pl and i dont get errors reloading, but still i cant type the command
https://imgur.com/qbWamrC
don't reload
RESTART?
Ofc, never use reload
fgor what is there rleoad then
Type in /reload and read the message. Its not supported, will cause problems and is an artifact from the past.
Also make sure to update your plugin every time you compile it. I have the suspicion that you simply forgot to place the new jar in your plugins folder.
Happens
and it's generally better to learn some java basics
yea
before trying spigot, although you can do it any way you want
I do
from where?
i help him with his server sometimes
nice
works now :skulli
when i type it it shows thistho
and not the message
it shows: You have used a command
Which PersistentDataType and value should I use if I use the key as a boolean where if the PDC has the key it's true and if it doesn't it's false?
Sounds like what you would expect. I dont see a problem.
boolean/byte, that's the smallest value you can store and use as a "marker" for that kind of thing
Byte or boolean. Generally doesnt matter.
Thanks 👍
But if its on an entity then you can as well use scoreboard tags
internally they are the same thing
1
someone know what the code i have to write on my spigot plugin to get the server server name wheres the player is?
Are you talking about a multi-server setup with a proxy?
player.getServer().getName()
wait a sec
That gives you the server implementation name... nvm
yes with bungeecord
That would be requested from the proxy via plugin messaging
how can i do that?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I personally hate this system and built something on top which returns a CompletableFuture instead
then how do hcf servers do it
Hey,
I tried to make a command that spawns a npc on the current Position. I heared that in the 1.21 you need a ServerEntity to spawn the npc. I uploaded my code here: https://pastebin.com/BMLs1wuT In the marked section I Think I have done somethin wrong or missed something. Can anyone look through it? When I run this code nothing happens.
~ @uncut grove
how do I get the plugins folder path? i mean server/plugins not server/plugins/<myplugin>
Go one folder up from your plugins folder?
path.getParent()
Any exceptions? Im not seeing a spoofed connection (which is needed for newer nms npcs)
nope, nothing. Do you know a doc / tutorial where I can see how the spoofed connection is working?
ty it works
public class PlayerConnectionSpoof extends ServerGamePacketListenerImpl {
private static final Connection DUMMY_CONNECTION = new Connection(PacketFlow.SERVERBOUND) {
@Override
public void setListener(PacketListener packetListener) {
}
};
public PlayerConnectionSpoof(ServerPlayer player) {
super(MinecraftServer.getServer(), DUMMY_CONNECTION, player);
}
}
this.nmsPlayer.connection = new PlayerConnectionSpoof(this.nmsPlayer);
Does this work for 1.21 I copied it and it says that what you can see in the imghttps://imgur.com/a/1QntRsX
You need to override one more method
do i import a new NMS class as the moj or spigot mapping?
moj
im not even close to compiling, but i certainly can't do it with that
what am i doing wrong?
is that how it's usually done? that's quite a lot of NMS to edit
witch one?
ugh nms
or use a good decompiler 
i'm literally stuck idk what to do. if i resolve these errors how i usually would then it would result in a lot of NMS code changes that i don't really think are needed
making lynx decompile it and fix errors isnt a good decompiler
vineflower is a great decompiler :3
what about wineflower tho
lynxflower when
i mean im using decompiled mojang mappings to try to contribute
What about CabernetMC aka LynxPlayzMC aka Y2KMC aka InventoryPR aka 🍷flower
can anyone please help me out?
that is too much for these simply minds, they'd never understand
you can't just use the server jar like that anymore
Ik you say you have a life and all but my byte serialization and menu type PR are simply begging to be looked at 
if you don't need nms, that is, and you shouldn't, lol
your byte serialization impl is flawed
Well, I don't care about byte ser, it is deprecated for removal
shush, don't help them
🫡
Even after I changed it?
Who knows
😕 pain
send link
@Deprecated(forRemoval = true, since = "1.21")
I'm on phone lel
✨
look im new to this and watching some random vids on youtube 😭
youre saying that i wont need the api if i use maven?
okay
Mmm well I noticed yesterday I could cast the NBTBase to NBTTagCompound so I can compress it instead of writing them uncompressed
That's probably the "flaw"
i wanna see it too out of curiosity
just look at stash it should be like the top PR
I can't see it on my phone my password is too long
Faks
theres a craftbukkit hyperlink
yeah that's flawed
ah wait
but i am not legally allowed to help you runs
Back go step 1 I suppose still gotta figure this out properly
Idk I'm not allowed to look kekw
Bitbucket is unable to reset the password for your account because it is managed by a read-only external directory. Please contact your administrator to change your password.
wtf
oh well
idk come up with better names
idiot >:(
woah
😭 it is in UnsafeValues anyway
I KNEW IT

i mean, i have signed the cla
THIS IS WHAT AMERICA AND NO POUTINE DOES TO A CANADIAN
If my impl isn't good enough upstream it you clowns
SHOW ME THE NDA, EMILY
it's not really a legal matter lol
Shit
Sadly not my patch

rewrite papers to be yours then upstream it
I've been bested by the agreement very aptly described by its name!
phew, glad you didn't name the agreement there
Well I know my impl is flawed atleast
papermc lawyers were on the line
Time to start from square one back to draft pr 😭
lawysers
Well I'm not stupid!
lawyers?
Sometimes

lynx is breaking the lawy
im just a boy
from a poor family
are you tho
Okay there freddie
is it normal i sang im just a boy as im just a girl and from a poor family as fred

no that is brainrot
no it is not

it is culture
choco do you need your twitch whispers checked
Well you fix the decompile issues
are you talking to simon hypixel about bad stuff
The Mr. Simon Hypixel
John Hypixel, inventor of Hypixel
if that involves changes to multiple lines of NMS is that okay? fyi this is my first time contributing so, just trying to get a sense of how to do things right
John S Hypixel
yes, the file needs to compile first before you can make any changes
i mean, you can't contribute something if it doesn't compile, so, like, lol
If you edit more than one line in an nms file your PC explodes
watch me
Watch out
i'll just watch owen for that one
so thats why im replacing my pc everytime i open any of your projects

I actually do all of my projects on a 50 dollar early 2010s think pad
damn painting pays a lot
too expensive
3 hour compile time
It takes 50 minutes to compile but I can't be losing my main rig
john backflip, inventor of backflips
ok i didnt expect the gif to be that big
accused by witchcraft of william frontflip
Don't forget about John Burger he is very important character in American history
Inventor of the burger
shot himself
john doe
Rip John Deer
joe blow
john america
Wonder what he invented 👀
rust
kek
john rust
💀
and john rust the second
john go
john kotlin
@eternal night what's your minecraft favorite server software. Answer very carefully
john odin sounds kinda fire tho
john rad
nah its ginger bill
gotta be vanilla
whatever rust "I'll rewrite it trust me" project hsa the most stars on github
Wrong the correct answer Is CabernetMC aka...
shaking my head
my fav server impl is @sterile axle c one
I'd honestly trust a server impl in go more than rust tbhhh
idk if it was c or ++ or #
Plus the go server wouldn't be aids to write plugins for
my fav server impl is that kid who made a server impl in arduino cpp
damn
y2k make an 8bit server impl
imagine trusting a gc over no gc
That's probably not realistically possible
make it possible
I mean you'd Really have to cut down on things to make it possible
I'd have to do it in C or assembly too
go is more aids than rust
what error handling?
goofy ahh syntax
file, err := Open(path)
if err != nil {
return "", err
}
contents, err := Read(file)
if err != nil {
return "", err
}
return contents, nil
wha

not really all that powerful, but that is fine
the language is supposed to be dead simple to read
func SumIntsOrFloats[K comparable, V int64 | float64](m map[K]V) V {
var s V
for _, v := range m {
s += v
}
return s
}
what the fuck
Yea
rusts is simple
its great isnt it
it's unreadable in go

💀
brille fielmann?
like if you work with large codebases in go it just becomes very unreadable
the fuck are you talking about
it actually doesnt
half the code is error handling and returning
yea it is verbose, does not make it hard to read / unreadable
I'd argue the fact that you can see exactly what happens with each error is rather nice
it clutters the code a lot tho
instead of blindly throwing shit up the callstack with ?
i really like go just that's annoying
i love blindly throwing shit up
i love unwinding the callstack into eternity
just .expect it
just found out that if you hold shift and click reply, the ping author thing is off
expect just pannics 💀
only now?
once i've made my changes to CraftBukkit, how can i obtain a testable spigot jar, before making any PRs or commits to stash, so i can test if my stuff works. event api needs a bit of testing, so how do i go about doing this?
i don't think that's illustrated anywhere on any guide
compile it with maven maybe?
Well, you'd be missing spigot patches applied on top
You can't I always test with cb
I.make a cb plugin
Doesn't some maven plugin apply them automatically
wdym

yeah but what server jar do i run that on?
Use mvn package
And run the bootstrap jar
thank you!
Compiling spigot for the 1 extra patch 💯
hi guys
I want to make horses act like real horses, responding to the player with some delay. Like I go straight on a horse and when I try to stop, horse is still going straight some time
Do u have ideas how to make it?
hi,
my commands are lame...
i want to put color on them, is it possible and how?
thx for your time
Are you using a command library?
nope
Brigadier handles the argument colors
Brigadier + Commodore
Some other APIs for example Cloud have built in support
You can’t do it with the built in api tho
(just use a command library)
how to use the brigadier to make it have color?
by deep diving into an internal library and NMS, learning brigadier which isn't documented, and then doing it 👍
;-; sounds hard
Use a command library like what lynx said
but brigadier isn't documented
then use another command framework
like cloud or commandapi
the world is your oyster
k, i'll try
did anything happen to Particle.REDSTONE in 1.21?
api particle names align with the vanilla names now, so, that'd be dust
Hey,
I tried to make a command that spawns a npc on the current Position. I heared that in the 1.21 you need a ServerEntity to spawn the npc. I uploaded my code here: https://pastebin.com/BMLs1wuT In the marked section I Think I have done somethin wrong or missed something. Can anyone look through it? When I run this code nothing happens. I also not recive any errors.
~ @uncut grove
dang why did it have to be a breaking change...
There are a couple of those
compile against an older version if you want to keep backwards compat
I can use java 22 to make plugins right or do i need to use 17?
what mc version are you targeting
1.20.6
use java 21
Its saying my main class is never used. Im following a youtube video and i got exactly what he has but mine says that what is my main class is never being used
Main```package org.mopo.cowCannon;
import org.bukkit.plugin.java.JavaPlugin;
public final class CowCannon extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
getServer().getPluginManager().registerEvents(new EntityListener(), this);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
Listener ```package org.mopo.cowCannon;
import org.bukkit.entity.Cow;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
public class EntityListener implements Listener {
@EventHandler
public void onEntityRightClick(PlayerInteractEntityEvent event) {
if (event.getRightClicked() instanceof Cow) {
Cow cow = (Cow) event.getRightClicked();
cow.getWorld().createExplosion(cow.getLocation(), 2f);
}
}
}
nvm i figured out what it was, the run was set to current file and not running the actual thing
the fun part is that when i did this, i broke future compat
plugin i wrote for 1.16.5+ wouldnt work on 1.20.6 bc of renames
it was something with potions idr
i also already updated that code so i dont even have the old one that it broke :c
no VCS used bc its just a personal plugin for my smp
should always use vcs
all of my personal stuff uses git lol
I don't think I have a single thing that doesn't use it
I'm trying to get a location that is 2 blocks perpendicular to the midpoint of a line, I was wondering if there is an easy way to do this. I've attached a birds eye view example where the ? is the location I'm trying to calculate. Any ideas how I would go about this?
I hope that makes sense aha
https://imgur.com/a/vLxX7eX.png
Is there anyone here I could send some skript code to, I want to know if its possible to turn it into a plugin
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
If you want to hire someone ^^
one of my users said they have no logs folder, is this even possible? it's plain BungeeCord apparently
yeah I don't think Bungeecord uses a log folder
How can I put an item in slot 0 of a StoneCutter inventory
https://prnt.sc/r0X6Y9ve3niN this one
Have you tried getting the inventory and using the setItem method
Material#getKey
why not 17?
yea 21 is also lts so its just as nice if not nicer
Hi, I am using this code to overwrite the /msg, message, w, whisper... etc commands
It works, but after using /msg the next time i type in chat regularly i get kicked with this message
"Received chat packet with missing or invalid signature."
public void onOperatorSet(PlayerCommandPreprocessEvent event) {
String cmd = event.getMessage();
if (cmd.startsWith("/msg ") || cmd.startsWith("/tell ") || cmd.startsWith("/w ") || cmd.startsWith("/whisper ") || cmd.startsWith("/message ")) {
event.setCancelled(true);
Player target = MCMafia.getInstance().getServer().getPlayerExact(cmd.split(" ")[1]);
if (target != null) {
String playerA;
String playerB;
if (event.getPlayer().getUniqueId().compareTo(target.getUniqueId()) > 0) {
playerA = event.getPlayer().getUniqueId().toString();
playerB = target.getUniqueId().toString();
} else {
playerA = target.getUniqueId().toString();
playerB = event.getPlayer().getUniqueId().toString();
}
String identifier = "privateWhisperFrom" + playerA + "To" + playerB;
MCMafia.getChatManager().createChannel(identifier, "Whisper", "§3");
Channel channel = MCMafia.getChatManager().getChannel(identifier);
MCMafia.getChatManager().playerJoinChannel(MCMafia.getGame().getMafiaPlayer(event.getPlayer()), channel);
MCMafia.getChatManager().playerJoinChannel(MCMafia.getGame().getMafiaPlayer(target), channel);
Chatter chatter = MCMafia.getChatManager().getPlayersChatter(MCMafia.getGame().getMafiaPlayer(event.getPlayer()), channel);
Message message = new Message(cmd.split(" ")[2], chatter);
MCMafia.getChatManager().playerActivateChannel(MCMafia.getGame().getMafiaPlayer(event.getPlayer()), channel);
chatter.sendMessage(message);
}
}
}
Does anyone know why this is happening or how to fix?
It that a plugin? A Spigot bug? Vanilla bug? Or what? Because that's really funny
Use case: Refill your air tank for deep space exploration
villager got confused
Was it the villager or the totem that got confused?
how do i makea toggable command?
Do you mean rather a command that toggles something else?
It was c++ and it’s barely implemented
like when u type /pvp it says on and if u type it again it says off
Hashmaps and reverse operator
just a boolean
In that case just use gamerule command
Which is which
currently tryna figure out wtf is wrong with my byte serialization code
I love looking at mojangs code /s
You wrote it
😭
True
like I'm trying to figure out how the fuck this stuff works and its just like Codec<T, C, A , B , E>

you like that emoji huh
its solid I can't blame you
i do and yea it is great
wdym Codec only has two type parameters :kappa:
yeah but then you also have like the other stuff inside of it 😭
idk what they're all called
russian doll?
Russian nesting codecs
Dyanimc<T> or whatever
which does who knows what kekw
welp I think I was missing using DFU so I guess I will be looking at this shit all night
it holds the DynamicOps and a T so it stays within the domains of that ops
yep that went over my head Kekw
xd
dw I'll have it figured out by the weekend

mm hmm
((CraftServer) Bukkit.getServer()).getHandle().getServer() I love this
why is it deprecated
deprecating internals of your own patch???
interesting
I'm ngl I'm just staring at a Codec and datafixer rn and just being like yep hmhm and nodding.
common first reaction
I don't think I'm capable of doing this right now 😭 I'm just sifting through Dynamic and am like what the fuck is this, then I find myself like 20 classes in and confused as all hell
checks out
I mean, whatever you are doing, you won't need a full understanding on the composite nature that is codecs and data converter
Be smart, find places where this is already used for similar purposes in internals, copy paste, profit
Is DFU open source?
legally you can't copy minecraft code for cb patches because of the CLA :^)
Yeah
that's kinda funny cuz its almost nearly impossible to avoid some influence
It’s one of the things they OSed
again, you don't need an understanding of dfu
find where mojang uses it (for exactly the same purpose as you are)
I wish they’d OS the NBT system
because, surprisingly, items loaded in newer versions of minecraft are ran through DFU
aikar has contributed to dfu?!
How else would it get so over-engineered
dinnerbone
Nah if that was the case spigot would be more over-engineered
i'm not kidding lol https://github.com/Mojang/DataFixerUpper/graphs/contributors
Dinnerbone
9 commits 11,434 ++ 38 --
fry is the second biggest contender
Oh dinnerbone
@eternal night CraftLegacy carried me through all that
💪 now its time to make this not look like ass
monkaW
why are there two CraftLegacy classes lmao
one legacy layer wasn't enough
why is there 2
how can I check what ip address the server is hosted on?
InetAddress.getLocalHost()
oh nice
it doesn't say the port
but that's aight
I don’t think that will get you the public ip
it will not
I just had to get the local network anyway
it'll give you a private ip
for your public ip, this will work
private static String getIPAddress() throws IOException {
try(BufferedReader reader = new BufferedReader(new InputStreamReader(new URL("http://checkip.amazonaws.com").openStream()))) {
return reader.readLine();
}
}
true
I am going to code a plugin with Kodlin. I cannot add the spigot library to pom.xml, I get an error.
Can you help?
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
To the pom.xml project it gives an error while adding spigot library:
Dependency 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT' not found
1.8 is no longer supported. You need to build it using Buildtools
Likewise, other versions also give this error.
?paste your pom
what versions have you tried
I tried 1.19.4 but this is not the version I want, it is just for testing purposes and I want the 1.8.8 version
ConsoleApp.xml was not loaded into the project. Is this the problem?
run Buildtools for 1.19.4, then run it again for 1.8.8
Is there any easy way to send players between servers when they click an item in a GUI? I'm using bungeecord with 3 subservers.
?pmc
I can't solve the problem, it gives the same errors
at what point are you seeing errors?
I had a look at that but I couldn't really understand what it was getting at, I'm new to all of this sorry.
package dev.bingulhan
class sinhaprojesi : JavaPlugin() {
}
I wrote this to the project but I need to download the spigot library and I get a not found error while downloading
What is this?
Looking for a new developer on my minecraft server due to a recent resignation, dm me if you are interested or want more information.
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
how do you damage an entity? like deal a certain amount of damage
You can lower it's health by an amount
declaration: package: org.bukkit.entity, interface: Damageable
gotcha, thanks
iirc it increments half heart : 1
In version 1.8.9, right click on armor stand is not detected? I wrote a code with Kotlin and tried it, it didn't work.
There is no error in the plugin
It was working when I made a diamond block for trial purposes.
But it didn't work in the armor stand
Not sure if this is available in 1.8
declaration: package: org.bukkit.event.player, class: PlayerArmorStandManipulateEvent
?1.8 also is too old just update
Too old! (Click the link to get the exact time)
I know 1.8.8 is up to date, but there are things I need to do in this version.
That's not what I meant
I understand, so what do I do about it?
Why is it not detecting right click?
?
Isn't that for 1.21?
?tas
Okay .d
Did you actually register the listener
Yea
how can I read a org.bukkit.Location from a YamlConfiguration?
I saved it using YamlConfiguration and somehow YamlConfiguration#getLocation does not seem to exist
using
dependencies {
compileOnly("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")
}
Probably because you are using outdated api
Please update to latest
Newer features were added later
uhhh the spigot plugin im creating is meant for 1.12.2
Then you have to make your own location serializer
i see how it is
How so, is the server 1.12
Normally I’d see 1.8 or latest servers and none in between lol
yes
ever heard of mohist?
oh god
Bruh
whats wrong with it
its unstable, plugins and mods are inherintly incompatable that and it has before done fishy things with the essentials jar at runtime
Countless things are wrong with it
Mohist is also considered the “worst of its own kind” too if you know what I mean
Forge
Fabric
or is it just better if i do whatever im doing in a mod?
Just switch to one thing
Do either modded or plugin
trying to run mvn -P development clean install. on my local Bukkit proect but im getting a test error:
-------------------------------------------------------------------------------
Test set: org.bukkit.AnnotationTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.058 s <<< FAILURE! -- in org.bukkit.AnnotationTest
org.bukkit.AnnotationTest.testAll -- Time elapsed: 0.057 s <<< FAILURE!
org.opentest4j.AssertionFailedError: There 5 are missing annotation(s)
at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:38)
at org.junit.jupiter.api.Assertions.fail(Assertions.java:138)
at org.bukkit.AnnotationTest.testAll(AnnotationTest.java:100)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
can anyone point me in the right direction to resolve this?
Hey all, does anyone have an idea how to solve this? Or is this a bug?
java.lang.IllegalArgumentException: missing required data class org.bukkit.Color
This is because of the 1.21 update
More context
The test should tell you which method is missing annotations
If it's not here, it will be above. The methods and parameters are listed somewhere in the build log
But basically a method (likely you have) added is missing a nullability annotation either for one of its parameters or on its return type
This is related to a particle probably? But Kat's right. Need more context :p
hi, this is a really silly question coming from paper, but i can't seem to use Bukkit.getPluginsFolder() it just gives a 'cannot resolve method error'
.getServer
Bukkit doesn't have this method
darn
Thought we might be cool like that
your method
Doesn't have getPluginsFolder()
ah
Alternative would be yourPluginInstance.getDataFolder().getParent() and that should be the plugins folder
(getDataFolder() is protected though, worth noting :p)
so uh
what was that api
for text components
where you could make templates
and use them over and over
what's the different between handle[...]Event and call[...]Event inside CraftEventFactory. i've tried taking a look at some of the methods but i can't wrap my head around why certain events are named as call vs handle
I believe getFile is but getDataFolder isn't
Unless you mean a different kind of protected
am i missing something? it wont load keys that don't have values. https://pastebin.com/UpRj7TJw
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
?
give an example
what does teams contain
seems like a very chaotic strucutre
try properly organizing that first
then making a proper mysql setup shouldnt be that comlicated anymore
remember to normalize your db and follow all the Schema rules
public TitlesGUI(PlayerTitlesPlugin plugin) {
this.plugin = plugin;
this.titles = new ArrayList<>(plugin.getTitleManager().getTitlesMap().values());
this.pages = new HashMap<>();
initPages();
}```
So as setting titles to a new array list in the constructor, will this always reflect the current values of the map in titleManager?
public void updateTitlesList() {
this.titles = new ArrayList<>(plugin.getTitleManager().getTitlesMap().values());
pages.clear();
initPages();
}```
rather is it necessary to redefine the titles list every time in order to reflect changes of the values in titlesMap?
idk what the error is here, says Cannot resolve method 'stream(List<World>)'
getWorlds returns a list, not an array
Arrays.stream is a method that converts a T[] into a Stream<T>
What you want is List#stream
illusion I have another project for you to yell at
what
someone told me
to make text component templates
that I could reuse whenever I needed to use it
I downloaded the Timber mod but it doesn't appear in the mods section on the Aternos server. How can I add it?
https://hastebin.com/share/hegilelixi.css
I've been getting this same stupid error again and again. Can someone help?
I need an expert :)
It looks like you’re encountering an IllegalArgumentException with the message “Plugin already initialized!” during the startup of your Minecraft plugin. This exception typically occurs when a plugin is being initialized more than once. Here are a few steps you can take to resolve this issue:
Ensure Singleton Pattern: Make sure that your plugin’s main class is following the singleton pattern. It should only be instantiated once throughout the lifecycle of the plugin.
Check Constructors: Look for multiple instantiations of your main plugin class or other classes that should only be instantiated once. The stack trace points to CommandsPartOne and Main classes. Ensure that you’re not creating new instances of these classes in your code unnecessarily.
Review Plugin Enabling Process: The error occurs during the onEnable method. Review this method to ensure that you’re not performing any actions that would lead to re-initialization of the plugin.
Update Dependencies: If you’re using external libraries or dependencies, make sure they are up to date and compatible with the version of the server you’re running.
Check for Conflicting Plugins: Sometimes, other plugins can cause conflicts. If you recently added a new plugin before this error started occurring, try removing it to see if the problem persists.
Server Version Compatibility: Ensure that your plugin is compatible with the server version you’re using. The stack trace mentions paper-api-1.21-R0.1-SNAPSHOT.jar, so your plugin should be compatible with this API version.
I can provide you the code, its a custom made plugin
no, only one
send code
which one do you want
yes.
which includes classes:
- CommandsPartOne
- FeedCommand
ok
package com.lexplugins.plugin;
import com.lexplugins.plugin.commands.CommandsPartOne;
import com.lexplugins.plugin.commands.FeedCommand;
import com.lexplugins.plugin.commands.InvincibleCommand;
import com.lexplugins.plugin.listeners.JoinLeaveListener;
import com.lexplugins.plugin.listeners.LeaveBedEvent;
import com.lexplugins.plugin.listeners.SheepShearListener;
import com.lexplugins.plugin.listeners.XPBottleBreakListener;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerBedLeaveEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public final class Main extends JavaPlugin implements Listener {
@Override
public void onEnable() {
// Plugin startup logic
Bukkit.getServer().getConsoleSender().sendMessage("Plugin booting up...");
Bukkit.getPluginManager().registerEvents(this,this);
Bukkit.getPluginManager().registerEvents(new XPBottleBreakListener(), this);
Bukkit.getPluginManager().registerEvents(new SheepShearListener(), this);
Bukkit.getPluginManager().registerEvents(new JoinLeaveListener(), this);
Bukkit.getPluginManager().registerEvents(new LeaveBedEvent(), this);
getCommand("invincible").setExecutor(new InvincibleCommand());
getCommand("suicide").setExecutor(new CommandsPartOne());
getCommand("feed").setExecutor(new FeedCommand());
}
@Override
public void onDisable() {
// Plugin shutdown logic
Bukkit.getServer().getConsoleSender().sendMessage("Pluggin shutting down...");
}
}
also on an irrelevant note, only the main class can contain the onEnable() and everything else can't have it or else it will break right?
so this is the main class
yup
yes. thanks
did you decipher the problem?
send CommandsPartOne code
roger
package com.lexplugins.plugin.commands;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class CommandsPartOne extends JavaPlugin implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player p) {
p.setHealth(0);
p.sendMessage(ChatColor.RED + "Man, you used /suicide... What did you think was going to happen?");
} else if (sender instanceof ConsoleCommandSender) {
Bukkit.getServer().getConsoleSender().sendMessage("The console ran the command.");
} else if (sender instanceof BlockCommandSender) {
Bukkit.getServer().getConsoleSender().sendMessage("The command block ran the command.");
}
return true;
}
}```
** extends JavaPlugin **
^
see the problem?
Also there's no reason to be logging
You're only performing operations if the sender is a player
So you can remove all the useless else / else ifs
hehe im following a tutorial
so it like
showed us how to log entities other than players
thats why :)
Also Bukkit.getLogger() exists
and i always run into errors because i try to do some stuff a little bit different from the tutorial
instead of getServer.getConsoleSender
then someone told me to use bukkit.getServer().getConsoleSender
kek
ALEXA WONT STOP FARTING
@worthy yarrow
Bukkit.getServer().getLogger().sendMessage("The command block ran the command.");```
.sendMessage is not valid there, if i use .getLogger
thats just extra work + bukkit.getLogger lets you choose a level ie: #severe("error message here")
press . after getlogger
aren't you supposed to use your own logger and not the bukkit logger?
and see your choices
Supposed to but for the sake of not doing consoleSender kek
Bukkit.getServer().getLogger().warning("The command block ran the command.");```
do i use this?
.warning is the closest to .sendMessage
sigh
oh severe
it's just a logging level
aren't loggers a basic concept in java
Idk at this point
intermediate?
well im not intermediate at all
I'd call logging a basic concept unless you want to make it complex
Bukkit.getServer().getLogger().severe("The command block ran the command.");```
so this just gets the server. gets the thing/logger which is trying to send the command, then what type to send
well, begginers usually use System.out
loggers are something more advanced
I use sout for debugs most of the time, but thats debugging I suppose
you can just use Bukkit.getLogger btw
but you should be using your plugins logger
getLogger().debug()?
i just want to print a message to the console 😭
.severe / .warning / etc, is just a level of logging, you know when it outputs in console "info: xyz | warning: xyz | etc
its not that hard
whats wrong with using
Bukkit.getServer().getConsoleSender.sendMessage("hi hello this is a message")
everything...
how to enable spawn entities ?
i mean 1.19.4 feature holograms,items
how to use the plugins logger?
wdymm :((
and lets see whether we'll have to call ?di
kek
<main_class>.getLogger()?
uh
sigh
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! 🎉
It's also not that we can't help you it's rather just that spoonfeeding you is not going to help teach anything
i only learnt java absolute basics, like i can make a very very simple number guessing game thats it
So then go learn it better
but i didnt know you have to learn java to the point you can build spaceships to learn minecraft plugin development
Well when you put in those terms, you're not even at a level where you can build a fire with java
So just take the time to learn the language before you attack an api
how good do you think someone should be before learning api's like spigot/bukkit
knowing what dependency injection is and how to operate a logger
At least know basic principles
When you say basic, you probably mean you know 6 total operators and thats about it
This isn't really even what you can call a level
You need a foundation of the syntax at least before trying to use an api
once you can write me a mapping file that changes net/minecraft/util/math/MathHelper to net/minecraft/util/math/Meth come back (that's a joke btw)
MethHelper
lmao
oh btw, for all the fabric users
mappings loom.layered {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
mappings project.file("meth.tiny")
}
``` worked last time I used it
chatgpt ass response
wait i was joking but this is actually just chatgpt lmao
e
@dusty herald
the error is gone now thanks to you :)
i removed the "extends JavaPlugin" in the CommandsPartOne
also can someone tell me why i get this warning all the time
[14:51:07 WARN]: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "org.bukkit.Server.getTPS()" because "org.bukkit.Bukkit.server" is null
[14:51:07 WARN]: at org.bukkit.Bukkit.getTPS(Bukkit.java:2374)
[14:51:07 WARN]: at com.destroystokyo.paper.gui.RAMDetails.update(RAMDetails.java:62)
[14:51:07 WARN]: at com.destroystokyo.paper.gui.GuiStatsComponent.lambda$new$0(GuiStatsComponent.java:27)
[14:51:07 WARN]: at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:311)
[14:51:07 WARN]: at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:243)
[14:51:07 WARN]: at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
[14:51:07 WARN]: at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
[14:51:07 WARN]: at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
[14:51:07 WARN]: at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
[14:51:07 WARN]: at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
[14:51:07 WARN]: at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
[14:51:07 WARN]: at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
[14:51:07 WARN]: at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
[14:51:07 WARN]: at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
[14:51:07 WARN]: at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
hi, if i export my project with plugin.yml containing some commands info(i am making a custom command) does a folder called NameOfMyPlugin containing the command config get created?
paper
?whereami
owh so i can receive help on their server not here
lmfao what the fuck
?
The error message is a lil funny
real
guys how do i set worldguard flags with my plugin?
Tf is this, do you have some plugin that creates GUI
maybe the default server gui?

