#help-development

1 messages ยท Page 1186 of 1

twin kiln
#

bc i found u use plg instance.getResource()

chrome beacon
#

Yeah use getResource and pass it to ImageIO.read

#

Then use the BufferedImage to loadServerIcon

twin kiln
#

il try

quaint mantle
#

Is there anything that allows me to change shader settings with plugins?

sly topaz
#

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

soft hound
#

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.

spiral light
soft hound
#

oh okay sec.

vagrant stratus
#

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

chrome beacon
#

Block displays instead of falling blocks would be best

vagrant stratus
#

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

chrome beacon
#

Block display do get quite accurate with their position

vagrant stratus
#

as do falling blocks, when they're not riding other things lmao

chrome beacon
#

That's true

twin kiln
# chrome beacon Yeah use getResource and pass it to ImageIO.read

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!");
}
chrome beacon
#

If you're server icon is 1024 pixels large

#

That's not the correct format

vagrant stratus
chrome beacon
#

Also reading from file every server list ping isn't a good idea

twin kiln
vagrant stratus
twin kiln
#

well it still does not work, same code, same error

chrome beacon
#

What's the error

vagrant stratus
#

Guessing the speed for the FallingBlock's

    @Override
    protected double getDefaultGravity() {
        return 0.04D;
    }

Not seeing a way to change this though ๐Ÿค”

chrome beacon
#

You can extend falling block class

#

(the nms one)

vagrant stratus
#

ugh nms

#

Chocoooooo

#

eh. guess I might as well be sure that's the actual thing determining speed before pinging the nerd LOL

twin kiln
#

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

river oracle
#

Also send the full error In a paste next time

#

?paste

undone axleBOT
river oracle
#

Also please learn how to read stacktraces

blazing ocean
#

you really shouldn't be reading it on every ping

river oracle
vagrant stratus
twin kiln
#

so the file isnt being read?

river oracle
#

Maybe

#

Who knows

eternal oxide
#

is there a reason you HAVE to use FallingBlock and can;t use a Display?

twin kiln
#

well im using screen on linux in putty so i cant scroll up and it goes past the screen.

vagrant stratus
river oracle
#

Even my stock terminal can scroll up

eternal oxide
#

All you have to do is calculate start and end and translate using a Display, then spawn an actual block at teh end

twin kiln
#

no, in the screen you can scroll up, it shows the other history then

vagrant stratus
#

Yea, so basically re-creating the falling block lol

eternal oxide
#

not really as an FB applies gravity

#

which is a BITCH in MC

#

is your FB just falling straight down?

vagrant stratus
#

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

vagrant stratus
quaint mantle
#

u guys any idea for set item to player crafting when player open inventory?

eternal oxide
#

Then a Display would be simple...

worthy yarrow
#

Hey I do minecraft physics

vagrant stratus
eternal oxide
#

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

sly topaz
#

but why would you do that instead of using a falling block

vagrant stratus
#

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

sly topaz
eternal oxide
#

before you spawn the display (to start falling) find the first solid block below it

sly topaz
#

or do you want to make it slower

eternal oxide
#

you then have yoru fall distance to calculate yoru duration

vagrant stratus
sly topaz
#

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

vagrant stratus
sly topaz
#

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

eternal oxide
#

Good luck with FB then. Smooth movement is going to be VERY hard to get workign, if its even possible

sly topaz
#

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

vagrant stratus
#

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

vagrant stratus
eternal oxide
#

whichever way you go you are going to have to check and modify it every tick

sly topaz
eternal oxide
#

for an FB you are going to have to modify its velocity every tick. for a Display you check for block changes below it

sly topaz
#

this has some easy ideas to implement

#

just make it ride a chicken lol

vagrant stratus
#

I'll make a spigot patch to allow me to modify the gravity, if that works then API can just be pr'd lol

sly topaz
vagrant stratus
#

Fuck client-side predictions lol

worthy yarrow
#

Is the block supposed to be falling at a constant rate?

vagrant stratus
sly topaz
#

if it is a constant rate then just making it no gravity then set velocity should work tbh

eternal oxide
#

velocity will not work with no gravity

worthy yarrow
#

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

vagrant stratus
#

Yeah, FB

#

I'll check that in a lil, got stuck playing overwatch lol

worthy yarrow
#

kek 1 or 2?

vagrant stratus
#

2

#

Fuck 1 fr

worthy yarrow
#

I played ow2 for a bit

#

It's pretty fun but eh shooters get so boring so fast imo

vagrant stratus
worthy yarrow
#

What do you have like 8 gb?

vagrant stratus
#

16

worthy yarrow
#

and that's not enough for ow?

#

sadge

vagrant stratus
#

It is

#

But not for an ide, Minecraft, and everything else I have opened

worthy yarrow
#

oh kek yeah

#

bet IJ soaks 60-80% of that mem huh

vagrant stratus
#

I don't use ij

worthy yarrow
#

oh

#

OH

#

right you eclipse weirdo

soft hound
#

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 ?

eternal oxide
#

Good man

sonic goblet
worthy yarrow
#

Can you set the background (wallpaper as it were) in eclipse?

eternal oxide
#

No, its a proper IDE so no silly frills

worthy yarrow
#

proper smh

#

I find every word in that sentence offensive ๐Ÿ˜ 

vagrant stratus
sonic goblet
vagrant stratus
worthy yarrow
#

basically same thing

#

IJ vs any other ide pretty much = apple vs android kek

pure dagger
#

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

eternal oxide
#

yes

#

Main will give access to all the methods of Main. JavaPlugin will only give access to methods of JavaPlugin

pure dagger
#

ohh

eternal oxide
#

If you just need a Plugin instancxe, either will do

pure dagger
#

okY

#

thanks

worthy yarrow
eternal oxide
#

yeah, just depends what its for.

worthy yarrow
#

ok just wanted to make sure I wasn't abusing Plugin kek

cold belfry
#

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
pure dagger
#

ur just castin it to chest

cold belfry
#

Isn't that what I want? So I can then modify the chest using chest.getInventory()

pure dagger
#

you can cast chest to blockstate

cold belfry
#

I see. Let me try that

pure dagger
#

i mean i say you cant cast it to chest because its blockstate parent of chest

cold belfry
#

i casted it to blockstate but how would I access the chest inventory from there

pure dagger
#

sorry

cold belfry
#

like specifically wdym "blockstate parent of chest"

pure dagger
#

that chest extends blockstate

#

every chest is blockstate but not every blockstate is chest i guess

cold belfry
#

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

sly topaz
#

just do it all in a single task

#

your issue might just be a desync one

cold belfry
#

im not familiar with using the bukkit tasks tbh

pure dagger
cold belfry
sly topaz
#

why is this in a different thread to begin with

eternal oxide
#

You are not

#

You schedule it so it runs after all your other code

sly topaz
#

they are setting it to chest, but in the main thread so it may not happen all at the same time

cold belfry
#

ah

cold belfry
eternal oxide
#

This line Chest chest = (Chest) b.getState(); is run in the main code sequence so it runs before your scheduled code

cold belfry
#

I understand now

sly topaz
#

you can just use BukkitScheduler#runTaskTimer if you want a task that runs continously, and do whatever checks there

cold belfry
#

wouldnt that still be a runnable?

sly topaz
#

or runTaskLater if it is supposed to run after x minutes as you say

eternal oxide
#

Why are you using runnables/tasks ?

sly topaz
cold belfry
# eternal oxide Why are you using runnables/tasks ?

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

sly topaz
#

yeah, to me it sounds like spawnlootCrate can be just a runTaskLater task

cold belfry
#

I see. I can try changing it to that

#

brb lemme move it to the bukkit tasks

sly topaz
#

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

proper cobalt
#

@blazing ocean

blazing ocean
#

@proper cobalt

sly topaz
#

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

proper cobalt
blazing ocean
#

no

proper cobalt
#

oh

blazing ocean
#

just chilling here

proper cobalt
#

can u help me

blazing ocean
#

?ask

undone axleBOT
#

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!

proper cobalt
#

kinda hard to explain would be easy to ss

sonic goblet
blazing ocean
#

just make a video or sth

proper cobalt
#

aight

sly topaz
#

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

blazing ocean
sonic goblet
quick shoal
#

Yall can I get some help, both my plugin.yml and my command are not showing the command in game, help!

soft hound
#

you sure you've done the
getCommand(name).setExecutor(class); ??

#

at the onEnable()

quick shoal
#

lemme check

#

?paste

undone axleBOT
quick shoal
#

im gonna paste the main

cold belfry
quick shoal
sly topaz
#

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

proper cobalt
#

hmmm what do you suggest i try

soft hound
quick shoal
#

huh

sly topaz
#

not the ones you have in your inventory at the moment

proper cobalt
#

oh wait that would be it probably

#

๐Ÿคฆโ€โ™‚๏ธ

#

let me try that

soft hound
quick shoal
#

yeah thats what i did.

proper cobalt
#

thank u so much @sly topaz i wouldve never noticed that

#

it works with the new items

sly topaz
#

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

quick shoal
proper cobalt
#

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

sly topaz
#

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

proper cobalt
#

yeah thats smart

sly topaz
#

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

proper cobalt
#

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

sly topaz
#

ideally you'd just depend on something like DFU, but there's no API for it

proper cobalt
#

not sure what that is

sly topaz
#

datafixerupper, it is what mojang/minecraft uses to upgrade worlds to new versions

proper cobalt
#

im not that advanced yet

sly topaz
#

that's fine, you just have to know it exists if you do run into this problem again but on production

soft hound
#

if u have one

#

that'd be great

quick shoal
#

on it

sly topaz
#

?whereami

quick shoal
#

???

sly topaz
#

you're using paper-plugin.yml, which means you have to use brigadier and not bukkit commands

quick shoal
#

ohhhhhhhhhh

sly topaz
#

but that's ultimately something to do with paper so you'd be better off asking in their discord

wise chasm
#

Hi, is there anyway to change a player's head rotation smoothly with nms packets? If so, which packet

sly topaz
#

just do it in very small intervals

wise chasm
#

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

sly topaz
#

I mean, I am not sure if packets will solve that tbh

#

let me give it a try myself

wise chasm
#

Ok, thank you

sly topaz
#

apparently it is smoother with packets, haven't tried it myself

#

if I had to assume, it might just be related to relative movement

wise chasm
#

Awesome, thank you very much. Will look into it

candid meteor
#

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

worldly ingot
#

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

wooden frost
#

anyone know how to rotate an armorstand's head towards a coordinate?

worldly ingot
#

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

wooden frost
#

How do you correctly transform a vector into a euler?

sly topaz
#

does build tools not generate the source jars

blazing ocean
#

There are no source jars?

#

You have the Spigot-Server module

sly topaz
#

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

remote swallow
#

It has flags for it but doesn't copy to m2

sly topaz
#

annoying, do I have to add nullness annotations for it to shut up

remote swallow
#

Iirx

#

Iirc

blazing ocean
#
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

sly topaz
#

they must write it like that on purpose lol

#

I do not want to believe someone prefers that formatting style

blazing ocean
#

He uses that formatting

#

in netbeans ofc

sly topaz
#

rather than going "yeah this is the ultimate formatting for java"

worldly ingot
#

I want to say it's NetBeans default formatter

sly topaz
#

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

blazing ocean
#

Whatever they smoke, I want some of that

wooden frost
sly topaz
#

why do you want to transform a vector into an euler angle

wooden frost
sly topaz
#

they represent different things, so transforming it depends on how you want to translate these values

sly topaz
wooden frost
blazing ocean
#

it's a vector

sly topaz
#

so you want to make the armor stand head face the player?

sly topaz
wooden frost
sly topaz
#

choco is writing a bible

wooden frost
#

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๐Ÿ‘

sly topaz
#

someone should add greentext command to cafebabe

wooden frost
#

greentext thing

#

oh yeah

#

no?

#

i thnk

candid meteor
#

I will definitely look into it

blazing ocean
#

however complaining about that punishment here will not be of much help

sly topaz
#

people against lgbtq+ in 2024 smh

wooden frost
wooden frost
#

couldnt even type rn smh

#

how is that even anti lgbt

blazing ocean
#

?

wooden frost
#

explain

#

also #general

blazing ocean
#

you're just mocking people with that

wooden frost
#

#general

pure dagger
#

whats happening lol

sly topaz
pure dagger
#

i see

#

but idk whats offensive

eternal oxide
#

The perpetually offended are always offended

sly topaz
# pure dagger but idk whats offensive

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

eternal oxide
#

Offence is taken not given. Clearly the dude was making a "joke" in his bio.

sly topaz
#

it being a joke doesn't make it any less offensive to the group of people that applies to

eternal oxide
#

You can. But its YOUR choice if you want to be offended. No one can force you to be offended

sly topaz
#

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

river oracle
#

Tbh i see it personally as more tasteless than actually offensive they know what they're doing and it's just tasteless.

eternal oxide
#

I saw it as kinda funny. But then again I'm not in any cult

sly topaz
#

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

eternal oxide
#

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

sly topaz
#

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

eternal oxide
#

I'd ignore it unless it became an actual issue.

sly topaz
#

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

eternal oxide
#

Nah people just need to pull their fingers out and stop looking to be offended by everything

sly topaz
#

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

sly topaz
eternal oxide
#

Community being welcoming. Lol paper

sly topaz
#

if you don't see the issue with that line of thinking then I can see why you're making this argument

calm robin
#

I'm using spigot 1.21 and cannot import the Material enum, everything else seems to be working properly, anyone else encounter this issue?

eternal oxide
#

Update your InteliJ

calm robin
#

Thanks

quaint mantle
#

can i get when click on the advancement menu?

eternal oxide
#

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.

sly topaz
#

does inventory open/click not trigger for that

slender elbow
#

no? ๐Ÿค” it isn't an inventory

sly topaz
#

I was hoping it'd just trigger anyway

#

but yeah

static ledge
#

can someone help me create a plugin

eternal oxide
#

?services

undone axleBOT
young knoll
#

Iโ€™ve given up on the chunk loading stall for now

blazing ocean
#

average person who has to work with chunk loading

young knoll
#

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

blazing ocean
sly topaz
#

I mean, it is probably easy to fix tbh

#

just not easy to work around

young knoll
#

Idk how one would fix it

ocean tide
#

how to check if particular item has cooldown?

chrome beacon
#

Use the hasCooldown method

ocean tide
#

I am on 1.18.2 and this method has only Material argument no ItemStack, form which version ItemStack as argument is available

young knoll
#

Probably 1.20.5 or 1.21

sly topaz
#

does the -Ddisable.watchdog=true flag work on spigot or was that a paper only thing

young knoll
#

I think it might be paper only

#

But you can change the value in server.properties instead

sly topaz
#

gonna set the timeout to 9999 I guess

young knoll
#

Throw on a few more 9s for good measure

worthy pumice
#

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

sly topaz
#

timeout-time

young knoll
#

max-tick-time in server.properties should work too

clear elm
#

How can I improve my plugin dev skills

chrome beacon
#

work on projects

clear elm
#

I have some Projekts in mind where I have no fking idea how it should work

shadow silo
#

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?

smoky anchor
#

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

summer scroll
worthy pumice
#

its resolved, i cant have the damage source in the damage, for some reason

summer scroll
young knoll
#

Probably adds the players base damage

#

Or perhaps takes into account held item

tired cedar
#

Is there an inbuilt method to get the player count of another server?

#

and maybe other information like MOTD

eternal oxide
#

?pmc only

tired cedar
#

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

blazing ocean
tired cedar
#

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

blazing ocean
tired cedar
#

I'll have a look into that actually, thanks for sharing

#

What do people normally use for an HTTP server on a Spigot plugin?

blazing ocean
#

You can use anything

#

Well, it kinda depends

#

do you want it to be publicly accessible?

pseudo hazel
#

why would people usually use an http server on their plugin

blazing ocean
#

If so, might wanna go for sth like inject

#

if not, probably don't want that

tired cedar
#

It's not at all accessible, purely for localhost only

young knoll
#

Canโ€™t you use something like redis pub/sub

blazing ocean
#

I mean injecting into netty makes it accessible on the game port, but yea ^

tired cedar
#

Having trouble resolving ChannelHandlerContext

#

attempting to use your library, inject

#

Looks like a good fit

tired cedar
#

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!

sly topaz
#

?paste

undone axleBOT
tired cedar
#

it's too late now I'm doing it a different way

#

but here it is for curiosity

eternal oxide
#

is TS24HttpInjector your plugins main class?

sly topaz
#

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

mortal hare
#

bruh since when windows bundles tar

#

does this mean i can finally do tar -xzf foo.tar.gz without 7zip?

forest shuttle
#

there's also wget

mortal hare
#

wget is just an alias to powershell module

#

iirc

#

but tar is a port of real application from bsd

forest shuttle
#

cool tbh

mortal hare
#

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

drowsy helm
#

Am i tripping or does velocity not apply on text displays

echo basalt
#

prolly not

echo basalt
#

7 years ago

mortal hare
#

how did i not known this before

echo basalt
#

2020 is as far to 2013 as 2024 is to 2017

mortal hare
#

.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

echo basalt
#

me when I have winrar set to open .jar files

mortal hare
#

7zip ๐Ÿ‘‡

echo basalt
#

watch me pay for winrar

#

to show my support to the motherland

#

even though it's ass half the time

mortal hare
#

i actually switched to 7zip due to annoying popup

echo basalt
#

just pay for it smh

mortal hare
#

just how i switched from sublime text to neovim for basic editing

echo basalt
#

notepad

#

take it or leave it

mortal hare
#

because i dont want to pay 80$ for text editor

#

which has basic syntax highlighting

echo basalt
#

me when

mortal hare
#

average day on neovim

#

eh, at least ik what to do

#

treesitter screams for c compiler

echo basalt
#

avg day on intellij's command prompt

wooden frost
sly topaz
#

bro doesn't do atomic commits

forest shuttle
#

seems to happen at random around 1/8 of the time

sullen marlin
#

Update your server

forest shuttle
#

Yeah ty. Just noticed it was fixed on 7934 a month ago still funny anyways.

candid meteor
#

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

rough drift
rough drift
#

like I have at least 26 services already

#

with a few hundred more well on the way

pseudo hazel
lilac dagger
#

win rar is great too ๐Ÿ˜„

dapper flower
#

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

lilac dagger
#

Up to you

summer scroll
young knoll
#

Iโ€™ve always used EntityDamageByEntity

#

I didnโ€™t know projectile hit event exposed the hit entity for the longest time

dapper flower
#

maybe because it causes 0 dmg?

#

mb it works

quaint mantle
#

Has anyone used WorldGuardWrapper before?

chrome beacon
#

?ask

undone axleBOT
#

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!

quaint mantle
chrome beacon
#

Personally I'm not a fan of it since it relies on Javassist

quaint mantle
#

Any other preference?

chrome beacon
#

Not aware of any alternatives

#

I would probably just write my own

sly topaz
#

why would you need to support both 6 and 7 anyway

chrome beacon
#

1.8:

sly topaz
#

I see

quaint mantle
#

I am using a decade old version, yes

blazing ocean
#

smh

sly topaz
#

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

blazing ocean
#

I'd rather just not use 1.8

sly topaz
#

that's a choice

quaint mantle
#

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

chrome beacon
#

Just use a bounding box to check

timid spear
#

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>

chrome beacon
#

in the move event or once every couple of ticks

chrome beacon
#

?nms

orchid gazelle
#

oops wrong chat

timid spear
#

Like my code above?

remote swallow
#

you need to run buildtools to create it

#

that artifact does not exist on repositories

sly topaz
#

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

idle condor
#

?paste

undone axleBOT
idle condor
#

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

peak depot
idle condor
#

?paste

undone axleBOT
fossil ridge
#

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

torn badge
idle condor
#

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?

pseudo hazel
#

why do you not have the source of your own plugins

idle condor
pseudo hazel
#

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

idle condor
pseudo hazel
#

but its the same for every java jar im pretty sure

idle condor
#

oh i got it decompiled nvm i have the code now ty <3

pseudo hazel
#

I advise you to use github to store the history of your code

fossil ridge
remote swallow
#

If 1 power level is 0.5 seconds then a lvl 3 to rocket is 1.5 seconds of power

fossil ridge
#

so basically you waste 2 more gunpowder to just fly 1s longer? Damn

sly topaz
#

that said, you should use git so that doesn't happen in the future as advised here

wraith delta
#

If one plugin cancels a event, how can I make the current project ignore listening to it?

sly topaz
#

I think you might be referring to the ignoreCancelled field in the EventHandler annotation

#

@EventHandler(ignoreCancelled = true)

wraith delta
#

Right, because it happens often people get confused between using true or false with that

#

figured id ask

sullen marlin
#

I think the docs explain it

sly topaz
#

it does, but I doubt anyone reads the javadocs for an annotation's field

wet breach
sullen marlin
#

Should have them within your ide

sly topaz
#

it takes time to get the habit

wraith delta
#

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.

sly topaz
#

ignoreCancelled false is the default

wet breach
#

it depends on order

sly topaz
#

so, you wouldn't have to set that explicitly

wraith delta
sly topaz
#

I honestly doubt that's the case

wraith delta
sly topaz
#

I mean, that doesn't really prove anything to me

wraith delta
#

then try it?

sly topaz
#

give me a MRE, I'll test it

sullen marlin
#

Meal, ready to eat. Yum

sly topaz
#
@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

eternal oxide
#

You would confuse many non native English speakers

sly topaz
#

I'm a non-native speaker lol

eternal oxide
#

Many != all

sly topaz
#

goes to prove it I guess

eternal oxide
#

I'm native English and I had to read it twice to understand your meaning ๐Ÿ™‚

quaint mantle
#

Is like if you write something in our native language, I mean you are right

sly topaz
#

I assume that's because of the string concatenation rather than the sentence being confusing

quaint mantle
#

I prefer when people correct me to improve my skills

wraith delta
sly topaz
#

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

eternal oxide
#

No it was simply the use of explicitly and implicitly. Very under used words.

blazing ocean
sly topaz
#

is that so? I guess it is more common in my language

#

TIL

sly topaz
#

what do you mean "even if claimed", was this in a wg region?

quaint mantle
wraith delta
# sly topaz uhh what

๐Ÿ˜ญ 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

sly topaz
#

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

wraith delta
#

without setting the priority it fails

sly topaz
#

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

wraith delta
#

this was never a issue with normal blocks, only spawners - anyways, that convo was solved a long time ago

sly topaz
#

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

blazing ocean
blazing ocean
sly topaz
#

has anyone tried rebasing spigot patches on top of mache I wonder

remote swallow
#

i mean spigot doesnt really have much nms interaction

#

but its probably off bc spigots fern flower fork

sly topaz
#

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

eternal night
#

for very unrelated reasons run

sly topaz
eternal night
#

Well, one day COPIUM ๐Ÿด

sly topaz
blazing ocean
remote swallow
sly topaz
#

it probably wouldn't be too hard to do it myself, just rather tedious

eternal night
blazing ocean
eternal night
blazing ocean
#

and a softSpoon option

eternal night
#

like, you end up with rejected hunks in basically every file

#

given vineflower tends to be a lot smarter than spigot's fernflower fork

remote swallow
eternal night
#

lemme grab my crystal ball

remote swallow
remote swallow
eternal night
#

Well when will chocos component PR be merged run

remote swallow
#

uhhhhhhhhhhhhhhhhhhhhh

eternal night
#

there ya go xD

#

uhhhhhhhhhhhhhhhhhhhhhhh

#

das my time estimate too

remote swallow
#

dam

#

have you done ur advent of code

eternal night
#

I have

#

nearly

remote swallow
#

what language

blazing ocean
#

not done yet!?

eternal night
#

the test case pass, rn I am struggling with reading the file

blazing ocean
#

it's so easy too

#

smh

eternal night
#

x86 assembly

sly topaz
#

I am not done yet either, just because I got bored

remote swallow
sly topaz
eternal night
#

I like the pain

#

tbf, with a couple of calls and rets, life is okay

sly topaz
#

I'd like to try that too, just to refresh my assembly knowledge

eternal night
#

string maniplation tho

remote swallow
#

lynx you wanna leak ur input

eternal night
#

das another story

#

I do not no

blazing ocean
eternal night
#

Yea KEKW

#

that is my current struggle

#

I mean, I know how I should do it just, I cannot be bothered so rn I am relaxing KEKW

blazing ocean
#

just write binary

#

smh

eternal night
blazing ocean
#

just build your own chip

#

get yourself a couple hundred transistors

eternal night
#

build some logic device that just solves that 5Head

#

tbf I presume I'll get bored of this by day 5, but w/e, still a nice thing to fresh up on

blazing ocean
#

just write the wasm

glacial narwhal
#

Hello ! i was looking to see how i could remove all chatcolors from a string (an item display name)

glacial narwhal
#

thanks

ocean tide
#

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.

eternal night
#

no

#

that feature was only added to the client in .3

ocean tide
#

oh oke thank for info

quaint mantle
#

any guide for minigame plugins?

quaint mantle
#

research on youtube I guess

wise chasm
#

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?

pastel axle
#

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?

sly topaz
#

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

pastel axle
#

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

sly topaz
#

then why not just spawn the entity and make it not visible by default?

eternal oxide
#

hideEntity on spawn to all but the fist player

sly topaz
#
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);
pastel axle
#

Yeah, that's probably the cleanest way. Let the game internals handle spawning/despawning. I'll have to experiment.

sly topaz
pastel axle
#

oh that's a good alternative, yeah

sly topaz
#

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

pastel axle
#

definitely sticking with Spigot, myself ๐Ÿ˜›

sly topaz
#

@alpine urchin where does packetevents gets the packet type names from smh

pastel axle
#

I'll have to double check if dying/respawning on the same chunk performs a full chunk unload/load

sly topaz
#

it should, yeah

pastel axle
eternal oxide
#

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

pastel axle
#

Luckily my setup only requires the one world, but yes definitely something I check for

sly topaz
#

would the world matter? Hm

pastel axle
#

for entity id it does, yeah

sly topaz
#

In my head one would save the entity's uuid along with their location for tracking so eh

pastel axle
#

yeah, but the packet uses entity id rather than uuid

#

which is silly to me but ยฏ_(ใƒ„)_/ยฏ

eternal oxide
#

for safety I'd get players from the world

#

then you know they are in teh same world

sly topaz
#

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

eternal oxide
#

I'd just world.getPlayers().forEach etc

#

fire and forget

sly topaz
#

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

eternal oxide
#

I think we are talkign at cross purposes. I was still talkign about the hidden entity

sly topaz
#

ah, makes sense

young knoll
#

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

pastel axle
#

yeah that's one thing i always liked about minecraft, it tries to be as efficient as it can in terms of networking

wet breach
fiery crystal
#

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

fading drift
#

is there a way to make a player not collide with blocks at a specific position

pseudo iron
#

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

chrome beacon
chrome beacon
summer scroll
#

Is there mojang mappings for 1.16.5?

chrome beacon
#

Yes but not for Spigot

fading drift
chrome beacon
#

No

#

You can use Falling Blocks

fading drift
#

good idea

#

ty

fading drift
#

is there a way to only show an entity for one player

worldly ice
#

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

worldly ice
#

permanently?

fading drift
#

ty

#

surely someone archived it

nova notch
#
Minecraft Wiki

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...

proud badge
#

Theyre planning on moving wiki.vg content to the minecraft wiki though

worldly ice
#

ah

#

oh this was pretty recent too

lilac dagger
#

i didn't know illusion published his engine

#

i could publish mine too but i'm not sure yet

glossy laurel
#

How to get all enchantements and their levels that a tool supports in survival

lilac dagger
#

i was gonna say check Enchantment but it seems it doesn't have it

inner mulch
#

is there a way to insert variables into a string like in rust? example "Hello {}!" , name

lilac dagger
#

nvm

#

this is the one @glossy laurel

#

Enchantment#getMaxLevel

smoky anchor
inner mulch
#

:(

quaint mantle
slender elbow
#

that preview feature got withdrawn

#

they are going to rework it

young knoll
#

$โ€Dank memes {var1}โ€

#

Oh wait thatโ€™s Microsoft java

quaint mantle
#

Then kotlin ๐Ÿ˜‚

remote swallow
#

poor choc

blazing ocean
young knoll
#

Shut

#

iOS likes to be fancy

blazing ocean
#

ios!?!?

tawny remnant
#

Is there a way I could open the Enchantment.KNOCKBACK function in intellij? Im using maven, dont know if that matters

blazing ocean
#

that is not a function

smoky anchor
#

What are you trying to do ?

tawny remnant
#

I wanted to see how it worked

blazing ocean
#

that is not a function however

tawny remnant
#

what is it then

smoky anchor
#
  1. You'd have to open NMS
  2. Enchantments are now declared with JSON
blazing ocean
#

they are handled via the enchantment registry

tawny remnant
#

gyat dang it

smoky anchor
#

You'd have to open enchantment effect type "knockback" probably
to see exactly what happenes

blazing ocean
#

inb4 1.8

smoky anchor
#

pls no

#

I can't do this anymore

young knoll
#

1.8 isnโ€™t very sigma

lilac dagger
#

1.8.8 is so old ๐Ÿ˜ฆ

#

?howoldis1.8

smoky anchor
#

?1.8

undone axleBOT
blazing ocean
#

?howold 1.8

undone axleBOT
smoky anchor
#

Wait, why are there TWO websites for shit

lilac dagger
#

10 years

young knoll
#

The top one only has a few versions

#

howold has all of them

#

?howold b1.7

undone axleBOT
lilac dagger
#

paying an entire domain and web server just for 1.8, that's brave

blazing ocean
#

that someone is phoenix616

#

who also has it for 1.7.10 and 1.12.2 iirc

lilac dagger
#

i see

orchid trout
wooden frost
#

Is it possible to change the head's POSITION in armor stands (coordinates)? maybe make it lower

smoky anchor
#

Dunno what you're doing, but may I interest you in trying out Display Entities ?

blazing ocean
#

inb4 1.8 kekw

smoky anchor
#

Please rad, staph this
I can't take this

blazing ocean
umbral ridge
wooden frost
smoky anchor
spiral light
#

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

river oracle
#

Might be some weird version desync caused by the flag

spiral light
#

without it works ... but i always used it :0

river oracle
#

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

spiral light
#

hmm okay i will remove it for the future but still weird

river oracle
#

It's possible in the past your environment has been perfect as to not cause conflicts

sly topaz
river oracle
rough drift
#

hotswappping plugins?

#

NAH

#

we hotswap the server

sly topaz
#

I have yet to try that myself

sterile flicker
#

Why PacketPlayOutEntityEquipment isnt fired for players?

peak depot
sly topaz
sterile flicker
# sly topaz 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?

warm mica
sly topaz
#

ah, beat me to it

sterile flicker
sly topaz
#

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

sterile flicker
thorn crypt
#

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

sly topaz
#

just display a different armor than the one the player is wearing?

sterile flicker
sly topaz
#

what does that have to do with these packets then lol

#

just give the player some boots with a jump strength attribute

sly topaz
#

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

thorn crypt
sly topaz
thorn crypt
thorn crypt
# sly topaz if I had to assume, it was probably related to the priority, since if your event...

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 ๐Ÿค”

sly topaz
#

I couldn't say for sure, it could be any event that fires before break event

thorn crypt
sly topaz
#

well, what factions plugin do you use?

thorn crypt
#

MassiveCraft ๐Ÿซ 

chrome beacon
#

Are you on Spigot

thorn crypt
#

Yes

chrome beacon
#

What version?

#

run /version

thorn crypt
#

1.12, I can't go above

sly topaz
#

well that makes it a bit more complicated, but let me check how massivecraft handles block breaking first

thorn crypt
sly topaz
thorn crypt
#

yessir

sly topaz
#

so the BlockBreakEvent wouldn't have the chance to be called unless you were trying to break it in creative I guess

thorn crypt
sly topaz
#

kinda sucks that they cancel block damage tbh

#

or you could just uncancel their event

thorn crypt
thorn crypt
sly topaz
#

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

thorn crypt
#

Could cause problems

#

The Block damage is indeed detected okay

sly topaz
#

eh, still worth a try but if the block damage event is enough for you then you can just use that

thorn crypt
#

I'll try ! Thank you, i'll let you know

sly topaz
#

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

thorn crypt
#

It seems to be working with the block damage ! :D

glossy laurel
#
            try {
                Database.database.connection.prepareStatement("SELECT 1").executeQuery();
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
        }, 0L, 60L * 20L);``` why does my sql connection die
remote swallow
#

i love public fields

chrome beacon
#

Connections shouldn't be kept alive for ever like that

glossy laurel
#

too

chrome beacon
#

Use a connection pool or create the connection when you want to make a request

glossy laurel
#

connection pool tutorial?

remote swallow
#

hikari cp

chrome beacon
#

^^ you can use HikariCP

glossy laurel
#

is it a new connector?

wet breach
chrome beacon
#

Yeah

glossy laurel
#

bruh.

glossy laurel
remote swallow
chrome beacon
#

Which is exactly why shouldn't try to keep them open like they're trying to

wet breach
#

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

glossy laurel
#

imagine dying

#

smh

quaint mantle
#

HikariCP with sqlite ๐Ÿ—ฟ

wet breach
wet breach
glossy laurel
#

I imagine this is also the reason why my plugin periodically died every day or so

quaint mantle
blazing ocean
#

proof?

worldly ingot
left jay
remote swallow
sly topaz
sly topaz
#

it isn't necessary for developing plugins

blazing ocean
#

should i use exposed with hikaricp or on its own

sly topaz
#

on its own should be fine

quaint mantle
#

is there some sort of docs on how to use bukkit configurations?

blazing ocean
#

javier why do you know so much about kotlin stuff yet don't like it

sly topaz
#

well, I can't just dislike something I know nothing about

quaint mantle
sly topaz
#

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

blazing ocean
#

why do you hate its ecosystem

undone axleBOT
sly topaz
blazing ocean
#

abusing kotlin features is fun

glossy laurel
#

how hard is it to make pvp bots?

blazing ocean
#

i really wanna get KMP working for stuff like gradle/maven and MC

sly topaz
#

what is even a pvp bot

sly topaz
blazing ocean
#

show

sly topaz
#

eh, would have to decompress my archives

blazing ocean
#

you can send me the archive

sly topaz
#

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

blazing ocean
#

could you still show me

sly topaz
blazing ocean
sly topaz
#

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

drowsy helm
slender elbow
rough drift
#

minecraft.wiki has it now

rough drift
#

it's a mirror

#

yep

drowsy helm
rough drift
#

yep

slender elbow
#

yeah

rough drift
#

discontinued

drowsy helm
#

oh dang

slender elbow
#

dead dead

young knoll
#

I thought they were keeping it up as an archive

pliant topaz
#

the official mc wiki now has it

#

like, a new page were they keep it

nova notch
#

"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

young knoll
#

Ah