#help-development

1 messages · Page 988 of 1

worldly ingot
#

No of course not

#

But it's useful for passing to a hover event lol

eternal night
worldly ingot
#

It's not meant to be used as a persistent serializable value

dawn flower
#

wait u cant have display entities riding on display entities

eternal night
#

Javadocs pr

young knoll
#

You can

eternal night
#

For free

dawn flower
carmine mica
#

ItemMeta#getAsString does decidedly NOT return a re-parseable snbt value

young knoll
carmine mica
#

it just returns stringified nbt

dawn flower
#

/summon block_display ~ ~ ~ {Passengers:[{id:"minecraft:block_display",block_state:{Name:"minecraft:clay"}}],block_state:{Name:"minecraft:dirt"}} only shows the clay

#

oh wait

#

theyre inside of each other

worldly ingot
#

The only thing it excludes is amount and type, so you'd have to insert those into the resultant string

river oracle
#

Kek

worldly ingot
#

Shit I can't type today

carmine mica
worldly ingot
#

Why not?

#

It gives you the same format as is expected in the /give command

carmine mica
#

because it just toStrings() the Tag

#

no no it doesn't

worldly ingot
#

Then it's broken because that's what it should be doing

carmine mica
#

its using the regular StringTagVisitor

#

you need to use the SnbtPrinterTagVisitor

worldly ingot
#

It's not NBT anymore though?

carmine mica
#

well the implementation is converting it to nbt

#

everything is nbt

#

nbt is what is used to store items in game files

eternal night
#

Didn't that change

carmine mica
#

everything can be converted to nbt is what I'm saying

eternal night
#

I could have sworn I saw an md5 commit

#

Regarding the getAsStrint

carmine mica
eternal night
#

Lul

young knoll
#

Is there a wait, it’s all NBT meme

carmine mica
#

it changed from toString'ing the data component patch, to toString'ing the Tag

eternal night
#

I see

worldly ingot
#

Yeah that should be returning it as a component-compliant string, not as NBT anymore. The idea was so that it could work in tandem with ItemFactory#createItemStack()

#

or whatever I called that method

carmine mica
#

well its not doing that either, its turning the full itemmeta, components and all, into nbt

worldly ingot
#

I'll make a PR. md might want it to be a different method though PES_SusThink which I kind of disagree with. I specifically didn't call it getAsSNBT() for a reason

eternal night
#

Another free pr??

carmine mica
#

the docs do say "an NBT string", so kinda expected

worldly ingot
#

It does, yes, because that's what it was

#

I didn't know components were coming when I wrote the PR lol

carmine mica
#

well sure

fringe yew
#

how would i get the mc version of a server (just mc version, not spigot)

eternal night
#

Probably smartest to keep it compatible with the item factory stuff

worldly ingot
#

I'll throw it down in a TODO and do it today

eternal night
#

Given that is the only place it can be used anyway

#

Or should be able to be used

carmine mica
#

yeah, but it's not. I know I don't care that people wrongly use it as a serialized value

eternal night
#

Well yes that's their issue lul

worldly ingot
#

:p If they wanna use that to serialize it to a file or something, sounds like a them problem

#

I wrote rather clearly that it's not meant to be used that way, so, not my problem

#

The idea was so it could be put into config files or something

young knoll
#

That’s a file

worldly ingot
#

Yes I understand that KEKW

#

But it's a configurable file, for user input

young knoll
#

Does it not go through DFU

worldly ingot
#

The ItemFactory method does, yes, but I mean y'know... your mileage may vary

young knoll
#

I see

worldly ingot
#

At least I think it goes through the DFU

#

If the /give command argument does, then yes, it does

#

I kinda just hijacked the ItemStack command argument

dawn flower
#

what part of the Transformation constructor is the "position"

worldly ingot
#

Translation

dawn flower
#

what do i put the rest?

worldly ingot
#

You can keep them as unit matrices/vectors if you'd like. new AxisAngle4f() will give you a unit one

eternal night
#

The give command argument certainly does not

worldly ingot
eternal night
#

Idk how either would, they don't include a version

#

I think the weird yaml representation does maybe

#

But it's a tad scuffed

carmine mica
#

item item argument doesn't either

young knoll
#

Keep the 2 quaternions as their identity form (just new Quaternionf) and set the other vector to all 1

carmine mica
#

oh lynx beat me to it

young knoll
#

This is why we NMS :(

dawn flower
#

for a block display i want the scale to be 1, 1, 1 right?

worldly ingot
#

Probably. That will keep it at standard scale

#

new Vector3f(1) should do the trick there

young knoll
#

I wonder if it’ll ever be possible to do NMS between versions without updating

#

Probably not

river oracle
young knoll
#

Kek

#

How do you load plugins

river oracle
young knoll
#

Even then

#

Mojang methods change

river oracle
#

Not always

young knoll
#

The more NMS you have the higher the chance something will change

river oracle
#

There obfuscated names change

young knoll
#

So do the mapped names sometimes

#

Or the arguments

river oracle
#

I mean I do quite a bit of nms and my dif is pretty small

young knoll
#

But sadly not 0

#

And thus modules go brrr

#

Meanwhile I somehow managed to have direct code modification for stardew valley last for a few versions

#

Magic

river oracle
#

How do you mod in stardew

#

Do they have a mod launcher?

dawn flower
#

do i just calculate the difference between the center block (the block containing all passengers) and the currently iterated block and set the transformation translation to the difference x, y, z

young knoll
dawn flower
#

it seems to be working

#

can i set the block biome?

spark kite
#

hello, i seem to have an issue with the current build 1.20.6 with build tools. my problem is when I build it and use maven and change the pom to 1.20.6 everything gets imported besides Material? I'm not for sure if I have the correct build.

dawn flower
#

can u make it so u dont go through display blocks

#

like shulker entity

young knoll
#

Yes

#

But it’ll only match a full block

dawn flower
#

wdym?

young knoll
#

Shulkers have a full block sized hitbox

#

So you can't easily do a stair block for example

dawn flower
#

its always a full block so idrc

young knoll
#

then yeah you just add a shulker inside it

#

Note that a shulker hitbox cannot rotate

dawn flower
#

oh wait thats gonna be problematic

#

any other way?

young knoll
#

nope

#

Minecraft collision is always axis alligned

dawn flower
#

aw

young knoll
#

You can of course do collision server side

#

But the client will be quite glitchy in that case

vital sandal
#

for some reason my npc have a really weird body rotation

#

and yes

#

they have the same value for pitch and yaw

dawn flower
#

oh wait how do u teleport the main display and it's a vehicles?

zenith gate
#

What is the animation id for Hurt? Everywhere I've been googling it says 2 or the wiki 0x22 Neither of them apply the correct animation.

zenith gate
#

only works for the person who you send it to

#

i need it for other players to see as well

pseudo hazel
#

then hit them with 0 damage

zenith gate
pseudo hazel
#

why

zenith gate
#

🤷

pseudo hazel
#

recursion probably

#

where are you doing this

zenith gate
#

i did test with fire damage.

#

lava damage i should say

#

but i have a delay with that to only fire every other sec

zenith gate
pseudo hazel
#

right..

#

so thats the stackoverflow

#

each time you get damaged, you try to damage yourself

#

which calls the event again

zenith gate
#

i cancel the event tho

pseudo hazel
#

whats the goal with this feature

#

well too late

#

the event already reached you

#

then you create another event by damaging yourself

zenith gate
#

So then yeah i would need th packet animation anyways. to avoid the double calling.

eternal oxide
#

no

#

just set a boolean

zenith gate
#

i dont understand

eternal oxide
#

in the event java if (damaged) { damaged = false; return; } damaged = true; //now damage the player

pseudo hazel
#

why do you want to damage the player when they are already getting damaged

zenith gate
#

i want to go above the default health value

pseudo hazel
#

cant you modify the event so its fixed automatically?

valid burrow
eternal oxide
#

there is also already max health and scale

zenith gate
pseudo hazel
#

what drvoss is saying

zenith gate
eternal oxide
#

event.setFinalDamage(value)

pseudo hazel
#

change parameters on the damage event

zenith gate
#

i need to go above 2048 yhealth

#

thats the cap

#

i want 20k. So i have a value in a map for the real health and do all calcuations on that. if that reaches zzero then i kil the player

pseudo hazel
#

then reduce the damage to 0 and do your own thing

eternal oxide
#

why do you feel you need to go to 20k? seems a ridiculous value

pseudo hazel
#

no need to cancel the damage if you want the hit effect anyways

ivory sleet
valid burrow
ivory sleet
#

and then u just "emulate" high damage

zenith gate
ivory sleet
valid burrow
#

well for the milioth time just do event.setDamagr

zenith gate
ivory sleet
#

but I mean, ur system can have high numbers, then u normalize those before visualizing it

eternal oxide
#

so make 1 heart = 2k health

valid burrow
#

just devide every damage by 10

#

congrats

#

u turned 2k into 20k

#

maths is amazing

pseudo hazel
#

cant you set the position?

polar forge
#

Guys how do u check for a logout from a player?

eternal oxide
#

OfflinePlayer#lastseen

#

getLastSeen() I think

polar forge
#

Thx

eternal oxide
#

oh you edited it, detect a logout?

polar forge
#

I did my first seen plugin, I am now making a last seen plugin

eternal oxide
#

do you want to see when they log out or as you first ask, when they last logged out?

#

ok

valid burrow
polar forge
#

If a player logs out, store the date in my config

eternal oxide
#

no point

#

its already on the OfflinePlayer

#

last played not last seen

valid burrow
#

meh at certain scale it still makes sense to store it yourself

#

its cross-server

#

possible api compatible

#

etc etc

eternal oxide
#

for us, we might have a use case. He won't

valid burrow
#

also true

polar forge
#

No but I mean, i need to store the date of the logout if the player leaves the server in my file

#

So I need to check for that

dawn flower
polar forge
#

If player leaves the server, store the date of the log out

eternal oxide
polar forge
eternal oxide
#

its already stored in OfflinePlayer. It's a date

polar forge
#

Huh

eternal oxide
#

did you even look at the javadoc I linked?

pseudo hazel
dawn flower
#

u cant

pseudo hazel
#

assuming we are talking about blockdisplay right?

#

why not

dawn flower
#

if it has passengers u cant

polar forge
#

It’s not a Boolean

#

So I can’t check for that

dawn flower
#

it yoinks the passengers or doesnt teleport at all, i cant remember

eternal oxide
polar forge
pseudo hazel
#

idk then

eternal oxide
pseudo hazel
#

youd have to ask the guy who made a whole ass plane

eternal oxide
#

of course it can be checked. its exactly what you are askign for

polar forge
dawn flower
#

who was that?

polar forge
#

If I use that

dawn flower
#

coll?

eternal oxide
#

its a date

#

DATE

#

a measurement of time

#

when they last played... a date

polar forge
eternal oxide
#

no you don't

#

how many times do I need to say it

#

YOU do not need to store it, it is ALREADY stored in OfflinePlayer

polar forge
eternal oxide
#

ok you do you

dawn flower
polar forge
# dawn flower why?

Bc then if a player does /lastseen player it can retrieve the info from that file

eternal oxide
#

I give up

polar forge
#

And not from your OfflinePlayer

dawn flower
#

just get that info from OfflinePlayer

#

Player extends OfflinePlayer so just cast it

#

wait i think it's the opposite

polar forge
#

But what if I want it stored in my file? Isn’t it possible?

eternal oxide
#

if player types /lastseen <name> you do Bukkit.getOfflinePlayer(blah).getLastPlayed()

#

oh look you have the last time they were seen

dawn flower
#

you can also do new OfflinePlayer("playerName").getLastPlayed();

chrome beacon
dawn flower
#

can u make a sound play for longer?

#

and why does ender dragon growl at 0.2 pitch sound like a goddamn monster

trail coral
polar forge
eternal oxide
#

Tell me a good reason why you need it stored in your file and I'll write the code for you

polar forge
dawn flower
#

void playSound(@NotNull Location var1, @NotNull Sound var2, @NotNull SoundCategory var3, float var4, float var5, long var6) what's var6

eternal oxide
#

not a good reason, you can just type /lastseen <name> in console

dawn flower
#

thats the seed

#

wtf is a sound seed

polar forge
trail coral
#

just store it in a database

#

and yes it is possible to store it in a config file

polar forge
#

Nah

eternal oxide
#

Just do what we all told you, read it from OfflinePlayer

trail coral
#

but it is useless and uses more resources than needed

young knoll
#

The seed is used to determine what variation of the sound is played

#

If you don't care about that, just use the version without that argument

dawn flower
#

so i can change the sound basically?

kind hatch
#

What sounds have variations?

young knoll
#

A lot

kind hatch
#

I thought most of them were pitch shifted?

trail coral
dawn flower
#

oh wait

young knoll
#

nope. some have variation

#

I think the villager yes one does

trail coral
#

there like 6 variations of some cave sound

dawn flower
#

i tohught u were forced to have a random variation lmao

kind hatch
trail coral
kind hatch
#

That's actually a nice addition.

young knoll
#

Yeah

#

If you run /playsound minecraft:entity.villager.yes master @s ~ ~ ~ you will notice several different sounds

#

That are all considered minecraft:entity.villager.yes

dawn flower
#

anyways how do i make a sound last longer

kind hatch
#

That you can't do.

trail coral
#

you just replay it i think? but thats different

kind hatch
#

You can make it last longer by making the pitch really low, but it will also change the sound.

young knoll
#

Yeah the game has no method to modify the playback speed

#

afaik

dawn flower
#

rip

trail coral
#

why do you need it

eternal oxide
#
OfflinePlayer target = Bukkit.getOfflinePlayer(...
LocalDate date = LocalDate.ofEpocMilli(target.getLastPlayed());```
#

litterally all you need for a seen plugin

trail coral
#

hey elgar how do you schedule something for a set time?

#

like i want to schedule a live event for sunday 6pm est for example

#

hwo do i do that

eternal oxide
#

ScheduledExecutorService

trail coral
#

whats that

dawn flower
#

btw coll how did u move the "center" display block and u cant move entities with passengers

trail coral
#

you cant?

chrome beacon
#

You can

#

Just not with the Spigot API iirc

#

Paper and NMS should have methods for that

polar forge
dawn flower
#

oh wait im prob not gonna get paper support here

young knoll
#

I did it via NMS iirc

dawn flower
#

tfdym iirc

#

when did u make it...

young knoll
#

Idk a while ago

trail coral
#

nms sucks to use right?

river oracle
#

I think it's nicer than api in some places

#

Really depends

chrome beacon
#

^^

dawn flower
#

what happens if u do Entity#setPose on entities thata rent armorstands

chrome beacon
#

The most annoying thing is supporting multiple versions

river oracle
#

Agreed

chrome beacon
#

Though that's also gotten better

trail coral
young knoll
#

Modules

trail coral
#

i have to rewrite code for every version right?

young knoll
#

You have code for each version and the plugin uses a bit of magic to load the correct core

eternal oxide
#

alex has a tutorial on modules

trail coral
#

whos alex

young knoll
#

?nms

trail coral
#

packets are confusing for me aswell

chrome beacon
#

What about them?

dawn flower
#

is the paper method in Entity.class?

young knoll
#

I think it's just an overload of .teleport

#

But for more info go to their discord

chrome beacon
#

^^

trail coral
worthy yarrow
#

I saw your link btw

chrome beacon
#

There are multiple ways

#

Just a massive switch can work

worthy yarrow
#

I was uh

#

Thinking about that

chrome beacon
#

You can also use reflection if you prefer that

worthy yarrow
#

No thank you 😄

#

Switch sounds the least complicated

spark kite
#

how do i get spigot 1.20.6 build for development

#

cause apparently its not working for me

young knoll
#

do you use maven or gradle

polar forge
#

Hi, so I tested my plugin (firstseen) but I get something strange

#

In the config file, the date has been stored

#

But when I do /firstseen player, I get Player Was First Seen On null

#

Why does it say null, if in the config file, there is the date?

eternal oxide
#

You missed a period

polar forge
#

BRUH

#

thx

#

Btw Elgarl

#

Your code doesn’t work, it sends an error null in the console

eternal oxide
#

nah, your code shows null, mine is fine 🙂

polar forge
#

??

#

That just doesn’t make sense

eternal oxide
#

it does. It means you did something wrong.

polar forge
#

I just used day instead of millis

eternal oxide
#

The code I showed would never produce a null error

polar forge
#

I used EpochDay

eternal oxide
#

that would not work

#

you are passing a millis since Epoc not days

polar forge
#

So the solution is to make it millis?

#

But I want a date like 03-05-2023

#

With months

#

And year

grim hound
#

and use SimpleDateFormatter

eternal oxide
#

Date is old, you just need to format it

polar forge
#

ofEpochMillis doesn’t exist

polar forge
grim hound
polar forge
eternal oxide
shadow night
#

getLastSeen()?

polar forge
#

But some ppl told me to better not to store it in the config and instead, better to use OfflinePlayer

eternal oxide
#

look at 3

grim hound
#

you can create your own files to store data

grim hound
lean arrow
#

Is there a structure equivalent to what a RegionAccessor does for biomes? I'm trying to detect the nearest structures to a location but iterating through a list and using World#locateNearestStructure isn't very efficient :p

(im so dumb i put this in general 😭)

grim hound
young knoll
#

World#locateNearestStructure is exactly how Mojang does it for /locate

lean arrow
# grim hound `World#locateNearestStructure isn't very efficient :p` do it async
Caused by: java.lang.IllegalStateException: StructuresLocateEvent may only be triggered synchronously.
    at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:42) ~[paper-1.20.2.jar:git-Paper-318]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.2.jar:git-Paper-318]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.event.Event.callEvent(Event.java:45) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
    at net.minecraft.world.level.chunk.ChunkGenerator.findNearestMapStructure(ChunkGenerator.java:130) ~[paper-1.20.2.jar:git-Paper-318]
    at org.bukkit.craftbukkit.v1_20_R2.CraftWorld.locateNearestStructure(CraftWorld.java:2257) ~[paper-1.20.2.jar:git-Paper-318]
    at org.bukkit.craftbukkit.v1_20_R2.CraftWorld.locateNearestStructure(CraftWorld.java:2246) ~[paper-1.20.2.jar:git-Paper-318]

don't think that'll work unfortunately because paper greg

#

why do you do this vencord i actively have nitro

rigid spire
grim hound
#

packets aren't scary

#

I think that they just never finished that part of the api

rigid spire
#

I don't think my question was "are packets scary" 😁

grim hound
rigid spire
#

So the answer to my question would be "there is no API that would trigger this animation" I take it?

abstract wyvern
#

could some1 help me at my server dm me and ill give more info

eternal oxide
#

?services

undone axleBOT
trail coral
#

is there an easier way of making a plugin multiversioned?

#

i dont like having to write my code 5 items over

#

and i also dont understand how modules work lmao

eternal oxide
#

no

trail coral
eternal oxide
#

you can abstract some of it but not much

trail coral
#

also what if i want to convert a 1.16.5 plugin that uses PDC to 1.12? theres no pdc in 1.12 so i would have to rewrite the whole plugin logic?

eternal oxide
#

like getting to the nms classes bypassing CB

#

yes

trail coral
#

dude wtf

eternal oxide
#

you can't simply back port features

trail coral
#

that changes the whole plugin it wouldnt be the same at all

potent ocean
trail coral
#

that sucks

#

my client asked for a multi version plugin and i am NOT doing that shit

sullen canyon
potent ocean
#

use github copilot to generate code for you

sullen canyon
#

dw

potent ocean
#

very simple

#

transfer code from 1.8 to 1.16.5 please

#

boom it does it for you

#

sometimes its dumb but you've gotta insult it

#

if its wrong and it'll get it right eventually

trail coral
#

gotcha

#

so like a slave

potent ocean
#

i dont get why people r so against using it

#

super useful for writing code i do not wanna write

#

not like the software engineering field is gonna be alive in the next 5 years

trail coral
#

ive never used it honestly

potent ocean
#

basically github copilot

#

is being the pilot

eternal oxide
#

um, who are you HyperSkys? Just signed up to Spigot yesterday and yoru profile on your .dev site created 5 minutes ago?

potent ocean
#

unless ur working on AI, or something similar

trail coral
#

but someone has to program the AI tho

potent ocean
trail coral
#

theres no way software programming is going anywhere

potent ocean
trail coral
#

you just gotta learn with the ai

#

and youre good

potent ocean
#

that'll be the only job

trail coral
#

you cant stay in the same place

potent ocean
#

making plugins or websites

#

full stack dev will not be a job in the next 5 years

#

it'll be rlly changed

eternal oxide
trail coral
#

not really

potent ocean
#

format wouldn't allow me to port

stone bramble
potent ocean
#

my old posts

stone bramble
#

lo l

trail coral
#

also is github copilot priced?

potent ocean
potent ocean
#

its simple math function

trail coral
#

does it count if im a highschool student?

#

💀

potent ocean
trail coral
#

ohshit

potent ocean
worthy yarrow
#

Does it count if you're in a bootcamp

potent ocean
#

r u not in high school?

#

or middle school

worthy yarrow
#

Nah I dropped out mate

potent ocean
#

hell im pretty sure u can be in elementary

#

and get it

valid burrow
#

i wanna make guest book kind of thing on my website no clue how to get started though 🤔

worthy yarrow
#

Currently not in a school system so I don't think they'll budge for me

trail coral
#

whats that

potent ocean
#

what are you on abt

eternal oxide
#

am I reading it wrong?

potent ocean
eternal oxide
#

nope, I'm just asleep on todays date 🙂

trail coral
#

were in may elgar

potent ocean
#

plus my discord got limited lmao

trail coral
#

but yea hyperskys is obv an alt look at his other accs on social media

#

like twitter 0 posts 0 followers 0 following

potent ocean
#

lmao

#

check my youtube

#

or steam

#

or github?

stone bramble
#

any1 know how to help me w this i have no idea how to create or use a component

potent ocean
#

go to paper support discord

trail coral
potent ocean
#

i believe unless spigot converted to components to

eternal night
#

nope, that is indeed paper-api

stone bramble
#

whoops

#

i forgot

#

straight up forgot i was using paper

potent ocean
trail coral
#

damn same

#

i had an acc from 2017

eternal oxide
#

lol

trail coral
#

i got termed cause i joked about being 6

#

who the fuck believed i was 6

potent ocean
#

and i sent my id to discord and everything

trail coral
#

yeah same but i didnt have an id at that time

#

i got an ID 1 month later but it was too late

potent ocean
#

no response at all

valid burrow
potent ocean
#

do u want them to have to sign up for account

#

if so that might be a little more tricky

#

cuz if its just comments have a post request open for POST -> /comment/create and a GET -> /comment/getAll

#

and store it in an SQL or MongoDB db

#

and then have a ts, javascript, vaadin (java) frontend load it all

spark kite
eternal night
#

make sure to configure maven to use java 17

#

at least

#

preferably java 21

valid burrow
spark kite
#

i have java 21

#

in order to use buildtools for 1.20.6 you need java 21 or 22

potent ocean
#

not hard to do all in Java

eternal night
#

javelin is nice and small

potent ocean
#

3.4.1 is latest and it does exist

#

do maven install

#

see if that fixes it

lilac dagger
#

try symlink instead

potent ocean
#

isnt symlink linux?

eternal night
#

windows has some scuffed version of it

lilac dagger
#

no it's also on windows

spark kite
#

Yeah, i dont know... lol.

lilac dagger
#

mklink target/file.jar source/file.jar

#

you'll get a file that you can delete

eternal oxide
#

just have your server pull a new jar at startup

trail coral
#

whats the api-version option for in plugin.yml?

valid burrow
trail coral
river oracle
trail coral
#

whats spring for

river oracle
#

websites

dapper flower
#

I always used paper/spigot api to create my plugin, when are you supposed to use the bungeecord api?

eternal night
#

for writing bungeecord plugins

quaint mantle
short pilot
#

it displays once and then after leaving the territory it doesn't display anymore

#

and yes my code is in different classes, I just chose to show this snippet because I thought it would be the most relevant

#

hope that helps

valid burrow
#

why r u using uuids?

round finch
#

i might be dumb....

but how do i set / get a list on pdc

eternal night
#

PersistentDataType.LIST.strings() for a List<String>

round finch
#

i'm trying to save a list into a chunk

eternal night
#

okay?

young knoll
#

The set method is the same for any type

#

Yay generics

next dew
#

how do i increase the impulse tnt deals on other tnts ? i was looking into velocity but idk if that if very reliable

round finch
fringe yew
#

how do i detect when a player drinks a milk bucket

fossil veldt
#

Good evening, I would like to ask why my survival pack + plot has been recognized as someone else's work.

fringe yew
#

i assume playerbucketemptyevent is only for water/lava then right?

eternal oxide
#

yep

fringe yew
#

bruh

remote swallow
#

you cant empty a milk bucket

trail coral
#

how do i make client-side buildings with packets? like in mmo servers on maps there are usually these "spawner" blocks. on top of the blocks theres a tree that you can break for resources etc or other buildings. but the tree isnt actually there on the server, its using packets to generate it for seperate players

round finch
fossil veldt
# young knoll ?

Today, when I was uploading another update of the pack named "Survival+Plots", it got banned after an hour due to "Redistributing someone else's resources", even though I spent many hours to do it, the pack's description contained all the links to the authors of plugins used in this pack.

eternal oxide
#

You can't upload others plugins without permission

fossil veldt
#

The pack contained a ready-to-use configuration, along with Polish translations. The entire pack was created for a survival server.

eternal oxide
#

Doesn't matter how much work you put into it. You do not own the plugins so you can not upload them

dapper flower
#

how do i check if a block is in a certain minecraft group of blocks? like #minecraft:deepslate_ore_replacables or #minecraft:minable/pickaxe

eternal oxide
#

Tag if it exists

#

ie Tag.DEEPSLATE_ORE_REPLACEABLES.isTagged(...

slender elbow
#

the plugin of theseus

eternal oxide
#

If you admitted to starting with their code base and the plugin is not OS, then bad person

iron spade
#

?paste

undone axleBOT
iron spade
eternal oxide
#

armorstand is null CustomBalloons.java:65

iron spade
eternal oxide
#

armorStand is null

iron spade
#

I don't understand

eternal oxide
#

the Field you are referencing, called "armorStand" is null. It's not assigned to an Object

polar forge
#

Hey guys

iron spade
#

oh

polar forge
#

I got a small question, so I’m making a new plugin, an investigation plugin. If I would have done /investigate <player> that player, and me would be teleported to an investigation room. When I do that command, the target ( the other player, not the sender) can’t send any commands

#

So I understood I would need PlayerCommandPreprocessEvent

#

But I need to make it in an Event class

#

I made my event class but it tells me Class must either be declared abstract or blah blah blah

#

What’s the solution for this?

#

Here’s the code

eternal oxide
#

do not extend playerEvent

#

do not implement cancellable

polar forge
#

Is there a reason?

#

I still get the error btw

#

Not anymore

eternal oxide
#

yes you need to make it a Listener class

#

its an event, same as any other event

polar forge
#

Implements listener?

eternal oxide
#

try it and see

polar forge
#

?tas

undone axleBOT
polar forge
#

Another question

#

So I have the command on another class, and the PlayerCommandPreprocessEvent is in another class, how would it know that if I do that command, at that moment the player has not the ability to send commands?

#

Here’s the other class’ code

#

It would come under line 33

#

How do I implement the PlayerCommandPreprocessEvent there?

eternal oxide
#

you don't

polar forge
#

How does it know then?

eternal oxide
#

you have to flag the player (PDC) so when they are in the room you can see in teh preProcess event that they are blocked from all commands

polar forge
#

PDC? Wdym?

eternal oxide
#

remove the flag (PDC) when they are released

#

?pdc

golden tulip
#

How can I get the author & name from Music Disc? (This in the Toolbar)

ionic thicket
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

ionic thicket
#

Yo, so I'm trying to create a new Enchantment and I'm watching a video/tutorial that tells me do add this, can anyone explain me what's happening?

eternal night
#

Don't

#

enchantments are registry based now

#

it isn't going to work

ionic thicket
#

bruh

#

thank you

#

is there any way to do that?

#

I mean, I don't really need an enchantment, i just need the itemstack to glow without showing any enchantment name

eternal night
#

Well, what version of spigot are you coding on

#

in 1.20.5 that can be just done with API

ionic thicket
#

i'm in 1.20.5 is that a problem?

eternal night
#

no, that is perfect

ionic thicket
#

4*

#

sorry

ionic thicket
#

my bad

eternal night
#

well in .5 you could use the above method ^

ionic thicket
#

Well i plan to run my server on the latest version

eternal night
#

.4 you'd have to dive really fucking deep

#

or just add a vanilla enchantment and hide it via item flag

ionic thicket
#

is it that fucked up to change the version?

eternal night
#

not really

#

but .5 (well .6) is experimental

#

so you wouldn't want to run it in a production environment

ionic thicket
#

alright

ionic thicket
eternal night
#

👍

ionic thicket
#

damn pretty weird the fact that this stuff is that difficult

river oracle
#

😈

young knoll
#

We love item components

#

Even if they’ve put us in a bit of an integration hell for now

river oracle
grim ridge
#

Any plugins that are public that add uuids or serials to every item ? That can help with anti duping ?

eternal oxide
#

god no, that would be horrible

#

If its an actual dupe it will dupe the serial too

buoyant jasper
#

i have plugin where player click on item it opens GUI why it takes 5 seconds until the GUI opens

eternal oxide
#

really 5 seconds?

buoyant jasper
#

yes not 4

eternal oxide
#

really really bad code or you are accessing a database to read data, slowly.

buoyant jasper
#

i do acess database

#

what could be the problem

eternal oxide
#

a slow query

buoyant jasper
#

how do i fix it

eternal oxide
#

cache the data you need

wary axle
#

Hello, I'm creating a direction plugin that displays the direction in which the players on my team are facing and I'm displaying it in the actionBar.

I have a problem where I can't determine the direction (because if my player turns his head, the direction won't be the same).
I've started by finding the vector between the two player positions, but how do I adapt it to the Yaw?

eternal oxide
#

use eye location

#

thats the position of the head, including the direction th eplayer is looking

wary axle
#

I know how to retrieve the yaw but I just can't apply it to define the other player's direction.

eternal oxide
#

teh vector between two players will be the same no matter where they are looking

#

if a player is at 0,0 and another is at 1,1. The vector between them will always be 0.5,0.5 (normalized)

wary axle
#

Yes, but if I display it on the screen and look in the direction of the player, my arrow will be the one pointing up, but if I turn 90degree the arrow will be on the left.

eternal oxide
#

both players can turn around as much as they like but the vector will remain the same

#

so you want them all to be relative to you

wary axle
#

Yes that's it I'm sorry it's been a while since I've been on it so I'm having trouble explaining x)

eternal oxide
#

you are going to need to calculate teh dot product

sullen canyon
#

In case I want to see if the chunk is loaded at this moment and if I do this quite often with this approach might it be too much resource consuming?

#

I believe there is a faster/better way to do it

eternal oxide
#

Just get the Vector between the players, then getDirection of eyes and dot product them

#

be sure to normalize so you are using unit vectors

#

none

#

Spigot

blazing ocean
#

ACF ftw

sullen canyon
young knoll
#

Working without a command api isn’t that bad

blazing ocean
#

tab completion can be a bit painful

young knoll
#

Maybe if you were making a plugin with a ton of them it would be a bit annoying

blazing ocean
#

especially removing the ones that don't match with current input

young knoll
#

StringUtil.copyPartialMatches

#

Easy

sullen canyon
remote swallow
#

there is like 10

sullen canyon
#

I think majority still works with the original api

remote swallow
#

two main ones are acf and cloud

young knoll
#

^

#

I tend to just manage my own little library

wet breach
#

If my plugin has like 2 commands not going to add acf to manage those be quite the overkill

kindred valley
#

A

kindred valley
#

YOU WILL DECLARE IF IT WORKS

compact haven
#

Attempting to modify an entity's nametag by intercepting the serverbound entity metadata packet

#

I'm getting the following error: java.lang.ClassCastException: class [Lcom.comphenix.protocol.wrappers.WrappedChatComponent; cannot be cast to class net.minecraft.network.chat.IChatBaseComponent ([Lcom.comphenix.protocol.wrappers.WrappedChatComponent; is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @7ac8591e; net.minecraft.network.chat.IChatBaseComponent is in unnamed module of loader java.net.URLClassLoader @255316f2)

Applicable code:

        StructureModifier<List<WrappedDataValue>> watchableAccessor = packet.getDataValueCollectionModifier();

        List<WrappedDataValue> read = watchableAccessor.read(0);
        read.set(2, new WrappedDataValue(2,
                WrappedDataWatcher.Registry.getChatComponentSerializer(true),
                Optional.of(WrappedChatComponent.fromChatMessage(nameTag))));
        watchableAccessor.write(0, read);
slender elbow
#

use WrappedDataValue.fromWrappedValue instead of calling the constructor

compact haven
#

doesn't seem that static method exists

#

although I got past that error with the following

    @Override
    public void onPacketSending(PacketEvent event) {
        if (event.getPacketType() != PacketType.Play.Server.ENTITY_METADATA)
            return;

        PacketContainer packet = event.getPacket();
        Entity entity = packet.getEntityModifier(event).read(0);

        int levelViewer = plugin.getLevel(event.getPlayer());
        int levelEnemy = plugin.getLevel(entity);

        String nameTag = entity.getCustomName();
        for (IPluginConfig.ViewerEffect effect : plugin.config().nametagViewerEffects()) {
            if (effect.applies(levelViewer, levelEnemy)) {
                nameTag = effect.apply(nameTag);
                break;
            }
        }

        StructureModifier<List<WrappedDataValue>> watchableAccessor = packet.getDataValueCollectionModifier();

        List<WrappedDataValue> read = watchableAccessor.read(0);
        read.removeIf((it) -> it.getIndex() == 2);
        read.add(new WrappedDataValue(2,
                WrappedDataWatcher.Registry.getChatComponentSerializer(true),
                Optional.of(WrappedChatComponent.fromChatMessage(nameTag)[0].getHandle())));
        watchableAccessor.write(0, read);
    }
#

I guess my next problem is that entity is null 😭

slender elbow
#

the method certainly exists

#

what plib version are you on+?

compact haven
#

I've got 5.1.0 imported

maiden olive
#

How to remove all tab completions from a command

#

Like player names and stuff

compact haven
#

your own command or a different plugin's command?

maiden olive
#

Mine

compact haven
#

bukkit's command api?

maiden olive
#

Yes

slender elbow
compact haven
#

oh lmfao

#

let me get latest

#

although, do you know how to read an Entity from the packet?

#

so confused, wasn't there a getSuggestions or something in CommandExecutor or am I crazy

slender elbow
#

onTabComplete

young knoll
#

onTabComplete return an empty list

maiden olive
#

I think that's what I did and it didn't work

```java
@EventHandler(ignoreCancelled = true)
    public void onTabComplete(TabCompleteEvent event) {
        if (event.getSender() instanceof Player) {
            Player player = (Player) event.getSender();
            event.setCompletions(new ArrayList<>());
    }
}
slender elbow
#

it's not an event

#

that event is effectively useless

#

in your class that implements CommandExecutor, implement TabCompleter, and inside onTabComplete return an empty list

maiden olive
#

Ok thabks

buoyant jasper
#

the gui is still in delay i dont know how to fix it

remote swallow
#

cache the data

buoyant jasper
#

how to do it

quaint mantle
#

hi

#

Does anyone know how to solve this problem?

buoyant jasper
#

?paste

undone axleBOT
quaint mantle
quaint mantle
#
        at net.noscape.project.supremetags.guis.TagMenu.handleMenu(TagMenu.java:108) ~[?:?]
        at net.noscape.project.supremetags.handlers.menu.MenuListener.onClick(MenuListener.java:22) ~[?:?]
#

To begin with, when I click on an empty space I get that error

quaint mantle
remote swallow
#

?stacktrace

undone axleBOT
quaint mantle
#

I'm not as experienced in Java as we might say, but what should I change in the code so that this error no longer appears in my server's console?

remote swallow
#

paste the full error

quaint mantle
remote swallow
#

thats the class not the error

quaint mantle
#

but

remote swallow
#

that is the error

quaint mantle
#

in fact it is about

#

Could not pass event InventoryClickEvent

remote swallow
#

in a seperate paste put the entire error

quaint mantle
remote swallow
#

yes

#

i need the error to tell you what is the issue and how to fix it

quaint mantle
#

it's all the mistake

remote swallow
quaint mantle
#

look

remote swallow
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

quaint mantle
#

go

#

wait

remote swallow
#

the item has no display name

#

dont check items by name use pdc or in your case nbt tags

quaint mantle
#

So what should I change to correct that error?

remote swallow
#

dont check if its the item you want by name. use nbt tags

quaint mantle
#

NBTItem nbt = null; ?

remote swallow
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

quaint mantle
#

I know I don't know much Java that's why I said I should change the code, but thanks

#

💀

stone turret
#

I have this issue where I'm trying to hide all commands except for the ones that the player should have access to (from my custom plugin and a few selected plugins.

How can I do this?
Ver: 1.20.5

Ive tried:
TabCompleteEvent
Implementing TabCompleter and setting/returning an empty list

Those didnt work
I am using a custom commander btw

sullen marlin
#

just set a permission for the command in plugin.yml

stone turret
#

I'm using a custom commander. That has permissions on it already.

sullen marlin
#

if permissions are properly set they wont show

stone turret
#

The developer of the API said to wait 20 minutes (it's been 3 hours)

stone turret
#
public class HealCommand {

    @Command(name="heal", description = "Heal command")
    @Permission("dufjismp.heal")
    public void execute(@Sender Player sender, @Optional Player target) {
        if(target == null) {
            sender.setHealth(20);
            sender.setFoodLevel(20);
            PlayerUtils.sendMessage(sender, "You have been healed.");
        } else {
            target.setHealth(20);
            target.setFoodLevel(20);
            PlayerUtils.sendMessage(sender, target.getName() + " has been healed.");
        }
    }
}
sullen marlin
#

we can only help you with spigot API

#

if you are using different command API then we can't help

stone turret
#

That's understandable.

#

I appreciate you even responding lol

languid pawn
#

@sullen marlin yoo ive seen u on github

#

u help with bungeecord servers right?

#

please help me too

sullen marlin
#

in spigot api, you set plugin.yml

commands:
heal:
permission: dufjismp.heal

and it will all work like you want

languid pawn
#

I created a bungee cord server using Spigot and whenever I try to start it, it just keeps me in the encrypting screen and shows "ReadTimeoutException : null"

#

Does anyone know how to fix this?

stone turret
languid pawn
stone turret
languid pawn
#

ah man. I really need help setting it up

#

it just does not work

#

is md_5 good at this?

stone turret
#

I wouldn't know.

#

You probably set up bungeecord wrong.

languid pawn
#

thats why i came here

#

to figure out whatever i did wrong

#

eventho i configured everything right

sullen marlin
#

start by reading the channel names

languid pawn
stone turret
#

I think I'm just going to start writing my own commands from scratch rather than using Commander APIs.

stone turret
#

or a server question?

languid pawn
#

well i asked the question in general chat and they read my question and told to come in this channel

sullen marlin
#

"2:49 PM]simpleauthority: @languid pawn Go to ⁠help-server"

#

no they didn't

languid pawn
#

my bad i didnt read the channel name properly. But still, any of yall know something about this issue? To cover it up more in #help-server ?

trim quest
#

currently my fav learning resource.

quiet ice
#

It used to have the mooc.fi courses, I wonder what happened to them. Oh, whatever

vast raven
#

saving an inventory via JSON itemstack in a mongo isn't worth or is it?

shadow night
#

wtf are you doing

blazing ocean
viral temple
#

return new String(Base64Coder.encode(outputStream.toByteArray()));

blazing ocean
#

you could just make it on your own, correct

viral temple
#

Doesn't Base64Coder.encode() returns a string?

blazing ocean
#

🤷

viral temple
#

Why the need for a new string object? 😭

blazing ocean
#

probably returns a byte array

mellow edge
#

I want to spawn an NPC in my world but for that I need their UUID, what if instead I want their skin to be imported from my local PC files? Is that even possible?

viral temple
#

Look for cook time

#

if you set it to 0, it's instant iirc

boreal sparrow
#

Is there a way to have a downloadable text file in chat, or something similiar? I want players to be able to get a full report on the server and commands issued, but I think that could get very cluttered in just the chat

viral temple
#

FurnaceSmeltEvent instead of FurnaceStartSmeltEvent

#

not sure what are you talking about

#

and 1.20?

#

iirc the cook time is in ticks

#

yeah

#

because you put 1 tick

#

try different values

#

for cook time, total cook time and burn time

sullen marlin
#

yeah, sounds like you are wanting to change burn time not cook time

#

or both idk

#

but cook time wont change charcoal usage

viral temple
#

decrease the value

sullen marlin
#

FurnaceBurnEvent for fuel usage

viral temple
#

for both

viral temple
#

that exists?

sullen marlin
#

yes

viral temple
#

i would just set up the furnace burn time/cook time every time the FurnaceSmeltEvent was called

#

I guess I'm just dumb now for not knowing.

glossy sandal
#

Hi, I was just wondering. How long should we wait for the tool component to be added? I understand that Mojang was "lazy" to do everything properly?

eternal oxide
#

Magic 8 ball says - try again later.

acoustic pendant
#

Hey, i'm tryig to compile a plugin and it is compiling an older version of it, i'm trying to check the maven but nothing seems wrong, why could this be happening?

#

maybe do you want my maven file? ask for it 👍

grim hound
#

is there way to listen to world loading start or finish during start-up?

sterile axle
#

yes, you can use that event. however, make sure you set load: STARTUP in your plugin.yml otherwise your plugin will load after worlds are loaded so you won't get that event; you would only get that world for any new worlds that are loaded later on

acoustic pendant
sterile axle
#

it works during startup, you just need to make your plugin load earlier. see my message.

sterile axle
glossy sandal
acoustic pendant
sterile axle
#

nothing about your maven file would cause it to ignore your code, so i'm not sure

acoustic pendant
#

I haven't changed anything there so I don't Know

acoustic pendant
eternal oxide
#

?nms for me

acoustic pendant
#

@sterile axleso i found the problem but don't know how to solve it xd

#

it is replacing the jar from a folder that it shoudn't

#

how can i change that? xd

eternal oxide
#

which lifecycle are you running?

acoustic pendant
eternal oxide
#

clean before

acoustic pendant
#

here¿

#

changed the directory and now it works

#

thanks

stone turret
#

Any Fixes anyone?

lost matrix
stone turret
mellow edge
#

can I use PlayerInteractManager class to detect entity press or is it something else? I want to open GUI when I click on NPC.

sullen marlin
#

?jd-s

undone axleBOT
sullen marlin
mellow edge
#

But I spawned an NPC with packets, afaik it is not registered in the server

trim quest
ivory sleet
#

Nope

#

There is a lot of mod code, and some plugin code that utilizes nms

Using mojang mappings can also help

If you use fabric, vineflower is supposed to help w nms decompilation

trim quest
#

then I should increase my Design Pattern knowledge to better read the Spigot API

lilac dagger
#

does anyone know why playerinteractevent would trigger twice?

#

when i right click it does a left click animation

quiet ice
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
lilac dagger
#

i have hand disabled

quiet ice
#

well then

lilac dagger
charred blaze
#

so i set isStartingIn5Seconds to false in a task but i actually forgot to save the object in my hashmap.

i have move event listener that checks isStartingIn5Seconds and doesnt let player move if its true.

problem is it works without resaving object in hashmap? how

tardy delta
#

i would simply make that lambda a class on its own

#

then store the countdown task

tardy delta
lilac dagger
#

i fixed it

#

it was hands going through somehow

charred blaze
#

but i didnt in this case

lilac dagger
#

i cancelled it and now it's fine

charred blaze
#

but it still works for some reason

lilac dagger
#

the interact event is called twitce for right click and once for left click

#

makes no sense

remote swallow
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
remote swallow
#

its called once per hand

lilac dagger
#

wait

#

but i do that

earnest forum
#

Main hand no?

lilac dagger
#

hand is main hand isn't it?

remote swallow
#

it is

lilac dagger
#

i cancel and return as you can see

remote swallow
#

what isnt working

earnest forum
#

Do getActioj

#

getAction

remote swallow
lilac dagger
remote swallow
#

look at the code

lilac dagger
#

that's so weird

#

i pasted a stack

earnest forum
#

No you are using getHand

remote swallow
#

use ur eyes

#

whats PropHuntGamer.java:266

earnest forum
#

didn’t click on the link

#

relax brother

remote swallow
#

its in the screenshot of code

lilac dagger
earnest forum
#

Alright man

#

just saying ur getting a bit excited over nothing 🤣🤣🤣

remote swallow
#

what isnt working from that code

lilac dagger
#

so i could debug

remote swallow
#

use a debugger or sysout values

lilac dagger
#

it's left clicking when i right click

#

i wanted to see where the left click came from

remote swallow
#

print getAction

#

and double check ur isLeft and isRight methods

lilac dagger
#

they're correct

#

i've looked a bunch

#

the interact event is triggered twice

#

twice for right and once for left based on the stack dump

#

all coming from bukkit

#

and interactevent

remote swallow
#

add a sysout for event.getAction and fully restart ur server no /reload or plugman

lilac dagger
#

sec

#

one click

remote swallow
#

are you actually clicking a block