#help-development
1 messages Ā· Page 722 of 1
Thats the action bar
There are only a few places on screen to show text
Boss bar, title, subtitle, scoreboard, action bar, and the item names
But the item names are client side*
What about toast notifications? š¢
Action bar
oh so the other one is the boss bar?
what other one
Boss bar is at the top of the screen.
At the top of the screen is the boss bar
yes
well, boss bars
You can have up to 4 iirc
The bar which gets displayed to show the health of a boss, is indeed the boss bar.
how do i set the boss bar?
I think you can have more than that.
And then you can add players to this BossBar
Then BossBar#addPlayer()
okay, thx
If you use the method with a namespaced key you can make it persistant
public class NullShape extends AbstractShape
uuuuh..... help?
show code
You need better type constraints
how do i make a team and add a player to it
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/scoreboard/Scoreboard.html#registerNewTeam(java.lang.String)
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/scoreboard/Team.html#addEntry(java.lang.String)
declaration: package: org.bukkit.scoreboard, interface: Team
declaration: package: org.bukkit.scoreboard, interface: Scoreboard
string is player namje
mm minecraft knockback code
can you do it better tho
Unchecked generics array creation for varargs parameter
Whats this for?
generics and arrays aren't really compatible
should be somewhat fine in a var arg tho
?paste
https://paste.md-5.net/sosikatice.js would this function work to create a list of strings lists read from a yml
and dont tell me tas
i have a line of erros i just gotta find its source
and i think this might be it
i don't think you can load a map like that
alright yall conundrum: I've a bunch of lists which may or may not contain the same fungible elements.
They get passed to a 'collector' which isn't interested in the lists itself, just that a list at spot a has the elements of the list that should be there.
My question here is: Should i store the references, so that i can paste the same list multiple times without eating much more memory, or should i copy them, in case someone decides to be 'smart' and edits the list after passing it?
is there a way to get a players mc version
so where is it
why not
it works with a normal string so why not with a string list
Because the map as far as i know is of the form strimg object
And object can be any of the objects including i think a section
?paste
gpt gave me this will surely work https://paste.md-5.net/ivoxibeden.js
nope the first method actually seems to work
iirc it ignores & codes
And if you use the actual color symbol it gets mad and throws an error
I have no idea why you would want to use legacy codes if you have the option to use MM?
legacy ftw š
If on windows a tiny server takes 1gb ram u could u get away with using like 0.5gb ram with lynix?
Or is that not how it works
just don't use windows server
But if I used 1gb ram on a windows server could I use 0.5gb on Lynix and have it still work as good
The only reason you should ever run a Windows server is if you need Active Directory integration for your business. Otherwise, stick with a linux server.
Nearly everything runs on it since it is quite literally the backbone of the internet.
Also, lower RAM usage means more headroom for your applications.
But if I had a world running of Linux thatās a 7x7 chunk world where even 95% of that is void, how much ram should I dedicate?
same amount as windows
But doesnāt windows use more?
if an entity takes 2kB of memory on windows, it'll take the exact same 2kB on linux
Windows uses more in general, not on an application level, but on the OS level.
the amount of memory the JVM will use up does not change
at worst it will vary by a very tiny amount, we're talking kB, maybe couple MB, but definitely not something to worry over
So If I used 1gb ram on windows I should use the same now
Thatās tiny
^ you could get away with having less RAM installed on the computer, although the OS still needs a fair bit to function well, too often I see people giving 90+% of system memory to the JVM and then the entire system runs horribly, the mc server included
But if I have 8gb of ram
How much should I give to this?
Like 0.5?
Modern minecraft needs at least 2GB minimum to run reliably for like 5 people.
You can get away with 1GB for a proxy, but the actual game needs a bit more in resources.
2gb for a survival world
Iām walking like no way near as big as a survival world
Is this a server for yourself? One to share with friends? Or are you trying to make it large scale?
Just a very very tiny world for no more than 10 ppl on at a time
Are you setting a world border?
Donāt know how to do that
Oh
If you aren't going to set one, you'll want to provision a little more than 2GB. (Probably 3GB)
10 people is going to put strain on the server if you don't pregen the world, I'd recommend 4GB at first, then downgrade to 2GB once it's been pregenned.
Whatās the different in having just barrier blocks?
What if I do
The worldborder looks nicer
simpler for users tbh
You wouldn't need barrier blocks? The world border prevents people from passing it. If the world border is set to 10K blocks in a radius, then that's as big as the world will ever get.
Also it extends past the top and bottom of the world
also does it support versions with no hex colors like 1.13?
Used to when it was still an indepenedent repo.
They nuked it when they merged it into paper.
Building the world, itās starting as a void world
So there gonna be no more than 50K blocks there
And thatās a huge stretch
Oh, well if it's a void world, then 2GB should be plenty for your player count.
Even just for 10 players
Wait did I say like 10 spread other a few servers
Prob only every like 1-3 on this 1 at a time lol
Wut
10 players on 3 servers takes more ram than 10 players on 1 server
Since you need 3 seperate servers
So 10 player max over 5 different 1gb servers is what Iām hoping for
10 players max?
Can Spigot even run on 1GB?
no
Technically, yes
Over all of them
What about 1.5GB?
my test server does D:
think the minimum is 2GB due the stack frame size being an issue and some other things
1 way to find out
And we shall
Ok, so I'm not crazy then.
might be able to get it to run it with less doubt it will run very well if you do XD
Iāll help you all updated shall I š
Good to know
Can you set a max width to the popup when you hover over an item in a GUI so text doesn't overfloat and it wraps instead (like item lure)?
Nope
Iāll test on Xbox iPad and pc
I think ChatPaginator can help with that.
You have to shrink the lore
how though? its annoying to do it using \n every time you want the line to wrap
Use chatpaginator
It can automatically split lines over a certain length
(Without slicing words in half)
Some fancy stuff
So 1gb server is possible and will run
Yay
ok tysm
Now letās set 5 of them up
It'll run, but as for how well, ehhhh, you should stick with 2GB to run reliably.
š
It even has 3 plugins installed!
Users can, should, and will inevitably learn to like modern things better. Numeric block and item ids were "easier" for people too, but now you can just use the block's name. Raw text components are objectively more difficult but at least MM lets people use XML-style grammar which is way more user friendly. <red>Hello</red> is a lot more readable to the average person than &4Hello is. Is legacy text shorter? Yes. But it's far from readable nor is it easier if you just take the extra key strokes. Your fellow server administrators will thank you later for using it
my test server always is on 820MB and GC is going crazy with it
Now get more people to join the server. :p
I only have 8gb so much easier if I had 16 but nope
So gotta make do
How much cost?
last time I ran mc and spigot at less then 1GB think it was just above 512mb of ram. I had to modify quite a bit of jvm arguments to just get it to launch and then some more to even be able to play lol. Have to modify quite a bit for it to run on extremely limited ram
I mean, 3 servers at 2GB = 6GB used. That's 2GB left over for the OS which linux will hardly touch.
I think RAM may be the least of your worries
the cpu is going to die
20 years old? How is it even running minecraft?
so what a pentium 4?
20 years ago was 2003
also don't know if 64 bit came out then, so you would be stuck at 32bit with 4GB of ram
You may want to stick to roller coaster tycoon 2 on that thing
I was close, pentium 4 came out in 2000 š
Soooo, an early gen i3?
Iāll send a photo tmrw
ok its possible they could have had a 64bit cpu because 2003 is when the Athlon 64bit came out
It has a cbvd thingy in it
yeah that is normal
To watch film in and the crap
You mean a disc reader?
it would be better if it still had the floppy drive
I think so yea
Like my old computers in elementary school!
yeah cd/dvd drive
... and high school
To be fair, I still had one in my tower up till 2019, so I get it.
I have a 1999 computer that is a pentium 3, has 4GB of ram and runs windows 7 š
Rip. It's gonna be EoL by the end of the year right?
And we have a box full of 2gb ram
There where considerd good when this pc was made
2038 but it could still run just the clock all messed up and all š
And remember itās a mini pc
Iām pretty sure
Lol, fair. You gonna run anything on it till it dies? Surely it's not your daily. Right?
You should run 5 servers on it
Ik Iām going to
And Iāve been planning on
iirc yes
interesting
it used to be my daily until about 2008, its not my daily no more
right now its in storage but I typically use it to run random things on there and tests
if it can run on that old hardware
so im assuming instead of spawn player its just going to be move player?
then those with nerwer should be able to run it XD
what would be the best way to get the players information for movement? only vector and velocity or are there other factors?
for now yeah
There are lots of factors
like if the player is swimming, flying with an elytra, just flying
sprinting, sneaking
... im not that advanced in math to understand the logic, its just for running around
No clue what you're trying to do
im essentially trying to find out the numbers and what happens based on movement
I tried to create a class that creates a display block at the location of a block, replacing it. I want to angle the position of the block, orbiting it around a centerpoint, the origin. The display does not seem to orbit around the origin properly.
public BlockNode(Location origin, Location loc, Block block) {
this.origin = origin;
this.loc = loc;
this.block = block;
this.radius = origin.distance(loc);
display = (BlockDisplay) block.getWorld().spawnEntity(loc, EntityType.BLOCK_DISPLAY);
display.setBlock(block.getBlockData());
location = loc.clone().setDirection(loc.clone().subtract(origin).toVector());
originYaw = location.getYaw();
originPitch = location.getPitch();
Bukkit.broadcastMessage("Yaw:" + originYaw + " Pitch:" + originPitch + " X:" + loc.getX() + " Y:" + loc.getY() + " Z:" + loc.getZ() + " Radius:" + radius);
}
public void setAngle(Float yaw, Float pitch) {
Location newLocation = origin.clone();
newLocation.setYaw(originYaw + yaw);
newLocation.setPitch(originPitch + pitch);
loc = origin.add(newLocation.getDirection().multiply(radius));
// Transformation trans = display.getTransformation();
// trans.getTranslation().set(new Vector3f(Float.valueOf(loc.getBlockX()),Float.valueOf(loc.getBlockY()),Float.valueOf(loc.getBlockZ())));
// display.setTransformation(trans);
loc.setPitch(0);
loc.setYaw(0);
display.teleport(loc);
Bukkit.broadcastMessage("Yaw:" + originYaw + yaw + " Pitch:" + originPitch + pitch + " X:" + loc.getX() + " Y:" + loc.getY() + " Z:" + loc.getZ());
}
this is what i have when it comes to movement currently https://pastecode.io/s/19iwcvhf
Rotation isn't done by pitch and yaw, it's done by the transformation
There's a rotation transformation
Right
Setting them the same seems to be the easiest
Alright, so what your saying is there is a method to create a transformation, set the origin, and input the angles, then apply the transformation to the displayās location?
My end goal here is to turn a structure into a series of block displays, and rotate them along an axis
Commented out
Btw how performant are blockdisplays?
An entity is an entity
Iāve seen plugins use hundreds of block displays with no lag
I tried to use FallingBlocks to display schematics, but then the game started to sa y "fuck this shit im out"
Block displays are entities
Block displays act as a much less intense alternative
Client side they are the same
So you think im fine displaying a 300x300 block of it?
I would avoid it lol
Wait wait
That's thousands of entities
I also tried using fake block packets, but that fucked the client with lighting updates somehow
Eh,displaying 90000 entities may be pushing some limits
Maybe 200
I did like
200 is nothing
Then an issue would be that im testing with a really heavy GPU not counting in that players have GPUs dimensions dumber than mine
I mean you can always test it
Spawn 90k display entities and see how your game likes it :p
When finally performant entities?
Game should EASILY be able to make 90k block display entities happen
Canāt think of many games that handle dynamic entities that well
TABS maybe
Client probably runs so much useless stuff on display entities that don't even transform and shit
whats this error?
https://pastecode.io/s/317de763 updated, there is a lot of variables i didnt know about
Im using getter from lombok
and the dependency is there
So would this code make the display rotate around the entityās true location? Transformation transform = display.getTransformation(); trans.getLeftRotation().set(new Quaternionf().rotateZYX((float) Math.toRadians(z),(float) Math.toRadians(y),(float) Math.toRadians(x))); trans.getTranslation().set(offset); display.setTransformation(transform);
I'm trying to load offline players by UUID who've never joined the server before (which I've done), then add them to the games internal save file for that kind of stuff. Where is that done in spigot so I can replicate it, or does anyone know how it's done?
why
Talk about existential crisis
This is one of the fundamental questions of life
Does anyone know about Recaf?
yeah, is it usercache.json in the server dir?
is there a way I need to load it in though through like nms or cb, since cb has an internal offlineplayers map in CraftServer etc
would the best way to do a speedrun timer be increasing a double by 0.1 every 2 ticks?
or is there a better way to do it
Would system time not be good enough?
well i would like it to be shown on a placeholder using placeholderapi
so it has to be a variable of sorts
That can be done, but that's only gonna update as fast as the scoreboard can refresh. Which I think can be done quickly, but I haven't used scoreboards all that much.
Can be done every tick
I want to make a display entity orbit to a new position around a location, the origin. Iām told using a Bukkit transformation is best. I have a display entity at a starting point, and I want the display to be positioned at a specific angle from the origin through a vector. How might I do this? Hereās a picture to illustrate btw. Also, trans.getLeftRotation().set(new Quaternionf().rotateZYX((float) Math.toRadians(z),(float) Math.toRadians(y),(float) Math.toRadians(x))); Can rotate a display block around it's center, but not around a specified origin Location. Any ideas?
That's just position math, not transformation. X=cos(T), z=sin(T) etc
Yaw, pitch, and roll rotations
In linear algebra, a rotation matrix is a transformation matrix that is used to perform a rotation in Euclidean space. For example, using the convention below, the matrix
R
=
[
cos
ā”
Īø...
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Why does my .jar always give an error in the code?
what's the error?
I should prob learn rotation matrixes n stuff
get a tex bot in here
vector has a simplified way to do it actually
F
F
F
F
F
F
F
at what version did nms become version independent with importing? i need it to use reflection for older versions cuz itll just throw an error if i do it the old way on a new server (net.minecraft.version) and itll throw an error if i do it the new way on an old server (net.minecraft.whatever)
For some reason I can't access my plugin's page
It tells me I don't have permission
Why is this? It doesn't seem to happen for other plugins
1.17
exactly 1.17 or like 1.17.1
That can happen if the plugin got deleted
https://docs.aspose.com/font/java/how-to-load-fonts/load-a-font-from-ttf-file/ Maybe this will help
i checked this last night, nope didn't succeed to load it
Ohh okay do you get some errors ?
yea ig i've to implement some APIs or classes which i don't know how
Have you Check all Imports Like in docs ?
How can I check if it did?
I didn't get any alert or email about it though
And I don't understand why it would be deleted
plugins only get deleted if you ask for it or its found to have a trojan/virus.
Then it definitely didn't get deleted
link?
did you upload a jar for it?
I uploaded many versions, and it had jars for every version of mc in it
will this work?
private static void sendPacket(Player player, Object packet) throws ClassNotFoundException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Class<?> craftPlayerClass = Class.forName("org.bukkit.craftbukkit." + getVersion() + "entity.CraftPlayer");
Class<?> packetClass;
Object playerConnection;
Method sendPacketMethod;
Object craftPlayer = craftPlayerClass.cast(player);
Object entityPlayer = craftPlayer.getClass().getDeclaredMethod("getHandle").invoke(craftPlayer);
if (getRawVersion() >= 17) {
packetClass = Class.forName("net.minecraft.network.protocol.Packet");
playerConnection = entityPlayer.getClass().getDeclaredField("b");
sendPacketMethod = playerConnection.getClass().getDeclaredMethod("a", packetClass);
} else {
packetClass = Class.forName("net.minecraft.server." + getVersion() + ".Packet");
playerConnection = entityPlayer.getClass().getDeclaredField("playerConnection");
sendPacketMethod = playerConnection.getClass().getDeclaredMethod("sendPacket", packetClass);
}
sendPacketMethod.invoke(playerConnection, packet);
}```
?support
Oh my god. Someone saved with errors again
I sincerely hope that you dont plan on using this often, unless you wanna tank your servers performance.
Any reason why you dont want to use ProtocolLib?
pre-cache your variables n stuff
im making this for my friend and according to him it "lags" the server
but idk if itll work if i shade it
people say it causes issues
Your friend has no idea what he is talking about...
This will be about 100-300 times as heavy on the server than what ProtocolLib does.
i told him it doesnt affect the server
ProtocolLib's packet sending can be called on the main thread but will just be added to a queue that's processed async
and he still doesnt want it
Your friend's an idiot but anyways
fr
Let's optimize this a bit at least
how?
Will, ty
Before we start optimizing this, lets explore if it is even the right approach.
Do you need multi version support? Or why do you use reflections. @dawn flower
That is a very weird line of versions. Does this plugin need to run on a 1.8 and a 1.19 server?
If you want something shadeable there is always packetevents
Alright, did you check if sending packets is necessary?
Do you need this for only a specific use case or should this
be used for generally sending packets.
custom mining & block manipulation client side so prob necessary
Myeah for old garbage versions like 1.8 you need packets for that. Newer versions have APIs for custom block crack animations.
Hi there! Today Iām going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...
This might be the better approach than using reflections.
alright
It lets you use NMS for different versions in one plugin.
You're in the right place
This is the server
chatgpt
private static final Method GET_PLAYER_HANDLE;
private static final Field PLAYER_CONNECTION_FIELD;
private static final Method SEND_PACKET_METHOD;
static {
Class<?> craftPlayerClass = Class.forName("org.bukkit.craftbukkit." + getVersion() + "entity.CraftPlayer");
GET_PLAYER_HANDLE = craftPlayerClass.getDeclaredMethod("getHandle");
Class<?> entityPlayerClass = GET_PLAYER_HANDLE.getType();
if (getRawVersion() >= 17) {
Class<?> packetClass = Class.forName("net.minecraft.network.protocol.Packet");
PLAYER_CONNECTION_FIELD = entityPlayerClass.getDeclaredField("b");
SEND_PACKET_METHOD = PLAYER_CONNECTION_FIELD.getType().getDeclaredMethod("a", packetClass);
} else {
packetClass = Class.forName("net.minecraft.server." + getVersion() + ".Packet");
PLAYER_CONNECTION_FIELD = entityPlayerClass.getDeclaredField("playerConnection");
SEND_PACKET_METHOD = PLAYER_CONNECTION_FIELD.getType().getDeclaredMethod("sendPacket", packetClass);
}
}
private static void sendPacket(Player player, Object packet) throws InvocationTargetException, IllegalAccessException {
Object nmsPlayer = GET_PLAYER_HANDLE.invoke(player);
Object playerConnection = PLAYER_CONNECTION_FIELD.get(nmsPlayer);
SEND_PACKET_METHOD.invoke(playerConnection, packet);
}
sum like this

optimized reflections way
took me forever
alrighty so this code
package io.github.dungeonproxy;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.ServerConnectEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.event.EventHandler;
public class EventListener extends Plugin implements Listener {
@Override
public void onEnable() {
getProxy().getPluginManager().registerListener(this, this);
}
@EventHandler
public void onServerConnect(ServerConnectEvent event) {
ProxiedPlayer player = event.getPlayer();
String serverName = "entrance_dungeon_floor";
ServerInfo serverInfo = getProxy().getServers().get(serverName);
int maxPlayers = serverInfo.getPlayers().size();
if (!getProxy().getServers().containsKey(serverName)) {
player.sendMessage(ChatColor.RED + "The server " + serverName + " was not found.");
event.setCancelled(true);
return;
}
if (getProxy().getServers().get(serverName).getPlayers().size() >= getProxy().getServers().get(serverName).getPlayers().size()) {
player.sendMessage(ChatColor.RED + "The server " + serverName + " is currently full.");
event.setCancelled(true);
player.connect(ProxyServer.getInstance().getServerInfo("limbo"));
}
}
}``` throws the error
```yaml
Cannot invoke "net.md_5.bungee.api.connection.Server.getInfo()" because the return value of "net.md_5.bungee.api.connection.ProxiedPlayer.getServer()" is null```
can the fix be (#.getServer() == null)?
serverInfo can be null, yes
ProxiedPlayer.getServer can also be null when the player is first joining
at least I'd assume so
ServerConnectEvent is also called for a new player.
Which means getServer() returns null because the player wasnt connected to another server before
your containsKey check can be replaced with a nullability check
but it wouldn't reach that far
getting the max player count would cause exceptions anyways
pong ping
bim bim bam bam
^ do I try this?
?tryandsee
no clue what you on about
ops
black ops
you mean Velocityā¢ļø?
na bungeecord

hi epic
Or waterfalfal
DragonProxy 
ig I was trippin
did I spell it wrong
thought it was mine
ur Dungeon
whats the thing called
I forgot
like it makes the message appear like that
can soemone embed that
Subtitle
#sendTitle?
Mhm
o
You can send an empty title to just show a subtitle
p much
hey i have a minecraft server with velocity proxy
i get this error after few hours that server is online from proxy console and no one else can connect my server any more :
[15:36:31 WARN] [io.netty.channel.nio.NioEventLoop]: Failed to close the old Selector.
java.lang.InternalError: java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.WEPollSelectorImpl.wakeup(WEPollSelectorImpl.java:238) ~[?:?]
at sun.nio.ch.SelectorImpl.implCloseSelector(SelectorImpl.java:183) ~[?:?]
[15:36:31 INFO] [io.netty.channel.nio.NioEventLoop]: Migrated 1 channel(s) to the new Selector.
[15:36:31 WARN] [io.netty.channel.nio.NioEventLoop]: Unexpected exception in the selector loop.
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.IOUtil.drain(Native Method) ~[?:?]
at sun.nio.ch.WEPollSelectorImpl.clearInterrupt(WEPollSelectorImpl.java:248) ~[?:?]
at sun.nio.ch.WEPollSelectorImpl.processEvents(WEPollSelectorImpl.java:186) ~[?:?]
how can i fix it ?
Yeah that makes sense
If you're having problems with Velocity then ask the velocity devs (in the Paper discord)
Thanks for directing me to support! It's all fixed now.
homeboy seriously made a maven module for each minecraft version 
wth with bukkitRunnuble why i have error when try check "isCanceled"
i mean i cant use it in start
when bukkitRunnuble not started
because its a method that gets set only after the runnable is created, not before. In other words you need an instance of the runnable otherwise everything is null
lol then how do I check if a thread is running in a loop or not?
because its set after it is scheduled. If something came along and cancelled it gets set because its scheduled. The only way you can have an instance of a runnable is if its scheduled or started
if i cancel this i can check this again
i mean if this canceled so is "null"
i not can
or
as long as it hasn't been removed from the list that manages the tasks scheduled
and when it is removed
so a task that is scheduled can get cancelled before the scheduler has time to run the task
and then once the scheduler has time to come across your task, it will then remove it from the list afterwards and not run it since its cancelled
so if i cancel runnuble this be erased ? end i again not can check
after a bit of time yes eventually it will be erased, this is why you retain the task id
so you can ask the scheduler if a certain task id exists
and then if it does, you do another check to make sure its your task by grabbing the task via its id
and if its yours, check if its been cancelled or not
what a hassle omg
well task id's can be resused
i create new runnuble
in start
i mean when it canceled i need erase it
or i have IlligalStateExeption
the scheduler will erase it, you can schedule another task that is a duplicate btw
you are not limited to schedule a single task
oh cool
so if the task you wanted to run was cancelled but then decide it should run, you instead just schedule a new task
It turns out you need to use task id?
you use the task id so you can check if your task is still in the list
if not is be canceled
either it was cancelled or it ran, in either case the scheduler ran your task in accordance of whatever was set
i see
that's nothing, I make a maven module every time I dunk on you
is there a simple method of disabling chat reports in paper?
- This isn't paper
- This ain't a paper specific issue
- Yes just get a plugin
- You're rude
- Paper has "fixed" some workarounds that can be done in spigot
- This is #help-development not #help-server
If Paper has fixed some workarounds that would work in Spigot, you'd be better off asking in their Discord
alright
The most sophisticated way to do this is packet interception Kaspers plugin is open source so you can look at his code
this is still the spigot discord, we cant help with paper stuff
Though if his plugin doesn't work on paper you should make an issue on github
Wait is paper ultra pro-chatreporting?
Identity changed!
From mausaen to 7bytes
This is something I would've needed to post in general
No clue who you are anyways
He is not rude, he is telling you we aren't paper to help with their issues
Avg paper user?
Blud goes with the ignorance path
Tried flaming me for saying alhamdullillah out of context
ĀÆ_(ć)_/ĀÆ
lmfao 10/10 tebex live demo experience
W
What did you want, a 403?
gives 403
No
you cant do that
Why gradle gotta be such a b**h sometimes
like just import this shit
stop complaining
maven is slower
how it better if it slower
Love those. You read or heard that somewhere and repeated it, didnt you.
Nice, anecdotal evidence
The first build takes a bit, but it caches the resources unlike maven
Was about to bring up the caches
I suppose you do clean package always lol
no, i just use build
So this is the same argument that MongoDB brings regarding the performance relative to SQL dbs.
They add a huge cache and tell everyone they are just faster.

I agree
I think its a bit more nuanced
They have a different usage
You cannot compare those
that also applies to maven and gradle
cus one does something that the other doesnt
But I also dont agree with one being objectively better
any1 have a project using model engine 3 i could take a look at?
If i can still find it. But its a bit sewn together.
Insults my entire API
wait
no
ye
maybe?
noo
Do you also have something against TS
TS is acceptable
Phew, my api uses it
Someone telling the truth
I have so many questions
Anyone know what could be causing my world custom generator to go back to the vanilla one on some restarts? I don't get any errors so idk why it switches to vanilla
If only i wasnt an athiest
That was the most passive aggressive nice thing someone has ever said
would you take "God bless you sir" on the street as insult then?
https://minestom.net
guys guys existing is cool and all but look at this
nobody even has any idea what you believe in or you dont believe
I don't know if it's an bug or what, but code gives different output for Release compilation and Debbug compilation.
I've never seen anything like this before, how could I deal with it?
š¤
guess u cant find it eh ;d
Nope, sry. But i found a gif of some testing with it...
thats alright. thanks anyway
how can i get custom head
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. Iāll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
how the fuck would I make my database abstraction modular so that separate "modules" / subprojects can use my main database hmm
When you know what data you're working with it's somewhat fine
I also don't want to just have a codec because indexing and sorting operations are important
if i have a nms project, and i wanna distribute a -core that has the nms in how would i do that, bc the interface for nms would be inthat so the nms module would need to depend on that but it needs to depend on the nms module
the init with reflections i would do already
just the dependency stuff
so i dont have nms doesnt have core and core doesnt have nms
Wut
okay hold on
In my projects the NMS modules all rely on core
But core doesnāt rely on any of the NMS modules
lets say i have my parent project, that is just empty, i have a core project that has the core stuff of my lib, i will make other modules i wanna distribute under their name and i wanna distribute core as core, but core should have nms shaded in except core will have the underlying stuff for nms, eg the interface of methods
i can make a shit diagram if you want
Core doesnāt need to rely on NMS then
You should have another module the bundles it all together
what could i call that
i dont like the name dist though
thats why i wanna do it with core
do i rename core to core-api and then new core with the deps?
You can also just have the root project bundle it all together
i mean
would that get confusing
if you depend on xyz for the main lib, but you could have xyz-something as an extension?
Generally people would only depend on xyz or xyz-api
Either the entire thing with implemention or just the api
Just like with spigot-api vs spigot
so i have my core, that has lib stuff, then im gonna make a storage module that could include stuff related to storage been as that might be huge
i wouldnt want to depend on xyz-storage and now have the core if i only need storage
wait
im not shading stuff thats that big so maybe i dont need that
hmmmmmmmmmmmmm
i need a brain
whos can i borrow
hm
doing my own database stuff
the decorator pattern isn't what I want
but some sort of inheritance thing
mm I can do this with 19 different abstract classes
shit..
pain
how to create particles
and how to set an item for this?
Pass it as the extra data
this is starting to get overly complex
can't wait to implement a weird inheritance chain
⨠hibernate āØ
no
._.
fuck orm
no
how?
but at least I can do
there we go
SkyblockDatabase database = ...;
if(!database.hasTag(REMOTE)) {
// refuse to load sharding stuff
}
:)
Epic: I love hibernate
Also Epic: I donāt know how to use hibernate
and it's all inheritance based so I don't have to specify every single tag for every single database type
My idea is to segment this into niche databases now
instead of just storing player and island data, I have a mongo core and an island storage impl
wish me luck
I have to remake all of this
So i can do
player.getWorld().spawnParticle(Particle.ITEM_CRACK, player.getEyeLocation(), 1, Material.NETHER_WART);
?
?tryandsee
i'm not sure that it should be so fast and small...
?paste
i did
player.getWorld().spawnParticle(Particle.ITEM_CRACK, player.getEyeLocation(), 8, 0.01, 0.01, 0.01, usedItem);
but it's too fast..
why metod isStarted return always false https://paste.md-5.net/iyicuqesen.java
There's also speed
why are you using id not BukkitTask and null checking for started
wdym
using a normal runTasskTimer with BukkitTask
i shold use nums?:?
time to rethink this all
So how to spawn some particles without offset and big speed
I think i have a method somewhere
what wrong with sholder
scheduler
could you send it please?
wouldnt this need each block on a seperate timer
but it should be the same thing
spawnParticle has a speed parameter
just set it to 0
use a repeating task running once a minute mapping an Instant to a block and then update it if however long has passed
like this?
player.getWorld().spawnParticle(Particle.ITEM_CRACK, player.getEyeLocation(), 8, 0, 0, 0, usedItem);
it doesn't work for some reason
why are you spawning a particle in a player's head?
did you mean to spawn them where the player's looking at?
no, i want to spawn particles like from eating food
then it still should be a little bit to the front I think
hmmm
wdym obaut "Instant"
the class Instant
oh i see
I belive I got a fairly decent looking eat animation in the past
Lets see what values I used
ok, then how to get location of player looking at?
public static Location getFacedLocation(Player p, double distance) {
return getFacedLocation(p.getLocation(), distance);
}
public static Location getFacedLocation(Location l, double distance) {
return l.add(l.getDirection().normalize().multiply(distance));
}
got it from the internet
and it works
world.spawnParticle(Particle.ITEM_CRACK,
player.getEyeLocation().add(player.getEyeLocation().getDirection().multiply(0.7)).subtract(0,
0.75, 0),
0, -0.5 + rand.nextDouble(), 2.2 + rand.nextDouble(), -0.5 + rand.nextDouble(), 0.1f,
new ItemStack(edibleItem.getParticle()));
That's apperently what I used to use
it's messy
draw.io best diagrams tool
Hi can anyone check if this code works and why the getItemInHand is like this getItemInHand? https://ibb.co/kHZsd06
Guys I need help
Because it's deprecated
Players have 2 hands
but will it still work?
probably
probably yes
how xD
ye
declaration: package: org.bukkit.entity, interface: HumanEntity
Read the deprecation message
I modified the spigot-api's code, only by creating a new listener class in it. I used maven local import to get the configured API work properly. I did only try a few methods, that were basically in the spigot-api, they all worked as expected. But when I was trying to access my custom class, I wasn't able to.
Did you do all the steps properly
Which ones?
Run buildtools to get the source
Make your changes
maven install to push said changes into your maven local
yes
Are you depending on the right thing
I wasn't using the repository anymore, only that local jar.
Wait wait wait... when Im importing the dependency or what do you mean?
I changed it from org.spigotmc to org.bukkit
i doI use Bukkit.repeatingTask anyway
But it didnt do anything
it really works normally 0_0
I would avoid the task ids and opt instead for the BukkitTask objects. They're a little easier to work with
Instead of scheduleSyncRepeatingTask(), use runTaskTimer(), same arguments, but returns a BukkitTask object on which you can call cancel() and isCancelled()
ok
You also definitely do not need a ConcurrentHashMap here if you're running your task synchronously. Just a regular HashMap should be fine
synchronize all the things 
You never know what those threads be doin
but there is a problem isCancaled cannot be used BEFORE starting the thread
No of course not but at that point the task will be null
I guess in your case now you could check if the taskId is > 0 lol
But I'd still recommend using a BukkitTask
why this better
Just nicer to work with an object and invoke methods rather than magic integer values
ok
public void stop() {
if (task != null) {
task.cancel();
// Optionally you can also do task = null. Up to you
}
}
public boolean isStarted() {
return task != null && !task.isCancelled();
}```
Choco please help
What version are you editing, how did you build Spigot, and what does your pom.xml/build.gradle look like?
And are you editing Bukkit? Or Spigot? There's a difference
Hmm... from buildtools I copied the spigot-api folder. That contains both
Hey does anybody know how I can use player.getInventory().remove(player.getItemInHand()); to only delete one Item and not every one when its in a stack?
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>spigot-api</artifactId>
<scope>system</scope>
<version>1.20.1-R0.1-SNAPSHOT</version>
<systemPath>${project.basedir}/spigot/spigot.jar</systemPath>
</dependency>
</dependencies>
This is how it looks like
Everything works except for that custom class
They're deprecated
Should just be able to subtract its quantity.
ItemStack item = player.getInventory().getItemInMainHand();
item.setAmount(item.getAmount() - 1);```
No need to reset, getItemInMainHand() returns a mirror
Accidentally changed it sorry
It was spigotmc btw
Okay, so what is it exactly you're adding? You probably don't even need to add it to Spigot. If it's an API addition you can do it in the Bukkit directory
I want to convert page from book to the list of lore, but i don't know how to divide lines in book ,_,
Idk I was just playing around. I added one listener class and then I tried to register it from the onenable
Books are fun. They're delimited by character width not by strict string length
Okay but why are you adding a listener to the server? What benefit does this have to you? Why aren't you writing a plugin?
Thats a good question. I was looking around the code and then tried it without success
I don't remember exactly the width a book uses for wrapping but you do have access to MinecraftFont.Font.getWidth(String) to get the width of a simple ASCII string (Font being a static field by the way, it's just named strangely)
It shows me the classnotfoundexception
Idk why when I ctrl+right click on the method, I can clearly see that there is a listener
You're still not answering the question. Why are you doing this in Bukkit's source rather than in a plugin? Are you just adding a listener?
public class MyListener implements Listener {
@EventHandler
public void eventListener(Event event) { }
}```
type thing?
Yes. I need to start somewhere, btw thats the exact same thing I added to the source
Okay, so firstly, don't lol. Bukkit isn't meant to be the host of listener logic. It's just meant to provide an avenue to do so for plugins
i think 113
I wasn't asking how I can or cannot register a listener. My main question is, why added classes won't get recognized
Either way, if you're trying to add something to Bukkit, edit code in the Bukkit and CraftBukkit directories. You can probably leave the Spigot directories alone in 99% of situations. Once you've made your changes to source, in either the Bukkit or CraftBukkit directory (whichever ones you made changes to), run mvn clean install to build an install the project locally. Then you can depend on it in your pom.xml as you normally would
sooo i need to format text with spaces...
It will override any existing installations or repo lookups
I think I didn't look through the readme.md XD
Im gonna try it thanks
- Edit code in Bukkit or CraftBukkit folders
- Run
mvn clean installin either of those two folders, whichever ones you edited - Depend on the version you built just like normal
That's pretty much it
so it doesn't work with cyrillic symbols
MinecraftFont.Font doesn't work with cyrillic
Yeah it's just plain ASCII
Wonder if maybe there's some way we could have it support whatever vanilla supports
So i'm Ukranian that's why it's a bad choice for me ._,
Wrap it in a resource pack. š
I mean, you can atleast know the width of "i"
š
yeah
only of i
oh wait
i can know the width of "o"
That's 2/33
of all alphabet
Hello! I'm geolykt - and I have yet another stupid question:
while (true) {
int ctrl = this.ctrl;
if (ctrl < 0) {
do {
Thread.yield();
} while ((ctrl = this.ctrl) < 0);
}
if (!BUCKET_CTRL.compareAndSet(this, ctrl, ctrl++)) {
continue;
}
break;
}
I have following code. I basically want to wait until ctrl is a positive number (or 0). Once it is, I want to increment ctrl by 1 (this is done via BUCKET_CTRL which is a AtomicIntegerFieldUpdater).
Is there a better/more efficent way to do this?
well, kinda oof
I made some fast "{<digit>}" formatters if anyone'd like https://paste.md-5.net/wovomitubi.java
format non integer numbers i'd assume
It seems to do something regex but the javadocs really are not clear
Is it possible to create chat plugin using rgb in spigot 1.8.8_v03?
you mean my code?
Yep
what exactly do you want to do?
like you know
idk is there an atomic increment maybe
"Player {0} has joined the server!"
otherwise looks good
.getAndIncrement yes - but it cannot do the comparision
I don't know, but an action bar or a title on the screen..
what are you trying to do tho, is this some kind of lock mechanism
My main concern are the two while loops
Yeah sorta
why?
wait what is the comparison for
you still have to wait, it's not like you have a choice
can an atomic operation fail
Basically it's an RW-lock. Values under 0 denote that some thread is attempting to resize an internal AtomicLongArray and that all read threads should wait until it completes to do so (at which point it returns to 0).
Nope
RGB is a 1.16 feature
do you think u could eliminate the check
oh wait nvm
It'd be great if I could hence I'm asking
Perhaps something VarHandle related? But it'd need to be atomic
why compareAndSet and not increment
you could make the only way of modifying the array a wake-up for your current thread
why not use one of the synchronization primitives? like a Phaser or smth
It could have moved back to negative values since the last check
Phaser? That is a foreign concept to me
It's been years since I have even heard of it. Never would have known it has something to do with synchronization. But I'll check
Yeah I guess I could use .wait() and .notifyAll() on the array object itself but something is telling me that is equally dangerous in case the write thread completes just between the ctrl < 0 check and the array.wait() calls.
java.util.concurrent.Phaser or similar, it's kind of like a countdown latch or a cyclic barrier, but the other way around, parties are registered to the phaser when they do some operation, and they can arrive/deregister once they're finished, while other threads can await/block until all parties have arrived and the phaser goes back to 0, then the waiting threads are awakened
they can be reused and dynamically have parties registered as needed
the javadoc are great
Hm, looking at it I think I only partially understood that. I think I'll go forward with my current idea and once I've set up appropriate benchmarks look at perhaps using Phasers.
Especially considering that I don't quite understand what the Phaser means with "Parties"
Actually I think I can get rid of my first if statement by changing the do-while to a while so I'd say a few opcodes there which should probably more than suffice for JIT-inlining.
You can picture it as the typical scenario of a jar of tokens next to a door, someone can only go through the door if and when the jar is empty, whereas other people can put and remove a token whenever they want/need. Once all the tokens have been removed, the door is opened
ij bug? complains about comparator (toint)
it compiles normally manually
oh wait
š¤
nevermind, its a double not int lol
Is there a way to get the Channel object from a Player using ProtcolLib?
isn't protocollib all about that but wrapped?
uh
or am i missing something?
i wouldn't trust chat gpt finding useful info about this kind of stuff tho
it was my last resort
hi need help
File crates.yml couldn't be reloaded. Reason could not determine a constructor for the tag tag:yaml.org,2002:java.util.HashMap$Values
in 'string', line 1, column 9:
CRATES: !!java.util.HashMap$Values {}
^
is this a plugin you are making?
Crates forHCF
Hey i am trying to let my code draw a image with Graphics2D but it only draws the line from g2d.drawline not the image from g2d.drawimage. The Image that it ment ot draw is located at the main folder of the server
int width = 64;
int height = 64;
File img = new File("./skin_black.png");
BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
image = ImageIO.read(img);
Graphics2D g2d = bufferedImage.createGraphics();
g2d.drawImage(image, width, height, null);
g2d.drawLine(5,6,7,5);
ImageIO.write(bufferedImage, "png", new File("./Char" + charid + ".png"));
System.out.println("Char erstellt!");
}```
Hope someone can help me with that
yeah
well you aught to show the code then
Hey Guys, we are currently working on a minigame, for this we wanted to use the normal Minecraft Spectator mode, however we are experiencing the problem that invisible Armor Stands are above the heads of the players and the NPC's, what can be the reason for this, we would like to remove this ? We use the following plugins in addition to our plugin:
Triton
TAB
Placeholder API
Citizens
Protocol Lib
Luckperms
we have absolutely no context on what ru even tryna do
` @Getter
@Setter
@SerializableAs("crate")
public class Crate implements ConfigurationSerializable {
private final String name;
private final ChatColor color;
private Type type;
private ItemStack item;
private ItemStack key;
private ItemStack hologram;
private final List<Location> locations;
private Map<Integer, ItemStack> loot = new HashMap<>();
public Crate(String name) {
this.name = name;
this.color = ChatColor.WHITE;
this.type = Type.CHEST;
this.item = new ItemBuilder().from(Material.CHEST).name(this.color + name + " &7Loot chest").build();
this.key = new ItemBuilder().from(Material.TRIPWIRE_HOOK).name(this.color + name + " &7Key").glow().build();
this.hologram = new ItemStack(Material.DIAMOND_SWORD);
this.locations = new ArrayList<>();
this.loot.put(0, new ItemBuilder().from(Material.RED_ROSE).name("&cTEST").build());
}
public Crate(Map<String, Object> data) {
this.name = (String) data.get("NAME");
this.color = ChatColor.valueOf((String) data.get("COLOR"));
this.type = Type.valueOf((String) data.get("TYPE"));
this.item = new ItemBuilder().from(type.getMaterial()).build();
this.key = (ItemStack) data.get("KEY-ITEM");
this.hologram = (ItemStack) data.get("HOLOGRAM-ITEM");
this.locations = (List<Location>) data.get("LOCATIONS");
this.loot = (Map<Integer, ItemStack>) data.get("LOOT");
}
@Override
public Map<String, Object> serialize() {
Map<String, Object> data = new HashMap<>();
data.put("NAME", this.name);
data.put("COLOR", color.name());
data.put("TYPE", this.type);
data.put("KEY-ITEM", this.key);
data.put("HOLOGRAM-ITEM", this.hologram);
data.put("LOCATIONS", this.locations);
data.put("LOOT", this.loot);
return data;
}`
is that a specific error I do not have
Did you register it as serializable
yes in main
has to be registered before you make any access to the config
@Getter
public class Main extends JavaPlugin {
private FileHandler config, storage;
private CratesHandler crates;
private HologramsHandler holograms;
private CommandAPI command;
@Override
public void onEnable() {
ConfigurationSerialization.registerClass(Crate.class);
this.config = new FileHandler(this, "config.yml");
this.storage = new FileHandler(this, "crates.yml");
this.crates = new CratesHandler(this);
this.holograms = new HologramsHandler(this);
Should be done in a static initializer block
You can do the same thing in your plugin's class
hey I've been trying for some time to send a player to another server with a spigot plugin when he joins, but unfortunately without success, the event is registered @EventHandler
public void cookiejoin(PlayerJoinEvent event){
Player player = event.getPlayer();
sendPlayerToServer(player,"citybuild");
if (!CookieklickerManager.playerExists(player.getUniqueId().toString())){
CookieklickerManager.createPlayer(player.getUniqueId().toString());
}
}
public static void sendPlayerToServer(Player p, String server){
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
try {
out.writeUTF("Connect");
out.writeUTF(server); // Target Server
}
catch (IOException e) {
e.printStackTrace();
System.out.println("Der Fehler!");
}
p.sendPluginMessage(BetterWorld.getInstance(), "BungeeCord", b.toByteArray());
}
getServer().getMessenger().registerOutgoingPluginChannel(BetterWorld.getInstance(), "BungeeCord");
well first of all your event is not annotated with @EventHandler so that event will never do anything
nvm it is
can u format your code?
okei, thanks
how
?format
```java
your code here
```
Hey Guys, we are currently working on a minigame, for this we wanted to use the normal Minecraft Spectator mode, however we are experiencing the problem that invisible Armor Stands are above the heads of the players and the NPC's, what can be the reason for this, we would like to remove this ? We use the following plugins in addition to our plugin:
Triton
TAB
Placeholder API
Citizens
Protocol Lib
Luckperms
\`\`\`java
\`\`\`
public void cookiejoin(PlayerJoinEvent event){
Player player = event.getPlayer();
sendPlayerToServer(player,"citybuild");
if (!CookieklickerManager.playerExists(player.getUniqueId().toString())){
CookieklickerManager.createPlayer(player.getUniqueId().toString());
}
}
public static void sendPlayerToServer(Player p, String server){
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
try {
out.writeUTF("Connect");
out.writeUTF(server); // Target Server
}
catch (IOException e) {
e.printStackTrace();
System.out.println("Der Fehler!");
}
p.sendPluginMessage(BetterWorld.getInstance(), "BungeeCord", b.toByteArray());
}
getServer().getMessenger().registerOutgoingPluginChannel(BetterWorld.getInstance(), "BungeeCord"); //this is in main
so?
sorry i have forgott @ eventhandler
i will make a lobby system to send the player to another server but the test are not going
ru sure the server name is correct?
what did you do that with
you could try delaying it by a tick
sometimes stuff is weird in PlayerJoinEvent with stuff like this
Ugh, debugging concurrent code is extreme pain.
That's correct. You can't send a plugin message in the join event
I've had that exact issue before with VeinMiner -,-
gradle plugin 
Waiting for Gradle 8.4 for J21 support š¤
I want to use it for an upcoming project lol
idk. J21 as far as I'm concerned
I don't Gradle enough to care about each detail on release
Hell I hardly care about Maven's release notes
Might be dumb question but do items with different persistent data stack š therefore could you limit a stack size by adding a random peice of data
They do not. Different NBT
J21 doesn't have much interesting feature imo
you are high
bro thank you so mutch
FFI and Valhalla is the only thing I'm hyped for
Record patterns, pattern matching, top level statements (in preview still though D:)
Sequenced collections are an ABI break too
ALSO FINALLY A STANDARD Math#clamp() FUNCTION
YEAHHHHHHHHHHHHHH
What about isNumeric
That is the main thing I'm concerned with
this is nice
Virtual Threads could be useful too but probably not worth it as of now
I want to say you can also use unnamed parameter names
ye
if (obj instanceof Point(_, int y)) should be valid too
Yeah I believe it is


