#help-development
1 messages · Page 1028 of 1
But I guess that proves modern versions can still handle massive player counts if done right
that was probably just the first one, there was a second one with shy over 1k players
Ah
I was told folia handled 1k, but I can't give specifics on like how well it did so
has all the juicy details
networking was 🔥
So it seems stuff was still not optimal
well, it was only the second test, there were a lot of unknowns and lots of tuning to do
the only way you can probably get an ideal setup without so much resource consumption would be to split up the main pieces in the server to be in their own applications
Still 1000 is overkill
GC was a big concern but it ended up not being that big of a problem in the end
Idk what server would actually want that many concurrent players
Imagine the chat spam
networking was the biggest bottleneck due to underallocating netty threads
if there was anything to compare against it would be that gaming servers have always been able to handle 1k players in the past since like 2005 or so. But all the servers that have done this have one thing in common, the components are all split up even if ran on the same machine. That is, there is a login server, chat server, world server etc
Fixed my problem using jank
DamageCause?
well if you used a source then yeah it wont be custom
but people wanted a method with a source exactly so plugins wouldnt be able to tell the difference lol
Can I send packets to hide the entity that is riding the player?
do inventories have handles that can identify them even if they have identical item data
can you save arrays to yaml files or do they have to be lists
public void saveStuff(String path, ArrayList<String> list) {
config.set(path, list);
saveConfig();
}
or just config set path Arrays.asList(array);
java 17 or 21 for 1.20.4 plugin development?
17
you can sure
I would recommend 21
You can't some Spigot classes are compiled against Java 21 in 1.20.6
I already tried this
The api shouldn’t be
i don't think the api is java 21 either
Error: LinkageError occurred while loading main class org.bukkit.craftbukkit.bootstrap.Main
java.lang.UnsupportedClassVersionError: org/bukkit/craftbukkit/bootstrap/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
Yeah that won’t work
Yeah. I also tried to merely load a Spigot IJ workspace in 17, that failed too
The api is still 17, I checked
Material uses Java 21 features that additionally required me to update IntelliJ
<maven.compiler.release>17</maven.compiler.release>
Heck the fact it’s 17 is kinda crazy
Up until recently it was 8
Literally how
the api probably can still be java 8
it's not doing anything fancy
just a bunch of interfaces
Nah it needs at least 9
why is that?
no, not an arraylist, can you save stuff like String[] to a yaml file and get it back without having to convert it?
i forgot what they added din 9
Private methods in interfaces iirc
We had a bunch of PRs that needed that and bumped it to 9, but MD decided to just go to 17
ItemType and BlockType have private static methods for example
what you compile against doesn't need to be same on the jvm used to load the server. You can compile on 17 if all you are depending against is the api. However, it may still be necessary for someone to use a higher version of java to run the server.
lower versions of java generally can be loaded by higher versions
no way there are still links for it available
yep
it should be possible
just have to modify their permissions
probably shouldn't add them as a contributor
interesting, this is probably one of the reasons I run my own git repos usually
well there is a variety of ways of doing it. You shouldn't assume that all big servers do it the same way
what big servers have that smaller servers don't is the fact they can have a dedicated developer or two
depends what is required, but anything that requires messing with NMS its going to cost you one way or another
you either comission for someone to make something or you have a dedicated developer you pay
there is however the exception if the server owner happens to be a developer 😛
but the cost then is your time
the problem you might encounter is controlling the enemies to inflict damage where you want them to. Other then that, everything else could be accomplished via api
this here, you can't control entity targeting as that is a goal selection
unless api has been updated to change it
but if api lets you control that, then sure may be possible via api only
and that should make things easier 🙂
also if this is for your own server
just remember this
you always have the option to modify the source 😉
🤓
this is what large servers do as well. Need something to be provided by the server, they just go ahead and modify the source where necessary
He he he ha
to include just incorporating the feature into the source
@quaint mantle ur pfp looks ai generated
configuration is only applicable if you need it to be first off and you want someone else to be able to control it
this makes sense to be configurable not because its sensitive information but that it can change later
well idk for items, but that is usually not necessary for other stuff lol
yeah probably best to not hard code that
makes it difficult to change params where necessary like if something is a bit op or whatever lol
I would just make a command to update the values from config
maybe sometimes this month I can update one of my plugins now that there is display entities and blocks
What does display entities and blocks mean?
one of my plugins that I haven't updated in years is called Server Tutorial
with display entities and blocks, it would just add to the features in how you could display tutorials
Does setting a block in a LimitedRegion trigger block updates?
I don't want to fire block updates when placing blocks
I could set a block in a World instance without it by supplying an update arg as false. But BlockPopulator advises NOT to get the world instance from it
But ever since populators now use LimitedRegion the option to not trigger a block update is gone, so I need to know if it does this before I rewrite my codebase.
Because if it can't I'm going to have to get the World anyways regardless of what the populator is telling me to do.
well there's a boolean param to control that
It's not present in LimitedRegion's block setter, that's what I've been saying
maybe there are no physics in LimitedRegion then
I'm gonna have to hope so
I'm just gonna wing it and do it anyways.
If it does end up triggering physics, where can I submit a feature request to give this boolean to LimitedRegion so it doesn't?
I'll be back in a little bit to report the results, I have to rewrite a lot of code to test this
probably the jira
LimitedRegion in BlockPopulator does not apply physics. If it for some reason does then that is a bug.
java
kotlin
Thank you, this is the behavior I was hoping for
do you guys know how to make a portal tp you to somewhere else for example in my skyblock server i want a portal to tp the person to their island
PlayerTeleportEvent, then check the TeleportCause - or maybe PlayerPortalEvent
then change the setTo location
is that a command
hey i have a question for using event calls between 2 different plugins. Im not fully understand what im ment to call. Im also not the most knowledgeable when it comes to java and/or plugin things
ok im using zEssentials as my "core" plugin and it handles everything in events for updating things. so im trying to call the team money for BetterTeams and Ive been looking for the event call in the src code and have no idea I thought i was close but what i thought was going to work didnt.
Maybe ask zessentials? Do they have documentation?
so im trying to call the team money for BetterTeams what does this mean?
like you're trying to get the amount of money a team has?
How would I get the sky light exposure and temperature values from a specific coordinate in a LimitedRegion
yea ive looked through it they give this as example
- line: 2
text: "&7Balance: &a%zessentials_user_formatted_balance_money%"
event: "fr.maxlego08.essentials.api.event.events.user.UserEconomyPostUpdateEvent"
then tell you it has to be a player event and send me to bukkit docs and ive looked through them
that is a placeholder not sure what that has to do with Events
can you send a link to the betterteams plugin
"To update your scoreboard, you can use the event system. This system allows you to avoid using tasks for updating placeholders."
so where does your plugin come into this?
text: "&7Balance: &a%zessentials_user_formatted_balance_money%"
event: "fr.maxlego08.essentials.api.event.events.user.UserEconomyPostUpdateEvent"
is just some plugin config using placeholder api
yea im just having issues with the event line to update the placeholder part
I figure it was better to ask dev than server because this is based around a coding issue
wait whats the event i call?
i have the placeholder part
text: '&7Team Balance: &a%betterteams_money%'
event: com.booksaw.betterTeams.team.storage.team.StoredTeamValue.money
i really have no clue what that config is asking for
that package is some random enum
this is from wiki
Events
To update your scoreboard, you can use the event system. This system allows you to avoid using tasks for updating placeholders. Traditional plugins often use tasks unnecessarily, which updates data continuously for all players. zEssentials aims to be as optimized as possible, making the event system the most efficient option. When a player performs an action on your server, an event is triggered (whether by Spigot, Paper, Folia, or even zEssentials). The configuration listens for the event you specified for the line and updates only that line.
In the default configuration we have the use of the event UserEconomyPostUpdateEvent to update line 2 and 3. When the player’s money is going to be changed, his scoreboard will be updated automatically.
Your event must be a player event (with some exceptions). You can find the list of events here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/package-summary.html
thats a list of all the better teams events
none of them really have to do with the money
yea thats the issue
does zessentials not provide an alternative to using an event
seems like a bit of a flawed system
but would it be this?
com.booksaw.betterTeams.team.storage.team.TeamStorageType.DOUBLE
i dont think so
it wont up update until plugin is reloaded
thats a really stupid design lol
yea real
yk that might work
but obviously if they afk, it won't update
I only need it to up the placeholder
yea well that should be fine
they afk after all
I'm using ItemDisplay to showing a head
but the head is looking in the opposit direction
how should I rotate it back
It got the Billboard.CENTER as well
in fact it rotate in all opposit direction
?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.
hey chat rq, what's the diff between SPELL_MOB and SPELL_MOB_AMBIENT
why don't you /playsound it
huh what even is SPELL_MOB supposed to be? it's neither in Particle nor in Sound enum
It’s a particle in 1.8
how would you place a villager and allow it to look to the direction based on the closest player, if they're close enough? but prevent it from moving from its spot
do I need to do some hacky stuff to achieve this
packets, etc.?
AI should be false right? AI is what is allowing the villager to walk around
With no AI it will do nothing
how i set the new position of armorstand with nms?
why nms?
First, you'll want to keep track of where the closest player is in relation to the villager. Then, figure out which way the villager needs to look based on where the player is. Next, Any events or commands to perform that action. Yes indeed AI should be off.
import org.bukkit.Bukkit;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Villager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
public class VillagerLookAtPlayer extends JavaPlugin {
@Override
public void onEnable() {
new BukkitRunnable() {
@Override
public void run() {
for (Entity entity : Bukkit.getWorlds().get(0).getEntities()) {
if (entity instanceof Villager) {
Villager villager = (Villager) entity;
villager.setAI(false);
Player closestPlayer = getClosestPlayer(villager);
if (closestPlayer != null) {
lookAtPlayer(villager, closestPlayer);
}
}
}
}
}.runTaskTimer(this, 0L, 20L);
}
private Player getClosestPlayer(Entity entity) {
double closestDistanceSquared = Double.MAX_VALUE;
Player closestPlayer = null;
for (Player player : Bukkit.getOnlinePlayers()) {
double distanceSquared = player.getLocation().distanceSquared(entity.getLocation());
if (distanceSquared < closestDistanceSquared) {
closestDistanceSquared = distanceSquared;
closestPlayer = player;
}
}
return closestPlayer;
}
private void lookAtPlayer(Villager villager, Player player) {
villager.faceLocation(player.getLocation());
}
}```
i make already. thanks
He mentioned that he dosen't want the Villager to move
Apply a 180-degree rotation around the relevant axis (e.g., y-axis) to correct the head's orientation in the ItemDisplay
Vehicle can be a boat
what
You can try
VehicleEntityCollisionEvent
Or not.. not sure
That's probably not it
you are on 1.8.9?
yes
nope
i have that verify the location on omvement
I wanted to know why the armorstand doesn't fall either, since I set gravity
nice
how do you generate a void only world
Is it possible to make a fallingblock stop at a certain y level? Im trying to levitate a block then let it fall down back to its original position, even if theres air under that original position or smth else
just a world gen and populator
tick it
then set gravity false
wdym tick it
with a scheduler
Best to use a BlockDisplay with translation for smoothness over a FallingBlock
oh yeah, block displays are amazing
Im using that for levitating up but not for falling down. Then I'd also need to add logic for a display block falling on your head and dealing dmg
would make falling back easier ig
it's probably a bad idea but you can consider nms
you can set no gravity to true and then edit the ticking in there
modify it's location internally
i mean what are the steps to do it
public class VoidGenerator extends ChunkGenerator {
@Override
public void generateSurface(WorldInfo info, Random random, int x, int z, ChunkData data) {}
@Override
public boolean shouldGenerateNoise() {
return false;
}
@Override
public boolean shouldGenerateBedrock() {
return false;
}
@Override
public boolean shouldGenerateCaves() {
return false;
}
}```
WorldCreator wc = new WorldCreator(name);
wc.generator(new VoidGenerator());
wc.generateStructures(false);
wc.type(WorldType.FLAT);
world = wc.createWorld();```
he's familiar with the api
javadocs is a good place to start
it has all the api classes
but you have to be atleast be knowledgeable on how minecraft works
is there a place to learn how mc acc works
no
Its mostly reading, Javadocs, experimenting and basically playing around once you find somethign interesting
oh, so you dont really need to learn how mc actually works?
No, but it does help
well, you need to have played some mc to know about what you're doing kinda
some of us here have been around since the beginning of MC
^
oh so you guys have been deving for a long time
The wiki and tens of thousands of hours of playtime
well i dont get how playtime helps
You learn a lot of obscure and mostly useless shit but it actually helps sometimes
I've found a lot of cool tricks to use for plugins that only work because of minecraft quirks that you stumble across
Things like hiding the health bar without needing a resource pack
What's acc?
actually*
anyways is it possible to create world in specified location
Elaborate
add path to the world name
i see thanks
filepath
uh so I have a player with a korean username I think, and when I try to do Bukkit.getServer().createPlayerProfile using that info it generates an exception about invalid characters in the name
but I thought those names were supported?
offline mode?
nope
must be utf8
I mean it shows up correctly in the debugger so it must be UTF-8 no?
be sure your IDE/maven is set to utf8
could you send the uuid
what difference would the source encoding make
What the characters are
I know exactly what that does and I don't see how it's relevant?
36cfad4c-813e-2b9a-9d61-fea38f4f5202
hmm I can't find it on NameMC
hmm interesting...
v2 uuids iirc are commonly used for npcs 
huh interesting yeah
I've never seen v1 in use
😂
What's giving me the error here? (I've showed everything that uses plugin in pictures)
plugin is null
oh yeah true mb
you need to assign plugin
how to get the block infront of player
it should always be the green and not the red one
just get the player's block position and add in the directon they are facing
getTargetBlock
that will get the red one not the green one
thats a block in front not the block infront
just realize that is a word :d
do you want the block the player is looking at or a block relative to the player's position?
block relative to the player's position
and what if they are facing diagonal?
it will base on the formula to see
you can just get the direciton they are facing and normalise it
how i verify if block is a slab??
and eventually I just got the solution by just clone the location and set the pitch to 0
oh yeah I read that wrong
uh that code should be deprecated
what version are you on
that would be called a decompiler, however it will not produce the exact source code
i need to get source code
because i want add something
Then kindly ask the jar author for the source code
you can use recaf to edit a jar without having to recompile it
however, take that with a grain of salt
yes, see recaf then
Have you considered just making another plugin that hooks to the plugin api
its would easy to get changes on ide
that too
what plugin are you talking about lol
let me tell what i want to do
i want to get a spigot source
i cant use normal because
it changed
what is the source jar here? Is it a plugin? Is it a server?
its a server jar
spigot.jar i mean
i want to get spigot.jar's source code
and put to ide
to made changes
and create new classes
some changes made yeah
by whom?
from a author idk him
?whereami
Well you are running their code
what is the name of the fork
my question is already not that
im asking for
how get any jars source
code
pretty much yea
Some jars sure, most of them aren't re-compilable, most of the times you can't edit them
especially wiith a server jar, the dependency setup would be abysmal
this is ridiculous
How so o.O
how so
🥷
why there is no tool to make that
because it's impossible
well, possible but very limited
why impossible you can see jars inside with recaf
then why you cant dowland
and you cannot usually recompile it
recaf works by editing the jar's bytecode directly.
It cannot offer you all IDE features because it only knows the jars content
Which, as discussed, is not the full source code but the compiled bytecode
new pfp
since when
eons now
(2 weeks?)
damn
in rust or some better lang
hmm
reminds me of when I had to fix a plugin for my friend which was gonna be used in a big minecraft event later that day and he only provided me with a jar and told me to have fun
lol
cc @lean arrow :)
anyone knows what this maven warning means:
system modules path not set in conjunction with -source 17
send the full log
also make sure you're compiling with java 17 at least
it's fine
was wondering what on earth it means
the path to your modules is not the same path as your jdk
it's perfectly fine to ignore if you're in intelli
Hey, are there any upto date and good plugin framework/helper libraries similar to lucko's helper?
what do you need
but your are using java 21 based in the first line not?
bukkit is a plugin framework no?
well, it is
got jdk21, dont see how that changes things
...
well that are warnings but in teory if you target 17 better use the correct jdk?
https://stackoverflow.com/a/77184084/7704486
Yeah too lazy
should be backwards compatible either way 🤷♂️
unfortunate
use a command framework
runtime dependency management
doesn't exist iirc
event injection stuffs
libby does
...???
_> yeah I was asking if something like I mentioned exists?
Like some alternative to let's say lucko's helper library
what do you mean by this 😭
Basically flexible event listeners and easy event registartions
how is it not easy
it's literally dead simple lol
uhhh
So basically
Just take it as an example okay?
@Command
public void function(...) {
Event.asyncWait(AsyncPlayerChatEvent.class, (event) -> {
...
});
}
okay
what are you even trying to do with this example
Uhhh, let me say this as an example
lets say you're making some kind of ban gui based plugin..
is there anyway to change the length of the gap between object and its name ?
I'd want them to be combinable into a single command along with gui
is this an armour stand
nope
yeah and?
ItemDisplay
how is that relazed to that example
make a text display for the name
@Command("/ban")
public void ban() {
alert("enter name");
Events.awaitChatFrom(user, (text) -> {
// use it over here
})
}
well yes a traditional way but I'm seeing if there is an option for that
no
Look up "Amber Watt negative space font" if you want the spacing between "Example" and "Button" to be smaller. Alternatively have a seperate text display for the text with a smaller scale
that's not a thing
It's just a showcase of typically how you could use what I wanted
they meant vertical
Huh?
either makr your own or just use a regular listener
Vertically? Between the robot and the text?
yea
Then add have a text display with a transform ig. What mc version is this for btw?
Also, looks really cool the bot
ig you could have a font with ascent tho
uh I shall try making a framework by combining these features
Shhh, I really didn't want to create my own tho
unavoidable
Life is but a game of fate
1.8 but forget
What is the best way of storing and requesting large amounts of player data?
As in how do large servers handle it? Because querying things every time you need something is not the best way ig. 😂
databases and just have a custom player object
just upsert the new object on change
is there a maven command to check all files for compile errors but not compile
i've bumped up multiple libs' versions and i'm wondering if there are some breaking changes but my compile time is stupidly slow so i was wondering if there was a command for this case
welp im compiling let's see how this goes
cargo check ftw
i was looking into rustc to find this command as an example but forgot about cargo lmao
ok no breaking changes yay
Use
mvn validate```
nope, gave me a build success after i intentionally left an error

I have never made a Minecraft plugin before. Where should I begin? I want to make a plugin for my Purpur server.
mvn verify seems to work but takes almost as long as mvn package
you can take a look here to start https://www.spigotmc.org/wiki/
but please note that a spigot plugin is not guaranteed to properly work on purpur, or paper, or any derivative of spigot, because they may change the API implementations
Hello there , i have a weird bug with my cache , mysql system
i get diffrent stats in 1 server , and in the second server i get diffrent stats too
but first you really need to get familiar with java or kotlin (most people here use java), otherwise it'll be like trying to write a book in chinese without speaking chinese
Alright
like in lobby server: 0 kills
in sw-0 server : 2kills
Yeah I am a little familier with Java. I'm always trying to learn it
syncing data bettwen server's how i can do that?
good then, you'll make progress significantly faster
and don't be afraid to ask questions
Yeah
the most important part is just knowing how to program
Thanks
everything else follows
kotlin ❤️
yupp!
where is the image
no
help
That's how stats work
but i have a system (custom plugin with database support)
in sw-0 server were i kill a player , i get 1 solo kills , it increase and saved in sw-0 server but in lobby server it does not update
it show 0
is it possible to make a nametag grayed out, like when sneaking?
any good site to compear spigot and mojang mappings
probably not
they started testing the day of and ON MY BIRTHDAY
not my fault
i was in London
lmao
I am getting this error
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.
do async events have their own thread per event call or just a single thread/thread poll for all async events? (asking because i will have to do potentially blocking operations on one of async events)
it depends on the event
e.g. async chat happens on the chat thread pool
async pre login happens on the login thread pool
async worldgen events happen on the worldgen threads etc
Size and makeup of said thread pool are also up for grabs
Could be limited to a max size, could not be
alr so blocking on async pre login shouldnt cause much harm?
no
epic
iirc that thread pool is unlimited 
after 30 seconds the client says goodbye though :p
then don't take that long :p
wait, you use dbs? i'm still on carrier pigeons
my father played chess over phone but he was always cheating
guys is this the correct server for help with bungee or is there a diff discord server
(its the right one)
right so
how would i go about doing the following: (i have no experience with bungee plugins, only with spigot)
say i have 2 servers, server 1 and server 2
i run a command on either server and all players from both servers are sent to my server, and then a function in a plugin on my server (spigot/paper) is run.
the function in that plugin will then do whatever it wants
is "my server" "server1", "server2" or some other server thats not behind Bungee?
both servers are connected to one bungee proxy
"my server" is either server 1 or server 2
?pmc yes you can do all that using PMC
also btw is PMC one-sided or can messages be sent both ways
the PMC is to send a message to the spigot server "my server" to trigger the code to run
PMC is both ways, but a player must be on a server for it to receive a message
So you need a Bungee plugin and a spigot plugin
um im not seeing any options here to prompt the spigot plugin to run a function in its code
Bungee plugin listens for the command to transfer all players, then send the PMC message to spigot
spigot plugin is listening for the PMC to do whatever you want
ah i see
such a good thing to see
damn
gotta write more tests
assertTrue(true)
or if you work for Google Tests run: 0
do google not test code
I'm sure some of it gets tested
well, I never write tests either so I can't complain lol
its all designed and written by committee
i need help with syncing data from 1 server to another , when i change the user data , i save it to mysql database, and when player leave i remove him from cache , and when the player join the lobby server i load the data from mysql .
but the data is diffrent
the data is being loaded before its being stored
when using a proxy, you join connect to the other server before leaving the previous oen
that's wrong , because i save it when its changed
aka when i kill a player i save it to mysql instantly
salvation is correct
then the problem lies in ur implemenation
they are both have the same database connected to
I'm going to bet you are saving on player quit
yes and when the user change data
on player quit is too late
i mean kill a player , win a game
i do it in 3 diffrent sinerao
- kill player (save)
- win a game (save)
- quit (save)
i have a custom system built in , where i use a Cache :
not sure if iam doing it wrongly here , i mean the sql code looks fine
in the Lobby plugin instance :
if your cache has an entry (old) for that UUID, it never refreshes it
but iam invalidate the local cache
when ever he leave the current server he is in
this is how iam saving it when a player quit
is it wrong?
When i have a inventoryClickevent, how do i test if the player has just put an item inside the chest or just moved items within his own inventory. I wanna detect the item he moves into the chest and not the item he moves throughout his inventory
the quit is going to run after the player is already in the lobby
If hes already in teh lobby he will have a cache data
so it never gets pulled from sql
does some1 have a picture of what DisplaySlot.PLAYER_LIST is? (scoreboards)
I'm making an rpg server and i want to make a randomly generated dungeon there are tons of guides online but how would I implement that as a plugin?
what exactly is a chache?
oh yeah wave function collapse may look very cool with minecraft builds
you chache things in there?
firstly i have :
- sql
- mongodb
- flat file (for settings)
.. etc
its like a backbone of the system
how can i remove a score from a scoreboard?
^
a friend made a maze type game with it and it's so freaking cool
read my answer?
as for how to actually put that into the game there are about 100 steps probably
Oh i searched that and i didnt see how quantum mechanics relates to what im trying to do
the base game class is 600 lines 😅
thats where software architecture and general game development skills would be useful
(i am never gonna be able to implement it myself)
look up wave function collapse for generation in video games
Thanks i found it
What is usually used to save groups of blocks and spawn them when needed, my dungeon will be a 9x9 grid filled with rooms of various sizes
1- from sw-0 server
2- from lobby server after i was teleported back
i use this method when a player is killed & killer
Hey, so I created a plugin that when you do [item] it shows up in the chat and it doesn't support HEX Codes for some reason and I have never figured it out and I've tried most solutions but no luck.
if (originalMessage.contains("[item]")) {
ItemStack item = player.getInventory().getItemInMainHand();
String itemName = item.getType().name();
List<String> itemLore = null;
if (item.hasItemMeta()) {
ItemMeta itemMeta = item.getItemMeta();
if (itemMeta.hasDisplayName()) {
itemName = itemMeta.getDisplayName();
}
if (itemMeta.hasLore()) {
itemLore = itemMeta.getLore();
}
}
// Replace [item] with the item name
String parsedMessage = ColorUtil.colorize(originalMessage.replace("[item]", itemName));
// Format the chat message nvm
String chatMessage = ColorUtil.colorize(String.format(format, player.getDisplayName(), parsedMessage));
// Apply hover event to the parsed item name
TextComponent messageComponent = new TextComponent(chatMessage);
messageComponent.setHoverEvent(hoverEvent);
// Send the formatted message to all players
for (Player recipient : Bukkit.getOnlinePlayers()) {
recipient.spigot().sendMessage(messageComponent);
}
// Cancel the original chat event
event.setCancelled(true);
}
}
public class ColorUtil {
private static final Pattern HEX_PATTERN = Pattern.compile("#[a-fA-F-0-9]{6}");
private static final String MINECRAFT_VERSION = Bukkit.getServer().getBukkitVersion().split("-")[0];
private static final List<String> ACCEPTED_VERSIONS = Arrays.asList("1.16", "1.17", "1.18", "1.19", "1.20");
public static String colorize(final String msg) {
return ChatColor.translateAlternateColorCodes('&', ColorUtil.translateHex(msg));
}
public static List<String> colorizeList(final List<String> messages) {
for (int i = 0; i < messages.size(); ++i) {
messages.set(i, ColorUtil.colorize(messages.get(i)));
}
return messages;
}
public static void tell(final CommandSender sender, final String msg) {
sender.sendMessage(ColorUtil.colorize(msg));
}
public static void tellList(final CommandSender sender, final List<String> messages) {
for (final String msg : ColorUtil.colorizeList(messages)) {
sender.sendMessage(msg);
}
}
public static String translateHex(String s) {
final Pattern hexPattern = Pattern.compile("#[a-fA-F0-9]{6}");
Matcher match = hexPattern.matcher(s);
while(match.find()) {
String c = s.substring(match.start(), match.end());
s = s.replace(c, net.md_5.bungee.api.ChatColor.of(c) + "");
match = hexPattern.matcher(s);
}
return s;
}
}
If someone could help me figure it out, that would be great
?paste
you have to use TextComponent#fromLegacyText
is there a good way to convert a bungee chat component to an adventure chat component
that isnt like reserializing the json into the other side
BungeeComponentSerializer
if you only have one then yes
when the player joins back to the lobby, do you refresh player stats?
thats too early, the other server will not have updated the sql yet
wow
hmm, if I use packetevents, which uses adventure components for everything, do I need to add adventure as a dependency as well? i get class not found on bungeecomponentserializerimpl
but its just an increment, I don't think it would take that long
wdym
ngl just use adventure itself
well I got the same issue with the json serializer
then include it
but yeah seems like there is no other way
When transferring between servers you are joined to the lobby before the quit event on the other server is finished
or try gson
I had hoped packetevents just used bungee components xD
so, its better to use a delayed task like runTaskTimer or something?
yes. Just assume when the player joins lobby the current data may be junk
yeah I mean this works , but 🤮 GsonComponentSerializer.gson().deserialize(ComponentSerializer.toJson(team.getColoredName()).toString())
I didnt sign up for this 😦
you kinda did
I mean
domain specific language
i dont need more components
i just need to send packets to the client and listen for them
but i guess if you want something done right, you gotta do it yourself
for since I wanna finish this update in this lifetime ill just stick with the serialer-deserialize method
Explain why not using minimessage?
Are you using adventure?
no
yeah im using bungee components
because it came with spigot
and that decision was made 2 years ago
You shouldn't need to touch Gson spigot should have methods
for what
yes thats what I showed
.
componentserializer is from bungee
team.coloredName returns the component
and gsoncomponentserializer is something from packetevents
Ig all the actual good methods ik of are from craftbukkit
That sucks
ComponentSerializer.toString(component);
Is this really not exposed??
minimessage is adventure
yes but thats cursed json
atleast in 1.20.4 it breaks the unicode
bungee moment
because it doesnt insert a second \ to escape the unicode
and then minecraft does a poopoo because it cant parse the json
but the magic fix for that is just .repace("\u", "\\")
so I guess its usable
but its probably not much better than toJson.tostring
but who knows
I totally forgot I had those domains
o true
welp, the domains should be active now where I can set name servers
or still wanting to wait the 90 days? lol
or 60 days rather
not a good thing to see
works on my machine moment
"works locally moment"
Do you guys know how to set up a portal either nether or specifically end portal to not send you to the end but instead to send you to your island on skyblock or run playercommand island
i tested it on my test server
on my pc
it was not saving the stats database users
🙂
should i do Direct Access to mysql data?
i mean save it directly?
i mean this
it save both target and killer 🙂 i bet i can do something better maybe get the current users in this arena , and save them all?
that's better than save 1 user at a time right?
im trying to think of a somewhat efficient way to show player teams using packets so it doesnt interfere with the scoreboard. Right now I am sending createTeam packets every time someone joins or leaves a team, which only leaves me with the issue that players that have left dont update correctly, but apart from that I think its pretty ugly to just keep creating teams, even though the client seems fine with it
the way I wanted to fix the no team issue is by removing all teams from the player with packets, but that requires 1 packet per team
so idk what the best way is
how i convert to packetevents this
exactly what happens in college
how i sent entity_status packet with packetevents?
?dependencyinjection
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ty
status is the bytes writed here?
How do I get the teperature and sky light level from a block location in a LimitedRegion?
You can't get it from the block location, nor BlockState, nor BlockData
The only way I've found it getting a World instance by getting the BlockState, retrieving the Location instance from it, and using the World instance from that, but that's spaghetti and feels very very wrong
Yeah I don't have a machine. Can't grab one till I get back from vacation
is your vacation going to last 60 days?
No but I won't be back till July
oh, well by then 60 days will almost be up then
sure are taking a long vacation. Didn't like the weather?
I'm not rn I'm leaving after this week I ain't get payed till Friday tho and I'll be too busy getting ready to set stuff up
thought you are on vacation till july?
or are you leaving for vacation next week? lol
Do you guys know how to set up a portal either nether or specifically end portal to not send you to the end but instead to send you to your island on skyblock or run playercommand island
portal enter event?
use a plugin, but you are in the development channel
anyone know where I can learn how to make custom worldedit brushes?
Sorry just no one answers there
Only plug-in will work? Like multiverse ?
@marble hearth are you saying you want to find a plugin to teleport you places using portals or you want help making a plugin that does that?
maybe both lol, but I am pretty sure they looking for a plugin
unless they want to make use of command blocks or whatever lol
but that would be a lot of portals
back when I knew nothing about plugins and I would use command blocks
plugins are soo much better
I'm leaving next week
ah the typical school schedule
public void onPlayerEnterPortal(PlayerPortalEvent e){
Player p = e.getPlayer();
Location islandPortal;
Location playerIsland;
if (e.getFrom().distance(islandPortal) <= 4){
p.teleport(playerIsland);
}
}```
@marble hearth maybe something like this?
idk im not very good at plugins yet but this seems like it would work
you have two null values
you need to initalise them
I know I was just showing them that so they could plug in their values
I just made that as an example
ah
I mean if a plugin can do it I can do a plugin instead
Just not sure
@blazing ocean can wave function collapse support tiles that are larger than 1x1?
From what ive seen they always use 1x1s
idk never used it
use distancesquared
I mean that sounds like you're not saving data correctly or you're not querying correctly, it's quite hard for us to say what you should do given the query fails, we don't have enough information
if your db operation fails it likely means you're doing something wrong
^ more information, perhaps some code and describe the operation you're trying to accomplish (start -> finish)
hey um im really very confused regarding how to work with PMC
I want to recieve a message on a channel on my bungeecord plugin, and then do whatever when i receive it
but i seriously just cant wrap my brain around how to receive a message (and how to send said message from spigot)
or datacenter started smoking
aternos
kek
nvm.
how could i have multiple plugins in one project
as dependecies?
e.g.
build.gradle
src
-> my_plugin_1
- -> src
- - -> java
- - -> resources
- - - -> plugin.yml
-> my_plugin_2
- -> src
- - -> java
- - -> resources
- - - -> plugin.yml
-> my_main_plugin
- -> src
- - -> java
- - -> resources
- - - -> plugin.yml
where each plugin would be its own JavaPlugin and initialise separately but my_main_plugin would initialise at the end and use the other ones as dependencies
preferably compile into one central plugin but even if it doesnt thats fine
why having three plugins in one project
cuz the other two are basically just subplugins for the first one
each specialised to do one part of the main plugin
and having a separate project for each seems rather dumb
just make one plugin?
go look at essentialsx on github they do it with gradle
In maven it's just modules
maven you just set each module to jar not pom
i hate maven 🤷
oh boy it will only get worse
Guys, please tell me, I install some construction (blocks), and then I remove it, but I always save it to the database to return it if the server shuts down, but I do not save the blocks of chests, or rather their contents, how to save BlockState?
what weird kind of google translate is that
now is the time to look in yourself for forgiveness
and like maven
gradle is so much less effort
gradle is so much less brain cells
maven isn't much more effort anyway
as long as you understand XML which is already a standard format
i dont
gradles syntax is uh, its own
I don't think the argument for maven is that it is less effort 
ive used gradle forl ike 3-4 years
it just isn't as powerful as gradle at the gain that it is more robust/changes less
Does anyone know how to make a certain structure guaranteed to spawn once, i am using structure blocks to generate rooms for a custom dungeon
keep track if its been spawned, and if it hasnt, force the spawn
there might also be a way with the spawning algorithm
@eternal night uve worked on gradle plugins how would @river oracle add a dependecy to a project inside a task
Structure blocks have to be the most complicated thing ive seen while working on my server
you'll have to force that placement yourself
I don't think you can guarantee that with structure blocks
assuming you want a random dungeon and not the same one everytime
yea
I honestly might just put an armor stand in the rooms and once its done overwrite one with the boss room
Basically what im trying to do is something similar to hypixels dungeons for the generation and layout
Tf is unknown.bin
WHAT
My images keep getting turned into binary files
tuesdays
That's how you do text blocks?
Yeah so basically what i was trying to do was use structure blocks to generate a dungeon out from a start room, but i need every door between the start and end rooms to be locked
It appears you have an extra " in the first sql statement
other than that
try it and see
And end room needs to be guaranteed to spawn
What
Why would you want to add a dependency inside a task
@river oracle answer him
well I figured it'd be easier than copying over every needed NMS dependency every time they update
or writing some script to edit a gradle file itself
Well no you'd just dynamically compute the nms dependency notation
Is there a structure blocks discord or smth i kinda feel like im comitting crimes asking about it here
I already do so, but you need to run the setup task to get the libraries.list from the server. I have another task called setupDeps which would throw them in, idk really any other way to trigger the setup with a gradle task. to ensure dependencies are added and stay there
Well, you'd want some generator then i.guess
E.g. define the MC version in the modules gradle.properties
Have a task that just updates that value when it creates a new copy
how tf does sculptor do it then
I didn't notice anything in the properties or gradle properties there so I figured ya'll dynamically added them too
wait nvm I had a good idea that isn't a task
That is literally what it does
do they generate dependencies into the gradle.properties at runtime?
When it migrates from one version to another, it copies the current one and does a find for the MC version in the build.gradle
No we keep the ver in the build.gtadle.kts
But same concept
MigrateVersion isn't a runtime thing
It's checked into git
Sculptur straight just does what you'd do, which is copy the old folder, find the Minecraft version like in the new folders build.gtadle.kts, bump it to where it wants it and off it goes
Nothing funky happens at actual grade runtime/compilation
hmmm okay
Thx minecraft commands has it ill keep the spigot questions to here from now on
What code do I need to put in a chunk generator to actually make structures spawn? I set the structure Boolean the true, but it only spawns the bounding box and no blocks from the actual structure. I know the bounding box is there at least because /locate is able to find it, and if I go to a stronghold for example I will get the eye spy achievement.
I realize this behavior even occurs when I have no code in the chunk generator at all, so rather than me doing something that causes them to fail to spawn, it is rather something I am missing which placees the blocks that make up the structure.
The Boolean for enabling structures didn't say anything about extra code that's needed in the chunk generator to place them, but it seems like they're actually is something that is needed. I just don't know what it is because there's no other mention of structures anywhere in chunk generator.
As mentioned this happens even when there is no code in the chunk generator, just a blank world with structures turned on. Ordinarily avoid world would still be able to spawn some structures, like floating strongholds. But in this case I only get the bounding boxes for said strongholds and other structures
tl;dr vanilla structure no appear in custom chunkgenerator, only bounding box
happens even when I don't actually override the gen functions, so it means I am missing something rather than breaking something
okay thanks
Might want to take a look at the attached project, it generates villages
https://github.com/skps2010/VillageGenerator/tree/master
i heard that since 1.20.3 the numbers can be removed from the scoreboard, how can this be achieved?
by setting the number format of the objective to blank. Paper has API for that, which Spigot seems to be still missing. So either use Paper, NMS, or the vanilla scoreboard commands
how do i hotswap with jetbrains runtime?
when you have columns tthat can't be null, when possible provide a default
for said column in the query when making it
this way, if you need to put data into the row, you don't explicitly have to specify if it isn't really necessary to specify
when creating tables, MySQL has a variable called DEFAULT
you tack it on to the end of your column creation part
I will give an example
gold bigint NOT NULL,
gold bigint NOT NULL DEFAULT '0',
you can also go in and use alter if you want to set defaults too
ALTER TABLE player_data
ALTER gold SET DEFAULT '0';
even so, something to be aware about. If a default is set for columns, you can explicitly remove them from your query when adding new players for example
as the mysql table will add the defaults for you
postgre is just enterprise mysql
there may be some slight differences but otherwise its mostly the same if you were using mysql 😛
if its a number I don't think it does, but I usually do just out of habit
less to worry about going wrong that way
How should you access the plugin's logger?
is it this?
public Logger log = this.getLogger();
And what if I want to use it in other classes
I'm currently making a plugin, what should the minimum version that it supports be? Is there a standard? I currently support 1.17-latest, I'm wondering if I should go lower (perhaps to 1.13?) or just cut off 1.17 and move to 1.18? Is there any benefit for doing so?
I only support latest
usually I'll do last 3 versions
no more than that ever though
generally though its important to remember 90% of servers are on latest
I mostly make my plugins for 1.8.8-latest, but it complicates things most of the time due to the changes within the API at some plcaes.
I'd say 1.20 is safest option. Most of the people are using 1.20 and higher anyway.
Alright, thanks
there is no standard, just know the further back you support the more work it creates for you. So really its about whether or not do you really want to support all those versions and the amount of work it takes to debug stuff on all those versions
latest to latest. users stuck on old versions are not worth the effort it takes to support them, especially with mojang recently doing a lot of large and nice technical changes.
And users insisting on staying on some old version tend to be the most annoying and demanding anyways
java.lang.NullPointerException: null
at com.onarandombox.MultiverseCore.utils.WorldManager.cloneWorld(WorldManager.java:144) ~[?:?]
at vn.giakhanhvn.skysim.entity.dungeons.boss.sadan.SadanBossManager.startFloor(SadanBossManager.java:40) ~[?:?]
at vn.giakhanhvn.skysim.util.Sputnik.lambda$startRoom$6(Sputnik.java:1138) ~[?:?]
at vn.giakhanhvn.skysim.util.SUtil$9.run(SUtil.java:969) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:783) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_411]```
What even is the null nulling at?
Show your code
Holdon give me a minute
vn.giakhanhvn.skysim.entity.dungeons.boss.sadan.SadanBossManager.startFloor(SadanBossManager.java:40) ~[?:?]
at vn.giakhanhvn.skysim.util.Sputnik.lambda$startRoom$6(Sputnik.java:1138) ~[?:?]
at vn.giakhanhvn.skysim.util.SUtil$9.run(SUtil.java:969) ~[?:?]``` I'm guessing these two?
?paste
https://paste.md-5.net/izasutoxoj.coffeescript
Line 40 is
World world = Bukkit.getWorld(worldname);
I have direction of an entity (vector) and taking this as thrust i need a direction perpendicular towards Y axis clockwise to act as lift
Is there a viable algorithm for this?
Right now I am aware infinite perpendiculars are possible in a 3D graph whilst in case of 2D only 1 or 2
So I was thinking what if I take Z as non changing and from (x, y, z) I make it (y, -x, z) ?
Could it be because the world is unloaded?
But it's duplicated a world with the name f6
is there a better way to give blocks a glow effect (the entity glow effect) besides having an invisible glowing shulker in the block you want to make glow?
A world with that name does exist
worldManager.cloneWorld("f6", worldname, "flat");
Hmm
How about if I try to load the world paste the schematic?
Does anyone know how to make a Smithing recipe without a template?
Before 1.20.5 I was able to pass Air with no side effect, but null and Air are prohibited now.
I have a Listener that sets the Result, but without all the pieces of the recipe, the table won't release the item.
if i wanna get a spigot jar with the mojang mappings i just build tool with --remapped and shade that into my plugin right?
you could set it to a random item and when the other two slots get filled with the right items it auto fills the template
or does --remapped give me spigot mappings

