#help-development
1 messages · Page 917 of 1
how can i do colored glass pane ? 1.20.4
just like any item/block
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html#RED_STAINED_GLASS_PANE for example
declaration: package: org.bukkit, enum: Material
i didn't check if it was in the material list my bad! Thanks for your help
Files.exists?
I'm using https://paste.md-5.net/dexeripiso.js currently to try and save info and restore it. i didnt include the save method but it works as intended. its a custom library that i can send the link to if needed. can someone help?
How do you know if player.getPing() is still buffering or if ping is actually 0
Well then it’s probably 0
So player.getPing() returns 0 also if it's still loading
So.. how do I know the ping .. state? xD
is there an easy way to save info to custom files and restore that info from the files?
even if its not what i used in the link
what does your data look like btw?
me?
yes
give me a sec
https://paste.md-5.net/vunuwuheqi.makefile
the config.yml isnt used for saving data
claims:
3,-13: FallenKingdom
3,-12: FallenKingdom
2,-13: FallenKingdom
2,-12: FallenKingdom```
huh
how do I include io.netty to pom.xml
Hi , how to get numbers of enitity of server ?
world.getEntities().size() is probably your closest bet but that's only loaded entities
and can i get this with placeholderapi ?
Oh you're not making a plugin
#help-server in the future but no, I don't think PlaceholderAPI has any placeholders for this. You can probably find an extension maybe
no i am making plugin
i mean can i use api of placeholderapi for this ?
I'm not sure how PlaceholderAPI is relevant?
getting entity world numbers
can ?
You would use this ^
You have no reason to use PlaceholderAPI for that kind of info
PAPI isn't a way to fetch state information via code. It's a way for server owners to display data to their users
so do you mean isn't for using api in making plugin ?
No. You can use PlaceholderAPI and provide new placeholders if you'd like. i.e. I add new placeholders like %veinminer_active% which gives either "true" or "false" based on the player's active state. But I'm supplying data, not retrieving data
ok
https://paste.md-5.net/igibexigov.rb
i tried casting (String) entry, but got this error
is there any way to get a string from a memorysection?
Hello I have a question
I want you to send you something really important that’s hypixel related and it had to be in DMs if that’s fine @worldly ingot
not really
what is in line 922?
playerRank.put(player.getUniqueId().toString(), (String) sc.get("rank.") + player.getUniqueId().toString());```
i assume that rank.) is part of it
lol that's why
Babies first phishing scam ! 👶
Yeah choco I also have something very important that’s hypixel related but even DMs isn’t gonna be good enough
I’m gonna have to mail it to you
Not the pipebomb. lol
https://paste.md-5.net/hayuquqofe.coffeescript
if (kc.get("spawns").toString().contains(kc.get("spawns." + kingdoms.get(player.getUniqueId().toString())).toString())) {
kingdomSpawn.put((String) kc.get("spawns"), (Location) kc.get("spawns." + kingdoms.get(player.getUniqueId().toString())));
}```
im making sure the file actually contains a player before restoring the data to the hashmap
why is your code look so weird
wym?
@glad prawn is that better?
i deleted space so the full thing was inline
@Override
public void enable(MAS plugin) {
listener = new ToggleEventsListener(plugin, this);
Bukkit.getPluginManager().registerEvents(listener, plugin);
HandlerList.unregisterAll(plugin.getAutoSellManager().playerListener);
}
@Override
public void disable(MAS plugin) {
HandlerList.unregisterAll(listener);
Bukkit.getPluginManager().registerEvents(plugin.getAutoSellManager().playerListener, plugin);
}```
Can I disable and re-enable listeners like this over and over?
ok
Why is it bad tho?
Just want to make sure, does throwing snowball to player no longer gives them knockback?
Never did
is it possible to see when an entity pathfind fails
Really? I got this on 1.20.4, and I tested it on singleplayer mode.
they never gave knockback
xceing's response is correct
mandela effect
not mandela, hypixel added that in
I remember it's giving player's knockback, but in 1.8
so he probably is mistaking with that
There were servers who added those, but I've heard people say it was built in in some servers like spigot
I'm bugging out lmao.
It was or wasn’t a spigot bug at some point
I can’t remember which was intended at the time
There's the awnser we've been looking for

I think vanilla behaviour has also changed
Yeah, now I'm questioning my whole existence playing this game
Anyways, how can I implement that in a plugin? I've tried to damage the player on ProjectileHitEvent, but it doesn't affect the player.
Give em 0.0000001 damage maybe
How did the bug occur? Or am I not allowed to ask for that
The damage event code is complicated and annoying af
The issue is that snowballs damaged with 0 damage
I think at the time spigot added the knockback because it still ran the damage code even though the damage was 0
yea that make sense, did eggs have the same issue?
It damages the player but no knockback.
oh nvm found a forum post of yours saying eggs were affected too
welcome to hell
private Location getDisplayEntityTargetLocation() {
Location newLocation = skeleton.getCurrentLocation();
// newLocation.subtract(boneBlueprint.getBlockSpaceOrigin());
//This readjusts the offset from the entity origin offset, necessary because armor stands can have offset models but display entities can't
Vector offsetBasedOnModelOrigin = boneBlueprint.getDisplayEntityModelSpaceOriginOffset().clone().multiply(1 / 25.599d);
//This rotates the position of this specific bone relative to other bones to put it in the correct location
offsetBasedOnModelOrigin.rotateAroundX(Math.toRadians(boneBlueprint.getOriginsForDisplayEntityLocationShiftBasedOnRotation().getX()));
offsetBasedOnModelOrigin.rotateAroundY(Math.toRadians(boneBlueprint.getOriginsForDisplayEntityLocationShiftBasedOnRotation().getY()));
offsetBasedOnModelOrigin.rotateAroundZ(Math.toRadians(boneBlueprint.getOriginsForDisplayEntityLocationShiftBasedOnRotation().getZ()));
newLocation.subtract(offsetBasedOnModelOrigin);
newLocation.add(getOffsetBasedOnParentRotation()); //todo: this will probably break some sub-bones when rotating in animations
//todo: experimental trying to figure out the skeleton rotation
Vector skeletonRotation = newLocation.subtract(skeleton.getCurrentLocation()).toVector().rotateAroundY(Math.toRadians(skeleton.getCurrentLocation().getYaw()) + Math.PI);
newLocation = skeleton.getCurrentLocation().add(-skeletonRotation.getX(), skeletonRotation.getY(), skeletonRotation.getZ());
// Bukkit.getLogger().info("his");
if (animationTranslation != null) newLocation.add(animationTranslation);
return newLocation;
}
don't ask me why the rotations just work with those exact values
it just kinda works
looks like hes vegetarian
Hello, is there an interface for reading how much damage player did to another with an attack?
ahh yes ty
only in bedrock did it give knockback
?paste
https://paste.md-5.net/axaxanivep.bash, why i keep getting this error for code
https://paste.md-5.net/ucuhalikuc.java
i've tried to debug
and everything
Scoreboard.# does not exist in your config file would be my guess
Scoreboard:
name: '&3&lZyptrik'
# Lines
'13': '&7'
'12': '&f%player%'
'11': ' &f| &7Kills: 1'
'10': ' &f| &7Kills: 1'
'9': ' &f| &7Deaths: 0'
'8': ' &f| &7Mined Blocks: 1k'
'7': ' &f| &7Playtime: 1 hour'
'6': ' &f| &7Balance: 500$'
'5': ' &7'
'4': '&fServer'
'3': ' &f| &7Online: 1/10'
'2': ' &f| &7Store: /store'
'1': ' &f| &7TPS: 20.0'
'0': ' &f| &7IP: &fserver.gg'
total-size: 14 # VERY IMPORTANT, IT WILL BREAK CODE OF NOT CHANGED
``` it does
you do not have line 14...
yea but it starts from 0
this loop starts at 14
that is not what your code says
i think i should get a new brain 💀
its fixed !!!
finally
after like 2 days
now i have to do the placeholder API thing 💀
(why did you even iterate from the back...)
what
actually nvm, I don't actually know what TreeMap is
does anyone know how to store data between restarts? im new to making plugins and want to keep my hashmap that i have for my data to persist
use flatfile or a db
could you elaborate? as i said im not familliar with making plugins
persistent data containers
Are you experienced with development or brand new to the whole industry?
pdc (persistent data container) is where you can store data in items, entities or chunks under keys
its like metadata but won't be gone after server shuts down
?pdc
ive done some python and c# as well as skript
and you can use data folder with player files so you can edit/see their data
Read over that post and let me know if it works for you
If not we can discuss other options
which is the pdc
That's just a poor version of an sqlite database
But I guess it's document based instead of relational which can be good and bad
s3 
hes asking because hes new
Sql and mongo have both usecases
okay
*both have
From the way they're speaking, they seem to have some basic programming knowledge
whats best way for scoreboards refreshing, do the tasks thing every tick for whole server or when player joins while hes online
No clue how far that goes but we could imagine a world where they're really experienced with working with mysql in c# and in that case it isn't advanced
Tracking player scoreboard data on a collection and ticking it all on a single (global) task
not really 😅
I like to imagine
I like sql because its safe and you know what is stored, with nosql there are no rules
nosql has its benefits with highly polymorphical data structures :)
basically if you abuse your AbstractFactoryProviderRegistryTemplate
:)
You'll end up facing a few situations where you need to store weird abstract data
persistentdata only takes primitive types right? so no instances of classes
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
uh
yeah
You can just serialize your data to a bunch of primitive types and move on from there
No clue about your exact use case scenario
its something that is easy enough for new people to learn
its pretty essential
For more complex objects I'd probably just do my own data storage
does sql work differently than persistentdata?
Data in SQL is stored in a table
And you can have multiple tables and create relations between them
SQLite is an implementation of an SQL database management system which works on a local .db file
PDC is mostly used for custom Items, while sql is used to store data in general
MySQL is the same but instead of a local file it's a whole thing
PDC is a lot more raw. Think of it as a really fancy Map<String, Object> wrapper
And that data is stored on whatever NBT container you're interacting with (player data / item nbt / entity / chunk / world)
do i need to do something for skript (coding plugin) registered placeholders (with skript-placeholders addon) to be used?
with placeholder api
or it will do it by itself
if i use the PlaceholderAPI#setPlaceHolders method
?tryandsee
im making a plugin thats supposed to record pvp damage done to each player by other players. Any ideas what would be the best way to store the damage done by each player?
I did that on my uh
minigame core
Let me start by saying NMS already tracks this
But if you want to do your own, the idea is to:
- Make an entry class
- Make an expiring fixed-size queue class type deal, where entries get evicted after let's say, being <50 entries old or older than, let's say, 3 minutes
In my case because games have a limited time scope I skip the whole expiring part and just have a list of every entry throughout the game
These entries are basically just wrappers of EntityDamageEvent with the minor difference of not storing hard references to players
And maybe adding some checks to get the true source, because people can shoot projectiles or ignite explosives and it's indirect damage
I wanna know about all damage I took prior to death
Including that 1 heart of fall damage 3 hours ago
im trying to make it record all damage until the players death. final goal is to make it heal percentually based on damages.
I mean yeah but there has to be some sort of time limit
Let's say I hit you once and then you prickle yourself to death 2 hours later
You deserve the kill credit
its going on this pvp arena part. the games last until everyone is dead. no hp regen except based on the percentual damage done to killed player
Then yeah you just adapt the data structure towards you need
so you're suggesting using EntityDamageEvent to record damages and dumping correct entries to queue type thing?
im new in spigot so i have to ask to make sure
Not storing the exact event but extracting the data you need into a separate class
and then having a list of all the data
For each player
I'd show code but I'm taking 3 days off work because I was working really unhealthy hours and I'm not gonna open my IDE
could you possibly DM me when you get back to work?
and then one day you will never open it again
thursday?
sure
hopefully 
Doubt I'll remember
You can figure this out by then
I think I have it on github somewhere
lemme check
this way I'm not opening my IDE
totally a mentally sane alternative
ahh that would be very helpful too
thank you
Does anyone have any idea on how to stop a Fireball from entering a certain region, I have the list of blocks I don't want the fireball to enter.
Why does the armorstand with the helmet (before the scheduler) have the correct yaw but the zombie that was created in the scheduler has the yaw at 0?
Like if the location of the Fireball is in that list of blocks, delete the firstball.
thank you, kind sir!
?paste
ProjectileHitEvent?
Sounds like an xy issue to me
no no
want to see something truly cursed?
no
like the second the fireball entity location is in that list of blocks
delete the fireball
before it even explodes or hits anything
too bad
private Location getDisplayEntityTargetLocation() {
Location newLocation = skeleton.getCurrentLocation();
// newLocation.subtract(boneBlueprint.getBlockSpaceOrigin());
//This readjusts the offset from the entity origin offset, necessary because armor stands can have offset models but display entities can't
Vector offsetBasedOnModelOrigin = boneBlueprint.getDisplayEntityModelSpaceOriginOffset().clone().multiply(1 / 25.599d);
//This rotates the position of this specific bone relative to other bones to put it in the correct location
offsetBasedOnModelOrigin.rotateAroundX(Math.toRadians(boneBlueprint.getOriginsForDisplayEntityLocationShiftBasedOnRotation().getX()));
offsetBasedOnModelOrigin.rotateAroundY(Math.toRadians(boneBlueprint.getOriginsForDisplayEntityLocationShiftBasedOnRotation().getY()));
offsetBasedOnModelOrigin.rotateAroundZ(Math.toRadians(boneBlueprint.getOriginsForDisplayEntityLocationShiftBasedOnRotation().getZ()));
newLocation.subtract(offsetBasedOnModelOrigin);
newLocation.add(getOffsetBasedOnParentRotation()); //todo: this will probably break some sub-bones when rotating in animations
//todo: this part tries to readd the animation
if (animationTranslation != null) {
Bukkit.getLogger().info("test");
newLocation.add(animationTranslation);
}
//todo: experimental trying to figure out the skeleton rotation
Vector skeletonRotation = newLocation.subtract(skeleton.getCurrentLocation()).toVector().rotateAroundY(Math.toRadians(skeleton.getCurrentLocation().getYaw()) + Math.PI);
newLocation = skeleton.getCurrentLocation().add(-skeletonRotation.getX(), skeletonRotation.getY(), skeletonRotation.getZ());
if (animationTranslation != null) newLocation.add(animationTranslation);
return newLocation;
}
then yeah you cancel ProjectileHitEvent and remove the ent
reuse your damn variables holy fuck
that doesn't make sense to me but it's the only way this will rotate right
Why does the armorstand with the helmet (before the scheduler) have the correct yaw but the zombie that was created in the scheduler has the yaw at 0?
chatgpt says it's a gimbal lock but that makes less than no sense that it would lock on a single axis rotation
besides my solution wouldn't fix that anyway
chatgpt's only good for regex change my mind
hm it was really good at translating my discord bot to 6 languages actually
was it though
very convenient for automatically translating stuff with markdown
yeah it was pretty good
yesterday I learned that custom escape menus are the most gimmicky shit
I understand all but two of the languages it did and it generally tbh I've hired translators that turned in things significantly worse than what I got back
they dont respect gui scaling no nothing
regular uis do though
not all, not always, not all formats
and I had to get it done in like 5 minutes so I told them to eat ass
I was going to ask if you ever played warcraft 3 but then I remembered you're a disgusting zoomer
I grew up with flash games
does fastboard api has no flicker?
smh
can't be bothered to show what I mean here but I did a menu style similar to wc3 which uses chains that come from the top of the screen, but the problem is that there is a size limit and if you use the smallest scaling you can actually see the top of the chains
we just kinda made a custom holder for the top of the chains but it was "fun" to find out
anyways im going to the gym
lmao
its been a solid 3 weeks
you're slacking
I literally just came back
was about to go get my post-gym meal and then crash
remember how I said I was working really really unhealthy hours
that's nothing
I've been waking up, working 10-18 hours, sleeping for 1 hour and repeat this
slept like 6 hours last week
see your problem is that you're not sleeping 8 hours
you're supposed to work 20 hours but then still sleep 8
that's what the real OGs do
as long as you get your 8 hours it doesn't matter if you're working 20 is what I've learned in the last decade
if you're not sleeping you're not being as productive anyway
eh
one day you'll think back to this moment and appreciate just how right I was, as with everything else
yeah well now that I've placed my money in investments my car died in the middle of the highway at night (yesterday)
it was a shitbox thank me later
there's always going to be some financial leech
go huff the fumes of my 22 year old toyota rav 4
that is the perfect car and if I had a million euros I'd spend 60k modding the shit out of it so it can live for another 60 years
not entirely true, I routinely stay up for 24 hours, it isn't until I am staying up for 48 that I start to become less productive
Why does the armorstand with the helmet (before the scheduler) have the correct yaw but the zombie that was created in the scheduler has the yaw at 0?
that's not what I said
i am more productive without sleep
I'm productive at night
everyone is productive at night, that's when no one bothers you and things are quiet
but I don't get 8 hours of sleep either
who does nowadays
but a bit less productive when I'm running on like 30 minutes of sleep
some people do. I don't because I have insomnia and don't get REM sleep
I get exactly 8 hours of sleep almost every time
ah insomnia my beloved
but between each time I sleep I might be up and working for 18-25 hours
or these days working for 16 hours and then at the gym for 2 hours
I just have obsessive issues that sometimes cause insomnia

nothing as good as working 18 hours and not being able to sleep because you're obsessing over some minor irrelevant detail
just wait until you start doing your own projects
sometimes I take a break and do some godot work
homie I have my own projects
so I'll just work 10 hours and then be like "oh just let me go do a prototype real quick"
and before I know it I've stacked another 18 hours
my problem is not stacking 18 hours, my problem is not being able to sleep after those 18 hours because you're still thinking about it
that's why you go to the gym
man I wish mine was
also working out after coding for like 20 hours
I went at 8:30 am when I would've rather gone to bed
recipe for failure
spoken like someone who doesn't have a diet that guarantees gym success
another icky thing of this 1 hour of sleep thing is scheduling shit
I was trying to schedule going out with my homie yesterday
"ah yeah I'm gonna be working until 6pm and then imma head to bed"
"what time are you gonna wake up?"
"8pm maybe"

I don't even try to schedule things more than 3 days into the future
3 hours*
that's because you've not hit the golden schedule yet
I know I'm probably going to be sleeping at midday today, then tomorrow at 2pm, then 4pm, then 6 pm
ok boomer
so I schedule dnd for friday when I know I'll have pushed my sleep schedule back
I don't even know what time I'll be sleeping
I just work, pass out for an hour, work, pass out again
I just know I have to be awake at certain times
like 4pm yesterday
or 5pm today because I have an appointment somewhere
lvl 1 amateur non-24h work day enjoyer
level 1 crook vs level 100 mafia boss
except it's 2 denegerate people boasting about who has the worse sleep schedule
speak for yourself, I've transcended degeneracy
you just need to learn to have a routine
and not to stray from it too much
this also means learning to stop doing work
I have nothing to make a routine over
you do, you should always have free time to do whatever you want and relax
Hi how get tps?
#help-server and provide more context
They might want to get the tps through code
where do i put this
is there a spigot api getter for the body yaw of an entity vs the head yaw?
on the green line?
entity Location rather than EyeLocation
oh interesting
hm is that even accurate
wouldn't that mean that if you get the entity location -> yaw you should be getting the entity direction and not where it's looking?
yes
I'm going to have to test that one, it looked to me like the base location was the eye location
entity location has the direction the body is facing. EyeLocation is teh head
zoom zoom
starting to get there
probably will be able to be done with this tomorrow
yeah just need to figure out why the animation math isn't working out and fix the one error that is probably causing it to jump around every so often
oh and probably actually implement mount points
right now I just got the bone directions working with the display entities and the packet stuff
My bad then ofc
very helpful guys
the maven in the rep looks different than one i have
Attitude
This is a plugin
So put it along with other plugins
Is that what you wanted?
Or did you mean the relocation?
yes
The <configuration> in which the relocations are put is the same level as <executions>. <configuration> inside <executions> is different
So create a <configuration> after or before <executions>
There you'll put the <relocations>
i mean
Read my words again
<configuration> and <executions> look different here
they're not next to each other
they're in each other
<configuration> inside an <execution> is not the same configuration
There's a configuration for an execution, and a configuration for the plugin
You want to put relocations inside the plugin configuration
ok
The <configuration> in which the relocations are put is the same level as <executions>.
?
You... left the scope of maven-shade-plugin
You are in maven-compiler-plugin
How even
uh im so bad
Either of the rectangles
Is where you place your relocations config
As mentioned, the configuration block is same indentation level as the executions block
Nope
it showed error
i didn't send it before
You placed your relocations deeper
Show it then
isn't this what you mean
Look at the example again again again
The relocations are wrapped in a <configuration>
oh so i need to put them in another <configuration>
Y e s
you only have 1 configuration for shade iirc
Looks good yes
Np
is this dangerous?
real
Nope, shading almost always breaks encapsulation
am i doing something wrong? i did like the github says
it doesn't show the scoreboard, and doesn't send errors to console
i tried to install fastboard plugin but i get this
[14:18:13 ERROR]: [DirectoryProviderSource] Error loading plugin: java.lang.IllegalArgumentException: Directory 'plugins\fastboard-2.0.2.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!
java.lang.RuntimeException: java.lang.IllegalArgumentException: Directory 'plugins\fastboard-2.0.2.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!
at io.papermc.paper.plugin.provider.source.FileProviderSource.registerProviders(FileProviderSource.java:70) ~[paper-1.20.4.jar:git-Paper-430]
at io.papermc.paper.plugin.provider.source.DirectoryProviderSource.registerProviders(DirectoryProviderSource.java:47) ~[paper-1.20.4.jar:git-Paper-430]
at io.papermc.paper.plugin.provider.source.DirectoryProviderSource.registerProviders(DirectoryProviderSource.java:17) ~[paper-1.20.4.jar:git-Paper-430]
at io.papermc.paper.plugin.util.EntrypointUtil.registerProvidersFromSource(EntrypointUtil.java:15) ~[paper-1.20.4.jar:git-Paper-430]
at io.papermc.paper.plugin.PluginInitializerManager.load(PluginInitializerManager.java:101) ~[paper-1.20.4.jar:git-Paper-430]
at net.minecraft.server.Main.main(Main.java:131) ~[paper-1.20.4.jar:git-Paper-430]
at org.bukkit.craftbukkit.Main.main(Main.java:326) ~[paper-1.20.4.jar:git-Paper-430]
at io.papermc.paperclip.Paperclip.lambda$main$0(Paperclip.java:42) ~[app:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalArgumentException: Directory 'plugins\fastboard-2.0.2.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!
... 9 more```
it says the plugin doesn't have a plugin.yml
and it doesn't in source code? why lol
fastboard is an api not a plugin
or is that something else
yeah fast baord is an api not a plugin https://github.com/MrMicky-FR/FastBoard
Nope thats pretty much it.
ok but
you include it inside your plugin
and no scoreboard
You shade it and you dont install it on the server.
If its an actual plugin like PlaceholderAPI or ProtocolLib, then you dont shade it and install it on the server.
But this one you shade
ight thanks
but how does it work lol, i did what github says
but it doesn't seem to be working
i don't get errors and it doesn't show scoreboard
hey guys
im how to remove potion damage delay
im hitting player 2 - 3 times and i using splash potion but dont working this potion
normal hits
You need to set the maximum no-damage-ticks to 0
where are this option
i can't find it
LivingEntity
Are you developing or administrating
in where ?
?
no
???
This is a development related channel.
i making server
its for coding plugins
anyway
Time to debug. Add a bunch of messages and see which methods get called.
You can broadcast pretty much anywhere. But why not just log to console?
ok lol
7smile7 you can help me in #help-server ?
What's up smile I'm still alive
Nope. Im mainly in the dev channel.
broo please
Good to know 🙂
thats coding thing
LivingEntity is a entity that is alive
like players, zombies, villagers
?jd
Look it up
ye i know that
i think this is where the problem is, it doesn't broadcast
but where is that
He is not a developer. LivingEntity will mean nothing to him.
but this was working before i move to FastBoard
Radical I'm too tired for this
Look through the configs. And move this to #help-server please.
i just did board.updateLine... instead of obj.getScore()...
If it doesnt broadcast, then the map is empty
💀
oh well
ig thats true
because nothing broadcasts at all places
its not even functioning
so
why lol
boardTask = getServer().getScheduler().runTaskTimer(this, BoardTask.getInstance(), 0L, 10L);
``` i used this before
and it worked with 0 problems
Send your code again pls
BoardTask -> https://paste.md-5.net/wumuyiziqo.java
All off it
Main Class -> https://paste.md-5.net/nilovuxata.java
Show the reload command pls
-.-
if i use /reload confirm papi crashes
ah lol
Reload Cmd -> https://paste.md-5.net/teyoyocepo.java
i don't really think that is the problem but ok xD
Ah i see the problem
Please make the constructor of BoardTask private.
This will resolve your problem.
Solved?
what effect is this?
its a video 😂
yeah I worked there fuck akuma
bros makin a 1:1 copy
hgahah
how much time does a player#getPing take to load?
p sure it takes a measurement every second
and averages it out with past measurements
it shows 0 for a few seconds after you join in
I didn't understand what you meant
Sad OG prison was fun back in the day
With player guards etc, then OP prison came round and fucked it
Any concept will inevitably be over simplified to appeal to the kids
I agree 👍🏼 💯 🙆♂️ 🤝 👍🏼
does anyone know of a plugin that allows you to sell from chests, that isn't chestshop?
how would I detect when a player enters a new chunk?
move event
what would I do in move event
or have a scheduler check every tick
Check both x and Z for from/to and see if they match Math.floorMod(value , 16)
Now, to get all the blocks within that chunk I though I'd have something like Chunk#getBlocks but instead I have getBlock() 😣
So I have to manually do a for loop?
First, why are you getting all blocks in a chunk?
I'm just playing around lol
does each block have a specific amount of bytes?
or does that depend on the light.. texture? are all block textures the same size?
I guess they are right? 16x16 rgb
The textures are not being sent to the client. That would be insane.
Its just meta data like type, rotation etc. The client can display this as he pleases.
type, rotation
even these are considered in the same byte. Each combination of block states is a unique block type :p
The chunk block data packet only really cares about the type (and light information). Entity and block entity data comes in another packet
Oh I lied. Block entity data is included in the chunk packet. I could have sworn they separated that
Damn Choco don't let hypixel know you got that wrong they might fire you
I'm pretty sure they hired you because you're always right
If that's true, they got scammed lol
im trying to add protocollib as a dependency but maven cant find it it
i just copied what was on spigotmc
does anyone know what im doing wrong?
https://hastebin.nl/yOwytRF (my pom.xml)
Can't believe Choco removed mystery boxes
Looks fine to me, but there is a 5.1.0 version you should probably use instead
Just be sure you're updating your project. In IntelliJ you have to explicitly reload the pom.xml
it cant find that either
oh reloading fixed it ty
Just needs a bit of encouragement :p
Why texture? The texture isn't stored on the server, and even if it would it would store a ResourceLocation pointing to the texture, not the texture itself
Yet*
🙏
I didn't manage to find any samples of code on how to monitor client incoming and outgoing traffic with io.netty (im not sure if there is incoming traffic or not)
This is why im looking at chunks manually and each time i enter a new chunk, I want to get all the blocks, and process them and return a chunk size in KB. If that's even possible. It's for debug purposes and only for my server really
That way I could calculate eg.: spawn size in KB, and then test it when I "optimize" the spawn area by removing unnecessary blocks that can't be viewed
Every byte matters! XD
Ooh sounds like hell
Yeah... I would appreciate any help XD
This is why I'm asking if every block is a constant amount of bytes, because it has to be right? Ignoring the batches compression. I need the raw data
It's not... From what I remember
I could use the BlockData class but where am I supposed to get the size of a block, I guess it would be in bytes
Block#getData() is deprecated and I don't know what a Magic value even is
size?
Amount of bytes that the block is
Thats not reall ypossible
If you press F3+3 you get this... How are these values even obtained?
i found that in the BukkitCommand class you can set the name and the label. What's a label? and is different from the name?
Most likely through netty?
Isn't a laben the alias that a command was executed with
Yeah.... do you know of any code samples of io.netty how to get these values? xD
Does some1 know whats repo and depe for this? https://github.com/TheSilentPro/HeadDB/tree/master
Pick a tutorial and begin
i dont learn anything in this link
dont have a good teacher for that ?
wdym you don't learn anything?
What part don't you understand?
you a know make plugin ?
i ask you you a learned in where
There is no single place I learned from
I learned by looking at open source projects, videos and forum posts like the wiki link above
if you're in a hurry then hire someone to make a plugin
i want to learn
give it a couple of months
It depends on the person, personally I'm quite a fast learner
how can i edit the nbt of an entity? i want to spawn an item display entity displaying an item
me too
i starting to learn tomorrow!
No need to edit the NBT directly. The API has methods for changing the item
declaration: package: org.bukkit.entity, interface: ItemDisplay
Use this spawn method and modify it in the consumer; https://hub.spigotmc.org/javadocs/spigot/org/bukkit/RegionAccessor.html#spawn(org.bukkit.Location,java.lang.Class,java.util.function.Consumer)
declaration: package: org.bukkit, interface: RegionAccessor
ty i was using spawn entity
if you're wondering what the difference is; the spawn method consumer runs before the entity is spawned allowing it to spawn with your data
spawnEntity will immediately spawn the entity and you can then use the reference to modify the entity
alright
Ideally you'd want to spawn it with your data directly to avoid updating the entity
it also allows other plugins listening to the spawn event to grab your data since it's set before the event fires
it takes a class, do you know which this is? i tried ItemDisplay, new ItemDisplay() (which doesnt work cuz it cant be instantiated, and entitytype.itemdisplay
ItemDisplay.class
ah thanks
is there a way the call .class on a generic?
could you tell me how to use consumers?
@Override
public void accept(ItemDisplay item) {
ItemStack itemstack = new ItemStack(Material.WRITABLE_BOOK);
item.setItemStack(itemstack);
}
};``` i tried this but it did not work
it says:
`Class 'Anonymous class derived from Consumer' must implement abstract method 'accept(T)' in 'Consumer'`
Use a lambda, will make the code much cleaner
world.spawn(location, ItemDisplay.class, item -> {
ItemStack itemstack = new ItemStack(Material.WRITABLE_BOOK);
item.setItemStack(itemstack);
});
oh alright ill try this
You probably need to use the diamond operator for that to compile
Yeah
the diamond operator?
<>
is there any way i can listen for sweep attacks from players ?
You can check for the sweep conditions yourself
other ways depend on what you're trying to do
i need to increment the damage on sweep attacks
kind of like the sweeping edge enchantment but on any sweep attack
that i want some players to have kind of a global sweeping edge effect on all tools even non enchanted ones
yeah then you'll need to check the sweep conditions yourself; https://minecraft.wiki/w/Sweeping_Edge#Mechanics
or look at how nms checks it and use that
RELISM
guys what happens when i deserialize an object, later recreate it, but there were changes made in the constructor, or new fields. Does somebody know what will happen? Will it just continue to work except the other fields are just null? Or will there be errors?
if there's new fields they'll be null
big no no in most cases
i don't like java's deserialization system
okay
Avoid Javas deserialization system where possible its a little rough
In many cases the old object may completely refuse to deserialize and throw an error
Things get especially fucky if you don't specify. A static serialization ID constant
Anyone know how to modify a player's stepheight, or make a listener that could simulate that effect?
The best way would be to wait for 1.20.5
It will add a simple attribute for step height
Incredible. Thank you.
I'll put it on the back burner xD
Use mojangs codecs everywhere

Hey,
I have a question about how I could prevent a player from interacting with a endercrystal? Right and Left click
Does anyone know?
PlayerInteractAtEntityEvent
but there I can only do event.getRightClicked() and not prevent the left click
Might that be EntityDamageByEntityEvent?
hey
package com.andrei1058.bedwars.shop.listeners;
import com.andrei1058.bedwars.api.arena.GameState;
import com.andrei1058.bedwars.api.arena.IArena;
import com.andrei1058.bedwars.api.arena.team.ITeam;
import com.andrei1058.bedwars.arena.Arena;
import com.andrei1058.bedwars.shop.ShopManager;
import com.andrei1058.bedwars.shop.quickbuy.PlayerQuickBuyCache;
import org.bukkit.Location;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
public class ShopOpenListener implements Listener {
@EventHandler
public void onShopOpen(PlayerInteractAtEntityEvent e,PlayerInteractEntityEvent d){
IArena a = Arena.getArenaByPlayer(e.getPlayer());
if (a == null) return;
if(!a.getStatus().equals(GameState.playing)) return;
Location l = e.getRightClicked().getLocation();
for (ITeam t : a.getTeams()) {
Location l2 = t.getShop();
if (l.getBlockX() == l2.getBlockX() && l.getBlockY() == l2.getBlockY() && l.getBlockZ() == l2.getBlockZ()) {
e.setCancelled(true);
if (a.isPlayer(e.getPlayer())) {
ShopManager.shop.open(e.getPlayer(), PlayerQuickBuyCache.getQuickBuyCache(e.getPlayer().getUniqueId()),true);
}
}
}
}
}
how i can add left click to this plugin
when i register the join event it shows error and says i have to make it public
join event is in there, and and i register in mainclass
should i make it in a seperate class
Oh yeah that's way better
Mojang made some great stuff there

Very easy to read too 
Idk how they made something so unreadable though I stg they have a talent
hi
i want to get a private Map<UUID, FastBoard> from a class to another, i made a public method to get from it to use in other classes, is that safe?
what should i do then
what I just said
if i use the listener in that class it causes errors
what do you mean
You cant make it public. You have a singleton.
If you create two different instances, then they cant see each others hashmap.
what should i do then?
To be able to make decent spigot plugins how much of Java should learn like I see stuff like -> symbols and all kinds of stuff I know about data types and if statements at switch statements and while loops but like some of the stuff just doesn’t make sense I’m starting to get the idea of making objects and creating instances and stuff but like, I just don’t know what to do.
I watch videos but then when i get on IntelliJ it’s like retained nothing that I learned. Is there any advice anyone has for me? I’ve never been super smart but I thought this would come easier than it has so far.
Project-based learning
have a manager that and hide the map in there
Instead of learning all the theory at once just break it down and learn along
It's kind of how I learned
exposing certain methods like get set and something else
Keep the constructor private and figure out how to get an instance of your class.
Youve already done it once.
and then expose the manager to both classes via a tree like structure
public static BoardTask getInstance() {
return instance;
}``` isn't this what you mean
I have a real issue with chatgpt if I don’t know something I just have them do it for me and it’s usually got errors.
What should I do when I want to make a feature and don’t know where to begin?
?
We start by breaking down the feature
I'd avoid using chatgpt for development as it's just plain bad
(we should make a thread for this)
If you make a video tutorial of how to implement Java docs into your code and just go over of if you get an idea and going to the javadocs and implementing stuff I’ll edit it and give it to you to upload or I can upload it myself I feel like that’s the hardest part 😭
Like the javadocs are scary bro
Javadocs is really just automatically generated html for comments
Oh another question, I see stuff like ‘item stack’ is that creating an instance of an object? And like where I can I find all of these kinds of things like item stack that spigot has to offer
?jd-s
public static BoardTask getInstance() {
return instance;
}``` isn't this what you mean?
Are you aware what the problem is?
yes
i think
registering the listener requires a public class, and the contrsucter is private
class Car {
private int tires;
}
______________________________
Car first = new Car();
Car second = new Car();
first.setTires(4);
System.out.println(second.getTires());
Tell me what this prints
7

Bannana
?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

how many varians of the larnjava exists now? xd
2 pretty sure
this actually intrigues me, it can't be 0 that would be too obvious, is it 3?
it is 0
no way
whats even a Car, and a class is not a method is it
anyone got a better name for a node in a char trie that stores the end of a word (it still has child nodes), ValueHoldingNode sounds pretty vague to me
ResultNode?
mwoa
FinalNode?
mm I'm starting to get the impression I should make a while pinned post about java terminology
this is a class, it does stuff
new is new
-> points to the right
learn em some strictfp
<- isn't a thing because we need to write our code right
- breaking out of named blocks
what does that code do, its not a right code is it
<< is like that <.< face but without the dot
do some research about it :)
why am I getting french networking yt recommendations
I wrote this code a bit ambiguously so that you cant just copy paste and run it.
Ping me when you figured out what that code does and why.
Now, why
Good. Why is that?
In the Cars class i save tries as a private integer, as nothing (like didn't save a value to it) and then i made getters and setters
and i set first.setTries() not second so second didn't change
and that was what i meant nothing in first place, nothing because it didn't have a set value
Right. Because a new instance of a class has its own variables and doesnt know about variables in other instances.
Now if you create two instances, and each instance has a Map<> variable, then those two maps are different.
Stores the last char of a word?
yea i realized
https://en.wikipedia.org/wiki/Trie (would be the node where "tea" ends, or "inn")
In computer science, a trie (, ), also called digital tree or prefix tree, is a type of k-ary search tree, a tree data structure used for locating specific keys from within a set. These keys are most often strings, with links between nodes defined not by the entire key, but by individual characters. In order to access a key (to recover its value...
and ty for that it was fun xD
And that was your problem. You had one instance for a listener and one instance for a runnable.
And if you put stuff into one instance, then the other instance will be still empty
But have you recreated the exact same trie down to the details?
why i got 2 skulls and a learn java 💀
dunno what you'd call exact, but yes its a char trie
https://pastes.dev/T8aL7Z8sKX
so whats best thing to do ☻
Only use one instance
I remember there being a term that we got encouraged to use
Cant just remember what it was called
red nodes would be ValueHoldingNode (assuming this is an inbalanced tree)
you get it?
Yea
so for registering listener, i used #getInstance() instead of using #(this)
but is this a normal thing from the api
?
So I'm using Inventory#setItem with an inventory that the player has opened. There seems to be a difference between what the client sees and what the server sees though.
The item is set, but I can't actually see it. It's invislble. I know that it's set because I've tried to get the item after I've done Inventory#setItem and the item is there. I just can't see it.
Any reasons as to why this may the case?
I'll note, I've already tried player#updateInventory to try and update what the player sees on the client-side but that doesn't do anything.
Make sure you have a reference to the correct inventory instance
I believe I do have the correct reference, because like I said: The item is actually set but there seems to just be a visual bug.
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R3.block.CraftBlock cannot be cast to class org.bukkit.block.Chest
What is a CraftBlock??
the impl of Block
am i supposed to get that from the blockPlaced? BlockPlaceEvent I am trying to get my chest that is being placed.
chest is a block state iirc
yes.. I just made stupid mistake. it working now. Thanks.
nice picture lol
I assume you are referring to my pfp?
It was generated by Dalle
finally
Someone can explain me why if i use CompletableFuture with a void, then when i want to use exceptionally/) to throw up the exception via a logger or throw exception keyword. I get tell that void cannot be applied to Void?
public CompletableFuture<Void> insert(String field, Object value) {
return CompletableFuture
.runAsync(() -> handler.getClient().hset(this.identifier, field, handler.getGson().toJson(value)))
.exceptionally((error) -> {
handler.getLogger().severe("[Redis]");
});
}```
return null
oh okay, but why? If that doesnt disturb you
idk exceptionally returns a new future
exceptionally doesnt return a future
okay, thats weird so
Why would you have to return if its void, but idk if it works, it works
so you can do stuff if its finished
what do you mean by that?
it does
I know that for doing that you use CF.sppluyAsync() why is designed for working the generic end value / result, that yes makes sense using a return
when the future has completed the operation, you can do something, like handle the response, notify users
oh is it generic'd
do you mean this?
lmao not even GPT can explain the reasons of why returning null inside a exceptionally code block of a void future. Seems weird if we see the point because why a void future, would have to return null ¿?
Void != void
java.lang.Void must always be null and is like every other object. It just happens to be a very special object that can never be initialized (and thus you can be sure that everything that returns java.lang.Void is returning null).
The main usecase of java.lang.Void is to have an Object-equivalent of the void primitive, which can not be used with generics (yet - valhalla when?)
oh allright, realyl thanks
private void calculateResult() {
String expression = display.getText();
try {
ScriptEngine engine = new ScriptEngineManager().getEngineByName("graal.js");
if (engine == null) {
display.setText("Error: JavaScript engine not available");
return;
}
Object result = engine.eval(expression);
display.setText(result.toString());
} catch (ScriptException e) {
display.setText("Error: Invalid expression");
}
}```
I know it's not spigot api, but I can't find help anywhere else and I'm too dense to figure out why the engine is always null
Well evidently ScriptEngineManager cannot discover the graal.js engine - perhaps you forgot to merge service files?
Oh, and don't use the no-args constructor of ScriptEngineManager.
Bear with me too, because this is the first java project outside of mc framework
Well in that case it might be worth defining on how your classloading is set up. Because JSR-223 usage to differ from setup to setup
Yk what I think my issue is, I never reconfigured the project to use graal
Earlier I was trying "JavaScript" engine, but that one produced the same result and I had been suggested to use graal instead
but why js on Java?
Was just following a source online lol
eh? i just was asking, i didnt want to soun rude
i just seen it weird haha because is not common thing
It didn't, that's just what I was doing
what are you trying to eval?
It's a calculator
what kind
?paste
basic
Then why js?
sounds about perfect for this case
https://github.com/FourteenBrush/MathExpressionParser
same question hehe
Also I'm a bit dense with this... first java project outside of mc framework
what
what?
register commands in plugin yml
I hardly know what I am doing lol
id say just use my library and put all user input in a string and ask to parse it
Sounds easy enough
would work fine if its a simple calculator
It's awesome you just had that ready to go
Hey,
I have a question about spawning endcrystals, because I use this code:
EnderCrystal enderCrystal = getGameMap().getWorld().spawn(playMap.getCrystalForTeam(team.getTeamColor()).toLocation(gameMap.getWorld()), EnderCrystal.class);
System.out.println(enderCrystal.getEntityId());
System.out.println(enderCrystal.getLocation().toString());
and in the console I can see the right coordinates and the entityId, but in the world ony the third endcrystal is spawned from 3.
Has anyone any idea?
My only guess is maybe something with gamerules? Because when trying it on another world, it works fine as far as I tested it.
You probably have some other code messing with it
// other plugin
no
I will check, but I don't think so
how do i remove all bossbars? this doesn't work:```java
server.getBossBars().forEachRemaining(BossBar::removeAll)
they still appear at the top of the player's screen
i dont think custom bossbars are added to Bukkit.getBossBars() (could be wrong ofc)
atleast didnt work for my vanish plugin
hello
works. thanks @tardy delta
doesnt do anything, i believe those are for vanilla ones
is there some1 who can help me with some api?
im tryna detect trade finish in TradeSystem by erikzimmerman
but it doesnt work
?paste
https://paste.md-5.net/geliqofeno.java - i would be glad if some1 will help me
registered it?
yeah
How can I get a list of materials that do not include MinecraftExperimental? I know it is an annotation but how can I check against it?
Here is an example from the JAVA_DOC
iirc there should be an isExperimental
I checked and couldnt find it :/
It's isEnabled something or other
does someone know?
declaration: package: org.bukkit, enum: Material
is it printing these
System.out.println("Trade Finish Event - Player 1 Progress: " + plugin.getConfigManager().getPlayerProgress(p1.getUniqueId()));
System.out.println("Trade Finish Event - Player 2 Progress: " + plugin.getConfigManager().getPlayerProgress(p2.getUniqueId()));```
@worthy yarrow have you found anything useful?
getServer().getPluginManager().registerEvents(new OnTradeFinish(this), this);
mesg the api dev then
it's on their end
Well I looked over the code and it's actually really well written to my eyes, there's just some fuckery going on with intelliJ recognizing the dependency and I can't even get the import to work... I just wrote out the math calculation myself
and also as a external library
or just rewrite your own implementation
wdym does the dependency not get pulled in?
yeah but these are like 2 lines of code
that don't work
It's like maven takes it as a proper depend, but then when I go to call ExpressionParser, I just get the good old cannot resolve symbol
does the api have it's own jar or do you have to register listeners for it somewhere
it should be in the documentation
What's it called
Can someone help please:
https://www.spigotmc.org/threads/question-about-mapped-mojang-spigot.638742/
Someone already told me:
"You are using obfusctated methods in a remapped jar(which has the actual method names).
Don't use the remapped version or use the actual methods."
Yea i mean i would if it would work.
If i use normal paper api 1.20.1 i dont find those methods too..
works perfectly fine for me lol, what java version are you on?
ah dang it im on 19, for no particular reason
Perfect, that worked... function name was a bit misleading but now it makes sense
what import are you using
could probably change it if you really wanted
and are you using the remap plugin
I don't think it's the dependency, something is messing with the import, intelliJ won't even recognize com."githhub" as a symbol
com.github? show screenshot
did u figured out something?
wym?
Yea i used those instructions: https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
Like just as an example, github isn't recognized
thats not even the correct import
I know
It's an example because "github" again, isn't recognized
i wanted to see what happens when using my code
https://github.com/erikzimmermann/TradeSystem/wiki/Installation It's aslso a separate jar you have to put in plugins
I did too tbf, I'd love to implement more than just a basic math calculator and if I could use your repo, it'd make it a whole lot easier

