#help-development
1 messages · Page 612 of 1
Yeah that's ok
no I'm not
PrepareAnvilEvent
When i setResult in this method, i cant take this result item. What should i do?
Oh my.
He only criticizes it if it has a major flaw usually
Which yours definitely does
Why what's the point, is it gonna use 100% of my server processors cpu? XD
that little compute method does nothing huge
bro ur name 💀
I posted the code for help, not for other people to find every single wrong thing about it
I'll cache it alright? xD
😄
only when it hurts my head enough
dispatch the command and have them as sender or player.chat
bro, idk what is happening lol
anyone else faced the same problem?
I am trying to add an event listener to the pluginmanager
But the TeamSystem gives error for somea reason. it sais found TeamSystem, needs Listener
But the TeamSystem is a Listener
I see you're more sensitive to bad code then XD A few quarters more of processor usage (0.25%) doesn't bother me though.. I'll cache it, it's not a big flaw
aalso check you have the right import
yup
blame the fact websocket comes up first
Bro, what did inteliJ think, i am building a website in minecraft?!?
yerah
Have furnace minecarts become any less jank in the past few years, or are they still painful legacy entities that don't understand how to survive within a modern server environment and don't understand basic physics?
How do i edit the tab/player list? i cant find it anywhere
player.setTablistFooter and header
thanks
declaration: package: org.bukkit.entity, interface: Player
PrepareAnvilEvent
When i setResult in this method, i cant take this result item. What should i do?
Is someone of you experienced with jakarta persistence api? I want to use it with spigot but I get the following error: jakarta.persistence.PersistenceException: No Persistence provider for EntityManager named persistence
@EventHandler
private void entityChangeBlockEvent(EntityChangeBlockEvent e) {
if (!game_running) {
return;
}
if (e.getBlock().getWorld() != world) {
return;
}
if (e.getBlock().getType() == Material.ANVIL) {
e.getBlock().setType(Material.AIR);
e.setCancelled(true);
// now set to air the block under if it's quartz
Block block = world.getBlockAt(new Location(world, e.getBlock().getX(), e.getBlock().getY() - 1, e.getBlock().getZ()));
if (block.getType() == Material.QUARTZ_BLOCK) {
block.setType(Material.AIR);
}
return;
}
}
This is the code for an anvil spleef game i am coding. When anvils fall, they disappear and they drop a no texture item (1.8.8 server), and the quartz block below stays. Any idea why?
Turns out it was worldguard
So you like wasting performance for a silly reason
Sounds great
but caching the pattern is as easy as moving the line to outside of the method
You guys are still interested in this? XD I've fixed that already a few hours ago
Thanks for improvement suggestions
that "buddy" posted a code to help the other person and not listen your bullshit criticism on other peoples code, I'd recommend you to focus on you and your code mistakes, which in fact we all do, as we're all learning. If you have any other questions/concerns send me a dm (don't want to spam here) 🫡
lol imagine being triggered by someone suggestion a simple change
Your server will unnecessarily suffer if you fail to listen to the advice of people that have experienced the same mistakes you’re subjecting yourself to
this makes me wonder, what the fuck am I doing for color parsing
Do yourself a favour and take the advice of others because they’re giving it for a reason
Move your RegEx patterns out into a static field. You have no reason to recompile the same expression each time
Or don’t and have worse performing code. Idc
hukkit
hukkit
((CraftPlayer) player).getHandle().b.a(test, null);
'b' has private access in 'net.minecraft.server.level.EntityPlayer'
help
?switchmappings
use mojmaps
currently your trying to access the logger
i feel like you want to use c.a
any idea whats wrong with my ide?
reload maven or gradle
reloaded mvn, cleaned invalidate caches
but still same
Can I just create a Scoreboard and then get it to change some lines?
that's still only one line
Get in in another class
Without passing it manually
Because there is a manager.getMainScoreboard
well, its very long error
I mean many errors
?paste ^
where did you get slf4j-api-2.0.0-alpha1 from?
that file is broken
try mvn clean and if that doesn't work, remove slf4j from your local maven repo
alright. thanks. Let me try
It's not a big deal, I'm just simply suggesting something, not sure why you getting all hostile on me. That's the whole point of this channel, were done here anyways I'm just trying to help 🙄
i don't see giving good suggestion to improve your code as such a bad thing
How can I listen for Chunk change?
Block / Entities have changed within the chunk
I only see these events:
now contribute a robust and highly feature full item gui api to it
and a better config api

you have to manually format it
wdym
And there are alot of Block Events, but they don't cover all block change possibilities. For example multi block change or block change with block.setType(...)
sone min
the format for hex's in spigot is §x§R§R§G§G§B§B
seriously
public class Formatter {
private static final Pattern HEX_PATTERN = Pattern.compile("&#[a-fA-F0-9]{6}");
public String format(String input) {
Matcher matcher = HEX_PATTERN.matcher(input);
while (matcher.find()) {
String color = input.substring(matcher.start(), matcher.end();
input.replace(color, String.valueOf(ChatColor.of(color));
matcher = HEX_PATTERN.matcher(input);
}
return input;
}
}
thx
(credit to @umbral ridge ) bc i was lazy and just wrote out mostly his code
boy i really chose the least optimal didnt i
ChatColor.of?
?paste for me
bungee chat api
spigot chat api
you shouldnt really ever use the bukkit chatcolor class
why not
i think the irony is i basically did what ChatColor.of does in the substr'd loop
L
need a minimessage spigot adapter that isnt like
Is this possible to check does player has resource pack or not ?
the one in minimessage
i use the leacy adapter
format it with minimessage to Component then legacy-ify it
isnt it convoluted to use bc of Audiences n shit
useUnusualXRepeatedCharacterHexFormat 
yus
also hmm
i couldve sworn when i read it it said it would need a BukkitAudience or w/e
cos i looked at adventure/MM for my stuff before i wrote my formatter
?paste
@remote swallow https://paste.md-5.net/nukayecuco.cpp
How can I listen for Chunk change? (Block / Entities have changed within the chunk)
either work
input.replace(color, String.valueOf(ChatColor.of(color.replace('&', ''))));
can use mine, can also change mine to use ChatColor.of
Empty character literal
try '\0' there idk
ight
same error
can i use urs @buoyant viper
this is why i never use chars
i feel like ive done what u sent n its worked but idk
using double quotes should work, if somehow not yeah u can use mine @silent steeple
ight send urs thanks
oh i just saw ur @, Monero 💪🏻
mine is this thing
give me crpyto
oh, var from java 10+ lol
Hey, does anybody know how to get a Biome's location? I want to create a custom compass that will point to the nearest x biome, which will be chosen by the player
the types (in order of when they appear) are int, char, String @silent steeple
im guessing ur using JDK 8 for development?
or at least ur source version is set to 8?
idk
should work just fine
toSpigotHex will only convert hex's, formatColors does the rest/normal codes
what if its a hex and a modifier
cuz its not working
it does the hex but doesnt do the &l
hmm
Sorry if this is obvious, but how do I check for a entities tag? I'm trying to check if a entity tag is one specific string
i have an idea
i may be stupid, but im also about 1k miles away from home to fix my stupid
i hand off my errors to uhh @remote swallow
i think i got it
why are you 1k miles away
vacation
and i forgot to leave my PC running so i cant VNC into it
bored idk
how can i get the block the player is facing?
like what block theyre looking at?
yep solved it
there should be a method rayTraceBlock in World (or Entity/Player?) that u might able to use
what was wrong?
this is my util class
public static String sColor(String s) {
return ChatColor.translateAlternateColorCodes('&', s);
}
private static final Pattern HEX_PATTERN = Pattern.compile("#[a-f0-9]{6}", Pattern.CASE_INSENSITIVE);
public static String sColorHex(String text) {
StringBuilder sb = new StringBuilder();
for (var i = 0; i < text.length(); i++) {
var c = text.charAt(i);
if ((c == '\u00A7' || c == '&') && i + 7 < text.length()) {
var hex = text.substring(i + 1, i + 8);
if (HEX_PATTERN.matcher(hex).matches()) {
sb.append("\u00A7x");
for (int o = 1; o < hex.length(); o++) {
sb.append('\u00A7').append(hex.charAt(o));
}
i += 7;
continue;
}
}
sb.append(c);
}
return sb.toString();
}
how can you get the name from an inventory?
and i used it like this
lore.add(sColor(sColorHex("|- &f&lGenerator Information:")));
for example
yes
oh were u just forgetting to format the rest of the text
aka forgot to wrap sColorHex in sColor
i forget why i made them separate methods
probably bc i had spent so long trying (and failing) to properly parse the hex lmao
because you added it all into 1 line?
ur not appending newlines by the looks of it
How do i split it up in lines?
add \n at the end of the strings
Hey I have a question why is it when my config.yml file loads well it removes # and spaces?
It says Illegal character: \ (U+005C) and Cannot resolve symbole 'n'
ur doing it wrong
Isnt this right? String deathMessage = deathMessage1\n + deathMessage2\n
deathMessage + "\n"
Thank you
?paste
How do i make bold text on discord in a plugin? ** dosent work
https://paste.md-5.net/uhiwumihun.cs - what to do? This code creates 2 seats for the horse, but it does not update its location in the stream if the player is sitting on the stand
I am coding a player vault plugin. It will sort the items in order, not according to the slots placed. For this, the player saves the items according to the page every time he changes a page. But while inserting, I insert in order, but a few dupe issues arise. Does anyone have a suggestion for a different solution?
Does anyone know?
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
on discord
Ohhh.. yeah of course, i though i could use discord things because its a discord bot plugin..

lol discorte chat gpt💀
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1225/diff#src/main/java/net/minecraft/advancements/Advancement.java I'm glad to know I'm not the only one who has accidently pushed NMS xD to spigot pr
@worldly ingot ban
lol, done that once before
I forget his username. I know he's in the Discord
@civic sluice
Fuuuck
help me
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
fixed. probably need to add that to my global gitignore
i wouldnt do that
I hate that.
coll did that and he now couldnt run buildtools
Then probably a thing for pre commit hook or even pre add hook if that exists.
pre commit hook? global gitignore? breaking buildtools? what are you all talking about lol. how can you even accidentally commit thousand files lol
its very easy to accidently just click the commit all button
It is very easy to accidentally execute git add src instead of git add src/main/java/org/bukkit
oh well I just select the files I changed in intellij
and it never even suggested to add any other files than the ones I changed
yeah image using git from command line
have you done a craftbukkit nms patch before though
Craftbukkit yes, nms no
git add * should add only changed files
Or, no, wait, sorry. git commit -am that is
There's probably a flag on git add as well that does this
nah git add does only add changed files that aren't filtered out by gitignore
And nms changes are file changes. Apply patches moment.
has anyone used it?
And nms isn't ignored in gitignore
stash scares me
@lost matrix hey
i copied the DisturbedFiller
How to use it
Why dosent my text get formatted? when my discord bot is sending "test" it isnt bolded in my coded i wrote this §ltest but it dosent work
because you cant color stuff on discord
you can format on discord, you can format and color in minecraft
But §l dosent work and ** around test dosent work too
where are you putting it
String test = "**▌test**"
Anyone used this?
look at this
read the javadocs
ok
if you cant read javadocs, and hate them. somehow i dont think you should be making stuff in java
Why isnt it getting formatted when my discord bot sends it?
String test = "▌**test** "
because my internet is too slow for it
idk how ur internet can be that slow, i had 6 megabit down awnd could read them fine
no way you are programming with an internet too slow to use javadocs
You could do it on dialup and be fine
Does anyone know why its not getting formatted?
it gets boring, waiting for each page to load
i used to have 0.5 megabit up and could send messages just fine, i somehow doubt its worse than that
unless you are on satellite internet
it sadly is
Hi, I've installed spigot on my computer, the server works fine but I don't know how to put commands on my server without giving myself the permissions. Do you know how to help me?
I have a file called "commands" but I can't put commands in it
that file is for command alias's
It's been a few years since I've used custom generators. I used to be able to override the vanilla BiomeProvider. So I could use a custom biome layout before the world generates. Can't seem to get it to work now. Overriding getDefaultBiomeProvider in my plugin class. Anything I'm missing?
Skill issue
Can someone help?
can you send screenshot
Not verified? Upload screenshots here: https://prnt.sc/
Why don’t you just download them to ur disk
And then instant
How can I make a still standing villager with no collision?
That is not whole embed
Hows code looking
its already bold
eitehr it isnt being encoded utf8 or discord is failing to read it properly
underlines in embeds do work for me
How do I update a Scoreboard?
What do u wanna update
i create them through yaml files, nothing special. I just use the normal formatting codes https://github.com/JEFF-Media-GbR/JeffBot/tree/master/src/main/java/com/jeff_media/jeffbot/discord/embed
works fine for me
the author doesnt support markdown, the description does
exactly like my screenshot
Or look at this, it reads a yml file and turns it into an embed
Also using embedbuilder
Yes, whats the problem with that?
Thats a typical game loop
i didnt know that was how you keep something alive
Many games have a while(true) or while(running) or sth in the main thingy, i just did the same for the bot lol
how did u stay alive? 
TIL
Pension funds hate this trick
someone used reflection and turned the queen off
correct
the author has no formatting
reflection? she was just picked up by the Garbage Collector
she had a while(running)
Lmao
Fun fact: a letter from germany to UK only costs 30 cents more than germany -> germany
really?
damn yall gotta pay for in-country mailing?
Yes, i sent a letter to wales few days ago
jk u gotta use stamps for US too but i think it depends on the kind of mail
Damn, I needed to pay like 1.20€ for Worms -> stuttgart XD
hm yeah I also paid 1.20€ lol
wdym
correction: 1.10€
normal letter is 0.85€
idk about letters
national 0.85€ and international (every country) is 1.10€
what is the best way to fix a race condetion in mysql ?
saving data on quit .
loading data on join .. ?
did you tell ur ide to add the import
use caffiene and yeah
i have a cache system implemented
so when player join :
i delay it to 1 second
but it seem to have no effect as it still load the old data ..
use futures
futures?
also do it on the async pre join event
i need to get the player instance .. and not the uuid
read this
you should never require a player instance
it should all run off uuids
but iam setting it to the player ..
Lets turn that into a blog post
user.setplayer and player instance
what does setPlayer do
iam using it in diffrence places :
huh
how isnt static supported in java 8
Is there a way to make a specific falling block stay a falling block even tho it hits the ground?
a get Player is fine, but having a setPlayer will break as soon as the player leaves and you try and do something
Not verified? Upload screenshots here: https://prnt.sc/
what i can do now to fix it?
Because if i try to use EntityChangeBlockEvent, the block just disapears and i think thats because this event stops it from going solid but the fallingblock disapears before hand
modify your code to not need a player instance and work off a uuid with the pre join event
alright
UUIDs my beloved
i feel a learnjava! coming
keep a weak reference of the player instance if you want
?paste your whole class
Hey i want to update my scoreboard so I set a new Score on the current one
Score map = online.getScoreboard().getObjective(DisplaySlot.SIDEBAR).getScore(
ChatColor.translateAlternateColorCodes('&', "&dMap: &l " + Cache.currentArena.getName())
);
map.setScore(3);```
Here comes the Problem
use fastboard
just do a null check on it, as when the player instance is gc'd the reference is removed, idk if its the entire value goes to null or just the getter for it
bruh ok
fast board will make ur life easier
that's what did you meant right?
yeah
Do entities have something similiar to CustomModelData like ItemStacks do?
no
what would this be any diffrence?
if anything you want to block on the async pre join, this ensures your data will be loaded
wdym "getConfig()" doesnt work?
Any way to distinguish an entity from another?
visually?
Great let me try it out 😄
yes
i don't think so
you cant have a static method in an inner class
like could a texturepack change their visuals based off of their name?
remove the static keyword
ofc you can
?learnjava!
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
thats not java 8
getConfig() is an instance method
or through their PDA of some sorts.
the thing is EpicEbic its loading the data when moved to the SERVER [B] faster than its saving it on server A (the server you were teleported from). .
might wanna block on quit instead
block?
smh
when you do io on the main thread it pauses it, thats why you do sql and stuff async
it is
if you block when they quit they wont move untill the save is done
something fucked up on there end then
you might honestly be worth making a bungee api, that stores data there and it only saves it to db when they fully leave the proxy
im pretty sure bungee knows when they quit proxy, or change server
could probably mix in redis pubsub
you could have a table that keeps record of whether a player is "still online" on any server, then only load the data when this is set to false again or sth. or use redis or sth for that
so i don't need the taskchain?
this is the requestConnection method :
iam not
so how would i want it to work :
-
Player select quests in the lobby server
-
Player go play bedwars or smth , finish a quest -> update it in mysql
-
Player is sent back to lobby to play another game or smth , and his data is loaded there
load data on bungee and give it to servers as requested with redis pubsub
alright thank
then you dont save it and load it most likely on the same machine within millis
never used redis before , do you have a tutorial or something i can read to learn it?
iam ..
same database , same plugin version , same server version
havent touched redis compleletly myself, but take a look at this https://github.com/mfnalex/PlayerDataAPI/tree/master/playerdataapi-core
Anyone?
thats what you can work to avoid
without a proxy in the way it works just fine :
join server A -> select quest -> leave -> join server B -> I found the data there .
dude what is this
- you didn't call setDescription if it's not there
- ever heard of String.join?
?learnjava! for the love of god
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
this hurts 🥲
why is that even mutliple strings
you can do it in 1 string
String deathMessage = "Line 1 \n" +
"line 2 \n"
String myString = "hello\n"
+ "this is a string\n"
+ "...";
or just
String myString = String.join(System.lineSeparator(),
"First line",
"Second line",
"Third line");
When is \n not the line separator?
weird
when you use windows
Java 15+ has text blocks
So epicEbic about this .. it already saving correctly but with bungee or veloctiy it does not do that ..
bungeecord api + redis pubsub is the way to fix it ?
granted, windows is the only thing still in use that doesn't use \n
it should fix most of ur issues (dont quote me)
its alright i won't thanks how would the system works ?
yeah but IIRC they use java 8
load data on the bungee join event, track it to their uuid, have an api or whatever that spigot plugins can call on to request specific data from bungee and the backend of that uses redis pubsub
thanks for explaining ❤️ ..
what is the default walk speed for a player?
That? Or in blocks per second?
I don't plan to run a blog
that, thanks!
i got a question for y'all. I'm thinking of adding custom sounds to my server's texture pack but how would i play them? Since they wouldn't be apart of the bukkit api?
is there a way to play a sound with its name only?
i'm guessing
playSound takes a string
declaration: package: org.bukkit.entity, interface: Player
To be honest, I found this code in one of the long ass tutorials (1+ hours) and the guy explained every single thing, he wrote this, I just modified it a little but forgot to cache it, I did it now though thanks to 10 million people wanting me to do it xD
Thanks!
Why would you use static though? Now I know
It's always okay to suggest it 1 time, I'm perfectly fine with that. But when it's suggested 3..4 times then, it would piss off anyone lol, thanks though, I do understand what you mean and thats okay
wish i had found it before i wrote my abomination lmao #help-development message
damn
You know your code the best xD But I don't think it's bad.. There is no such thing as a bad code. Just learning mistakes
How can I get the texture string of a player?

thanks never seen that
player.getPlayerProfile().getTextures().getSkin() returns a URL
Thanks
Let’s say I have a plugin that needs to be refactored and my dev quit, where do I find a new one - how do I ask for one and where?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Ty
Some reason adding a texture to a player NPC through gameProfile.getProperties().put(“textures”, new Property(“textures”, texture, signature)); only adds the inner base texture without the overlay (if that’s what it’s called). Does anyone know how to fix this?
Some any other place that doesn’t require me to have 20 posts beforehand? Is the a discord server for hiring people?
you could hire me
other than that, no I dont know any discord servers for hiring people
you didn't set/send the player meta
How should I do this?
I’m using the Mojang remappings btw
why don't you use PlayerProfiles?
there's no need to use mojang's GameProfiles anymore
Because I’m finding lousy, outdated tutorials
I’d rather use PlayerProfiles, but don’t know how
PlayerProfile profile = Bukkit.createPlayerProfile(UUID.randomUUID());
PlayerTextures textures = profile.getTextures();
textures.setSkin(someUrl);
profile.setTextures(textures);
yeah his issue is not with setting a texture, he's not got teh right data set to enable the second layer
the getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);
How should I create a server player using a player profile?
You could also just cache and uncache stuff with a plugin on your proxy with redis and make redis calls whenever you need the data. (using hset) and you should generally get data back in millis.
thank you for explaining
oh didnt know you need it for NMS stuff. yeah in that case you need a game profile, that's true
I need to send an entity data packet? Shouldn’t it contain second layer data in the texture sent when the NPC is spawned in?
second layer has to be enabled
Oh, I see.
How should I enable it?
I’m new to NMS
Well, I’ve done it off and on every so often. Not that much
send that packet I posted above
but be sure you set the flag correctly in the data first
What is a flag? Sorry, I’ve not experimented with changing entity data much.
Idk what do you expect when asked that vague question in spigot server
we even don't know what wrapper are u using
or are u even using wrapper
is there a way to determine what caused the PlayerItemDamageEvent to trigger? Trying to have it where if a specific item, mining a specific block happens, then the damage event is cancelled. Looking through the docs doesn't seem to indicate a simple way to do this.
you could listen to BlockBreakEvent, set a flag like "ignoreNextDamageEvent" to true, then in PlayerItemDamageEvent, if the flag is true, cancel the event, and set the flag to false again, or sth
Event driven code is still a little new to me. How would PlayerItemDamageEvent read the value from BlockBreakEvent?
Because its the same item
you'd probably have to flag what item it is as I guess it would be possible for an armor damage event to jump in the middle.
private boolean ignoreNextDamageEvent = false;
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
if(/* player is using my custom item && is breaking my custom block */) {
ignoreNextDamageEvent = true;
}
}
@EventHandler
public void onItemDamage(PlayerItemDamageEvent event) {
if(ignoreNextDamageEvent) {
event.setCancelled(true);
ignoreNextDamageEvent = false;
}
}
something like this. Or maybe set the ignoreNextDamageEvent to false again automatically one tick later, in case for whatever reason the damage event isn't always called
i don't think so
Any way to force and/or semi-force a top down view? 🤔
Wouldn't there be navigation difficulties? 🤣
Why would there
use hologram or particles and make the hologram large
can easily get a top down view that way 🙂
if you still need them to move around
Did you get a cat yet
I have event listeners in different classes, overriding onCall. Let me back up and that may help with a good solution. I’m modifying so that when a certain block is mined, it causes 100 damage to be added. OnBlockBreak checks for the block being mined and the tool being used. After that, PlayerItemDamageEvent is called. I want the damage to apply regardless of it the item has unbreaking, so if unbreaking procc s, it has to account for the damage that wasn’t applied.
No, the place I rent requires a pet deposit before they will let me have a pet. But there is other things I need first
Oh rightt 👀
adopting is free
not always, but I know plenty of places where it doesn't cost much or is free
but that isn't why it will cost me $500 lmao
a pet can be quite destructive if the owner isn't responsible. I can see a $500 being resonable, if they risk having to replace skirting boards/doors/flooring
oh I am not complaining about it lol
seems more then reasonable to me
just I have other things I need before I put more money down is all 😛
I just hope you have a good landlord who will give it back when teh time comes. Often they become different people once you decide to leave.
its illegal for them to keep the deposit and if you take them to court they will automatically lose if they can't show proof of any damages and the repairs made. You will get double the amount back if they refuse to give up the deposit and in some states its triple
nice
in other words it would be in my benefit they try to keep it when they are not suppose to XD
here in teh UK its not so
my best friend's former landlord still owes her about 1000€ of deposit but she's too afraid to sue her about it so I guess the money is gone lol
that is actually quite a bit
I would sue, especially since I always have pictures of when I lease and when I leave
Yeah
but there is plenty of stuff though that the land lord simply can't keep the money for. For example painting
in the majority of states the land lord is actually required to paint between tenant leasing anyways, therefore they can't charge you for this
carpet, if its 3-5 years old already, they can't charge you for anything in regards to it because its considered wear and tear
I am lucky that my landlord is my best friend‘s mother so she‘s quite friendly and doesnt try to do weird things
Blinds are the same as well and basically everything in the unit has a wear and tear factor associated. Meaning they could only keep the deposit for something that would be unusual. Like putting a hole in the floor for example. That isn't really something that happens with wear and tear or big holes in the wall or maybe some broken windows
Yeah everything that „degrades over time“ is usually the landlord‘s problem
Send the „player is sleeping“ packet
Idk which one it is exactly
Probably something with EntityMetaData or sth with that in the name
yeah, here that is pretty much the case unless the can show that something is broken when it shouldn't be
like if the fridge was brand new when you moved in, and now its not working anymore
XD
but it depends on how many years too, but lets say 1 year lease
that fridge should still be working lmao
and at the very least why wasn't the landlord notified
also, of note there is a lot of things that are landlords responsibility to repair. And the landlord can't increase your rent for it, except between lease renewals and you can withhold a portion of rent or all of it if they don't make repairs within a reasonable amount of time. Now that isn't to say they are not owed that rent, just don't have to give them what is owed until they fix problems
https://nms.screamingsandals.org/1.19.2/net/minecraft/network/protocol/game/ClientboundSetEntityDataPacket.html
https://nms.screamingsandals.org/1.19.2/net/minecraft/world/entity/Pose.html (Pose.SLEEPING)
you defeinitely need these 2 things
Also, if you don't want to wait for land lord to fix it, you can fix it yourself and charge the land lord for it. However this is only possible if the land lord is taking an unusual amount of time to repair it, or you have at the very least notified them of the issue
Say I want to have an item that makes players run faster when holding it. Should I edit the player's GENERIC_MOVEMENT_SPEED (https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html#GENERIC_MOVEMENT_SPEED) attribute or should I use setWalkSpeed (https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setWalkSpeed(float))?
declaration: package: org.bukkit.entity, interface: Player
declaration: package: org.bukkit.attribute, enum: Attribute
I'd imagine attribute modifiers?
Wait, can attribute modifier be applied to player attributes? I don't see that as a thing
Sure, but I want it to affect the user even if they have speed or other things changing their walkspeed value
Ideally it'll just multiply their speed by 1.25x while active or something
how could i possibly set up the 1.7.10 spigot/bukkit? i want to do it with intellij community
1.7.10 😭
I feel like this gets messy if other plugins are modifying walkspeed though, eg: if I apply my 1.25x multiplier, then they get slowed down (by something idk) and then I remove my 1.25x multiplier it may not be the same value. I feel like it'd be much cleaner if I could us attribute modifiers
wtf
you don't you upgrade
atleast 1.8.8 my man
and that's saying a lot
1.7.10 still has log4j exploit xD wait I wonder how many 1.7 servers have that patched it'd be fun to go back and try xD
if all of you just want to say "why don't you upgrade" or do a "crying emoji" then do leave, i just want to do plugins for 1.7.10, i don't want to upgrade.
If it's not usable anymore then just tell me, don't say "why not upgrade"
its not that its... not usable... but why work with such an old version?
you could save a lot of headaches by using the latest version (or at the very least, like 1.16)
I mean you coulddd use it, its just you're opening a box of security vulnerabilities I doubt you could patch
forge/mod purposes + dragon block c purposes
I'm trying to make a player NPC show its skin outer texture layer. The player spawns with the skin, yet still doesn't show the outer layer
SynchedEntityData entityData = npc.getEntityData();
entityData.set(npc.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);
List<SynchedEntityData.DataValue<?>> valueList = entityData.packDirty();
ClientboundSetEntityDataPacket entityDataPacket = new ClientboundSetEntityDataPacket(entityID, valueList);
connection.send(infoPacket);
connection.send(addPlayerPacket);
connection.send(entityDataPacket);```
it is fine
that's not what i meant
or are you trying to create a hybrid
does spigot even host the 1.7.10 jar anymore?
1.7.20... unreal....
spigot doesn't run mods
Hello, I am coding a playervaults plugin, but the items will be sorted in order. For this I save the items by page and sort them in order but there are a few dupe issues
This item is on page 2
1st page has gaps
so he puts it in the spaces
but those items are still on page 2
how do i fix this
i think BT only goes back to 1.8.0
mohist.
not supported
hybrid servers
and dangerous
is the Spigot 1.8 build still that strange protocol hacked one that supports 1.7.6-1.8.8? lol
if you are going to use forge use forge
private void storeItems() {
List<PlayerVaultItem> playerVaultItems = playerVault.getItems().getOrDefault(currentPage, new ArrayList<>());
playerVault.getItems().remove(currentPage);
playerVaultItems.forEach(playerVaultItem -> PlayerVaultPlugin.getInstance().getDatabaseManager().getPlayerVaultItemRepository().delete(playerVaultItem).join());
playerVaultItems.clear();
for (int i = 0; i < PlayerVaultPlugin.getInstance().getConfig().getIntegerList("gui.paginated-slots").size(); i++) {
int slot = PlayerVaultPlugin.getInstance().getConfig().getIntegerList("gui.paginated-slots").get(i);
ItemStack itemStack = getInventory().getItem(slot);
if (itemStack == null || itemStack.getType().equals(Material.AIR)) continue;
PlayerVaultItem playerVaultItem = new PlayerVaultItem(player.getUniqueId(), playerVault.getVault().getId(), currentPage,
BukkitSerialization.itemStackToBase64(itemStack));
playerVaultItems.add(playerVaultItem);
}
if (playerVaultItems.isEmpty()) return;
playerVault.setPlayerVaultItems(currentPage, playerVaultItems);
playerVault.save();
}```
this method works before every page change and when the menu is closed
if i learnt 1.16, would the learning still serve for 1.7.10?
Last time I used one of those softwares it didn’t take long until production broke but they’re cool projects
API-wise, maybe
NMS-wise, not at all
i don't know what is nms
mohist also provides patched jars without permissions of plugins and blames the plugins (essentials)
internals, net.minecraft.server stuff :P
definitely not
nah?
Oh what a great start 😬
I mean think of all the convient shit we have now we didn't have back then
true
so basically if i learnt 1.16 i wouldn't know how to use 1.7.10?
I mean it woulda kinda transition over, but there's no point
just code a server sided mod with forge
it'll be way easier
thats not what i meant
Not entirely true
if you want mods, and plugins, don't do that, just use mods
i'm really confused right now
?
But its like if you if u code on the modern web, would you know how to code on the web infrastructure we used 10-20 years ago?
Probably not
A lot of things have changed for the better
idrk what to do, i want to make plugins for both 1.7.10 and 1.16 (and up)
drop 1.7.10 support work with only 1.18.2+ at minimum
1.7.10 sounds like a big one of those “shooting yourself in the feet” moments
only 8% of servers run 1.8, and even less run 1.7.10 over 85% of servers run 1.18.2+
oh i also want to mess with the nbt from a mod thats 1.7.10 (or something like that)
nvm, i should probably do as you sai
d
just create a serversided mod
its like Ghostbusters, dont cross streams.
hybrid servers are a mess of two independent codebases hacked together
if youre gonna work on Forge modded servers, its better to just make a Forge server-side mod
no matter what version of minecraft ur using
my shit's names are too descriptive. i think I'll rename CustomBlockData to Paschinski, and MorePersistentDataTypes to Koslowski.
is it fine if you use 1.8.0 jdk for 1.16.5
yes
gooood
are you using maven?
yeah?
ok great
cant wait to learn..
I'd recommend a more recent version but it would work yes
1.16.5 is java 16 i think
I'd use that version
Its more stable and has more features
no streams or lambdas in java 8
lambdas 😭
I think that’s java 7? 😅
Ye
Indeed
Compiles to invoke dynamic
So very fast
8 was the version that added both
1.16 is java 8, 1.17 is java 16, 1.18+ is java 17
got confused rip
na all good, same honestly
We’ve been feasting on it for so long its easy to mix it up
Oh 1.17 is when they switched? I keep thinking it was 1.13 🤦♂️
I'm trying to make a player NPC show its skin outer texture layer. The player spawns with the skin, yet still doesn't show the outer layer
SynchedEntityData entityData = npc.getEntityData();
entityData.set(npc.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);
List<SynchedEntityData.DataValue<?>> valueList = entityData.packDirty();
ClientboundSetEntityDataPacket entityDataPacket = new ClientboundSetEntityDataPacket(entityID, valueList);
connection.send(infoPacket);
connection.send(addPlayerPacket);
connection.send(entityDataPacket);```
Tbh there are good reasons why one wouldn’t wanna use streams or lambdas
to avoid nested lambdas one has to adhere to the monad pattern
And just that adds complexity to ur code
One of these days conclure could just start making up patterns
Moreover streams aren’t that pure as they seem, there is a lot going on under the hood
And I would never notice
I bet he already does that
But nobody dares to say anything
Lmao 🤣
I wish more would understand this
Everyone just silently nods to not show up as stupid
Oh yeah ik, I've rarely used streams
Inb4 monad pattern isn’t real
you probably have used them before without realizing
My biggest fear roflmao
Ah yes, the vacuum pattern. Ofc i heard of it
lol
streams have existed even before lambda was really a thing in Java
Java 22 will finally add rivers and oceans too
ah yes to complete the collection
Yeah lol
yes
NoteblockAPI still uses java 7
Collections u say? 
When do we get the more advanced stuff
Java 23 aims to add hydro accelerated patterns to implant a bombastic side eye principle on the moon 🤡
Like oxbow lakes
lol
Can you help me
O am coding a playervaults plugin, but the items will be sorted in order. For this I save the items by page and sort them in order but there are a few dupe issues
This item is on page 2
1st page has gaps
so he puts it in the spaces
but those items are still on page 2
how do i fix this
I see a lot of people use a bunch of APIs but frankly it's often just for a couple of actions they could achieve with nms or sometimes natively. So what does API really stand for ? Abscense of Programming Intellect ?
private void storeItems() {
List<PlayerVaultItem> playerVaultItems = playerVault.getItems().getOrDefault(currentPage, new ArrayList<>());
playerVault.getItems().remove(currentPage);
playerVaultItems.forEach(playerVaultItem -> PlayerVaultPlugin.getInstance().getDatabaseManager().getPlayerVaultItemRepository().delete(playerVaultItem).join());
playerVaultItems.clear();
for (int i = 0; i < PlayerVaultPlugin.getInstance().getConfig().getIntegerList("gui.paginated-slots").size(); i++) {
int slot = PlayerVaultPlugin.getInstance().getConfig().getIntegerList("gui.paginated-slots").get(i);
ItemStack itemStack = getInventory().getItem(slot);
if (itemStack == null || itemStack.getType().equals(Material.AIR)) continue;
PlayerVaultItem playerVaultItem = new PlayerVaultItem(player.getUniqueId(), playerVault.getVault().getId(), currentPage,
BukkitSerialization.itemStackToBase64(itemStack));
playerVaultItems.add(playerVaultItem);
}
if (playerVaultItems.isEmpty()) return;
playerVault.setPlayerVaultItems(currentPage, playerVaultItems);
playerVault.save();
}```
this method works before every page change and when the menu is closed
Application programming interface
it's called "not reinventing the wheel"
But yes koalexis I’ll give you a short history lesson
Go back some years and the amount of features spigot had in its api was way less
Thus so many apis and libraries were created to provide features that were missing
Often this required to at some point reference nms, and just doing that is somewhat effort taking since you gotta setup up the project environment, write good code, maintain and so on
This is partly why people just use apis from applications as well as frameworks and libraries, features might not be available from whatever stuff you’re using so then its just too perfect someone else has written exactly what you need
There is also another term thats good to know called ABI
Which stands for application binary interface
And has more to do with the binary compatibility of an application interface
Don’t forget about ABBA

interesting blog post in case someone is bored -> https://www.morling.dev/blog/refining-return-type-java-methods-without-breaking-backwards-compatibility/
If you work on any kind of software library,
ensuring backwards-compatibility is a key concern:
if there’s one thing which users really dislike, it is breaking changes in a new version of a library.
The rules of what can (and cannot) be changed in a Java API without breaking existing consumers are well defined in the Java language specification...
convenience
i wonder if @worldly ingot could utilize this for integrating Components to Bukkit rather than .Spigot
Looks like it's taking advantage of types that are similar to one another, so probably not
Plus we aren’t changing return types in that, are we?
We are making a new method with a different return type
Just uhh, make the component methods take a parameter that does nothing
And have people pass null
10/10 best api design
return Object 
take in a parameter that lets u choose the return
and have a zero-parameter version that returns String for backwards compat
Both options are kinda fugly
there is only one option, Removal!
True
damn I love how even after years of experience with packets and nms half my shit doesn't work
coding 👍
While I still have some bugs in more complicated functions I do notice a huge decline in issues after long coding sessions. It ain't a rare case anymore that after 3 hours of coding everything works first try. That's generally coding related, not packets/nms related. 1-2 years prior it was pretty rare to have no bugs after coding for hours
Therefore I learn a lot less from "basic tasks" which is a little sad. A fair tradeoff I'd say
Long story short: "Half my shit doesn't work" is a long lasting friendship but at some point you lose contact
this seems like very messy code with all the appends
how could i improve it
i mean ig i could not use a StringBuilder
but
meh
other than moving the string build parts to seperate functions to clear up a bit I don't think there's a lot you can do
I wouldn't say it's that messy either. Have seen worse
You really don't have to use a string builder here
You're not getting much benefit out of it anyways
Mc ver: 1.20.1
hello every1
I am making a plugin that if or if it loads after another, the issue is that with depend on plugin.yml is not working because the plugin is injected by another which downloads that plugin I need any idea or I rethink otherwise the code?
When not using a loop to build a complicated string this is the cleaner way, yes. As Choco already stated it will barely change anything performancewise
alr
ima have to split all this up into different classes to follow SOLID
since this class is doing way more things than 1
but
I don't fully understand your problem. So you have a plugin that loads plugins on demand. Do you want the loaded plugins to depend on the plugin that loads them?
Something like this, the plugin depends on the dependencies that come with the downloaded plugin
If the plugin that loads those plugins loads first, can't it download and initialize the other plugins before the one that requires them as dependencies loads?
I'm trying to display frozen hearts onto the player. So far I've tried both
player.setFreezeTicks(100);
player.lockFreezeTicks(true); (This just locks the frozen effect on the side of the screen really).
Anyone have any ideas how to display the frozen heart effect?
is 100 equal or more than maxFreezeTicks?
No
I'd guess you don't get those hearts before being fully frozen
You need moar powah
if im wanting to return 2 values in 1 method should i use a map or something?
Ah, I see
since i dont wanna loop the inventory twice
Make some kind of data class to hold them both
You either define an object or you can use an Entry or Pair
So can't instantly set freezing, have to wait the minecraft default time
no you just set the freezing ticks to maxfreezingticks. 100 is not enough
It's 5 seconds, and default freeze time is 7 seconds?
hmm
so like this
@Getter protected static final ImmutableMap<Material, Integer> sellableItems = ImmutableMap.of(
Material.WHEAT, 25
);
@Override
public Pair<Double, Integer> calculate(Player player) {
Inventory inventory = player.getInventory();
double amount = 0;
int itemAmount = 0;
for (Material material : sellableItems.keySet()) {
for (ItemStack contents : inventory.getContents()) {
if (contents != null && contents.getType().equals(material)) {
amount += contents.getAmount() * sellableItems.get(material);
itemAmount += contents.getAmount();
inventory.remove(contents);
}
}
}
return Pair.of(amount, itemAmount);
}```?
I'll test it out, but if I'm still needing to wait 7 seconds then there really isn't a point to max freeze ticks
Yes that would work. Usually you would still create a little record for that matter since you can give it a reasonable name. That's up to you though
When you set it to maxfreezeticks I would expect you to not be required to wait longer.
alr well if that's all
Interestingly enough, 200 fixes it o-o
because it's over the max so he's fully frozen
that's why you just set it to what maximum returns
yeah, i was assuming it was like fire ticks
then even if another plugin for whatever reason increased it, you'll be fine
where it's a duration that lasts after the player leaves the area of effect
It will slowly decrease when leaving but the damage will stop as soon as it's below max
max is a poor name
If anyone was interested I already solved it, Paper has a class called ModernPluginLoadingStrategy which at least in my case interfered with me, I tried with pure Spigot and no problem.
It actually was a hard cap at first until I yelled at MD about it :p
Now everyone named Max will be sad
well in that case the name was reasonable
Yes but it meant you couldn’t make players take freeze damage :p
If one was implementing a lang file how would you go about it, managing replacements ect
yeah, i eventually changed it to max and it didn't work, so just reverted back to 200
I can't decide on how I want to execute it
for max he would have to be inside powdered snow
otherwise you'll have to take max + ticks you want the effect to stay
You would typically follow i18n standards
I mean handling replacements like <player> ect
My goal is to mostly make configurable messages not so much language configuraton
But you said a lang file
Just use a standard placeholder string
^
Like {player} or %player%
Well idk thats what we always call it when i do stuff like that
I mean should I write abstraction instead of spamming .replace
Probably
Well now you know its not a lang file lol
yes what should it be called then
If you are going to deal with more than a few replacements I would write some abstraction
Do you have any idea of what the usage for it would be, im not quite sure how I want to use the abstraction
Text or message file etc. Cause lang file typically means you want to setup translations etc lol
what if you want translations that include placeholders
That is what the i18n standard dictates
So you'd still end up with a bunch of .replace()
I was thinking about using Minimessage and utilizing this but I fail to see the value of using these dynamic replacements
https://docs.advntr.dev/minimessage/dynamic-replacements.html
If you go that route. Its not the only way to do it
Probably the easiest way. Dunno if there's another way that's both readable and not performing too bad
There is
Whatever placeholder api does
But replace is the easiest
Its just ugly af
I was thinking about using an enum or smth but im not sure
I recommend just %s and %1$s
Or {} and {1} if you want a less Java-specific option
Yes but that’s ugly for end users
And end user that's willing to edit the language file can pretty easily determine what %s replaces
"Gave an apple to %s"
"Okay, %s must be the player name"
Fair
Also also, Minecraft uses this exact same formatting in their language files
But what about when u have multiple placeholders and want them to be able to change the order
Ex.
%player% has killed %target%
%target% has killed %player%
That's what %1$s does
ohh
1 = first placeholder, 2 = second placeholder, etc.
(Or {0} {1})
Right
That’s what I use because lazy
fs
Wut
for sure
https://bytebin.lucko.me/KhOzMIhrPz
What do you think about this type of thing for messages?
I haven't implement replacements just kinda drafted this
whoops i messed up the get function but ye
FS can mean too many thinks
Fuck sake, for sure, filesystem
Oh no Kotlin
I cannot give opinions for I have no idea what is happening
Lol
How would one figure out good names for your classes/ interfaces. I follow all the java naming conventions but have a hard time getting the right name of them
Usage is Messages.Gang.NO_PERMISSION.get()
Any tips?
I dont like having the get function but i dont think there is a way to make the NO_PERMISSION be a string on its own but figures
Thats a good idea
The connections had problems all over iran yesterday
@quaint mantle I mean you can add the operator fun get to Gang and Server so you have
Messages[Messages.Gang.NO_PERMISSION]
idk 
Yeah ig
I wish there was a nice way to get the Component API out from under the Spigot tags. I don't like the spigot() solution, but also deprecating String methods isn't the way to go either. Spigot just seems like the best way without compromising on consistent naming
yeah :v
getting them out of spigots namespace would be poggers
Messages.Gang.NO_PERMISSION.runReplacements(
Replacement("player", "Nopox")
)
Alright guys how is this to use?
Deprecation has nothing to do with it, the problem is the naming
You can’t have 2 methods with the same name and parameters
And getCustomNameComponent looks dumb
Ik that I was just kinda talking about the paper approach
If only java considered return type part of the signature we could have this but with different return types lol
who knows why the armmorstand does not update its position in the stream if the player is sitting on it
im trying making a way to spawn particle in a range selected by the player, how can i do it?
Depends on what stream you are using, but it could be due to not having an updated reference
Pretty vague. There is a spawn particle method
But you could take values in from a command of how far away
in a random range i mean
runTaskTimer
Runtasktimer isnt a stream
lol
That is a task. So it could be then you want to use futures
Are you teleporting it
I don’t think teleporting entities with player passengers works to well
You have to dismount the player teleport both then remount
Passengers do not automatically teleport with the entity especially more so players
The best way to do it in a seemless fashion is to not teleport the entity
Well, apparently, every time you also have to put the player on an armor stand
How you do that is you would spawn the entity at a location. Dismount player teleport and mount on new entity as its already there and then kill the old entity
end how? velocity?
it looks like a teleport
Reason that works better is because you are not waiting on both to teleport at same time because there is times where they wont. So just having a new entity there ahead of time prevents that issue
Well the entity isnt teleporting just the player
So instead of trying to sync up teleports you just dont. Since you can just duplicate the entity lol
I generally need this for 2 saddle horses, but I don’t know other options
Hi, with breakNaturally you can't take the item drops, there's another method were the block are like being broken by the player but instantly?
hey addon can use in server?


