#help-development
1 messages ยท Page 1186 of 1
Yeah use getResource and pass it to ImageIO.read
Then use the BufferedImage to loadServerIcon
il try
Is there anything that allows me to change shader settings with plugins?
no
you could make a mod which allows you to change the settings by sending a plugin message, however I doubt players would install that mod lol
I haven't been coding in java for a while, and now I'm thinking of getting into it again, but I wanna make a library where I'll store my re-usable code, could someone be able to help me out as to how to link it to my main project plugin, I'm using maven.
build your libary with the command argument "install"
this will install the lib to your local maven repo and in you project plugin you add your lib like you add the spigot api
oh okay sec.
Would it be okay if I DM you ?
What's a good way of slowing a falling block down?
Velocity didn't seem to work & chickens cause the falling block to jump since it's not landing on one specific block that Minecraft's happy with
Block displays instead of falling blocks would be best
regardless I still need it to land on an exact block, as it's being turned into a proper block.
The jumping's just stupid & looks bad
Block display do get quite accurate with their position
as do falling blocks, when they're not riding other things lmao
That's true
does not seem to work.
@EventHandler
public void onServerListPing(ServerListPingEvent event) {
InputStream fileObject = this.getResource("/icons/bollie-1024.png");
BufferedImage icon = null;
try {
icon = ImageIO.read(fileObject);
} catch (IOException e) {
throw new RuntimeException(e);
}
try {
event.setServerIcon(Bukkit.loadServerIcon(icon));
} catch (Exception e) {
throw new RuntimeException(e);
}
event.setMotd("allo!");
}
My issue comes from the position movement when having it ride a chicken, but that's the only method that seems to work in regards to slowing its fall
Also reading from file every server list ping isn't a good idea
oh well, il change
The other issue is that I need the falling block -> physical block as well.
I'd rather not do a bunch of fuckery w/ display items to determine if it's properly on the ground & shit
well it still does not work, same code, same error
What's the error
Guessing the speed for the FallingBlock's
@Override
protected double getDefaultGravity() {
return 0.04D;
}
Not seeing a way to change this though ๐ค
ugh nms
Chocoooooo
eh. guess I might as well be sure that's the actual thing determining speed before pinging the nerd LOL
at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1356) ~[?:?]
at net.jorisstudios.bollielobbie.coreplugin.BollieLobbieCore.onServerListPing(BollieLobbieCore.java:35) ~[?:?]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.21.3-R0.1-SNAPSHOT.jar:?]
... 46 more
BollieLobbieCore.onServerListPing(BollieLobbieCore.java:35)
Also send the full error In a paste next time
?paste
Also please learn how to read stacktraces
you really shouldn't be reading it on every ping
Any way for me to spawn that class as a falling block w/ spigot code or am I stuck having to do it all in nms? ๐ค
so the file isnt being read?
You didn't even send the full error so I couldn't tell you
Maybe
Who knows
is there a reason you HAVE to use FallingBlock and can;t use a Display?
well im using screen on linux in putty so i cant scroll up and it goes past the screen.
falling block -> physical block.
If there's a way for me to do it w/o basically recreating the falling block then ๐
That's just a shitty ssh client then find a better one lol
Even my stock terminal can scroll up
All you have to do is calculate start and end and translate using a Display, then spawn an actual block at teh end
no, in the screen you can scroll up, it shows the other history then
Yea, so basically re-creating the falling block lol
not really as an FB applies gravity
which is a BITCH in MC
is your FB just falling straight down?
Pretty much, arbitrary x,y,z just has to fall to the block directly below it so it's not jumping to a random block since it must be on a single block to be physical
Only cause it's hard coded ๐
u guys any idea for set item to player crafting when player open inventory?
Then a Display would be simple...
Hey I do minecraft physics
There's default methods, but nothing to change the values lol
Spawn the BlockDisplay where you want to start. Set a Transformation to move it to where it ends. Set a transformationDuration to say how long it will take. When it lands spawn your new Block and destroy the Display
but why would you do that instead of using a falling block
How would I set the duration? Given the arbitraryness of it there's no hard coded value I can use, especially since I can't just get the block it'll land on as that could change and it's not worth constantly checking to see if the duration has to change
why not just apply velocity instead
before you spawn the display (to start falling) find the first solid block below it
or do you want to make it slower
you then have yoru fall distance to calculate yoru duration
^
you'd end up doing the same thing be it with a falling block or a display then, which is calculating the speed necessary to reach x at y speed
Except for if the solid block changes (which is possible), which requires rechecking once in a while and at that point I might as well just get falling blocks to work lol
I'd do a falling block just cause it already makes the block physical for me but eh, it's pretty much the same in the end
Good luck with FB then. Smooth movement is going to be VERY hard to get workign, if its even possible
well I guess if you disable the falling block gravity then it will never turn physical
will players be able to place blocks in the place where it is supposed to land
if they are, then it makes thing a bit more annoying
Even if I got it smooth I still need to make it slow and get it work with block changes so it's not floating in mid air if blocks get broken lol
Yeah, which is why I want to use falling blocks if possible. I don't have to care about player modifications at all lol
whichever way you go you are going to have to check and modify it every tick
for an FB you are going to have to modify its velocity every tick. for a Display you check for block changes below it
I'll make a spigot patch to allow me to modify the gravity, if that works then API can just be pr'd lol
eh, it'll probably mess up client-side predictions, but if it works then great
Fuck client-side predictions lol
Is the block supposed to be falling at a constant rate?
Above a single block @ a constant albeit slow rate, yes.
if it is a constant rate then just making it no gravity then set velocity should work tbh
velocity will not work with no gravity
Could you perhaps get the initial velocity of the falling block and reduce the speed?
discVelocity.multiply(Constants.DRAG_FACTOR);
Example, constant = 0.98, ran every tick the velocity is slowed by 2%
Instead of every tick, you could just say reduce by whatever and it should fall slower?
And I'd assume this to be with the actual falling block not a display
kek 1 or 2?
Don't got the ram ๐
What do you have like 8 gb?
16
I don't use ij
I'm currently having an issue adding my library to my plugin, for whatever reason, it says that the class cannot be found from the library.
Here's the maven code:
<dependencies>
<dependency>
<groupId>com.anchoutils</groupId>
<artifactId>AnchoUtils</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Any clue as to why ?
Good man
Fellow eclipse Chad ๐ค
Can you set the background (wallpaper as it were) in eclipse?
No, its a proper IDE so no silly frills
Netbeans
Non-IJ user ๐ค
NetBeans ๐
if i need instance of plugin is there a difference if i put argument "Main plugin" in constructor or "JavaPlugin plugin" (which main extends) because i saw someone do it
yes
Main will give access to all the methods of Main. JavaPlugin will only give access to methods of JavaPlugin
ohh
If you just need a Plugin instancxe, either will do
Tbf I think most cases it'd be dependent on whether it's for internal use eh?
yeah, just depends what its for.
ok just wanted to make sure I wasn't abusing Plugin kek
Trying to make a chest and put items in it in my plugin. The class that it is in is in a separate thread due to how my code is set up. Im using the bukkit runtask to avoid this causing errors.
Getting the following error:
java.lang.ClassCastException: class org.bukkit.craftbukkit.block.CraftBlockState cannot be cast to class org.bukkit.block.Chest (org.bukkit.craftbukkit.block.CraftBlockState and org.bukkit.block.Chest are in unnamed module of loader java.net.URLClassLoader @4dcbadb4)
Relevant code segment:
Bukkit.getScheduler().runTask(Randomblock.getInstance(), () -> chestLocation.getBlock().setType(Material.CHEST));
Block b = chestLocation.getBlock();
Bukkit.getScheduler().runTask(Randomblock.getInstance(), () -> b.getState().update());
Chest chest = (Chest) b.getState(); //THIS LINE
Bukkit.getScheduler().runTask(Randomblock.getInstance(), () -> chest.getInventory().clear());```
I marked the line that I believe is what's causing the error with //THIS LINE comment. I looked up the error and people wwere getting the error for trying to cast the Block (b) to Chest, and they were able to resolve it by getting the state of the block. However, I already am getting the state of the block in this and I am still getting an error.
Spigot version 1.21.1
Please let me know if yall have any input
ur just castin it to chest
Isn't that what I want? So I can then modify the chest using chest.getInventory()
you can cast chest to blockstate
I see. Let me try that
i mean i say you cant cast it to chest because its blockstate parent of chest
i casted it to blockstate but how would I access the chest inventory from there
i didnt mean thats the solution im just trying to say that
sorry
wdym? sorry I dont understand
like specifically wdym "blockstate parent of chest"
that chest extends blockstate
every chest is blockstate but not every blockstate is chest i guess
how would I use that to fix it do you think? Like i dont fully understand what youre suggesting i try
sorry if im being slow lol im running on 0 hours of sleep
unrelated to your issue but why are you running 3 different tasks for this
just do it all in a single task
your issue might just be a desync one
im not familiar with using the bukkit tasks tbh
are you sure that the blockstate will be a chest? if not, then you cant just cast it
ye im setting the block to a chest before checking it
why is this in a different thread to begin with
they are setting it to chest, but in the main thread so it may not happen all at the same time
ah
i needed to have a runnable so I could time it, it's a function that i have set to go off after x amount of minutes
This line Chest chest = (Chest) b.getState(); is run in the main code sequence so it runs before your scheduled code
I understand now
that doesn't sound like something that needs to be in a different thread
you can just use BukkitScheduler#runTaskTimer if you want a task that runs continously, and do whatever checks there
wouldnt that still be a runnable?
or runTaskLater if it is supposed to run after x minutes as you say
Why are you using runnables/tasks ?
yes, but it runs in the main thread, so you won't have to deal with context switching
ahh
so essentially im making a loot crate feature so when the server starts up it runs "initiateLootCrate" function, which determines coords for the loot crate and says them in chat, then 20 mins later it calls "spawnLootCrate" (the function/class where im having the issue) which spawns the actual chest and puts items in it. initiateLootCrate needs to run every 80 minutes
I decided to make my own class that extends runnables so I could pass variables between the functions (location variable) -- this is just what I saw online to do
yeah, to me it sounds like spawnlootCrate can be just a runTaskLater task
do note that since the bukkit scheduler works in the main thread, it uses game ticks as unit of time, this also means that if the server lags, it'll delay the task and it may be off by a few seconds
@blazing ocean
@proper cobalt
this is desirable for most people since one wants the tasks to be ran in sync with the server, however if your crate absolutely needs to be ran after x minutes in real life, regardless of the state of the server then you do need to do it in a different thread
u helping ppl in vc?
no
oh
just chilling here
can u help me
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
kinda hard to explain would be easy to ss
Upload a YT video king ๐
just make a video or sth
aight
I could never, my potato pc just drops frames like a maniac whenever I try to record the screen
I could probably try with an encoding that my hardware natively supports so it doesn't struggle as much tbh, I have yet to fiddle with that
need to go to the store anyway lol
I record short vids on my programming environment (a steam deck gigachad) it also drops to like 20 fps because no hardware acceleration so I feel that
Yall can I get some help, both my plugin.yml and my command are not showing the command in game, help!
FIXED IT! thank you. did not think about the possibility of a desync. im too tired to be doing this LMAO
does ity need to be in onenable specifically? i have a function linking them together
I am not completely sure, but it might just be some items having the int PDC from before it was changed, so that happens
you are getting the LIFETIME value from the meta after all
hmmm what do you suggest i try
I mean as long as it's inside of it
huh
give yourself new items that don't have the old pdc
not the ones you have in your inventory at the moment
for commands, I'll make a command handler using reflections
yeah thats what i did.
thank u so much @sly topaz i wouldve never noticed that
it works with the new items
had it happen to me lol, thankfully it is on dev and not on prod
I had mine in prod so I had to migrate all the items the players had, it was a pain in the ass
should I send the github repo?
yeah that sounds uff, gotta remember i cant just change stuff like that
how would you even migrate something like that
did you do it automatically or manually
I just listened to the inventory open event and on join to change the items as they appeared, then added a data version tag for all the upgraded containers o I wouldn't do it again
yeah thats smart
to avoid that, you can have a data version tag from the get-go
so that if format changes, you just up it and check against that
yeah well the usage of it wouldnt really be compatible
i mean i guess it could be with rounding
thats a problem for later me
ideally you'd just depend on something like DFU, but there's no API for it
not sure what that is
datafixerupper, it is what mojang/minecraft uses to upgrade worlds to new versions
im not that advanced yet
that's fine, you just have to know it exists if you do run into this problem again but on production
?whereami
???
you're using paper-plugin.yml, which means you have to use brigadier and not bukkit commands
ohhhhhhhhhh
but that's ultimately something to do with paper so you'd be better off asking in their discord
Hi, is there anyway to change a player's head rotation smoothly with nms packets? If so, which packet
I mean, just teleporting should do
just do it in very small intervals
I'm trying to do it smoothly
Already have the teleportation setup
Trying to find a way to change it via packets to get rid of that jitteryness when using teleport
Ok, thank you
A New Age of Weapons in Minecraft. Contribute to WeaponMechanics/MechanicsMain development by creating an account on GitHub.
apparently it is smoother with packets, haven't tried it myself
if I had to assume, it might just be related to relative movement
Awesome, thank you very much. Will look into it
hello everyone I have a question, can i send a packet from a spigot server plugin containing a boolean value to a client who has a forge mod that can recieve that packet and use that information
it's more like how can I do this any documentation for this
specific case or?
any help would be appreciated
Yes. That's precisely what the plugin messaging channel is for
Forge communicates over the plugin messaging channel. Each mod has its own channel
I believe forge serializes with a varint, that being the discriminator for the packet, then the rest is just bytes (whatever data you want to send). You'd have to look at the implementation of the mod to see what the channel is, what the id of the packet is, and what data it expects. Or if you're implementing the mod yourself, then you probably have a good idea of what to expect
anyone know how to rotate an armorstand's head towards a coordinate?
Vector direction = targetCoordinateVector.subtract(armorStandPositionVector).normalize()
Then you can get its location, set its direction, and teleport
Unless you only want to move the head, in which case same idea, but you'd have to convert that vector into an EulerAngle
ok thanks :D
How do you correctly transform a vector into a euler?
does build tools not generate the source jars
I don't like having no javadocs and the param names being l1 l2 when using rempaped mojang
I mean for the API
wonder if it'll pick it up if I add the spigot repo
oh it did, surprisingly
It has flags for it but doesn't copy to m2
annoying, do I have to add nullness annotations for it to shut up
I'll check if there's a flag
there is indeed
public static final OptionSpec<Compile> TO_COMPILE_FLAG = PARSER.accepts( "compile", "Software to compile" ).withRequiredArg().ofType( Compile.class ).withValuesConvertedBy( new EnumConverter<Compile>( Compile.class )
{
} ).withValuesSeparatedBy( ',' );
what the fuck md
they must write it like that on purpose lol
I do not want to believe someone prefers that formatting style
yeah but maybe they started it for the meme and then just went along with it
rather than going "yeah this is the ultimate formatting for java"
I want to say it's NetBeans default formatter
that's crazy
what kind of crack do oracle guys smoke to make that formatting the default, I'll never know but I do want to know
Whatever they smoke, I want some of that
because for me it just breaks completely, the rotation goes here n there everywhere
why do you want to transform a vector into an euler angle
to rotate an armorstand's head
they represent different things, so transforming it depends on how you want to translate these values
yeah but what does the vector represent here
rotation towards a player? idk
it's a vector
so you want to make the armor stand head face the player?
spigot's api uses euler angles kek
what
choco is writing a bible
be using paper
join server for paper.
get responses once per eternity
paperserverbansforstupidliberalreason
join spigot server
ask question
gets useful feedback in litural seconds
Thank yall for existing, u people are cool๐
someone should add greentext command to cafebabe
i think discord already has greentext u just need to use a spacebar i thikn
greentext thing
oh yeah
no?
i thnk
ah alright thank you, I'm new to minecraft development or game development in general so don't know these things that might be obvious to other more experienced developers
I will definitely look into it
the reason you got banned is because of your pronoun field and you not wanting to remove it
however complaining about that punishment here will not be of much help
people against lgbtq+ in 2024 smh
uh yeah dont care to be honest.
jpw os tjat amto lgbt
couldnt even type rn smh
how is that even anti lgbt
?
how is that antilgbt, no trolling, no bullshit
explain
also #general
you're just mocking people with that
#general
whats happening lol
there was a bit of a discussion
The perpetually offended are always offended
it is a delicate topic, that's all. It's like making fun of jewish people for hitler, or using the n-word for the shit and giggles when you know it has racial implications
Offence is taken not given. Clearly the dude was making a "joke" in his bio.
that's such bs, because you can be purposefully offensive lol
it being a joke doesn't make it any less offensive to the group of people that applies to
You can. But its YOUR choice if you want to be offended. No one can force you to be offended
it isn't a matter of being offensive or not, it is a matter of a person being purposefully obnoxious, why would you want that in a community
Tbh i see it personally as more tasteless than actually offensive they know what they're doing and it's just tasteless.
I saw it as kinda funny. But then again I'm not in any cult
I don't see it as offensive either, but I can see the fact that it might be offensive to some people so I don't make light of it
same way you don't go saying the n-word to people or making fun of war crimes, it is just tasteless and not actually funny
there's a time and place where it might ultimately be, the discord pronouns field isn't it
Oh yeah its clearly going to get someones back up, but it is also clearly joking. Not a very good joke but its still a joke
you could argue so, yeah. I don't particularly believe it is good to encourage that behavior in any community, so the paper team did good on just going straight for the ban
I'd ignore it unless it became an actual issue.
that's reactive, and could be a fine way to moderate
with a community as big as paper's though one has to be preemptive at times, it is a hard task
Nah people just need to pull their fingers out and stop looking to be offended by everything
you just don't want things to snowball for no reason, or well maybe at the cost of the community being seemingly "unwelcoming" but if people like that find it unwelcoming all that ends well is well lol
ah yes, I am not the problem, everyone else is!
Community being welcoming. Lol paper
if you don't see the issue with that line of thinking then I can see why you're making this argument
I'm using spigot 1.21 and cannot import the Material enum, everything else seems to be working properly, anyone else encounter this issue?
Update your InteliJ
Thanks
can i get when click on the advancement menu?
Ther is a packet sent when teh player opens the advancement menu, but I don't know if there is an event for it
Nope no event.
does inventory open/click not trigger for that
no? ๐ค it isn't an inventory
can someone help me create a plugin
?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/
Iโve given up on the chunk loading stall for now
average person who has to work with chunk loading
Even teleporting into the world causes it, I guess the vanilla chunk generator doesnโt like having 0 chunks in the world to work with
Moonrise handles it fine
Iโll probably just shove a 1000x1000 pre-generated world into the plugin

Idk how one would fix it
how to check if particular item has cooldown?
Use the hasCooldown method
declaration: package: org.bukkit.entity, interface: HumanEntity
I am on 1.18.2 and this method has only Material argument no ItemStack, form which version ItemStack as argument is available
Probably 1.20.5 or 1.21
does the -Ddisable.watchdog=true flag work on spigot or was that a paper only thing
I think it might be paper only
But you can change the value in server.properties instead
gonna set the timeout to 9999 I guess
Throw on a few more 9s for good measure
im working on a plugin and i need to damage an entity with a certain value based on distance from player to target, but its always doing more than the max damage, does anybody know whats going wrong?
// Hit an entity
Location hitLocation = nearbyEntities.getFirst().getLocation();
LivingEntity target = (LivingEntity) nearbyEntities.getFirst();
// Get distance from player to hit location
int distance = (int) player.getLocation().distance(target.getLocation());
// Determine damage based on distance
int damage;
if (distance <= 15) {
damage = 6;
player.sendMessage("Damage: 6");
} else if (distance <= 30) {
damage = 3;
player.sendMessage("Damage: 3");
} else if (distance <= 80) {
damage = 1;
player.sendMessage("Damage: 1");
} else {
damage = 0;
player.sendMessage("Damage: 0");
}
// Apply damage to the first entity hit
target.damage(damage, player);
// Spawn particle effect at the hit location
player.getWorld().spawnParticle(Particle.CRIT, hitLocation, damage);
return; // Stop further ray tracing
for clarification, when the message is sent, it says the correct damage amount, it just doesnt deal the correct amount of damage
it was in spigot.yml btw, not server.properties
timeout-time
max-tick-time in server.properties should work too
How can I improve my plugin dev skills
I have some Projekts in mind where I have no fking idea how it should work
I'm trying to make a weird hat plugin. I want to essentially be able to put custom models on my head using customModelData. This is easy enough, but I want to be able to rotate the models while on my head. I dont know if it's possible without having different models for the rotation states?
You could use a very old technique for animated models.
This video explains it a bit, but it being this old, the generator may no longer work.
https://www.youtube.com/watch?v=9EXrHIBD_2E (good example at 2:00)
I can't really explain it well but I'll try
The model has every possible frame of the animation
And you use an animated texture to swap between them
By doesn't deal the correct amount of damage do you mean higher or lower than the damage you set?
its resolved, i cant have the damage source in the damage, for some reason
Interesting, that's weird.
Is there an inbuilt method to get the player count of another server?
and maybe other information like MOTD
?pmc only
Not a huge fan of that...
But thank you for showing me
Is embedding a small minimal HTTP server for internal use only a bad idea?
or actually a TCP server may make more sense
It's not a bad idea, but for what specific use case do you need it?
Trying to move information across 2 servers, but also a Discord server
currently using Socket.IO but not a big fan of some of the ways I'm doing that
You could also use my library inject I guess, but I feel like having this stuff shared on the connection would not be a good idea lol
I'll have a look into that actually, thanks for sharing
What do people normally use for an HTTP server on a Spigot plugin?
You can use anything
Well, it kinda depends
do you want it to be publicly accessible?
why would people usually use an http server on their plugin
It's not at all accessible, purely for localhost only
Canโt you use something like redis pub/sub
I mean injecting into netty makes it accessible on the game port, but yea ^
Good shout actually
Having trouble resolving ChannelHandlerContext
attempting to use your library, inject
Looks like a good fit
IntelliJ does not believe it exists
never mind we're chilling now
we are no longer chilling
InjectSpigot.INSTANCE.registerInjector(new TS24HttpInjector()); causes a mighty crash
something something Caused by: java.lang.IllegalArgumentException: Plugin already initialized!
post the whole stack trace
?paste
is TS24HttpInjector your plugins main class?
you might have created an instance of your plugin by accident
@blazing ocean your library could have used the service provider API for the injectors tbh
that way there'd be one way to get the instance on all platforms
I guess the singleton is more straightforward for beginners
I say mostly because having it this way kinda gets in the way when having multi-platform plugins/mods
bruh since when windows bundles tar
does this mean i can finally do tar -xzf foo.tar.gz without 7zip?
there's also wget
wget is just an alias to powershell module
iirc
but tar is a port of real application from bsd
cool tbh
this is on windows 10 btw so it was probably introduced around in 2020 if i had to guess
this is probably how windows 11 supports new compression methods
at least for tar archives
Am i tripping or does velocity not apply on text displays
prolly not
2017
7 years ago
how did i not known this before
2020 is as far to 2013 as 2024 is to 2017
.tar.gz was always alien archive on windows, but for 7 YEARS windows supported it
but Microsoft decided to not create GUI wrapper around it until windows 11
me when I have winrar set to open .jar files
watch me pay for winrar
to show my support to the motherland
even though it's ass half the time
i actually switched to 7zip due to annoying popup
just pay for it smh
just how i switched from sublime text to neovim for basic editing
me when
average day on neovim
eh, at least ik what to do
treesitter screams for c compiler
avg day on intellij's command prompt
what did you do..
bro doesn't do atomic commits
ok this is hilarious and nowhere in my plugin I'm modifying drops or any entity location or speed lmao
seems to happen at random around 1/8 of the time
hidden trampoline block
Update your server
Yeah ty. Just noticed it was fixed on 7934 a month ago still funny anyways.
PR it I guess
I'm having such a hard time learning that's like
I dreamt that I was working on this problem
but it's okay I'll get through it
7zip is the GOAT
service provider API is literally the BEST I abuse it so hard
like I have at least 26 services already
with a few hundred more well on the way
better late than never
win rar is great too ๐
i want to do stuff when an entity is damaged by a projectile, do i need to use EntityDamageEvent with projectile cause or do i need ProjectileHitEvent
Up to you
ProjectileHitEvent seems the better option in your case.
Iโve always used EntityDamageByEntity
I didnโt know projectile hit event exposed the hit entity for the longest time
deadass
it doesn't looks like it works for snowballs tho for some reason
maybe because it causes 0 dmg?
mb it works
Has anyone used WorldGuardWrapper before?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I'm just looking for examples ^
Personally I'm not a fan of it since it relies on Javassist
but you can take a look at the WorldGuard compatability expansion from CombatLogX https://github.com/SirBlobman/CombatLogX/tree/main/expansion/compatibility/WorldGuard/src/main/java/combatlogx/expansion/compatibility/region/world/guard
Any other preference?
why would you need to support both 6 and 7 anyway
1.8:
I see
I am using a decade old version, yes
smh
I mean, I don't personally have anything against that, I just find it amusing that there's a whole library dedicated to supporting different versions of worldguard
goes to show just how complex of a task regions are I guess
I'd rather just fork worldguard 7 and do the necessary changes to make it support 1.8
I'd rather just not use 1.8
that's a choice
I want a player in a specific region to be teleported back to spawn, but I don't really want to use WorldGuard. Any suggestions?
And yes
I am still using a prehistoric version of Minecraft
Just use a bounding box to check
How do I get the remapped dependency?
<dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot</artifactId> <version>${minecraft.version}-R0.1-SNAPSHOT</version> <classifier>remapped-mojang</classifier> <scope>provided</scope> </dependency>
in the move event or once every couple of ticks
Run BuildTools
?nms
oops wrong chat
Can't it be used inside the maven dependencies?
Like my code above?
you need to run buildtools to create it
that artifact does not exist on repositories
it has to be installed in your local repository, since it can't be in the remote ones as it'd be distributing minecraft's code
?paste
https://paste.md-5.net/ocalazadoq.cs
im trying to make it so after the blocks are turned into brown concreate and brown wool it after 7 seconds it restores all the original blocks back but right now the nbt and metadata is being lost the code used to work untill i made some modifications and it doesn't anymore since it's really really messy and i don't know what im doing i can't fix it so im asking for help to see what the problem is and get suggestions on how to fix it
last time i asked for a answer is replied to
im also fine with pasting the full code if it's needed
1.8 goated
?paste
How do I give a player a level 3 rocket? I saw FireworkMeta and FireworkEffectMeta but neither of them allow me to set the rocket level
At first, I thought it is FireworkMeta#setPower because that is the closest thing, but it doesn't go from 1 to 3 but instead from to 0 to 255.
Yeah, I am looking for flight_duration which has to be set to 3b
1 power level = 0.5s flight time
hey i was wondering if i can download one of my plugin's old versions and exctract it in a way that i can see the code since when i made some changes that were fine on that version they are now broken in my current version of the code is there anyway for me to decompile the jar file and see the code?
why do you not have the source of your own plugins
since i rewrite everything i want to update in a single jar file and project and don't save copies of it (which is deff my fault) but the account of the spigot plugin and everything is registered under my name if thats the issue
well I was more referring to your lack of a backup yeah xD
but yes you can decompile jars, I just dont know how to
yeah honestly on me
but its the same for every java jar im pretty sure
oh i got it decompiled nvm i have the code now ty <3
I advise you to use github to store the history of your code
yes I read that in the docs, but idk how long a level 3 rocket is compared to level 1
If 1 power level is 0.5 seconds then a lvl 3 to rocket is 1.5 seconds of power
so basically you waste 2 more gunpowder to just fly 1s longer? Damn
use vineflower to decompile it
that said, you should use git so that doesn't happen in the future as advised here
If one plugin cancels a event, how can I make the current project ignore listening to it?
what
I think you might be referring to the ignoreCancelled field in the EventHandler annotation
@EventHandler(ignoreCancelled = true)
Right, because it happens often people get confused between using true or false with that
figured id ask
I think the docs explain it
it does, but I doubt anyone reads the javadocs for an annotation's field
hence people should read the docs
Should have them within your ide
I agree, however I don't expect it to be everyone's first instinct ๐
it takes time to get the habit
In another case I had to use ignoreCancelled = false for one of my plugins to drop a mined spawner, yet it will still not be called if another plugin cancels block break event.
ignoreCancelled false is the default
it depends on order
so, you wouldn't have to set that explicitly
it didnt work lol. mining a spawner requires adding ignoreCancelled = false
I honestly doubt that's the case
to double check ive decompiled the other spawner plugins and they contain it as well
I mean, that doesn't really prove anything to me
then try it?
give me a MRE, I'll test it
Meal, ready to eat. Yum
@EventHandler(ignoreCancelled = false)
public void onMineIgnoring(BlockBreakEvent event) {
event.getPlayer().sendMessage("Broken a " + event.getBlock().getType().getKey().getKey() + " explicitly not ignoring the event");
}
@EventHandler
public void onMine(BlockBreakEvent event) {
event.getPlayer().sendMessage("Broken a " + event.getBlock().getType().getKey().getKey() + " implicitly not ignoring the event");
}
would this be enough
You would confuse many non native English speakers
I'm a non-native speaker lol
Many != all
goes to prove it I guess
I'm native English and I had to read it twice to understand your meaning ๐
Is like if you write something in our native language, I mean you are right
I assume that's because of the string concatenation rather than the sentence being confusing
I prefer when people correct me to improve my skills
While running the same event setup for a block it drops even if claimed, for spawners it does not drop. without ignoreCancelled = false, the spawner drops but is unable to read the entity data
if anything, one could attribute it to the fact that a single word had changed right in the middle of the sentence instead of at the ends, which is where people pay the least attention when skimming
No it was simply the use of explicitly and implicitly. Very under used words.
with what
uhh what
what do you mean "even if claimed", was this in a wg region?
Just ignore this situation, all ok
๐ญ Ive been saying it backwards. i meant @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) is required but it will still properly cancel if protected by something such as worldguard
I mean, priority highest and ignoreCancelled would mean you might not have the chance to cancel the event at all, rather it'd be already cancelled
without setting the priority it fails
I think whatever you experienced then was more of an issue with priorities rather than the ignore cancelled behavior
yeah, I can imagine, since I assume WG works on lowest priority or something like that
or I guess it does in normal for it to causes issues huh
that's interesting, I don't know how WG handles priority, they might even offer configuration for that
this was never a issue with normal blocks, only spawners - anyways, that convo was solved a long time ago
md, if you are reading this can you answer me this question: do you hotswap when working on Spigot? Or just recompile
if you do hotswap, how well does it work when having to manage multiple modules, I gave it a try the other day but it didn't seem to work exactly how I'd expect it lol
I usually hotswap when working on my paper fork runs
Multi-module projects and hotswapping works fine for me
has anyone tried rebasing spigot patches on top of mache I wonder
i mean spigot doesnt really have much nms interaction
but its probably off bc spigots fern flower fork
the decompiled source for a few methods is rough lol
mostly when trying to understand the chunk generation part of the code
I'd like to assume that mache + vineflower would have overall more healthy output
yes ๐
for very unrelated reasons 
is it public ๐
Well, one day
๐ด

are you hinting to something happening soon
it probably wouldn't be too hard to do it myself, just rather tedious
sadly not, hence the copium
they got paperweight v2 working
yea, it is terrible
and a softSpoon option
like, you end up with rejected hunks in basically every file
given vineflower tends to be a lot smarter than spigot's fernflower fork
how soon are you thinking it will be
lemme grab my crystal ball
maybe you should convert us
i wouldve thought youd know what the estimate is for the spoon
Well when will chocos component PR be merged 
uhhhhhhhhhhhhhhhhhhhhh
what language
not done yet!?
the test case pass, rn I am struggling with reading the file
x86 assembly
I am not done yet either, just because I got bored

I didn't know you were such a masochist
I'd like to try that too, just to refresh my assembly knowledge
string maniplation tho
lynx you wanna leak ur input
when you implementing splitting strings
Yea 
that is my current struggle
I mean, I know how I should do it just, I cannot be bothered so rn I am relaxing 

build some logic device that just solves that 
tbf I presume I'll get bored of this by day 5, but w/e, still a nice thing to fresh up on
just write the wasm
Hello ! i was looking to see how i could remove all chatcolors from a string (an item display name)
I think ChatColor.stripColor
thanks
Im wondereing if there is posibility of set cooldown for particular item (not global for each Material), I see spigot API has it only for minecraft 1.21.3, I tried to use packetevents API but its solution also work only on recent version of minecraft. I need it on minecraft 1.18.2, so is anybody knows how to gain it.
oh oke thank for info
any guide for minigame plugins?
Hi, I have an issue while working with display block entity. I am teleporting the display block entity to a location and using setTeleportationDuration() and I'm having a player spectate the display block entity while it is moving.
The issue is when the interval is 2 seconds, so 40 ticks, right before it reaches the 3rd location it slows down and doesnt travel to the exact location. This is only happening for an interval of 40 ticks. It does not happen when the interval is 20 ticks or 60 ticks
Here is the code
https://pastebin.com/E2UDzyWX
Any idea how to fix this?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Hi all. I'm working on a plugin that uses packetevents to send a custom armour stand entity to players (different to each player). This works great overall, but if the player dies and respawns (or enters range), the custom armour stand doesn't respawn.
What would be the most performant way to either respawn the stand when the player is within range, or track whether the stand is visible to the player so I can manually re-trigger a spawn?
it'd be easier to just use a real entity and edit the metadata packet instead
that way, it can still be different but the entity won't disappear
well, unless it is in a completely different position for each player I guess, in that case, there'd be no difference since the packet would be reset whenever the entity is destroyed and re-added
Hmm, I want to say the entity's position is the same for each player, but the "existence" isn't. By that I mean, the owner can see it first, then on a timer it's made visible/interactable to everyone else
then why not just spawn the entity and make it not visible by default?
hideEntity on spawn to all but the fist player
var armorStand = world.spawn(someLocation, ArmorStand.class, stand -> {
stand.setVisibleByDefault(false);
owner.showEntity(stand);
});
Bukkit.getScheduler().runTaskLater(MyPlugin.instance(), task -> Bukkit.getOnlinePlayers().forEach(player -> player.showEntity(armorStand)), idkTheInterval);
Yeah, that's probably the cleanest way. Let the game internals handle spawning/despawning. I'll have to experiment.
if you still want to go the packet way, you can just listen to the chunk load/unload events for tracking I believe
oh that's a good alternative, yeah
or if you want to be accurate, listen to the ClientboundForgetLevelChunkPacket and ClientboundLevelChunkWithLightPacket, no idea what packet type they correspond to when it comes to packet events
there's PlayerChunkLoad/UnloadEvent(s) if you're on paper too
definitely sticking with Spigot, myself ๐
@alpine urchin where does packetevents gets the packet type names from smh
I'll have to double check if dying/respawning on the same chunk performs a full chunk unload/load
it should, yeah
yeah i struggled a little with that too ๐
I think you need to check the player is in the same world as the entity as teh packet holds no world reference. Unless CB does it under teh hood
Luckily my setup only requires the one world, but yes definitely something I check for
would the world matter? Hm
for entity id it does, yeah
In my head one would save the entity's uuid along with their location for tracking so eh
yeah, but the packet uses entity id rather than uuid
which is silly to me but ยฏ_(ใ)_/ยฏ
for safety I'd get players from the world
then you know they are in teh same world
like, the packet will fire and you'd check if the chunk corresponds to any of the locations in the map <location, entityId> or whatever
I don't get it
a single packet will be sent per player, meaning we'd just send it to the player that is receiving the chunk with light updates packet
I think we are talkign at cross purposes. I was still talkign about the hidden entity
ah, makes sense
Isnt entity ID global
Itโs just a static atomic int in the entity class iirc
Also itโs used for networking as itโs smaller
A varint is up to 40 bits where a uuid is always 128
yeah that's one thing i always liked about minecraft, it tries to be as efficient as it can in terms of networking
Well, it didn't always used to be that way. Most of the time the networking stuff is bound to the NBT data system it uses, just so happens it works for network related stuff. But in regards to modern versions, it does appear they do try to optimize some of the network related things
does anyone know of a plugin that can make holograms but the text is a large font and it like stands out, i see people doing this, just dont know what there using
its a TextDisplay entity. https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/TextDisplay.html
is there a way to make a player not collide with blocks at a specific position
hlep me pls
i have no idea how plugin
just want to edit/make plugin that have command to show player coords (others) and the people who can use it is configurable
Replace the blocks with block displays
What part do you need help with
Is there mojang mappings for 1.16.5?
Yes but not for Spigot
iโm 1.8 does that still exist
is there a way to only show an entity for one player
oh are you on 1.8?
send packets to the player connection
wiki.vg is down apparently but you can use that to get the protocol spec and figure out what packets to send
Wiki.vg closed down
permanently?
wiki.vg, a wiki that documents Minecraft's protocol extensively, is sunsetting on November 30, 2024. As the announcement posts reads, "The final content will be archived and made available for download in MediaWiki's XML export format under the CC-BY-SA license, along with an archive of images and other media." The sunsetting announcement can be...
yes
Theyre planning on moving wiki.vg content to the minecraft wiki though
ty
i didn't know illusion published his engine
i could publish mine too but i'm not sure yet
How to get all enchantements and their levels that a tool supports in survival
i was gonna say check Enchantment but it seems it doesn't have it
is there a way to insert variables into a string like in rust? example "Hello {}!" , name
String#format is probably the closest ?
Otherwise the usual string concatenation
-# Hoping we get String Templates one day
:(
String templates complement Java's existing string literals and text blocks by coupling literal text with embedded expressions and template processors to produce specialized results. An embedded expression is a Java expression except it has additional syntax to differentiate it from the literal text in the string template. A template processor c...
poor choc
didn't know they weren't using regular double quotes but rather โ
ios!?!?
Is there a way I could open the Enchantment.KNOCKBACK function in intellij? Im using maven, dont know if that matters
that is not a function
What are you trying to do ?
I wanted to see how it worked
that is not a function however
what is it then
- You'd have to open NMS
- Enchantments are now declared with JSON
You'd have to open enchantment effect type "knockback" probably
to see exactly what happenes
inb4 1.8
1.8 isnโt very sigma
?1.8
Too old! (Click the link to get the exact time)
?howold 1.8
Minecraft 1.8 is 10 years, 3 months old.
Wait, why are there TWO websites for shit
10 years
Minecraft Beta b1.7 is 13 years, 5 months old.
paying an entire domain and web server just for 1.8, that's brave
i see
take that back
Is it possible to change the head's POSITION in armor stands (coordinates)? maybe make it lower
No
Dunno what you're doing, but may I interest you in trying out Display Entities ?
inb4 1.8 
Please rad, staph this
I can't take this

Someone actually bought a domain for this... waste of money XD
i know what they're for i just wanted to use a single entity for two separate rotating objects
Using two display entities is much better.
There is no reason to use an armor stand to display 2 models.
In fact using armor stands is worse, they are way less performant.
If you're in newer versions and want to show any model, your go to entity should always be Display Entity.
my build fails always at the same point... someone knows the issue ?
CMD: java -Xms512M -Xmx2024M -jar BuildTools.jar --dev --remapped
ERROR:
[ERROR] Failures:
[ERROR] EntityRemoveEventTest.testForMissing:69 The class net/minecraft/world/level/entity/EntityAccess has Entity#discard, Entity#remove and/or Entity#setRemoved method calls, which don't have a bukkit reason.
Please add a bukkit reason to them, if the event should not be called use null as reason.
Following missing reasons where found:
Method name: setRemoved, name: setRemoved, line number: 33 ==> expected: <true> but was: <false>
[INFO]
[ERROR] Tests run: 49134, Failures: 1, Errors: 0, Skipped: 30
Try it without the dev flag not sure why you'd want to remove version check anyways
Might be some weird version desync caused by the flag
without it works ... but i always used it :0
--dev
Disables BuildTools version checking, Java version check, and MC version lookup. Just builds the actual build environment
Only useful if md is working on snapshots maybe idk why else it'd be there
hmm okay i will remove it for the future but still weird
It's possible in the past your environment has been perfect as to not cause conflicts
for hotswapping spigot itself too now that I think about it
Oh yeah true
I have yet to try that myself
Why PacketPlayOutEntityEquipment isnt fired for players?
1.8 is omega sigma
it is fired for players
I use reflection to print the โaโ field(entity id) from the packet class and it is displayed in console, but not at all at the moment when I put on the armor
PacketPlayOutSetSlot?
That's for entities that aren't you yourself
I imagine the packet is only sent to other players and not yourself
ah, beat me to it
?)
that packet is essentially the inventory click event
or wait, uhh, maybe I am remembering wrong, let me check
uhh yeah that sounds about right
But it is better to use packet? I can put on armor without going into my inventory(
No
Hey, I have a problem with the plugin Factions, I have a code that is supposed to send a message to the player to tell him "You placed a block", and I got the message when I place a block somewhere I can place, but if I try to place it in like safezone for example, the event is cancelled (because im not allowed to place blocks) AND I don't have the message sent
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void checkBlockPlace(BlockPlaceEvent event) {
event.getPlayer().sendMessage("Block placed !");
}
I attached 2 screens showing when I try to place somewhere I can't, and somewhere I can
what are you trying to do with all of this
just display a different armor than the one the player is wearing?
Custom boots with jump effect
what does that have to do with these packets then lol
just give the player some boots with a jump strength attribute
well, if you are ignoring cancelled events then you wouldn't receive event
just remove the ignoreCancelled flag and you should receive the cancelled event
just make sure to check Event#isCancelled for any action you might want to do only if the event isn't cancelled
Okay, I don't know what to say, it's a question I asked some time before and yet I couldn't fix it, I asked help and some people has told me to use the "ignoreCancel", and if I remember right I tried without the ignoreCancel and it wasn't working.
Now it's working, probably something I did wrong back then, thank you !
if I had to assume, it was probably related to the priority, since if your event handler was lower priority than whichever one the factions plugin uses, it wouldn't end up doing your action. Glad you got it working anyhow
Well i think I did try to use HIGH and HIGHEST priority, but i was a bit tired at that time, maybe I did a mistake somewhere, who know !
But thank you a lot ๐
Wishing you a great day !!
Well, I think I know where was the problem, it was not exactly blockPlace, but blockBreak !
I did this :
@EventHandler(priority = EventPriority.HIGHEST)
public void checkBlockBreak(BlockBreakEvent event) {
event.getPlayer().sendMessage("Block break ! :D");
}
@EventHandler(priority = EventPriority.HIGHEST)
public void checkBlockPlace(BlockPlaceEvent event) {
event.getPlayer().sendMessage("Block placed ! :D");
}
when I try to place a block (no matter if it's in a zone I can place in or no) I will get "Block placed ! :D"
But if I try to break in a zone I am not allowed to break, I wont get the "Block break ! :D", but if I'm in a zone i can break in, then I will get it ๐ค
they might be cancelling the interact event, so no break event is fired or something like that
I couldn't say for sure, it could be any event that fires before break event
I also think it's that, but how can I be able to check then ? Because I kinda need it
well, what factions plugin do you use?
MassiveCraft ๐ซ
Are you on Spigot
Yes
1.12, I can't go above
well that makes it a bit more complicated, but let me check how massivecraft handles block breaking first
Thank you ! I really appreciate it
https://github.com/MassiveCraft/Factions is this the one?
https://www.massivecraft.com/factions. Contribute to MassiveCraft/Factions development by creating an account on GitHub.
yessir
seems like it is cancelling the block damage event itself
https://github.com/MassiveCraft/Factions/blob/808782376d6c133a8aae36352324a3688d247b7f/src/com/massivecraft/factions/engine/EnginePermBuild.java#L132-L148
so the BlockBreakEvent wouldn't have the chance to be called unless you were trying to break it in creative I guess
So how can I have a triggered event of a player trying to break a place no matter if he is allowed to or not ?
try listening to the block damage event instead
kinda sucks that they cancel block damage tbh
or you could just uncancel their event
Yeah
I'll try using the block damage
you could uncancel the damage event so that the block break event is triggered if anything, they do check for the block break event as well anyway
eh, still worth a try but if the block damage event is enough for you then you can just use that
I'll try ! Thank you, i'll let you know
the other option is to fork the plugin and just make it not cancel the damage event kek
since it isn't receiving updates anymore, it wouldn't be too much of a burden lol, I'd end up doing that
there's also factionsX which is based on massivecraft's factions plugin but that is also not updated anymore
It seems to be working with the block damage ! :D
try {
Database.database.connection.prepareStatement("SELECT 1").executeQuery();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}, 0L, 60L * 20L);``` why does my sql connection die
i love public fields
Connections shouldn't be kept alive for ever like that
proof?
Use a connection pool or create the connection when you want to make a request
connection pool tutorial?
hikari cp
^^ you can use HikariCP
is it a new connector?
the connection will force close anyways since you have the tcp socket limits and mysql has its own limits in how long a connection can remain opened
๐
Yeah
bruh.
link?
Which is exactly why shouldn't try to keep them open like they're trying to
A connection pool as being suggested literally manages the connections for you
and keeps them alive for you ๐
the way you are doing it wouldn't work, simply because eventually the connection needs to be re-created but your method isn't accounting for checking if it died or recreating it lol
HikariCP with sqlite ๐ฟ
don't need to imagine if you already experienced it
lol it does nothing for sqlite
I imagine this is also the reason why my plugin periodically died every day or so
Exactly
proof?
Is that a threat 
hey guys im having trouble importing the foundation library can someone help me with it? ive been strugging with this for like a week https://www.spigotmc.org/threads/having-trouble-importing-the-foundation-library.671081/
eh, it still makes it easier to switch database source if necessary
I would recommend not using foundation at all if being completely honest
it isn't necessary for developing plugins
should i use exposed with hikaricp or on its own
on its own should be fine
is there some sort of docs on how to use bukkit configurations?
javier why do you know so much about kotlin stuff yet don't like it
well, I can't just dislike something I know nothing about
valid valid
it isn't that kotlin is particularly bad per se, I use it for jetpack compose, I just hate how the ecosystem around it evolved and am more comfortable with java to begin with
why do you hate its ecosystem
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
because people abuse the hell out of its features, it makes a holy mess on a big codebase
abusing kotlin features is fun
how hard is it to make pvp bots?
i really wanna get KMP working for stuff like gradle/maven and MC
what is even a pvp bot
I once did a kmp thing but for NMS lol
show
eh, would have to decompress my archives
you can send me the archive
I'd rather give it a go again
last time I tried it kmp was still pretty early on so I had to hack around a ton
I believe it is more flexible now
could you still show me
I am not uploading 500gb lol

tbf I could probably reduce that archive by a ton just by removing the msvc shenanigans
it is like 50gb worth of build tools lol
minecraft.wiki has it now
like permanently?
yep
yeah
discontinued
oh dang
dead dead
I thought they were keeping it up as an archive
"The final content will be archived and made available for download in MediaWiki's XML export format under the CC-BY-SA license, along with an archive of images and other media."
it doesnt say where its archived but its archived somewhere?
or am i just searching on MediaWiki wrong idk
Ah