#help-development
1 messages · Page 1045 of 1
Oh didn't know that, that's nice.
i tried this
@EventHandler
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
org.bukkit.block.Block clickedBlock = event.getBlockClicked();
if (event.getBucket() == Material.LAVA_BUCKET) {
new BukkitRunnable() {
@Override
public void run() {
if (clickedBlock.getType() == Material.LAVA) {
clickedBlock.setType(Material.AIR);
}
}
}.runTaskLater(Main.getInstance(), 15 * 20);
}
}
but it is not work with me
@summer scroll
@young knoll
Logic error
You need to get the block where the lava is placed.
In that event you can get the block and the block faces.
you mean this event.getBlockClicked().getRelative(event.getBlockFace() ?
The lava is not placed on the clicked block.
That's right!
but i already try this now xd
but not work
event.getBlockClicked().getRelative(event.getBlockFace()).setType(Material.AIR);
}
You can format the code using in discord with this btw
put java too in the formatting
Can I get your full code please?
@EventHandler
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
if (event.getBucket() == Material.LAVA_BUCKET) {
new BukkitRunnable() {
@Override
public void run() {
if (event.getBlockClicked().getRelative(event.getBlockFace()).getType() == Material.LAVA) {
event.getBlockClicked().getRelative(event.getBlockFace()).setType(Material.AIR);
}
}
}.runTaskLater(Main.getInstance(), 15 * 20);
}
}
sure!
Store the block in a variable so it's easier to read, also maybe you can debug the material type of the block.
You need to make sure if the task is even called.
@EventHandler
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
org.bukkit.block.Block block = event.getBlockClicked().getRelative(event.getBlockFace());
if (event.getBucket() == Material.LAVA_BUCKET) {
new BukkitRunnable() {
@Override
public void run() {
event.getPlayer().sendMessage("wlc");
if (block.getType() == Material.LAVA) {
block.setType(Material.AIR);
event.getPlayer().sendMessage("done!");
}
}
}.runTaskLater(Main.getInstance(), 15 * 20);
}
}
the first message was sended but the message that in if block doesn't sended.
@summer scroll
That's nice, now you know that the task is called and running properly, now debug the material type of the block, so debug the Block#getType
yea
the problem come from gettype method
i will try
So on your code above, the block is before the lava is even placed, so it will be Air if I'm not wrong
There is block, and blockClicked, I don't know what's the difference.
but when i remove the condition of getType the code is work
What does the getType says?
not says anything
but i tried to remove it
and try
and it is works
@EventHandler
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
org.bukkit.block.Block block = event.getBlockClicked().getRelative(event.getBlockFace());
if (event.getBucket() == Material.LAVA_BUCKET) {
new BukkitRunnable() {
@Override
public void run() {
block.setType(Material.AIR);
event.getPlayer().sendMessage("done!");
}
}.runTaskLater(Main.getInstance(), 15 * 20);
}
}
Interesting, can you maybe try to debug what is the type?
Like debug the block.getType() in the task.
But you need the variable block inside the task.
Because what you have here is not ideal, if player places something in the lava for example diamond block, it will be gone.
@exotic obsidian it's working fine on me, as long as you assign the variable inside the task.
@EventHandler()
private void onBucketEmpty(PlayerBucketEmptyEvent event) {
if (event.getBucket() != Material.LAVA_BUCKET) return;
// Start the task to remove the lava
Executor.syncLater(60L, () -> {
Block block = event.getBlockClicked().getRelative(event.getBlockFace());
// If the block is lava, remove it
if (block.getType() == Material.LAVA) {
block.setType(Material.AIR);
}
});
}
new BukkitRunnable() {
@Override
public void run() {
org.bukkit.block.Block block = event.getBlockClicked().getRelative(event.getBlockFace());
if(block.getType() == Material.LAVA) {
block.setType(Material.AIR);
event.getPlayer().sendMessage("done!");
}
}
}.runTaskLater(Main.getInstance(), 15 * 20);
@summer scroll i think there's a joke xd
Yes like that.
i know but it is not works
Hmmm, not sure then.
wait i think i found the solution
What was it?
nah
i try to change the name of class because the name of class is the same as the block variable definition so i was thought there is confusing.
Bro what, don't tell me your class name is Block
I mean it should work regardless right? lmao
yup
i want u to try something
the code ur sended above is works with me
when i changed the timer
in the beginning was 15s right? i tried to put it 3
and it is works
but when u try number above 3 it is not works u can try
@summer scroll
I'll try 15 seconds.
Make sure to help someone in the future
You're welcome!
Custom items coding and Add Custom Texturen help ?? Video ?
is any devs here doing a project for free? im looking to build a dev team for my server yeah head dev is still open please dm me if anyone is interested
?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/
Does anyone know ow a way to check how long right click is held or smtn like that
Pls @ me In the response
Hi, I'm starting a petition to remove the debugging phase from the world. React with a + if you agree
what debug phase
any software debugging work
just think about a world without debugs
what are you on about
Using blockbench with spigot ??
how do I use blockbench with spigot
You use one of the existing plugins (model engine mainly) or make your own
Actually model engine I think only works on paper? Might wanna double check that
why use model engine 
hey, i want to disable the ender dragon spawn
i just canceled the CreatureSpawnEvent
however, the bossbar still apears
is there a way to remove it?
you can just use custom model datas
how i verifiy if main thread is blocked?
I have a method that goes through many locations and I feel that the server "crashes" at that moment, so I assume that the thread is being blocked
If I've got config file with format
data:
somekey: 1
otherkey: 2
thirdkey: 3
How can I get a list of those second level keys? e.g. a list of somekey, otherkey, thirdkey. I don't need their values
this method runs through 10x10x256 locations
getSection(data).getKeys(false) smth like that
You can use spark or something
Oh thanks, I was trying to use getStringList on data lol
Or standard java profiling tools
I don't know how to see in Spark if the thread is being blocked at that moment, but I'm sure it is blocking.
You can send link here
hi guys, I'm trying to make a plugin for guards but something went wrong and they don't attack entities, I'm attaching the code below
https://pastebin.com/2TFm7uzP
What debugging have you tried
me?
use ModelEngine
and bedrock entity model
if i do this and the server crashes a few seconds later, and auto-save was not called, this line of code will have no effect. correct?
this shouldn't cause the server to crash lul
this code to create custom potion effects does not work :
but the item is not changing still same ..
THIS IS HOW IT LOOKS LIKE :
no lore , no potions , no enchantments(for weapons , armors , tools) is working ..
Idk how your code looks, I do not remember doing anything with potions myself
But the PotionMeta seems sus, you might be replacing the previously modified ItemMeta with it ?
Are you ever applying the meta
yes
the name is changed to &eSloth Potion so the item meta is set successfully
i have been trying for 2 day's now
idk what's wrong
this is how it should looks like
in the config file
any help will be appricated ❤️
potions , lore , enchantments and also the amount seems to not working?
only name and material do work
I would recommend just creating some random command to test if you can create an item normally, as a sanity check of a kind ig
thanks
I would also check if you somehow modify the items in your list after creating them.
'cause I can't find anything wrong with your ItemCreator
??
I did not say that
you were asking, and I answered
;)
simple words: that piece of code should indeed not crash your server
yeah me too
[11:23:17 INFO]: Potion Effect: SPEED Duration: 60 Amplifier: 2
Try using that method to give a player those items isntead of whatever you're doing with them.
That does not mean the item is correctly modified, that is just your debug.
You'd have to print the item instead.
To be sure the item is correctly created.
After the setItemMeta just print out the itemstack
Just itemstack is enough
I mean, the print method calls toString on its own if you pass an object.
Do keep me updated
So you're most likely modifying the items- what
i don't think so
You mean the whole thing works or.. ?
it just not showing it here :
so when itry to remove it it open a menu
without lore , etc etc
when i give it to my self
it works
Great, congratz on moving further with your problem :)
. . . how.. how does your createButton method work ?
I see it takes in the name and type............
hi guys, I'm trying to make a plugin for guards but something went wrong and they don't attack entities, I'm attaching the code below
https://pastebin.com/kmYhjb3m
can somoane help
i want to make my own custom reipe with custum in and output item
ik what was wrong .. it was creating new itemstack
hello, just wondering if anybody knows how to make java like chest ui, even tho bedrock users use pocket ui?
just like this.. ive been searching for a long time for this but seems like i cant find anything (edited)
- eww loot boxes
- tell your users to switch the UI
- I'll be surprised if I see you getting any support here
That is a slight pain in the ass
Tho I have to say, I like the centered text there
yeah that looks good
some recommended me use crossplatform but,, its only use bedrock forms thho,, but its not like to use/force classic ui,, cause bedrock pocket sometimes messes the plugins menus
the fuck is that supposed to mean
Bedrock forms are.. complex
You can, for example, use geyser's api to send a form, which is alright
But geyser only added API for like 10% of all functionality
If you want more than that you need to use Json-UI
And Json-UI is complex and not that many people know it
It does let you do things like these
that can be easily done in java too
this form??
Yeah
i mean that form can be done to java too?
Java doesn't have forms
You'd need to have a regular menu on java and a custom form on bedrock
i guess i sould use cleshlike ui then on java while forms on bedrock
Up to you
i just want to be as possible not messing the plugin menu while i use bedrock tho,, the menus is inspired by this server
**95.216.228.73:25567 ** https://builtbybit.com/resources/premium-survival-setup-nitrosetups.27760/
even tho bedrock players use pocket,, the menu is still java-like chest ui
i wonder if it has any of the plugin but they said in the post the only use deluxemenu
not everything though
bedrock allows for a lot more
but the scene is incredibly underdeveloped
haven't played bedrock in ages
why are buildtools creating a 1.20.1 jar when i select 1.20
because it's practically the same
i see, thanks
does anyone know how i can make a text display entity smaller and remove its background?
Set the background color to something with 0 alpha
And use the scale part of the transformation
ty
?learnjava
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! 🎉
?
¿
¿?
do u guys know how to solve this problemt java.lang.NullPointerException: Cannot invoke "net.minecraft.server.network.ServerGamePacketListenerImpl.latency()" because "player.connection" is null
happening here
ServerGamePacketListenerImpl packetListener = serverPlayer.connection;
packetListener.send(ClientboundPlayerInfoUpdatePacket.createSinglePlayerInitializing(npcPlayer, false));
packetListener.send(new ClientboundAddEntityPacket(npcPlayer, 0, blockPos));
i need check 25000 locations if has a block on db. any alternative?
add them to a list and do a contains check? idk what you expect here, that's a lot
The provided connection is null
?xy btw
cupboardarea have 25000 locations
^
and it seems to be blocking the main thread because when I undo it, at that very moment the server "crashes" for a few milliseconds
that what exception says ik, but im executing command as a player and as a player im surely connected to server
500ms for the method to be executed
runTask then?
okay and that's not bad for 25k locations 
what would that do?
db async ahah
not run it on the main thread
youd have to check the nms mappings, to see what function returns what, and if the provided serverPlayer is not null
location.getblock.settype is possible on secondary thread?
what
not on an async thread
You can't do any mutation asynchronously on another thread
then how i make on async thread
for no "crashes" the main thread
?workdistro
we literally just said it's not possible on an async thread..?
changing anything in the world, usually cant be done async afaik
you said to use bukkit.runtask
ok?
that aint async
that's not async
So what would you use this for?
or #runAsyncTask()
Are you saying to make a scheduler that checks locations little by little?
you didn't understand how tasks work
then?
?workdistro

I've sent this three times already 😭
im seeing
from what the topic title says, it says that it is using several threads to do this video
It's asyncrhonous still because the tasks don't occur at the same time
yes
bump
Nump
just pointing out that async != multithreaded because they seem to believe that is the case
I was just intending to point out the differentiation on how you can have async without multiple threads
ok ok thx
hello, im updating 1.8.8 plugin to 1.20.1, it does not recognize "minecraft" library, I tried to remap spigot 1.20.1 jar, but does not work for some reason, can someone please help me?
depend on spigot not spigot-api
where do i get spigot-api? (im fairly new to java, so im sorry)
its in gradle..
looking for a fairly simple and tiny xml parsing library for java
with deserialization and whatnot
don't use the jar
so i should just delete the .jar?
It's deprecated
wasn't it deleted
nop
that's dum
what ths makes
?
import BB?
is of bukkit api
yeah? i don't get your problem
bukkit api 1.8.8 not have boudingbox class
dont use 1.8 api
?1.8
Too old! (Click the link to get the exact time)
I need to know what this does first
add the compileOnly 'org.spigotmc:spigot:...', not spigot-api
@blazing ocean max on this case, the coordinates are 10,0,0 and min the coordnates are 0,0,-10. right?
I thought you knew about the current api
and you can just impl that yourself easily 
BROOOOOOOOOO
you can literally just go to current bukkit source and copy the class
HOW AM I GOING TO IMPL IF I DON'T EVEN KNOW WHAT THAT CODE DOES?
yeah lmao
by reading the current code?
I AM ASKING WHAT TO DO TO JUST IMPLEMENT MYSELF
yeah i was just about to tell you
step 1 is to chill the fuck out
HOW I READ THE MAX COORDINATES?
I can't find it on Google
yeah and that for all 5 other ones
maybe be this
please for the love of god don't inline those
remove those includeGroup and run buildtools again
?mappings btw
Compare different mappings with this website: https://mappings.cephx.dev
?nms i meant
same thing
it's just ugly
tastes are personal
`Total Time: 4 minutes 43 seconds
Success! Everything completed successfully. Copying final .jar files now.
Copying spigot-1.20.1-R0.1-SNAPSHOT-bootstrap.jar to C:\Users\user\Downloads\spigot-1.20.1.jar
- Saved as .\spigot-1.20.1.jar`
its still the same tho (i opened intellij after it was comepleted)
Replace the - in spigot-1.20.1 by a : in your buildscript
so it should be compileOnly 'org.spigotmc:spigot:1.20.1:remapped-mojang'
?
try
Yeah exactly
the structure looks like this group-id:artifact-name:version:classifier
still...
does anyone know if the spigot way of serializing/deserializing data also saves pdc contents?
sorry I mean specifically for itemstacks
I was using base64 but people were asking me to switch
How does it look now and do you have the remapped-mojang jar in your local maven repo
how can i send my code for help
?paste
it does (if you are talking about BukkitObjectOutputStream bs)
so it should preserve all data like base64 does right
omg this is so fun
well idk how you create the b64
wrong channel
I'm talking about itemstack.serialize and then itemstack.deserialize
Well yea, but that method is used both for MemorySection#set and for BukkitObjectOuputStream
https://paste.md-5.net/anepenitaw.java dont look add my comments
alright I just needed to make sure it preserved everything because the whole point is to save items modified by other plugins so they're frequently loaded up with pdc data, thanks
👍 (|| required disclaimer that bukkits item stack storage stuff is less than idea and is known to break on version upgrades|| )
if i use any give cmnd but then i get in chat the command peinted
what
i have this in my class:
import net.minecraft.server.IChatBaseComponent; import net.minecraft.server.PacketPlayOutChat;
why does it say "Cannot resolve symbol 'PacketPlayOutChat'"?
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
PacketPlayOutChat is spigot-mapped, but you have mojang mappings
isn't it 1.20.1-R0.1-SNAPSHOT
hi, how can i use getConfig() to save data?
?paste
?paste
lmfaoo
hey guys, i was looking for some advice on some good practice
i have some location data that i want to story in a yml file, sort of like homes
should i load it into a map so it's in ram? or should i read directly from the file when i need to access it?
YamlConfiguration already loads it into a map
But there's no reason not to have your own map as well
okay, ill research YamlConfiguration
haven't really done much with serialization yet
good learning opportunity
hm am I doing this wrong somehow? never tried to do it via spigot before (ignore the method names I'm in the middle of changing it)
public static Map<String, Object> toBase64(ItemStack itemStack) throws IllegalStateException {
return itemStack.serialize();
}
public static ItemStack itemStackArrayFromBase64(String data) {
try {
YamlConfiguration yaml = new YamlConfiguration();
yaml.loadFromString(data);
return yaml.getItemStack("");
} catch (InvalidConfigurationException e) {
throw new RuntimeException(e);
}
}
[16:35:13] [Server thread/WARN]: java.lang.RuntimeException: org.bukkit.configuration.InvalidConfigurationException: while parsing a flow mapping
[16:35:13] [Server thread/WARN]: in 'reader', line 1, column 48:
[16:35:13] [Server thread/WARN]: ... RON_CHESTPLATE, meta=ARMOR_META:{meta-type=ARMOR, lore=[{"text": ...
definitely not happy
oh is it because it doesn't like the way it's a string? probably is isn't it
this is what i use
public static ItemStack itemStackFromBase64(String data) throws IOException {
try {
ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(data));
BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
return (ItemStack) dataInput.readObject();
} catch (Exception e) {
throw new IOException("unable to decode:", e);
}
}
I'm switching out from base64 based on user feedback
I do have it working with base64
ahh
i read somewhere sometimes enchants dont deserialize properly but i havent had issues so far
nah I definitely messed up forgot how I structured this in the backend, I should not be passing this as a string
oh hey think I got it
what does that mean? : [Spigot Watchdog Thread/INFO]: Startup script './start.sh' does not exist! Stopping server.
i would assume, that the startup script './start.sh' does not exist and therefore the server has been stopped
you presumably attempted to /restart
how can i find out what the actual startup script is?
I would like to get the village Position from
/execute positioned 0 0 0 run locate structure #minecraft:village but that only returns the distance using store result.
Is there a way to get the raw console result so I can parse The nearest #minecraft:village (minecraft:village_plains) is at [24, ~, 24] (500 blocks away) using Bukkit code?
I'm using Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), to run the command.
use the api instead?
any1 know how to detect how long somone holds right click
tyvm
?paste
can you please stop doing that randomly, same with ?learnjava, #bot-commands exists for a reason
when did i do that lol
you just randomly do ?learnjava
and double ?paste
especially annoying because it floods the chat with a wall of text
And what is it about you
hey, @echo basalt hoping you could share the link to me,, tutorial on how to make this
I do whatever i want if its not against rules
you should shut your mouth up and not talk anything you see
Whevener i start to say something you appear like a cucumber
lynx based
i asked you nicely to stop lol
?learnjava
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! 🎉
since when is it so long lol
is it funny
no
it actually is yeah
the first filter is whether people have the patience to read that whole thing
it's really not long
tiktok attention span go brr
I often times can't get people to read 7 words
i ain't reading allat
it should be a 5 second long tiktok video that shows a timelapse of learning java over 10,000 hours, sped up
I think this is what the matrix movie was about, it's been a whle since I've last seen it
5 seconds is too long
not if you add a subway surfer gameplay
still too long for my liking
damn you're in too deep
if you say so 😳
Does anybody know which constructor corresponds in 1.20.1 to this 1.17.1 NMS constructor?
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
ClientboundPlayerInfoUpdatePacket
I think, I don't really use that website
thx
congrats
Relatable
thanks
hi, wonder if you guys know how to connect old bedrock plpayers even tho geyser only support 1.20.80 now at the minimum
why
hashmaps ✨
did
Why doesn't InventoryClickEvent fire on armor equip (by placing the armor piece)?
player inv is client side
How tf would that work
your plugins are running on the server, if the server doesnt know about something (it happens client side) then there is nothing the server can do
No, he is not asking about what client sided means or anything, he is asking you wtf you are sayinf
equiping armor is serverside but not the process of clicking it in the inv
Only the creative inv is client-side iirc
yes
Everything else is handled on the server
that's right
Minecraft is a server bound game
maybe it's 1.20.1 spigot error then
Any other plugins on ur server?
is there a way to upload my own plugins?
Wdym
to spigot website
how
Are you 7, 70 or why can you not navigate a basic forum site
By making an account and creating a resource
i found it 💀
anyone an idea?
how are you able to get the data but not the block?
since WallSign is a data type
not a block
right?
yeah, ik, when i'm using the normal Sign class it works for Oak Wall Signs, but not for other variants
@sullen marlin explain yourself
jira is probably the better place
Though, what the the inheritance hierarchy differences between the classes?
is there a way to apply a punch enchantment to a shot arrow?
i'm new to kotlin, any idea why?
Cause primitives can’t be null.
Objects can.
this is the whole kotlin string/java string thingy
okay... fixed it somehow, idk what the problem was 🤷♂️
anyway thx for the help 👍
its nice but not yet xd
anyone willing to help me debug something to do with my .yml file clearing upon server reload?
not sure how to fix it
getString()!! no null assert it

what
what if it's null
just ?: error("node is not found")
don't NPE it
that's bad for users
Before reload, these test places are fine and are showing up okay
after reload, they're gone from the GUI, but not the yml
Reload or restart?
Sounds like you're not loading them
Probably a list being cleared.
i'm loading them, but im not really sure where it's going wrong
i'll send my PlaceManager class
i run this every time on server startup
is there an event for finishing the game?
as in end portal?
maybe that or just killing the enderdragon for the first time
this animation
idk
i guess just the entitydeathevent
respawnevent triggers when you leave the end portal
you can check the players stats and if the player has killed the ender dragon
on entityDeathEvent would work just check if the entity is the ender dragon
okay thanks
yea jk

Hey, I just read this message and managed to reduce some usage (translated: massive caching). What do you think now?
I really appreciate your help and advice, thank you 🙂
with the same processor :O
(btw they are just bots)
lmao, and same amount of ram
ow, 6600
wanna split that 900 difference between the two GPUs? lmao
wait we're even using the same amount of ram
how tf you've 80gb of swap
Memory(swap)
71.9 GB/81 GB
is it because the size of partation? the server was on my desktop and my c drive has 128gb
maybe thats the reason
I don't really know haha, sounds very high
does anyone know how I could download a newer java version on an aarch linux?
yay -sS jdk
and archlinux-java ftw
looks good enough
yay: command not found
It's best learnt in practice
Google your question before asking it:
https://www.google.com/
then you'd have yay installed by now
pacman :nodders:
what did you do 
no idea what any of this does
do uname -a
dpkg ain't a thing on arch
and if pacman also isn't a thing that's not arch
I mean u aren't using debian based distro lol
Linux alixsystemtests 5.15.0-102.110.5.1.el8uek.aarch64 #2 SMP Sat Jun 10 18:23:55 PDT 2023 aarch64 aarch64 aarch64 GNU/Linux
you said archlinux
kinda
so how do I install a newer java version?
erm yea i missed that a
he literally said aarch
since I need like 22
im fucking blind ok
same
what distro you running
I'm pretty sure Debian
hello kitty linux
once guy once showed me how to check that
debian has dpkg
but I forgot how
cat /etc/os-release iirc
some people told me otherwise
literally first google result 
I have no opinion since I have no idea about any of this
oracle 
they did this
i just read arch and my brain goes to neofetch and then turns off
hey quick question what is the smartest move to disable a plugin when database com fails bc the rest of the plugin depends on it
throw an error in initialiser
Or just call the disable method in plugin manager and safely abort the startup of your plugin
plugman vibes
I did this sudo dnf install java-latest-openjdk.x86_64
but uh
65.0 bytecode versions are still unrecognized
make sure to run it with the right version
^^^
wdym?
I just start jars with -java
do which java
/usr/bin/java
on arch they bins are located under /usr/lib/jvm/.../bin/java
idk how it's on fedora never used it
and java -v?
does /usr/lib/jvm exist
then use that
Are you trying to run a mc server but your new java version is not recognized by your server?
sounds like it
pretty much
use direct file path
that's what i said
Why doesn't he just specify the path to the executable file (on win java.exe on linux I think just java) instead of java at the start
use direct file path
what does that mean?
wait you might need to use direct file path!
use the direct path to java.exe not just java
java.exe
fedora 
java for linux nerds
when you just type java -jar shit has to traverse your PATH to find a java binary on your machine
why can't I just upgrade the jdk?
if the first java binary found is the 19 one, you use the 19 one
remove the old one
to circumvent that, you just full specify the path to the java 21 binary
i always prefer having everything installed or just docker
which one
dockerised mc >>
the one you just installed
ohh
but wasn't there a way to dynamically switch the used java version on linux?
Well but changing around your path or by using symlinks
idk on fedora
but I am not well enough versed on fedora yea
but arch has archlinux-java and debian has alternatives-list or something
update-alternatives is debian iirc?
ah yea that
I wonder what even defines default java on linux? Is it PATH or JAVA_HOME or something different?
depends ™️
path usually iirc
yea everybody just does their own shit
U should just use sdkman on Linux

sdkman on debian, sure
Docker best
what no
Not a big fan?
use the direct file path as four people told you 
I mean, why use sdkman when you could be on an OS that has the AUR
at least actually uninstall it, not just rm -rf the directories it uses 
but like
I use Fedora. I don't like arch too much maitainence time for me
to which java exe
Are there some kind of HashMaps that supports weak values instead of weak references?
Yes
See their MapMaker
cool
tree fiddy
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
?learnjava
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! 🎉
Can any people help with a plugin? im new to coding and i dont know how to fix this
"
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = event.getEntity();
for (ItemStack item : player.getInventory().getContents()) {
if (item != null && item.getItemMeta() != null && "Atlas Totem".equals(item.getItemMeta().getDisplayName())) {
int uses = totemUses.getOrDefault(player.getName(), 0) + 1;
if (uses < 10) {
event.setKeepInventory(true);
event.setKeepLevel(true);
totemUses.put(player.getName(), uses);
} else {
totemUses.remove(player.getName());
}
break;
}
}
} "
?paste
Paste there please
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = event.getEntity();
for (ItemStack item : player.getInventory().getContents()) {
if (item != null && item.getItemMeta() != null && "Atlas Totem".equals(item.getItemMeta().getDisplayName())) {
int uses = totemUses.getOrDefault(player.getName(), 0) + 1;
if (uses < 10) {
event.setKeepInventory(true);
event.setKeepLevel(true);
totemUses.put(player.getName(), uses);
} else {
totemUses.remove(player.getName());
}
break;
}
}
}
Error is?
yes
Thats not an error?
weird
Whats the error, not is there a error
stacktrace?
go to your console and copy the big error that gets spit out
?
k
"cannot find symbol"
The entire error...
brother
sounds like the spigot jar isnt being included in the plugin tho
im sorry im new
how would he compile then
No stack trace?
But you don't know how to copy/paste?
ooo that cosole
...
....
sorry
np
I don't wanna do it, do you bedless?
ooo k
It's a different thing
not to do with helping you
Rather a spigot inside joke if you will
malformed pom?
and wen i was compile it i got this "class AtlasItemsPlugin is public, should be declared in a file named AtlasItemsPlugin.java"
can you send a ss of your project struct and your main class?
Ye'
you can format it better like this
World world = Bukkit.createWorld(new WorldCreator(String.valueOf(player.getUniqueId())).type(WorldType.FLAT));
after a server restart the world kinda dissapears, i cant access it anymore using /world <name of world>, any reason for this?
are you saving the world on shutdown?
I need help, java.lang.NoClassDefFoundError: net/minecraft/world/entity/player/Player using NMS
no?
You need to run that each time so the server knows to load it
then im creating multiple worlds though no?
Not if the name is the same
not if they got the same name
also idk how that would work since i cant really store every players uuid, etc
The method is really loadOrCreate
I doubt you want 10000 worlds loaded all the time
i could probably just get all files in the container then ig and load like that
ok thanks
How many worlds are you loading....
One for each player that's ever joined your server is a terrible idea
im making a server where each player has their own island and their island is in their own world
That's just inefficient
Load it when they join and unload it when they leave
You don't want every island ever loaded all the time
yeah didnt rly think of that
Iirc the modern practice is same world different islands no? I mean rendering is already a thing so
idk i looked it up and i found a couple pages saying 1 world for x islands is the same as 1 world per island
its also easier to do a world per player since the locations would be the same for every world
I mean you can just save any location for any player so that's not really valid argument imo
🤷♂️ i find it a lot easier
It's not like that bad to world : player, but just do as md said and don't forget to unload the worlds when you dont need em anymore
👍 ty fpr the help
wouldnt ASWM be perfect for this?
Don't reinvent the wheel yeah, but good practice
They don't want to do that
Fair
It’s a bit more work to manage but you don’t have the overhead of loading and unloading worlds
Yeah and if the intent is to spawn them on their island onJoin, the loading worlds is a bit of a nogo
But ig their intent is unknown so up to them
I still need to develop an algorithm for this tbh
I can create the world quickly, but I need to generate an area within the world without making the server cry
anyone know how to fix this issue?
You're on a higher or lower java version than required
provided thing is on java 17
What makes the server cry?
Trying to generate a lot of chunks at once
how do i change it?
my pc has java 22
and i have java 22 selected in all my projects
you're trying to shade something thats on version 17
its bstats im trying to use
see what you're using in the shade
Why at once? You could try doing them in batches perhaps?
hello, is there a guide for data pack developers to make them compatible with spigot?
for recipes using RecipeChoice.ExactChoice / RecipeChoice.MaterialChoice
Will these be ONLY a single item, but multiple options
or will it be any variety of these items?
so like if i have a multiple choice that has Netherrack and Oak planks, i want to make it so i can only use ALL planks or ALL netherrack
Well yeah, I just need to know when it’s done
like not mix and match
I was thinking about how to run a repeating task as a completable future
private void sendBlockDamage(Player player, Location blockLocation, int stage) {
BlockPos blockPos = new BlockPos(blockLocation.getBlockX(), blockLocation.getBlockY(), blockLocation.getBlockZ());
ClientboundBlockDestructionPacket packet = new net.minecraft.network.protocol.game.ClientboundBlockDestructionPacket(player.getEntityId(), blockPos, stage);
CraftPlayer cp = (CraftPlayer) player;
ServerPlayer serverPlayer = cp.getHandle();
ServerPlayerConnection playerConnection = serverPlayer.connection;
playerConnection.send(packet);
}```
(Yes I've tried the spigot method, yes I've tried protocol Lib, Yes it's sending these every tick)
No matter what I do the block break animation ends up looking extremely weird as show in the video it's like flashing on and off
But then I realized I can use a callback instead
I wonder if you put completion thresholds in the generation process to moniter progress
Use a different id, not the players
The api also allows you to do that
ie: checkpoints you could say
Meh, I just need to execute something async when it’s done
I mean, that's basically what CF is :d
fair enough
How would you make a future that returns when a repeating task has gone through X iterations tho
:p
Bump
counter
if (counter-- == 0)
cancel();
future.complete(null)
yeah you can just create a new CF
Hm what should I just just a random int
Also why does it matter just curious?
Client-sided predictions
Just use the block's hashcode or something
Alright ty
Inb4 block hashcode matches player entity id :p
@young knoll @echo basalt ty guys it worked
@lone jacinth can you explain what the point of the || condition is here? In what situation would the owner not be Material in an invokedynamic instruction's handle?
an array won't be the owner of a values or ordinal call in an invokedynamic instruction. You can't call those methods on an array of materials, just methods on Object like toString
in both these cases, the owner should still be Material in the invokedynamic's handle
well .length isn't a method. You can't have an invokedynamic instruction with a H_GETFIELD from javac. you can have a H_GETFIELD in an invokedynamic in the jvm, but afaik, javac won't ever produce that. however, it shouldn't matter. All that matters is you return the correct array, then the .length is after that
the owner of the values() call is still Material
again, you already have the array
this is about getting the array, whatever happens after with the array is of no consequense
is there a way to fix the issue with maven, that even after install changes arent applied to other modules that depend on the other one?
this is rewriting the method to get the array
I don't think so? That || condition didn't exist until it was rewritten to correctly handle invokedynamic and it's specifically checking stuff that is only present for invokedynamic
maybe some fucked up plugin doing heavy bytecode shit caused some error
(^ is clueless)
can we like blame lombok or something
yeah, I'm curious as to what causes that. so I'm guessing derfrzocker has some reason why it was added
You can have this situation, but I don't think that covers this.
private static <E extends Enum<E>> int test(final E constant) {
final java.util.function.Function<E, Integer> ordinal = Enum::ordinal;
return ordinal.apply(constant);
}
test(Material.AIR);
so in this situation, the owner of ordinal is not Material, but Enum. But the instantated method type in the handle wouldn't include Material I don't think, so it wouldn't trip that second condition
I actually think that this example completely fails and could cause all sorts of issues currently since Material isn't known anywhere inside the test method. You'd have to rewrite all Enum::ordinal calls and check if the enum is a Material which is a huge performance drag
for this, does that return a clone
or can i just use .add(material)
or will i have to take that list and update it and set it back to the pdc
manually
you have to set it back. pdc impls just wrap nbt
so its creating the list every get() by parsing that nbt
wdym
the get is only called on used interaction when the list is updated
thats all
yeah, and every time you call get it's re-creating the list from the nbt, and everytime you call set, it's taking that list and converting it to nbt
that list doesn't exist anywhere except when you call get, so it isn't even a clone
oh i get what you mean now
I thought you were making a comment of the performance of it lol
yeah thanks tho
i get it now
well it could be performance comment if you were calling get 400 times instead of just once and then re-using the list instance
lol
i have a multi module project, when i update the common module, it often happens that the new stuff still didnt arrive in the other modules after mvn installing the common one. is there a way to ensure this and not having to remove and readd common as a dependency?
Unsupported class file major version 60
fudge
mfnalex's morepersistentdatatypes
im using java 22.0.1
how do i fix that lol
had an issue with inventories, if u make a inv with Bukkit.createInventory it asks for title but how can this title be retrieved from the inventory object
Is there some workaround
create a neural net and a server side api that recognises english text, then port a monitor view from every client and read the inventory name
odd, in my listener, the event gets cancelled but swapdye seemingly does not work, but this only happens on high ping, why would this be?
public void onItemClick(PlayerInteractEvent event) {
Player player = event.getPlayer();
ItemStack itemInHand = player.getInventory().getItemInMainHand();
if (itemInHand.getType() == Material.LIME_DYE || itemInHand.getType() == Material.GRAY_DYE) {
if(event.getAction() != Action.PHYSICAL && (player.hasPermission("hubbly.playervisibility.use") || player.isOp())) {
event.setCancelled(true);
swapDye(player, itemInHand);
} else {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("messages.no_permission_use")));
}
}
}
private void swapDye(Player player, ItemStack itemInHand) {
Material newMaterial;
String displayName;
if (itemInHand.getType() == Material.LIME_DYE) {
newMaterial = Material.GRAY_DYE;
displayName = ChatColor.translateAlternateColorCodes('&', "&rPlayers: &cHidden&r");
for(Player online : Bukkit.getOnlinePlayers()){
player.hidePlayer(plugin, online);
}
} else {
newMaterial = Material.LIME_DYE;
displayName = ChatColor.translateAlternateColorCodes('&', "&rPlayers: &aVisible&r");
for(Player online : Bukkit.getOnlinePlayers()){
player.showPlayer(plugin, online);
}
}
ItemStack newItem = new ItemStack(newMaterial);
ItemMeta meta = newItem.getItemMeta();
if (meta != null) {
meta.setDisplayName(displayName);
newItem.setItemMeta(meta);
}
player.getInventory().setItemInMainHand(newItem);
}
?xy