#help-development
1 messages · Page 761 of 1
Wooks kinda wike a seawion if u wook hawd enuf
It hurts my brian to read that at 5 am wow
A very furry one
re-reading this, separate classe
A command class is exclusively responsible for command behavior
Is that a mercedez logo
Anyone know a good way to set the damage appearance of an anvil. I don’t know if Google hates me or something, but I can’t find an answer
Damage appearance?
How cracked the anvil appears.
Ah
?spigot-jd
They’re materials
declaration: package: org.bukkit, interface: Tag
Wait what!? Seriously thought it was a block state
Thanks
minekampf moment'
?
@wet breach now im getting Check the info you entered. It doesn't match the info for this card whenever I switch my card lol
Even tho the detatils 100% correct
I have a feeling thats another way of saying card is blocked from being added
Nice. It probably is another js that needs to be invoked to make it do proper checking. Like it probably doesnt validate until a click or tab key pressed
Or it could be what you said
Hello, I'm trying to make a Kits plugin. But the system I made doesn't work at all... Does anyone have an idea?
kits:
diamond:
delay: 50
items:
- DIAMOND: 1
iron:
delay: 30
items:
- IRON_SWORD: 1
- IRON_CHESTPLATE: 1
if (sender instanceof Player) {
Player player = (Player) sender;
if (args.length == 1) {
String kitName = args[0];
if (main.configKit.contains("kits." + kitName)) {
for (String itemName : main.configKit.getStringList("kits." + kitName + ".items")) {
int amount = main.configKit.getInt("kits." + kitName + ".items." + itemName);
ItemStack itemStack = new ItemStack(Material.getMaterial(itemName), amount);
player.getInventory().addItem(itemStack);
player.updateInventory();
}
} else {
player.sendMessage("Le kit n'existe pas !");
}
} else {
player.sendMessage("Utilisation incorrecte. Utilisez /kit <nomDuKit>");
}
}
return true;
I have no errors, nothing...
what the hell is this
whats delay
also wtf is main
you would usually save items as item stacks, not strings
maybe try sending some debug messages to see where it breaks
Otherwise kits will get boring rq lmao
yeah that too
Ok
is there any event for when a you draw a block on the map?
My server uses custom blocks which are just retextured note blocks
I want some way to detect if a note block is being drawn onto a map and if it's a custom block I want to change its color
you mean when a Player places the block?
im pretty sure maps are rendered client side
I think he's refering to worlds as a map
ah okay
perhaps not though 🙂
I got confused by "draw on the map"
same
I know from modding that each block has a color that is used for drawing the map item maps
but idk if spigot exposes any of that
If he is talking about Maps then he's probably going to have to render his own image
or pick base blocks with the color you want
I know there is an event for map initialization but can I get the map that would normally be drawn from that event or does it just give you an empty canvas or something like that to draw on
it gives you a MapView
its probably used to determine what region of the world the map should draw? im not sure
you parse your list wrong way
for (String item : main.configKit.getStringList("kits." + kitName + ".items")) {
int amount = Integer.parseInt(item.split(": ")[1]);
ItemStack itemStack = new ItemStack(Material.matchMaterial(item.split(": ")[0]), amount);
player.getInventory().addItem(itemStack);
}
player.updateInventory();``` that's how it should look for your current formatting
does anyone know how to change terrain generation such that biomes are smaller, without reinventing terrain generation as a whole?
I asked this some time ago but the conclusion was that I basically have to rewrite how minecraft generates biomes
and thats not a good solution
and it's the only one i know fr 🙂
you don't need to rewrite entire generator, but probably need to work with BiomeProvider
my old post on spigotmc
well that messes with the biomes only though doesnt it?
you need biomes to be smaller no?
like, mountain generation will be wacky
idk if block generation for atuff like mountains will change too if I just change the biome
idk for sure
and even then, vanilla has like 5 noises for just biome generation
well for that you probably need to also override ChunkGenerator
well, i'm also only capable of making void world 🙂
Can I use intellij ultimate to get, for example, a command updated in the game as soon as I change something in the code without restarting the server, ie running the server in intellij.
can you do that with community edition too?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Yes
Is this tutorial for both intellij ultimate and intellij community?
Yes
Okey
why am i unable to build my bungeecord plugin?
and why am i unable to send the pom.xml in discord?
someone know how i can fix this?
I tried upgrading the clien version in the pom.xml but nothing change
Is it possible to save arraylists in a yaml file?
getList()
set()
tho you would have to manually cast your stuff to the type you need
Hey since Bukkit.getOfflinePlayer returns object for any uuid, even if the player is not real, how can we tell whether the player is real?
It will if you can change the biome before anything is generated. And a biome now since the changes can be just a single block big not that would be really useful lmao
This still doesn't work, is there anything else I need to change?
kits:
diamond:
delay: 50
items:
- DIAMOND: 1
iron:
delay: 30
items:
- IRON_SWORD: 1
- IRON_CHESTPLATE: 1
if (sender instanceof Player) {
Player player = (Player) sender;
if (args.length == 1) {
String kitName = args[0];
if (main.configKit.contains("kits." + kitName)) {
for (String item : main.configKit.getStringList("kits." + kitName + ".items")) {
int amount = Integer.parseInt(item.split(": ")[1]);
ItemStack itemStack = new ItemStack(Material.matchMaterial(item.split(": ")[0]), amount);
player.getInventory().addItem(itemStack);
}
player.updateInventory();
} else {
player.sendMessage("Le kit n'existe pas !");
}
} else {
player.sendMessage("Utilisation incorrecte. Utilisez /kit <nomDuKit>");
}
}
return true;
what's the error tho
Well first off you can check if its a valid uuid that conforms. Online uuids use uuid version 4 where as offline ones use version 3. So you can check before anything else that the uuid is a in fact a valid uuid version 4. If that passes you can probably use getPlayerProfile() as that should pull a valid profile from mojang if its a real player uuid.
.hasPlayedBefore()
!= null
.isOnline()
That only checks if they have joined your server before
if you need that for your server ofc
is there any other case to use offline player on your server?
Idk
where is it stored?
such info
out of curiosity
world data ig
Nah it’s a file
i used to uncover it from world nbt
I think it’s offlineplayers.json or something
in older versions
interesting
Actually
Thats where the data for getOfflinePlayers is
HasPlayedBefore just checks if they have a player.dat file
yep
okay, and I assume that the biomes get decided before the terrain if I use the biomeprovider?
Biomes no longer effect terrain
yeah thats my issue
I can now have a mountain with like 20 biomes if I just scale down the biomes
mhm
but instead I would rather have a small mountain with 1 biome xD
All the players data
What's the best way to convert degrees into yaw
x / 2
what kinda math is this
No errors, and no messages...
bros waffling
wa
ok have u ever heard of 343 yaw tho
how high can yaw go again, havent played this game in a while
-180 <= x <= 180
So you subtract 180?
are you in the client
Then it's in the acceptable range no
are you dealing with yaw on server or client
client
subtract 360 till its in range
thats a full rotation which in effect is no difference
that just won't work
-90 deg in yaw is 0 degrees in our conventional system
converting yaw to deg is easy with just + 90
More like converting 2d world to 3d
I receive messages "1" "2" "4"
if (sender instanceof Player) {
Player player = (Player) sender;
if (args.length == 1) {
String kitName = args[0];
player.sendMessage("1");
if (main.configKit.contains("kits." + kitName)) {
player.sendMessage("2");
for (String item : main.configKit.getStringList("kits." + kitName + ".items")) {
player.sendMessage("3");
int amount = Integer.parseInt(item.split(": ")[1]);
ItemStack itemStack = new ItemStack(Material.matchMaterial(item.split(": ")[0]), amount);
player.getInventory().addItem(itemStack);
}
player.updateInventory();
player.sendMessage("4");
} else {
player.sendMessage("Le kit n'existe pas !");
}
} else {
player.sendMessage("Utilisation incorrecte. Utilisez /kit <nomDuKit>");
}
}
return true;
?
The negativeness and positiveness of the yaw tells you the direction it is going in.
Negative should be up and positive should be down
that's pitch
Right tired lmao. So negative should be going left and positive right
double theta = Math.atan2(-x, z);
yaw = (float) Math.toDegrees((theta + _2PI) % _2PI);
what bukkit does
But the reason for doing it like that is because you dont need to do anything fancy to know the direction someone is turning such as messing with vectors lol
Would be such a pain if we had to mees with vectors to just determine the direction of rotation
Means the list your received is empty
🙏 please avoid nesting over 3 levels
Why ServerSetSlotPacket spawn sword like this? Its weird my camera is maximum down to see this normally u cant even see it
When instead of sword i send map its nearly invisible
Anyone got tutorial on how to use scoreboards...? Ever since they got introduced I got no idea how to use them correctly, especially with plugins.
And unable to read what is on the map
@Override
public void join(ProxiedPlayer proxiedPlayer) {
proxiedPlayer.sendAndFlush(new ServerLoginSuccessPacket(proxiedPlayer.getUUID(), proxiedPlayer.getName()));
proxiedPlayer.getChannel().pipeline().get(NettyPacketCodec.class).setConnectionState(ConnectionState.PLAY);
proxiedPlayer.getChannel().eventLoop().schedule(() -> {
proxiedPlayer.sendAndFlush(new ServerJoinGamePacket(proxiedPlayer.getPlayerID(), Gamemode.SURVIVAL, proxyEngine.getDimensionRegistry().getDefaultDimension_1_16(), Difficulty.PEACEFULL, 1, "default_1_1", false));
proxiedPlayer.sendAndFlush(new ServerPlayerAbilitiesPacket(false, true, true, false, 0.0f, 0.0f));
proxiedPlayer.sendAndFlush(new ServerSpawnPositionPacket(new Position(0, 70, 0)));
proxiedPlayer.sendAndFlush(new ServerPlayerPosLookPacket(new Position(0, 70, 0), 0, 0, 0x2));
}, 250, TimeUnit.MILLISECONDS);
}
If anyone interested this is code that sends packets after player join limbo
Its a bit old but i found this
https://www.spigotmc.org/wiki/making-scoreboard-with-teams-no-flicker/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
😐
how to overlap a plugin event with another plugin
I would use screenshots and gimp or photoshop.
Makes it easy to change the transparency when overlapping.
what
i'm sure you could use mspaint with some dedication
Ah ok. Yes, so the server fires one event and every plugin gets this event, one after another.
So if you get the event after another plugin has already cancelled the event, then you can simply
uncancell it if you whish. This can be ensured by having a higher priority than the other plugins listener.
lower priority you mean
lowest priority gets the last say and action
highest priority goes first and gets to do something first
thanks bukkit 
"highest priority runs last because it has the final say"
hmm that does make sense in the context of events yeah
yeah I always forget bukkit does it the opposite
how would I go about making an Inventory type for PersistentDataContainers?
You need to serialize the type and the content (ItemStack[])
I see what you are doing. Complex objects cant be serialized by just getting some random bytes.
getMSB and getLSB are methods exclusive to UUIDs because they are essentially just random 128 bit numbers.
And java has no primitive representation, so it gets split into two 64 bit longs.
The most significant 64bit and the least significant 64 bit
yeah ik but i have no idea what to put there, i copied the code from https://docs.papermc.io/paper/dev/pdc (custom data types)
can't I just serialize the whole Inventory object into bytes?
Yeah, they serialize UUIDs here
You can only serialize primitives (int, long, float, double etc) and Strings into bytes.
hm..
Well Strings also just because they are essentially a char[]
So your task now is to find an intelligent solution to serializing:
InventoryType -> some primitives
ItemStack[] -> some primitives
And back ofc
hmmm
PDCs support String as their primitive backbone. This means you could just serialize anything to json and throw it in there.
https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/ this might help, I think
to put a itemstack array in pdc you need to use bukkit object output stream
Damn that avatar 💀
This does all the heavy lifting for you. I would try to write one yourself first.
hes gay so what
oh no! a gay person
?paste
https://paste.md-5.net/tidoruyito.cs how i can resolve it?
By not calling queries with closed connections...
but is open
public void openConnection() throws SQLException, ClassNotFoundException {
if (connection != null && !connection.isClosed()) {
return;
}
synchronized (this) {
if (connection != null && !connection.isClosed()) {
return;
}
//Class.forName("com.mysql.jdbc.Driver");
connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password);
}
}
connection.isValid innit
- Get HikariCP going: https://www.baeldung.com/hikaricp
- Every time you don anything with your DB: Get a new connection from HikariCP
CP = Connection Pool
It manages connections for you
Isn't it always the same connection?
no
no
you close the connection when you finish and you only assign it once
what is the max lengh for a username in minecraft
16
arl
You should never use the same connection twice. Having to do all the validation work by hand is asking for trouble.
Just let something like Hikari handle all that nonsense.
bruh...
it sometimes can be, it depends
the job of the pool is to keep connections open for use
there is a max time connections can be opened, so they will eventually die, but the pool will detect this
and make a new connection to take the place of the one that died
i cant do it Every time I do something
using a connection pool just reduces the over head in opening and closing connections by reusing connections as much as possible before it dies 🙂
can someone help me in #help-server
Then make sure to meticulously check your connections for viability
Anyways gtg
lol, cya later
buff smile
public void onRespawn(PlayerRespawnEvent event) {
String playerName = event.getPlayer().getName();
Player player = event.getPlayer();
player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 1000000, 1, false, false));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 1000000, 0, false, false));
}
}```
fsr this doesn't give me any effects, but the event is triggered
@lost matrix i have do it
public void reloadConnection() throws SQLException {
stopConnection();
closeConnection();
connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password);
}
I do this every time I make a Query
Reconnection comes with cost
If your server has slow connection to db you should not do it.
Is it possible to move the action bar message down? It's a bit too high for my purposes atm
no
because I think thats where the item name pops up
and its like a client side thing too
resource packs
cant
So i am learning the spigot API for 1.12-1.20.2 but there something else than ChatColor ? because its deprecated
?whereami
ur on paper aint u
My bad
but anyways bungee chatcolor is better in all regards
paper still deprecate it
hm
different topic, how do i export my plugin in a way someone else can be like 'i build on this'?
like an api?
like, im working with someone else, i want to give him the ability to make his stuff interface with mine
yea
If you're using maven you can use the install task to add your project to your local maven repo
Then you can depend on it like normal
wellllllllllllllll I can do that
but that guy isnt even on the same side of the ocean as i am
As long as you both have access to the project that shouldn't be an issue
if you want easier access you can host your own maven repo
Just use git?
^^
i am but that'd still require for him to install it wouldnt it?
if you are both working on the same plugin ,just use source control like git
yes
thats kinda how git works
If you want to modify the same project, use git. If one project depends on the other, use a maven repo and automatically deploy nightly builds to it
If I want a module system within my core should I use CommandMaps instead of putting them in the plugin.yml?
Whoever does not have git installed shouldn't be having these issues
i mean maven install
Agreed
the idea here is that he doesnt have to build the plugin
For maven you'd want to do mvn deploy
wym
The easiest solution is to deploy to an FTP repo, but other ways exist
i was told here to run mvn install to get it into my .m2 folder
That is if you want it to be done privately
But if you want to deploy it publicly, deploy it is.
is there setup required or does it just end up on maven central?
also can u explain the ftp repo please?
Deploying it to Maven central/OSSRH isn't that intuitive tbh
wait what does deploy do then?
Basically you need to declare a repo to deploy your stuff to, in my case it was https://github.com/Geolykt/Presence/blob/main/pom.xml#L51-L58.
If needed (depending on the protocol), you also need to enable the required wagons like so: https://github.com/Geolykt/Presence/blob/main/pom.xml#L100-L107
hm so it requires a dedicated server, bummer
You can also do it via file://, I think (at least you can do it via gradle)
OSSRH/Maven central does not need a dedicated server, but you need to register a group id and all. It takes a good day to figure out
i probably should do that before someone steals my name again
the woes of choosing a name that sounds random but is an actual word
but what is this person gonna help with if he cant build the plugin
well..... because thats not how you distribute API stuff....?
i put the maven dependency in and hit build
or are they making a separate plugin with yours as a dep
again, yes
lol its fine
time to suffer in maven ig
hey geol is there a 'get started here' link or is this 100% pain ?
You cannot steal names
As you need to show proof of ownership of a domain name or of a github account
kthx
uh why is intellij marking this as an issue but not saying what it thinks the error is
then there is no error
ye but why does it highlight it
It tells you
Doesn't look like it is highlighting it
Unless you mean the background highlight which is just an instance highlighter
^
no it was lit while the cursor was elsewhere
You're trying to instantiate a class that looks like a utility class?
Which is what it's warning you for
it's the usage highlighter
If you clicked on instance it would highlight those 4 instances
yea but in green
whats that yellow highlight for?
is that the same thing just for the method?
green?
Probably the same thing
thats usage
Yeah same thing different colour
anywhere you have ReachAPI it shows
You could be because those are different colours lol
this isnt a green highlight lol
What is bro waffling about
Yellow highlight: #52503A
Green highlight: #344134
I think you should take a test geol 
you have a colour picker at hand?
Yeah
No way you said this
i cant type sue me
windows powertoys
Well they concluded I am utterly incompetent at distingishing colors
ShareX has some great tools, one of which is a color picker
Could be my autism idk
autism shouldnt affect your eyes
Could also be yellow-green colourblindness
wait idea brb
those values accurate?
My eyes actually work. It's my mind that doesn't
Yes
i can achieve the same with 2 apps
default apps
if it would open that is :/
tbf those colour codes are probably slightly desaturated because of your black background
The main problem I have are if the color isn't "intense" enough my brain cannot pick them out
Definitely colour blindness :p
I mainly have this problem on thin lines
might be the monitor
Usually when screens or projectors are employed
people assume monitors are built the same in 20223
These are common tests
they're not
You tried
damn
?, 8??, 16!, 8!, 12??, 9!
try again on your phone @quiet ice
i see the numbers choco wrote but now yall got me doubting myself
try on 2 devices at least
what if my green looks nothinglike your green because im colourblind but that is what green look slike
Those are red-green colour blindness tests
Yeah in that case everything but the top center ones are at least guessable
i cant recall if those dots have the same brightness, they should tho
7 13 16 8 12 9 it shows very clearly
Good job you aren't red green color blind
😛
When I magnify it I can tell the colors of the dots
maybe you have cateracts
Lol
oh thats curious, you might not be totally blind if thats whats happening here
iirc theres a lot of partial blindness types
*red-green blind
But uh, at some point my pattern recognition is just 404ing
might be the screen quality then
Doubt so.
zoom in and move the image around?
Bruh. My brain can't even see the 1 even though I now see each dot that is part of the 1
oh that's curious. I think there's one part where my pattern recognition fails too, but its on those 3d card thingies
i... have no idea how to describe them
hm, I think I know what you mean
like the ones that are just ink on cardboard
not those hologramm things but those that look like people descibe lsd
Ah uh then yeah no idea
found em
if you focus on a point closer to your eyes than the image, the regular patterns overlay. they arent exactly equal giving the illusion of holes in it
oh are u shitting me this one says LSD bruh
I don't see it
Hm. I've seen those before...
Or rather said, I've already been to this wikipedia article
What's the best way to store a set of member UUIDs for a faction in a SQLite database? Should I add this set to my table of all the other faction attributes (such as name, description, etc) or make a separate table for it?
you store the factionid in the player table
what event will be called when a block (shulker box) is broken by a piston?
oh dang i didnt think about it that way
so a separate table just for players
BlockChangeEvent something with Physicschange event i think
You can check with the block state
Hold on i will confirm that for you. Jus gettin on pc
why cant i do this NamespacedKey key = new NamespacedKey("minecraft", "Tag");
lowercase
im tryig to recreate the tag that is being added to items when using /give @s nametag{Tag:"what ever"}
And as far as im concernd its uppercase there
rules for NamespacedKeys is all lowercase
raw nbt are not necessarily namesoaced keys
@lusty cipher ,
BlockPhysicsEvent
Spigot auto converts all to lowercase
well how else do i check then
nbt is not api so idk what you're trying to use
hmm thank you very much
ah shoot
cause the only information i found was that when creating an item like that the info is saved in a pdc
pdc is not full nbt access, and it uses namespaced keys to discern plugin ownership of a tag
Yes, the event is called pretty frequently according to spigot docs, on a busy server can be called up to 1000+ times per second..
Also it is fired when a block changes state
So you can work with the piston by getting it BlockState
well tell me how else i could possibly test for that then
it depends exactly what you want to "test for" exactly
Does anyone know how to give yourself Armor Trim in the new version (1.20.2), would somebody be able to provide a code snippet of how to do so?
with pdc you can only access other tags put by your or other plugins
if an item has a certain item tag
PDC will not allow you to check nbt tags
but that event doesn't get me the item that is being dropped. I want to edit the dropped item
a item tag created by this command /give @s nametag{Tag:"nicknamer"}
PDC is a wrapper around a Spigot NBT
declaration: package: org.bukkit.inventory.meta, interface: ArmorMeta
Try this EntityCombustByBlockEvent
that sounds like something completely different
okay well then again the question what else do i do
i understood by now that my method doesnt work
Sorry im just finding out about this,
yall told me that 10 times
you would need to access teh raw nbt, so one of the nbt libraries
yes, I assume you want to store other things in there later too like kits or something
not sure if there is any capture for the vanilla /data command yet
if there is you could parse that
whats the easiest way to change a persons nametag
i found somethng about teams but either im too dumb for that or it doesnt work
Is the Stash and Jira only really slow for me or is there something going on there
Only seems slightly slower for me. Only like a second or so.
Do you want to only change the name above a players head, or also the name the player has in the tab list and chat.
I wonder if changing the users name in tab and above their head requires the use of packets
tablist and above their had in chat im doing it already
cause my chatbuilder has the nicknames of all online players stored anyways
Do you need this for changing the name completely or do you only want to decorate the players name.
Because for the former, you would want the player to also be recognised by the server with a different name
for consistency. (Auto completion or targeting someone with a command)
well then completly
In that case you probably need a more radical approach. Are you ready for some NMS and possibly reflections?
so i have a choice? xd
Wait, let me check the protocol. Maybe you can spoof the name there already.
x)
why do so many people pluralize the word reflection as reflections
looks so weird to me
i think its not incorrect
just reflection sounds better
why did it get that name anyway
reflection
anyone know
and not injections
or so
solid chance
would be beyter
probably on the tablist packet
Injection would be wrong imo
Problem is that the server uses the players name to lookup the UUID. I thought it would be the other way around...
Reflection isn't just for injecting things
More like introspection
why is it called reflection
That's serverbound though
bc oracle named it like that :)
do you have kids
Oracle didn't come up with that name
Yes, thats the point. I want to spoof the name early so that the server constructs a GameProfile with that name.
if you wanna go that far you can intercept such packets
wait no
that wont work in my situatiin
i need to be able to change the name WHILE the player is connected too
Alright, then making the server also aware of that might be a journey.
alright xd
Im in the mood for some nms digging actually. Let me see what consequences simply changing the GameProfile on playtime would have.
has no one made an api for all this yet??
like
i thought changing the players name is nothing outoftheworld type stuff
I mean there are plenty of apis for chaning a players name tag etc. But changing a players name, even with server side recognition is
something you see very rarely.
Only with a few hacks. I mean you could listen to command and tab complete events and simply replace the names.
But it would be fun to completely change a players name on the fly
alright then lets try it
couldnt you also just somehow reconnected the player and then have a new playerloginevent
or what ever event comes before the player profile is created
Just running BuildTools real quick to build a remapped project so i can explore without decompiled garbage
alright
Okay uhm, did nms always have so many unused imports?
Ah... the patches made some slight changes 🙂
damn
can I change how fishing works
Hm. It looks like it could be possible to add a name change to the AsyncPlayerPreLoginEvent. Doubt it would get accepted tho.
Sure
like force fish event but do something else for it when I actually catch a fish
or change time values needed for fish to be fished
Yeah you can do all of that
I mean... if you make them work together
as in?
If you program code that works together. 🤷
I mean
can I just idk
if you give item to a player
and I have mod installed
can I give a modded item
did you try it?
How necessary is it to tell the client about dimension codec
can the client smoke copium or does it throw a fit when you tell it to spawn in one of them
Im still following the breadcrumbs. The entire Login procedure is pretty messy.
alright tell me if theres anything i can do to help or if you made any progress
did you try turning it off and on again
Can't you intercept that packet and then inject the new username?
what about changing the name of the gameprofile after the entire login process?
I've definitely messed with something like this before
It would be theoretically possible to add a setPlayerName() method in the AsyncPlayerPreLoginEvent but i doubt it would be accepted.
hacky reflections :)
Im currently finding out what consequences this would have.
The problem is that the gameprofile gets passed around like a cheap... pencil
Its quite hard to figure out where it is used.
But it looks like the only place is the PlayerList. So inside the EntityPlayer itself.
Im still wondering why the player list needs to be a list as there is never any relevant random access via index anywhere

Jo, strong encapsulation?
Ok it looks like you can simply change the username inside a GameProfile via reflections and
resend the player info packets in order to change a players name completely.
Let me try a quick example
alright thank you
how i can get The depth of the hitboxes
?paste
https://paste.md-5.net/rofiwubemi.cs
Try this out
Hitboxes have a regular quadrilateral cross section
Are you telling me I can calculate it?
I mean. Here
mm
All sides have the same length when looking from above
Thats what i mean
Wait let me double check. This might be old information.
Yeah, looks about right
so the code is cooret because the lenght is the Width
hey, pathfindergoals wont work on newer mobs right
can you show me the imports?
i dont know which ones to use for like half of those objects xd
I hope you have remapped NMS in your pom.xml
sure...
import com.google.common.base.Preconditions;
import com.mojang.authlib.GameProfile;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import java.lang.reflect.Field;
import java.util.List;
Those are my imports
When I build my plugins (no matter if Gradle or Maven plugin), my server crashes.
Does anyone have an idea why that is?
The players get this kick message
No error in server log
i for the love of god cant find the propper maven imports
like the mojang dependency
where is that locateed
libraries.minecraft.net if you mean authlib
?nms
maybe a silly question but how do i add line breaks to this?
this is for the kick message
thats what i thought but it doesnt seem to be working for whatever reason
👍
Reading \ from a config escapes it in the loaded String.
So \n is now \\n which is not a newline character but simply the \ and n char.
yeah that seems to be it
if you wanna read lines from config just make a string list
and use a string joiner
You would have to do something like
String replaced = loaded.replaceAll("\\n", "\n");
i prefer my option simply because the user can create actual lines in the config
Or you can allow a String list, yeah
ahhh i see, thank you it works now :)
like this for me
temporär ist ein Adjektiv -> klein schreiben
das mag sein
Same goes for permanent
das mag auch sein
🙂
I often use this
text a
text b```
hey how do i make a piglin attack chickens
Have you tried just setting the chicken as a target via the api?
If this doesnt work then you need some nms
... I... I accidentally have been packaging my plugin with its 1.7.10 version using the spigot library in compile mode...
...
No wonder it was 12.2MB big...
I would be more concerned about the fact that there is someone still writing code with the 1.7 api
Did you forget to run BuildTools with the remapped flag
You need to run BuildTools
-jar .\BuildTools.jar --remapped
I try to offer compatibility for 1.7.10 onwards, since there are still servers playing on it. Once mojang removes 1.7.10 from the versions list, so will I from my plugins
I have to change a lot of code, sure, and sometimes I take a while to offer 1.7.10 compat, but It's a nice exercise and I get there
no i did that
I mean with 1.13+ you cover about 90% of all servers. Everything below is legacy in my books.
(Also, I started writing plugins for an 1.7.10 server in crucible, so it sensibilised me to it)
Fair enough, and good point!
Get a newer BuildTools version
alright papa
You built 1.20.1 and depend on 1.20.2
oh
For new plugins, I start them in the latest version an then make my way downards; If I don't have to change any code, great! If I do, then shucks, will come a bit later
My project structure is as it is specifically so i can build plugins for every version, and honestly, maven modules are carrying lol
Though my projects end up looking like this
It's the topic of conversation 😛
.
isnt hypixel 1.7 for example?
I think it does support it that much back yeah
They dont really use spigot. They have a completely custom jar at that point
Wtf is crucible
well this is still red
One vastly unknown plugin loader that works specifically for 1.7.10 Minecraft + 1.7.10 Forge
The only difference between spigot and crucible are the nms mappings
What's my peeps upto today?
So a fork of cauldron I assume
I think so, yes
Hypixel has a dedicated team of some of the top Minecraft developers where they have control over their own server software
Not at all comparable to an NMS method you want to call and backporting that call to Minecraft 1.7
pickup priority
Can I set an external download link for my spigot app to modrinth?
Could not find goal 'remap' in plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 among available goals compile, help, testCompile -> [Help 1] what do i do i hate maven
how to spawn a custom mob at a certain location, I know how to spawn a mob at a location but I dont know how to give him custom attributes
Or is this against the rules?
like name, equipment, and such
Entity entity = spawn entity
entity.what ever
I have this so far
infront of the last line
put
Entity entity =
and then you can use the entity object to do whát ever
one of their major jars they build is forked from 1.7 iirc, but its not at all as Choco said near comparable, equivalent or even alike 1.7 (spigot/bukkit)
can you do that on bukkit pls I need amethyst in 1.7
@storm crystal
mhm
Entity entity = what
Isn't the hitbox just a cuboid that's rotated based on the body yaw of the entity?
Entity entity = p.getWorld().spawnEntity(p.getLocation(), EntityType.ZOGLIN);
actually I don't remember hitboxes ever being rotated
oh no they don't lol
they're fixed
yeyeye
wouldn't be much of an AABB would they
AADN
@storm crystal like this forexample
So you don't need a third axis in the aabb
does anyone know better way of doing ?
entries.parallelStream()
.collect(Collectors.collectingAndThen(
Collectors.groupingByConcurrent(entry -> entry.getProvider().getMetadata().getId(),
Collectors.mapping(
EntrypointContainer::getEntrypoint,
Collectors.toUnmodifiableList()
)
),
($) -> $.entrySet().parallelStream()
.collect(ImmutableBiMap.toImmutableBiMap(
Map.Entry::getKey,
entry -> new PluginContainer(entry.getKey(), entry.getValue())
))
));```
you just need width and height
length is the same as width
wtf are you doing
$ as lambda parameter variable name, myes
try a regular for loop
converting a list
who'd do such a such 
_ as a lambda parameter name 🥺
parallely streaming into a collector literally decreases your performance for no reason
how do I spawn it
but WHENN
you cant
not yet
):< nuh uh
Yes you can do this so long as the Modrinth page doesn't link to some off-site payment
I'm going to assume block display's don't work in spigot? 🤔
Why would you assume that?
they do
Thank you!
if you do that it spawns. you spawn it and define the entity as the thing you spawn. Then after its spawned you can edit it
not yet.... 
I've been trying to spawn them the past few days and none have worked unless I'm just real dumb.
spawn Entitys?
Could be a multitude of reasons why it wouldn't be working
You should write concrete methods here for sure
Positioning, poor affine transformations, etc.
Yeah, that's what I'm doing using the spawn entity.
show code and errors
affine transformations?
#setTransformation()
ngl, I wish it would error at this point
Could also just not have a block state assigned to the display and it's using air instead
Like I said, lots of reasons it wouldn't be showing
I tried
BlockDisplay entity = (BlockDisplay) location.getWorld().spawnEntity(centre, EntityType.BLOCK_DISPLAY);
entity.setBlock(Material.DIAMOND_BLOCK.createBlockData());
entity.spawnAt(location);
entity.spawnAt()?
Yeah, is that not correct?
npo?
spawnEntity already spawns the entity
I'm just trying to get it to spawn into the world at this point lol.
.
Hence the name
That's a Paper method as far as I'm aware and not necessary
Alright, I removed it
Are you using paper DevBukkit
On my server or?
BlockDisplay display = world.spawn(location, BlockDisplay.class, unspawned -> {
unspawned.setBlock(Material.STONE.createBlockData());
unspawned.setInterpolationDelay(10);
...
});
Yeah that should work fine
If not then just make sure your Location objects are in the correct place as you expect
I've debugged the locations and it came out fine 🤔
are you sure your method gets executed?
I mean the rest of the code is being executed so yeah, I'm confident it is I'm trying smiles a sec.
and a print statement after it
thats the easiest way to check
also
try teleporting the player to the entity
it should trow an error if it doesnt exist
Why is the spigot api so wacky sometimes 😅
I'm trying to teleport thing atm, it doesn't show visablly unless it's just super tiny if that's possible
how can I give entity armor and potion effects?
Do you want to spawn an entity with armor and effects or do you want to give an existing entity armor and effects?
spawn
Uh oh. Dont we have a guide for entities?
use the spawn method that takes a consumer, like this for example ^^
and then you can modify the entity
how am I supposed to know
^^
To set armor get the entity equipment and to give effects you can use the addPotionEffect method
what is the newest maven compiler
I don't know if this makes any sense to anyone helping but this is the transformation https://i.imgur.com/VhQ3hcK.png
doesnt work
xdd
Not every entity has equipment. Only LivingEntities
^^
Show your entire method
w/e ill figure it out tommorow im tired
My guess is that you're still trying to spawn a BlockDisplay
Which isn't a living entity
or they forgot to cast it or something
No need to cast
its being spawned correctly btw
It's a generic method
It could also be that they didn't use the spawn method that takes a consumer
Sending: thoughts and prayers on facebook
@EventHandler
public void onFish(PlayerFishEvent event) {
Player player = event.getPlayer();
Entity entity = event.getCaught();
FishHook hook = event.getHook();
if (entity != null) {
player.sendMessage("§8[§6Server§8] §7You caught a monster.");
event.setCancelled(true);
hook.remove();
Location location = player.getLocation();
location.setX(location.getX()+1);
location.setZ(location.getZ()+1);
Entity monster = player.getWorld().spawnEntity(location, EntityType.ZOMBIE);
if (monster instanceof LivingEntity livingEntity) {
monster.setCustomName("§8[§6H§8] §7Monster");
livingEntity.setHealth(20);
}
}
}
here I got this so far
no but really how do i make it not compile 10 different version
Do a maven clean and then maven package
so my second guess was correct
You didn't use the spawn method that takes a consumer
okay thx
Like this
there is still 5..
This should work. Do you get the "You caught a monster" msg?
it works
The lowest one
i know
but
i dont want it to compile the other ones
can i turn that off somehow
it annoys me
it works but I gave up at setting custom armor and potion effects for now
Probably. I never bothered so i would have to find out how to this as well.
Not monster.getEquipment() but livingEntity.getEquipment()
Do you think having a module system in a server core would be useful so they can enable and disable if they want too and I was thinking to it so it's part of the API so people can expand on it for there on server?
Is there a way to implement cooldowns other than using bukkitrunnables?
depends on the duration
If you're not wanting to display a message the moment a cooldown ends, you could just store timestamps and compare
hmm
if it's a few mins then you could but if it's like 3 hours or more I would use timestamps etc
Yes. Always use timestamps for your cooldown and only use runnables if you want to update a users view of those timestamps.
3 second cooldown for chat
definable cooldown from 1 - 24 hours for mute
Oh then yeah, timestamps easily
No need to send messages or anything when cooldown is up, you can send the time remaining in chat if a message fails to send
timestamps you don't want to keep running runnables for hours on end it will make the plugin run slower and overload the server in the end
I don't think that would happen, but it is overkill for this situation :p
so timestamps are the only way?
I would use timestamps if you have never used them, here's a time to learn 🙂
Probably the best way. Save when a player last spoke (or when the cooldown is set to expire), compare against current time
I'm using timestamps for my ignore command and mute command
lets say i mute somebody and save it in a db so its serverwide, wouldnt it be extremely ineffiecnt to compare it everytime the player tries to speak?
I would always use timestamps, no matter the time period. Times and Durations should always be represented using fixed points in time.
Yes
?data
and you said i cant display remaining time with timestamps, therefore players cant know when their mute is gone, wouldnt that be frustrating?
How easy is it to work with timestamps?
It is very important to define a scope for your data. Load into memory when a player joins and save it back when he quits.
Its simple. You just check if a timestamp is in the past or not.
for like /mute <player> <duration> <reason> whats the format to enter the duration in mins or seconds
Depends how you implement the parsing
I was going to make a system like this D2,M24,S20 but it might be an over kill lol
A common format would be /mute bob 1d10h30m30s
Alright thank you
@lost matrix i dont quite understand the ressource, if i use the "crud" method and delete the data everytime, how can i efficiently store data that will be permanent?
The important part is The scopes of data
Mines kinda fucked then because I load the data only when it needs using then once it sets it will save then bam never uses again unless it gets called haha
but still, what do i do with permanent data
lets say i have 10000 players with levels in a skill
Save it when the session ends
I would at least update experience periodically and levels immediately ¯_(ツ)_/¯
Depends on how important that data is I suppose
is it possible to make player NPCs just like in Hypixel?
what if the server crashes tho :(
And additionally saving all loaded data every few minutes. Or for really important data you can use a write-behind method like choco suggested
or is it something too difficult/complex?
okay
of course you can
Its pretty complicated. I would use an external lib for now.
?paste
is mine fucked then? https://paste.md-5.net/viputubepa.java
if I wanted to do standing NPCs Id just use like villager as placeholder
i get this error btw @lost matrix
well I was more asking out of curiosity if that's like actual player standing
Your server isnt on 1.20.2
oh yh that may be why
this would be done with a bukkitrunnable, right?
But yeah, the periodic saving could simply be done with a bukkit runnable
You could cache the player data then save it when they leave the server and when they join grab all there data to the cache
what do i use for caches, the only cache i know of is a hashmap?
Caching is a whole layer that needs careful consideration
I know I was just saying for an extra option
isn't hypixel using citizens? (not sure exactly if its forked or a different release)
I think everyone uses citizens
But i would use Caffeine for local caching and Redis for remote caching
@lost matrix I FINALLY GOT IT TO WORK TYSM
what is this?
Tell me if the renaming works
I mean, just player looking NPCs, not actual players
I dont know a lot about already existing plugins that people use
I mean do research and see if you like it
Dont bother with caches for now. Most if not all Databases have a cache themselves.
yh it does
Cache<String, DataObject> cache = Caffeine.newBuilder()
.expireAfterWrite(1, TimeUnit.MINUTES)
.maximumSize(100)
.build();
This is how a cache from caffeine could look like
Its just a map
ok so a next level hashmap
pretty much yeah
Dose anyone use Trello to plan there work?
max size of the map. If new entries come in then oldest ones get thrown out
oh thats smart
Remember, its a lazy cache, so expiration is validated lazily (for who ever might use it)
Sure
a lil bit
😘 yeah ofc. Ill remember. And if not then youll let me know again.
Sometimes, started using Github projects tab instead
I've used it to plan my plugin that I want to release
well, mostly to the fellas who just chop that code in as is w/o knowing what it really does :,)
Citizens could make this, or you can just make your own with packets, there are lots of tutorials about this (This could be done with packets, and tricking clients to see non-existent players (NPCs).
Ill let them know when they want to add listeners to this thing :=
thank you jdk real cool
@storm crystal I would suggest this tutorial, its pretty same for 1.17.1+ versions:
https://www.youtube.com/watch?v=mnUVroXsyG8
In this episode of the Spigot MC Plugin series, I show you how to create an NPC with NMS and Packets. First, we make a fake player with a skin. Then, we give that NPC some items and a helmet. Finally, we make it look at you when you move around it. #Spigot #SpigotTutorial #MinecraftNMS
Brain.fm 20% off: http://brain.fm/kodysimpson?via=kodysimps...
What do you mean by lazy cache?
Excuse me wtf is that
something something emojis in regex
Should I allow papi placeholders in all my messages so then the people can customize them more or only ones that are needed?
I would allow then in fully plugin
Alright thank you
In my case i use an utility method, which check if PAPi is enabled and replace them using it (PAPI). If not just return the text directly without replacing
well I'm making it if they don't have papi then it disables the plugin so PAPI is a depency for me
right that perfect, would do the same haha
yeah haha
because if not is a mess working with placeholders, you have to replace them manually i neach thing. Because the values are different
yeah exactly
you can set a Scheduler so expiration and all the other obersvers/runners/whatever runs based on that
YEAH
its something about concurrency right?
yeah, for it to be eager it needs to be done async in principle
eager? 🤔
eager is the opposite of lazy
right, thanks man. Because you talk an asf closed english which you only natives understand
I mean, that's the proper terminology, lazy initialization is on demand and eager is right away
I'm not a native speaker by the way, english is my third language
if i save data to the cache, couldnt it be manipulated with programms, or does this only work if the data is client side?
Is a new Chunk object created when they unload / load
For player claims I save a list of Chunk but they seem to randomly reset
But there are still objects in the array
I would be cautious storing things like Chunks and Locations in arrays
moreso chunks than Locations
If you need a chunk you might be best off instead storing just the chunk coordinates
Got it
Whats the best way to map them so i can grab a given claim without looping thru all them
I was doing Chunk -> ClaimObject
It's kind of sloppy but I guess the only option is a string? I can do like worldname+x+z
you should really only store worldname, x , z
as you said above
also don't use a string use an object
public class SimpleChunk {
private final String world;
private final int x;
private final int z;
// constructor nd stuff
public Chunk toBukkt() {
// bukkit code here
}
}
you may think this seems redundant but chunk stores a lot more than a world name and x and z coordinateds
So map SimpleChunk -> ClaimObject
Because I need to be able to pull a claim object quickly as it is checked when they enter chunks, break blocks in chunks, etc
pretty much
Whats the best way to compare it, if i make new SimpleChunk(world, x, z) during setup, when i am checking the chunk during move event if i do new SimpleChunk again the key will not match
yes it will
implement equals and hashcode
allow the equals method to take in a bukkit chunk too
that'll limit creating temporary objects
Why people work with Chunks when talking about regions? I seem them as a mess i prefer cuboid areas using locations
im curious about this
There is also a slightly faster way with a smaller memory footprint when using a Long2ObjectMap and bit shifting x and z into a single long
But then world
Chunks are really easy to handle and portion. And way faster than cuboid regions as well.
how they faster? Im interested now if you are not bussy
Gets put in a Object2ObjectMap<UUID, WorldDomain>
Each WorldDomain contains a Long2ObjectMap<SomethingChunkSpecific>
Lookup for chunks can always be done instantly in O(1)
Regions need to be iterated and are O(n) worst case impl.
You can do a few optimizations but in the end you are always left with a small O(n) section
because you need to iterate.
how can I displace entity?
as in change their location but dynamically, not teleport them
like velocity?
yes
Unless the old world is deleted and created again with the same name. Then you would have a different UUID but are left with your (invalid) name mapping.
