#help-development

1 messages · Page 1829 of 1

trail lintel
#

woah wait holup lol

trail lintel
sullen marlin
#

Read the docs, but still

trail lintel
#

deprecated?

sullen marlin
#

Read the docs

trail lintel
#

sure thing

#

sec sorry

sullen marlin
#

Should've been enough to get you on your way

mighty sparrow
#

Do Mojang plan into removing pretrified slab

hexed hatch
#

Fairly sure they won't at this point, they've basically supported it

#

there's three block states to make use of as well

mighty sparrow
#

17w47a Petrified oak slabs now have an item model again.

#

They made it back

hexed hatch
#

well no, it's always been in the game

#

it just lacked a gui model

mighty sparrow
#

yaaaa

#

what are the state of a petrified slab?

young knoll
#

That’s only 1 block though

mighty sparrow
#

I mean what are states?

hexed hatch
#

bottom half, upper half, double slab

mighty sparrow
#

Oh ye!

#

Makes sense

young knoll
#

Iirc they only have top bottom and double states

mighty sparrow
#

So with a resource pack, I could modify the model of a petrified slab

hexed hatch
#

Yes

#

for each state too

#

that's what I've done

mighty sparrow
#

What is your plugin ?

hexed hatch
#

Not public

mighty sparrow
#

Oh okok

hexed hatch
#

I also often use command block states

#

but survival players cannot break them obviously

trail lintel
#

Ok I am prob the big dumb, gimme a little nudge. I am getting the items with event.getItem() in a PlayerInteractEvent listener. But these seem to just have a basic ItemMeta, not damageables.

hexed hatch
#

and too many of them will cause lag spikes entering chunks

young knoll
#

Note blocks

mighty sparrow
#

I want player to destroy the block, which will be a tombstone so petrified slab is good

#

it acts like a stone

hexed hatch
#

note blocks are another good option, but you'll have to disable behaviors for them and it does take away from noteblock functionality in survival

#

but yeah, petrified double slab is the best non-replacing custom block

mighty sparrow
#

nah people use the noteblocks, would be weird

young knoll
#

You can add the functionality back

#

OR did it

sullen marlin
#

Also what version

trail lintel
#

This is for 1.18. So if I wanna have a durability bar on my item, I will need to use a base Material that is damageable?

sullen marlin
#

Yes

trail lintel
#

In that case, am I stuck with that item as the appearance for my custom item, if they aren't using a texture pack, or is there another way to set appearance aside from base material?

sullen marlin
#

Ultimately custom items need a texture pack

#

You can require texture packs now

#

Players won't be able to join your server without it

mighty sparrow
#

Are you the guy that made spigot ?

sullen marlin
#

Yes

mighty sparrow
#

shiiiiiii

#

big guy

trail lintel
#

Ohhh thats interesting, Is that a spigot setting that will enforce that or something I have to code? Also holy shit your amazing, thanks so much for the great software.

drowsy helm
#

there are much better ways to get custom textures without using damageables

hexed hatch
#

CustomModelData™️

sullen marlin
#

^

#

But specifically for the durability bar

hexed hatch
#

Mojang needs to add ArmorModelData immediately

sullen marlin
#

It needs to be an item with durability

trail lintel
#

So custom model data is what im using for the custom appearance in my own resource pack

hexed hatch
#

I want custom armor damn it

drowsy helm
#

that was like the method back in 1.9 but theres actual methods for it

hexed hatch
#

buoo, I think they want a durability bar on a non-tool item

trail lintel
#

but I ALSO want durability for my item, but want it to appear as an ender eye for people who DONT have the resource pack

#

Prob impossible 😉

hexed hatch
#

wow I'm so right

#

and yeah, not possible

hexed hatch
#

but you can just make a custom item for like shears or something

#

give it an ender eye texture with custom model data

#

and boom

#

you got it

drowsy helm
#

unless you want all your items to be eyes of ender its impossible lol

trail lintel
#

yeah thats what im gonna do I think, gonna use a tool and look into forcing people who join to download the texture pack

drowsy helm
#

yeah whenever i make servers which rely on custom textures i always force it

hexed hatch
#

believe vanilla mc has a setting for forcing resource packs in server.properties

#

don't quote me on that

#

keep your packs light too

young knoll
#

Yes

hexed hatch
#

in the kb

#

never enter the mb

drowsy helm
#

even pre 1.18 its possible to force it anyway

hexed hatch
#

yep, with ploogins

trail lintel
#

yeah im workin at 7kb right now for the mod and resource pack =] just wanna do a simple item retexture

young knoll
#

Lol going into mb is fine

hexed hatch
#

no

young knoll
#

OR is at I think 8mb

hexed hatch
#

8mb is the limit yes

young knoll
#

Even on my internet it only takes 8 seconds to download 8mb

sullen marlin
#

Just pull a call of duty

#

300gb texture pack

young knoll
#

8mb is not the limit

hexed hatch
#

not possible mr spigot

#

50mb is the limit*

young knoll
#

No

#

That’s old

drowsy helm
hexed hatch
#

then what the fuck is it

young knoll
#

It’s 250mb now

hexed hatch
#

oh

trail lintel
#

Is this a fairly new feature? I can't seem to find anything about forcing players to have a resource pack. There are some old plugins that claim to do it

hexed hatch
#

they upped it?

mighty sparrow
#

just put the texture pack in the cloud

#

🆒

young knoll
#

They upped it twice

hexed hatch
#

that's so cute

young knoll
#

50 -> 100 -> 250

sullen marlin
mighty sparrow
trail lintel
#

I don't think you can see that from server side right

sullen marlin
#

You can

#

Have for a while

#

That's how the old plugins work

young knoll
#

There’s an event

drowsy helm
#

pre 1.18 you can just listen to the texturepack event

trail lintel
#

oh snap you can see what texture packs a player has? That will work 😮

young knoll
#

No

mighty sparrow
#

Damn, my troll idea came out great

hexed hatch
young knoll
#

But you can see if they accepted it

trail lintel
#

Ohhh I see

trail lintel
drowsy helm
#

wdym

young knoll
#

There’s a vanilla setting

#

In server.properties

hexed hatch
#

server.properties

mighty sparrow
#

server.properties

hexed hatch
#

so true

trail lintel
#

I think I might check out server properties 😮

mighty sparrow
#

Anyone saw the video of the guy ordering his pizza with minecraft by using plugins? lol

trail lintel
#

huh, ya don't say o.o

mighty sparrow
trail lintel
#

initiates hacks

mighty sparrow
#

if I use petrified oak slab, how can I get the block state (double)

young knoll
#

getBlockData and cast to slab iirc

trail lintel
#

Ok... I enabled require resource pack to true, but upon joining the server nothing happens when I have no resource packs installed. Maybe I put it in the wrong location? I put the zip inside my spigot folder /world/datapacks

stable ice
sullen marlin
#

its for the datapack in the server.properties

#

textures do nothing server side

young knoll
#

You need to have it hosted online and point to it in server.properties

trail lintel
#

Ohhhhh interesting, lemme try that here

hexed hatch
#

throw it in a dropbox

#

make the link public

trail lintel
#

thank you guys for the patience, I'm being the big stupid tonight

young knoll
#

It’s annoying you can send it from the server itself

#

Sadly

hexed hatch
#

it would be too convenient

trail lintel
#

Yeah would be nice if I could just have the file on the server and pipe it to em somehow

drowsy helm
#

you can with some coding

sullen marlin
#

can in bedrock

hexed hatch
#

make spigot support it immediately

sullen marlin
#

the one sensible feature

mighty sparrow
#

Modifying the model of a block is by resource pack right?

hexed hatch
#

yes

#

you know what

mighty sparrow
#

Because I know nothing about datapack

hexed hatch
#

I'll just send you my resource pack

#

and you can try to reverse engineer it

mighty sparrow
#

That would be great to inspire myself from @hexed hatch

#

greatly appreciated

drowsy helm
#

datapacks are more game logic, resourcepacks are textures and models

mighty sparrow
#

im still under the shock that texture pack are now named ressource pack

#

i feel old

hexed hatch
#

I am going to strip all of my assets from it though

sullen marlin
#

I mean theyre the same thing

mighty sparrow
#

how many mb/gb @hexed hatch

drowsy helm
#

yeah they changed the name waaay back

#

if you want to mess around with resourcepacks i really recommend lookign at fonts

mighty sparrow
#

fonts?

drowsy helm
#

can do heaps with them

mighty sparrow
#

why fonts

drowsy helm
#

yeah

hexed hatch
#

they're so much work though

drowsy helm
#

can also do stuff like tags, emojis etc

hexed hatch
drowsy helm
#

in the post i outline why font based is better

mighty sparrow
hexed hatch
#

block models go in models/block, and you'll have to change the json file in blockstates to point to the models

#

good luck

mighty sparrow
#

you already prepared everything for me

#

Ill make a test out of it

#

rn

#

thx a lot

hexed hatch
#

well there aren't any models in there

#

so you'll have to make them and put them there

mighty sparrow
#

ye im making one with the block maker

#

online

hexed hatch
#

cool

#

good luck

mighty sparrow
#

blockbench

hexed hatch
#

blockbench is fun

young knoll
#

Custom helmet model?

hexed hatch
#

yes sir

young knoll
#

Well, item model on the head

hexed hatch
#

and on the arm

#

making sculky mobs spawn below y 0

young knoll
#

That sounds cool

#

Really makes me want to go full OR

#

But I’m not a great artist :p

hexed hatch
#

OR?

#

Oh, Originrealms?

mighty sparrow
#

are models json files ? @hexed hatch

hexed hatch
#

All of my work goes into my private smps, I just like making augmented smp experiences

young knoll
hexed hatch
#

yes Dreamy, and you'll have to put the textures in there too

young knoll
#

What ya got more than 1

hexed hatch
young knoll
#

Ye

hexed hatch
#

well, over time. not multiple at once usually

#

my projects tend to be overambitious anyways and will only be completed like 10% of the time

young knoll
#

See you just need to get simps to fund the smps

hexed hatch
#

My friends don't have money

#

I really don't enjoy playing public minecraft servers anymore

#

medium sized smps amongst fun people and no children is the way to go

summer scroll
#

eventually you will not enjoy public servers anymore xd

#

that's what u get from being a dev

#

at least for me

trail lintel
#

Awesome 😄 you guys are the best. If its not SUPER obvious people just aren't gonna do it, this will handhold even the most stubborn =]

drowsy helm
hexed hatch
summer scroll
#

it's modified on the resource pack maybe?

trail lintel
#

today we all learn things 😄

young knoll
#

Yeah you can send a custom message

hexed hatch
#

that's kinda swanky

trail lintel
#

That was set in the server properties

summer scroll
#

owh

hexed hatch
#

owo

#

you should make the message more threatening

#

tell them you'll eat their liver if they don't install it

trail lintel
#

it even just applies it immediately, you don't even have to alt tab and get the file and all that!

#

amazing

mighty sparrow
#

if you dont download the ressource pack we'll send someone to kill your family

trail lintel
#

LOL I'm gonna make it super aggressive

tender shard
#

lol

#

I'd rather do something submissive. "If you don't download our resource pack, kittens will die. Somewhere. Maybe..."

mighty sparrow
#

If you dont install it, your game may not work properly and may crash please for the security of your pc

mighty sparrow
#

I like the kitten one

#

classic

#

could make it a bit more minecraft

tender shard
#

then use "ocelot" instead of kitten

mighty sparrow
#

yes

young knoll
#

If you don’t download this pack ya getting yeeted out of here

mighty sparrow
#

or any other minecraft reference

tender shard
#

turtles

#

everyone loves turtles

#

some people dislike cats (which I don't understand) but NOONE hates turtles

hexed hatch
#

You know what

#

just because you said that

#

I'll hate turtles from now on

trail lintel
#

Interestingly, it SAYS it will disconnect you, but if you click proceed, then the request fails, you can just click "continue". But I suppose that makes sense.

#

If provider of your resource pack is down, your server shouldn't be down

tender shard
#

I SAID PLEASE

hexed hatch
#

Too late. I really, really hate turtles

tender shard
#

ugh

mighty sparrow
#

Millions of villagers suffer every year, please it's time to stop. Download our ressource pack to avoid the death of multiple villagers

#

ON GOD

tender shard
#

ugh no villagers suck

tall dragon
#

you would hate this?

hexed hatch
tender shard
#

they take 7 emeralds an give you - what? a dirt block

tall dragon
tender shard
#

fuck villagers

hexed hatch
#

and his stupid beady eyes

tender shard
#

villagers suck, and not in the good way

tired dagger
hexed hatch
#

error pls

tired dagger
hexed hatch
#

your list isn't initialized

tender shard
tired dagger
tender shard
#

subCommands is null

#

or abstractCommand is null

hexed hatch
#

this.subCommands = subCommands; what is this lol

#

that's not how you initialize a list

#

silly boy

#

oh wait

#

I'm an idiot

tired dagger
#

xD

#

silly boi

tender shard
#

show the FULL error pls

#

you cut the stacktrace

#

didnt you?

tired dagger
tender shard
#

oh okay nvm

young knoll
#

Doubt it

mighty sparrow
young knoll
#

Isn’t add(null) valid

tender shard
#

seems like the thing you wanna add to the map / list is null

tender shard
young knoll
#

Depends on the type

#

Lists can have null

tender shard
#

most lists use hashCode

#

yeah SOME lists may

#

but most dont IIRC

summer scroll
#

I got that error yesterday I think

#

It's because how you initialize the List iirc.

tender shard
#

just check whether what you wanna add is null. if it isn't, the list itself is null

summer scroll
#

Like you can't use List#add If the List is initialized with Arrays#asList

#
List<String> list = Arrays.asList("a", "b");
list.add("c"); // It will throw UnsupportedOperationException
young knoll
#

The most common list is an ArrayList

golden turret
#

new ArrayList<>(Arrays.asList());

young knoll
#

Which accepts null

golden turret
#

List.of

tender shard
#

then the list itself must be null

#

fun fact: modern java versions tell you what's null

worldly ingot
#

Has to be using Java 17, they're using MC 1.18

#

I believe aglerr is correct

#

afaik, that : null bit is the message from the exception, which is probably null

young knoll
#

That’s wouldn’t be a NPE though

tender shard
#

but if the list isnt inited, it must be null

worldly ingot
#

It's not an NPE

hexed hatch
#

this isn't a npe

young knoll
#

Ah

worldly ingot
#

It's an UnsupportedOperationException

tender shard
#

oh

#

i'm sorry

dusty sphinx
#

What is the BungeeCord chat event?

young knoll
#

Yeah that would be an immutable list

tender shard
#

ChatEvent @dusty sphinx

dusty sphinx
#

got it

hollow spindle
#

Is there a way to debug/obtain the error stacktrace on why a command won't register?
This is all i get and I know just commenting out this line makes the plugin turn on.

at java.util.Objects.requireNonNull(Objects.java:208) ~[?:?]
at xyz.nekonii.hexcraft.hexcore.HexCore.onEnable(HexCore.java:40) ~[HexCore-2.0.0-shaded.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Paper-398]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Paper-398]

Command being registered. (It was working fine before, I'm unsure as to what I've changed to affect this.)
Objects.requireNonNull(getCommand("shop")).setExecutor(new CMD_World_Shop(this));

young knoll
#

Is it in your plugin.yml

hollow spindle
tired dagger
tender shard
#

yeah as said, I was wrong

#

I only saw "null" and didn't read the stacktrace any further

tired dagger
#

oh, didn't see that part my b

tender shard
#

np 😄

hexed hatch
#

I see that null and assume it's a good ol' npe

mighty sparrow
#

Worked @hexed hatch

#

Now I just need to do a good job

hexed hatch
#

ok so

#

put a block next to it

#

and you'll see a problem

mighty sparrow
#

oh ye

#

bruh

tender shard
#

but tbh I still think that abstractCommand is null

hexed hatch
#

✨cullfacing✨

mighty sparrow
hexed hatch
#

yep

tender shard
#

because if the collection isn't null, it mut be the parameter

#

btw sorry if I'm missing some ltters in typing, my keyboard is a bit fucked lol

mighty sparrow
young knoll
#

I thought we established null was not the issue

tender shard
#

it says so in the error message

tired dagger
#

Added a check statement and it didn't throw an error

young knoll
#

Which error is this

tender shard
#

yeah but instead of doing that, you should check why you tried to add null to it in the first place

tender shard
trail lintel
#

So one more thing about custom items, the base material will determine what enchants will be available to my item right? So if I want my item to be enchantable I need to look for a tool that has the same available enchants I am looking for?

young knoll
#

Yeah that would be because the list is immutable

trail lintel
#

(available from the vanilla craffting table)

dusty sphinx
#

if i cancel a chat event will it still reach the server

tender shard
dusty sphinx
#

i want to translate a chat message into a command that can be executed on either the proxy or the target server

tender shard
tired dagger
#

So, LIS, this is the line that causes the error

trail lintel
#

I would like the item to perform like a real item at the vanilla crafting table, with the base game enchants

tired dagger
#

But I don't see why anything would be null for it to throw unsupported

summer scroll
drowsy bramble
#

How do i get if someone enters /give?

summer scroll
#

Or, show me how you initialize the AbstractCommand

drowsy bramble
#

with additional info obvs

summer scroll
#

How you create the AbstractCommand object i mean

mighty sparrow
#

@hexed hatch ?

hexed hatch
#

what

#

the cullfacing? There's no good fix for that

tired dagger
tender shard
drowsy bramble
#

ye

#

in one

tender shard
#

yeah well

young knoll
#

PlayerCommandPreProcessEvent

tender shard
#

^

#

but why do you want to intercept other plugins' commands anway?

#

in 99% of cases it's a very bad idea

young knoll
#

That’s a vanilla command

tender shard
#

it's also a command that 99% of servers have from 3rd party plugins

#

that's just why I was asking

#

because normally people just use permissions to block vanilla commands

drowsy bramble
#

im trying to create /give <player> <customitem>

#

i could be misconstruing whats needed

tender shard
#

then just register your command in your plugin.yml and register a CommandExecutor

summer scroll
#

that's a misuse for that event

tender shard
#

yeah you're abusing that event to do things that aren't meant to be done that way

trail lintel
#

So this Damageable interface. Is there a way to set the total durability? I only see get and set damage values. I imagine it uses the durability of the base material again.

tender shard
#

if you wanna have custom durablity, you'll have to do your own logic for handling it

trail lintel
#

I may be able to cheese it by using some sort of ratio. If they specify 3000 as the max durability, ill find the ratio of the flint and steels max durability to that, then set the surability on flint and steel appropriately

hexed hatch
#

so there is a fucky wucky way to add custom durability

#

by adding negative durability

young knoll
#

I used PDC to make a custom durability system

#

Worked great

hexed hatch
#

which works, but it won't display the bar until it reaches 0 obviously

tender shard
#

yeah but anway, it will look fucked up to the client

drowsy bramble
#

i can provide the other class if i need to, but this is what i have currently. pretty sure one if not multiple parts of this are wrong

mighty sparrow
#

👁️ 👄 👁️

hexed hatch
drowsy bramble
#

u can do that

young knoll
#

No

drowsy bramble
#

?

young knoll
#

PDC is probably just a map

tender shard
#

only prope thing to have it work nice is to store the ACTUAL durablity in the PDC and then make the client think / set the "real" durablity on the itemsatck to be scaled accordingly to your ACTUAL durablity

hexed hatch
#

ah

drowsy bramble
tender shard
drowsy bramble
tired dagger
#

Hmm, so it's something with the .add()... but the object is not null...?

mighty sparrow
#

those if statements could be reworked with some || and &&. Use some exit conditions

tired dagger
tender shard
desert loom
#

It's probably because you're using collections.emptyList

tender shard
#

what class is your list?

tired dagger
#

Same one

desert loom
#

Which returns an immutable list iirc

tender shard
#

yeah but it shouldnt have "null" in the error msg

#

something MUST be null

tired dagger
#

I meann yah but look at my debug message

tender shard
drowsy bramble
#

ah

tender shard
#

it means: don't execute the second statement if the first one is already true

#

you get what I mean? If not I can explain it in 3 lines

young knoll
#

&& is fail-fast

#

|| is pass-fast I guess

tender shard
#

yeah

mighty sparrow
#

I read conditions like sentences. || or && and

#

its not that hard ngl

mellow gulch
#

does anyone know when PersistentDataHolders save their persistent data?
for example: if i set persistent data and then the power goes out before a world save happens, when the server is relaunched will the data be lost?

tired dagger
desert loom
#

If you attempt to add something to a Collections.emptyList(), you get this error.

hexed hatch
#

omg the other gizmo

desert loom
mellow gulch
tender shard
#
boolean firstCond() { print("Test"); return true; }
boolean secondCond() { print("Bla"); return true; }
if (firstCond() || secondCond() ) print("Yo!");
``` ->
Will result in
young knoll
#

I assume null is because there is no exception message

#

For some reason

desert loom
#

Weirdly enough if I run that code locally on my machine it has no null exception message.

tender shard
#
"Test"
"Yo!"

while if you just use | instead of || , it will print

"Test"
"Bla"
"Yo!"
tired dagger
desert loom
#

just try changing your Collections.emptyList() calls with new ArrayList<>() or something, it might help.

#

yea

young knoll
#

^

#

Emptylist returns an immutable list

tender shard
#

imma go to sleep, have a nice day everyone ❤️

mighty sparrow
#

gn

tired dagger
#

How odd. Okay

tender shard
#

it's not odd

#

just check what it returns

mighty sparrow
#

What is bungeecord

tender shard
#

a proxy

young knoll
#

A proxy to connect servers together

tired dagger
#

I changed Collections.emptyList() to new ArrayList() and it worked

mighty sparrow
#

damn thats cool

young knoll
#

Without something like bungee cord servers would suck

#

Hypixel would be impossible

tender shard
#

bungee = makes players think that different servers are just different worlds on the same server

tired dagger
#

fax

tender shard
#

(very basic explanation)

mighty sparrow
#

Hypixel use bungee af in this case

tender shard
#

every large servers uses a TON of proxies

tired dagger
#

Prob their own implementation of Bungee

tender shard
#

even the server I worked for used 3 different bungees and they only had about 500 players being online at the same time

mighty sparrow
#

I never learnt about proxys, even in my network class. pandemic shortened everything

young knoll
#

Can you like

#

Connect proxy’s with a proxy

mighty sparrow
#

then connect the proxy to a proxy

#

that connect to a proxy

tender shard
#

think about bungee as this: it makes the servers more relaxed and it makes the devs much more stressed

#

lol

#

that's a proxy in a nutshell

young knoll
#

I don’t know much about networking but surely hypixel isn’t able to route all that traffic through one point

mighty sparrow
#

bungee makes dev caffeine consumption increase

young knoll
#

Yet you connect to 1 ip so idk

tender shard
#

as said, even the tiny 500 concurrent player server I used to work for used 3 bungees

drowsy bramble
young knoll
#

But then how can you connect via 1 ip

mighty sparrow
#

Do hypixel use spigot ?

drowsy bramble
#

or both

tender shard
#

one SRV DNS record

tall dragon
young knoll
#

I see

tender shard
#

hypixel uses their own paper fork IIRC

young knoll
#

So the DNS routes to multiple IPs?

tender shard
#

kinda, yes

drowsy bramble
#

thought u were going to bed @tender shard

tender shard
#

I thought so too

mighty sparrow
#

hes too much into the discussion

#

he cant

tender shard
#

@young knoll I'll explain SRV in a nutshell

#

normally you enter domain.com and it returns you one IP

young knoll
#

Last I heard hypixel used a modified spigot

#

But that was some years ago

tired dagger
#

^

#

They're good at hiding it too

tender shard
#

with SRV records, you can do something like: you enter domain.com and it returns:
1.2.3.4
or
2.3.4.5
or
3.4.5.6

#

it's called "round robin"

summer scroll
tired dagger
#

But it seems to have the /find command which is from Bungee

tender shard
#

the client then chooses one of those IPs at random

#

sometimes it takes the first one, sometimes the second, etc

mighty sparrow
#

the ips are in a list then the index is choosed by a random next

tender shard
mighty sparrow
#

how they manage to do this clientside

tender shard
#

well the client simply gets 3 (or 8, or 129) IPs and then just decides for one randomly

drowsy bramble
tired dagger
#

How do you manage to change the server version in the debug screen btw?

young knoll
#

You can do that easily with a fork

drowsy bramble
#

would a preprocessevent be the way to go or?

tired dagger
#

For?

young knoll
#

You can do it with packets too, yes

tender shard
#

for what?

#

there's no way to change it without packets

summer scroll
young knoll
#

I saw a plugin that lets you put placeholders in there

tired dagger
#

No

tender shard
#

ugh I dont like you everyone. now I have to drink another beer and stay online for 20+ minutes

unique shuttle
#

hello, does anyone know how I can prevent the command from repeating in this way?

mighty sparrow
#

lmao pufferfish fork. i find it so funny

tired dagger
#

Never heard of pufferfish before

drowsy bramble
tender shard
mighty sparrow
tired dagger
#

ahh

young knoll
#

Everything is a paper fork

tender shard
#

(all those forks will die at sometime. stay with paper)

mellow gulch
summer scroll
mighty sparrow
#

its not very well known, its @quaint mantle that initiated me to it

drowsy bramble
#

ah

unique shuttle
drowsy bramble
tired dagger
trail lintel
#

how do I go about getting the maximum health of an item? Damageable doesn't seem to have it, I think I am on the right track with event.getItem().getItemMeta().getAttributeModifiers(Attribute.GENERIC_MAX_HEALTH);, but this returns a collection of AttributeModifiers. I expect there would only be one for this guy

tired dagger
#

I believe

summer scroll
quaint mantle
#

hey guys, looking to crowdsource an idea, so far everything ive tried hasnt worked.

i'd like to have items floating above players heads, pretty much by having them equipped as passengers. issue is, you can see the items in first person clipping through your head since they start at an awkward position.

does anyone know a good possible workaround?

unique shuttle
drowsy bramble
trail lintel
#

yup like a Damageable should have a maximum durability right

mighty sparrow
#

idk if its possible

trail lintel
#

but there doesn't seem to be a way to get that value

summer scroll
mellow gulch
young knoll
#

Or something like that

trail lintel
#

DOH

#

yup its on the material, ty lol

unique shuttle
#

I am creating the command outside of plugin.yml, and doing it the command autocomplete in chat returns the duplicate command to me. instead of just returning "global" it returns "global:global"

tired dagger
#

Thank you, @desert loom btw

quaint mantle
quaint mantle
#

maybe i didnt try a proper way, i think i used like hideEntity and it caused issues like dropping the item

mighty sparrow
#

if player press f5? @quaint mantle

mellow gulch
mighty sparrow
#

idk if you can know the keys the player pressed

odd sentinel
#

whats the right way to compare two itemstacks to make sure they're the same? even extra data like enchantments, fireworks data, etc

quaint mantle
summer scroll
mellow gulch
summer scroll
mighty sparrow
#

universally, equals is the best option

odd sentinel
#

it's pulling wooden swords without enchants when compared to a wooden sword with enchants

young knoll
#

isSimilar should compare everything bar stack size

unique shuttle
odd sentinel
#

ya there must be some flaw in my code because I have isSimilar

young knoll
#

Look into a command framework

#

You can also inject into the command map yourself, but you should avoid that

tired dagger
summer scroll
#

Aliases is useful you know

mellow gulch
mighty sparrow
#

do someone made a plugin in kotlin here except me

quaint mantle
desert loom
unique shuttle
drowsy bramble
#

give me a sec to clarify

tired dagger
trail lintel
#

class org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack cannot be cast to class org.bukkit.entity.Damageable (org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack and org.bukkit.entity.Damageable are in unnamed module of loader java.net.URLClassLoader @6a4f787b) What exactly is goin on here....... That error message confuses me a little

odd sentinel
#

ok ya this code of mine was ancient... it was from an era where wool colors were determined by durability

tired dagger
#

woow

#

the old days

trail lintel
#

Ah holup, damageable inherits from itemmeta not itemstack

drowsy bramble
#

i think i need to create a target player var too so theres that

tired dagger
trail lintel
#

Well, same issue with ItemMeta. complains about an unnamed module of some kind?

mellow gulch
#

found the code, but its really old and idk how usable the code is now

drowsy bramble
trail lintel
#

wrong damageable class I think, there is an entity damageable and a inventory damageable 😉

drowsy bramble
#

is it bad to use command.equals(args)?

young knoll
#

How would that work

drowsy bramble
#

also gn

lavish hemlock
#

what is command in this context?

#

you should never compare two variables that are not of the same type due to the contract of equals

young knoll
#

I would guess it’s a command

lavish hemlock
#

(the reason it requires you pass Object is that it is a pre-generics method, obviously)

young knoll
#

I mean most equals impls should handle it gracefully

#

But it’ll never be true, you can’t compare a ham sandwich to an airplane

lavish hemlock
#

this is bc it has to cast the second value to compare fields within stuff like IDEA's automatic implementation

drowsy bramble
#

i probably did the second part wrong anyways

lavish hemlock
#

always use equals on String

young knoll
#

Yeah the command is probably not going to equal a string

lavish hemlock
#

don't do this tho command.equals(p.getDisplayName() + heart_of_war)

#

you're comparing a command class to a String

drowsy bramble
#

how would i do it?

lavish hemlock
#

which is invalid

young knoll
#

And by probably I mean definitely

mellow gulch
mighty sparrow
#

equals is suppose to be used to verify if the object that called equals is equal to another object

#

right

lavish hemlock
#

equals is value comparison, == is identity comparison

quaint mantle
mighty sparrow
#

yes

lavish hemlock
#

value comparison = comparing the values of the two instances

#

identity comparison = comparing the references of the two instances

young knoll
#

I would imagine pdc is saved with the rest of the object

lavish hemlock
#

which is why you don't use == on String

young knoll
#

So chunk save for chunk pdc, player data save for player pdc, etc

lavish hemlock
#

because it's never guaranteed that will be the same String in the heap.

mighty sparrow
#

so with string, I must always use equals ?

lavish hemlock
#

yes

young knoll
#

For simplicity sake, yes

mighty sparrow
#

thanks I will do this in the future

#

for all my projects

lavish hemlock
#

IDEA automatically warns about it but ye

mellow gulch
mighty sparrow
#

idk why it would be different

lavish hemlock
#

uhhh

#

I don't know

#

actually, apparently so

young knoll
#

You can actually make strings identity comparable

lavish hemlock
#

interning ✨

young knoll
#

But that’s not important to worry about here

lavish hemlock
#

but never use .intern(), it actually has some pretty bad performance costs

#

it's better to use stuff like Guava's Interner

young knoll
#

Good to know

#

I’m not even sure what the use case is

#

Strings that are used a ton I guess?

lavish hemlock
#

yeah

sick herald
#

anyone know a good npcs plugin for 1.17? i was using znpcs but after putting it on my server instead of my pc, it just gave me a bunch of errors

young knoll
#

Citizens

sick herald
#

preferably not paid

young knoll
#

there is a link to free builds in like

#

The first sentence

sick herald
#

tried that aswell but it kept giving me errors, ill try once more tho

#

this always happens

#

the server runs at ~4gb of ram usaged normally then when i spawn an npc it jumps to 8gb

#

which is how much ive allocated to it

young knoll
#

That’s

#

Something

sick herald
#

indeed.

lavish hemlock
#

optimization

sick herald
lavish hemlock
#

I am aware

#

I was making fun of MC

#

as well as this plugin

young knoll
#

There’s no way citizens uses 4GB of ram to spawn an npc

sick herald
#

want me to record it

mighty sparrow
young knoll
#

That would be a level of incompetence so great the universe would have collapsed into a singularity

lavish hemlock
#

you can just build Citizens yourself

young knoll
#

Don’t even need to

young knoll
#

Just grab it from Jenkins

lavish hemlock
#

oh

sick herald
#

after i spawn an nps lol

lavish hemlock
#

nice

#

lmao

young knoll
#

Yeah I feel there is something else going on

sick herald
#

i am so close to committing

young knoll
#

I used to run citizens on 4GB just fine

summer scroll
#

even on 2gb

#

maybe try different builds or something

sick herald
#

i did lol

mighty sparrow
#

Did u fix it @sick herald

sick herald
#

found a random plugin that kinda works so its fine

mighty sparrow
#

Citizen is a well known plugin I dont understand why it does this to u

#

Maybe u spawned too much npcs

drowsy helm
#

Have you tried a diff version

shut meadow
#

hey guys, i have coded a plugin to join a team via the /status command, but now a death scoreboard isn't displayed anymore in the tablist can someone help me?

#

here the code:

import commands.commands;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;

public class Tab {
    private static Scoreboard sb;

    public Tab() {
    }

    public static void setScoreboard() {
        sb = Bukkit.getScoreboardManager().getNewScoreboard();
        sb.registerNewTeam("001LIVE");
        sb.registerNewTeam("002REC");
        sb.registerNewTeam("003AFK");
        sb.registerNewTeam("004REDSTONE");
        sb.registerNewTeam("005MINING");
        sb.registerNewTeam("006RP");
        sb.registerNewTeam("007GOD");
        sb.registerNewTeam("008FARMING");
        sb.registerNewTeam("009VC");
        sb.registerNewTeam("010DEFAULT");
        sb.getTeam("001LIVE").setPrefix("§f[§9LIVE§f] ");
        sb.getTeam("002REC").setPrefix("§f[§cREC§f] ");
        sb.getTeam("003AFK").setPrefix("§f[§7AFK§f] ");
        sb.getTeam("004REDSTONE").setPrefix("§f[§4REDSTONE§f] ");
        sb.getTeam("005MINING").setPrefix("§f[§bMINING§f] ");
        sb.getTeam("006RP").setPrefix("§f[§dRP§f] ");
        sb.getTeam("007GOD").setPrefix("§f[§6GOD§f] ");
        sb.getTeam("008FARMING").setPrefix("§f[§aFARMING§f] ");
        sb.getTeam("009VC").setPrefix("§f[§5VC§f] ");
        sb.getTeam("010DEFAULT").setPrefix("");
        Iterator var0 = Bukkit.getOnlinePlayers().iterator();

        while(var0.hasNext()) {
            Player all = (Player)var0.next();
            setTeams(all);
        }
#
}

    private static void setTeams(Player player) {
        String team = "";
        if (commands.livers.contains(player.getName())) {
            team = "001LIVE";
        } else if (commands.aufnehmer.contains(player.getName())) {
            team = "002REC";
        } else if (commands.afks.contains(player.getName())) {
            team = "003AFK";
        } else if (commands.redstoner.contains(player.getName())) {
            team = "004REDSTONE";
        } else if (commands.miners.contains(player.getName())) {
            team = "005MINING";
        } else if (commands.rper.contains(player.getName())) {
            team = "006RP";
        } else if (commands.gods.contains(player.getName())) {
            team = "007GOD";
        } else if (commands.farmers.contains(player.getName())) {
            team = "008FARMING";
        } else if (commands.vcs.contains(player.getName())) {
            team = "009VC";
        } else {
            team = "010DEFAULT";
        }

        sb.getTeam(team).addEntry(player.getName());
        player.setScoreboard(sb);
    }
}
tulip owl
#

How would i tab complete a players name?

@CommandAlias("crown")
public class crown extends BaseCommand {

    @Subcommand("on")
    @CommandPermission("untitledplugin.crown.on")
    @Description("puts a crown on the specified player")
    public static void onCrownOn(CommandSender sender, String[] args) {


        Player p = Bukkit.getServer().getPlayer(args[0]);; // Person to be crowned

        if(p.isOnline()) {
            p.sendMessage(ChatColor.GOLD + "You have been crowned!");
        } else {
            sender.sendMessage(ChatColor.RED + "Player Must Be Online");
        }
        
    }

    @Subcommand("off")
    @CommandPermission("untitledplugin.crown.off")
    @Description("takes the crown off the specified player")
    public static void onCrownOff(CommandSender sender, String[] args) {


        Player p = Bukkit.getServer().getPlayer(args[0]);; // Person to be crowned

        if(p.isOnline()) {
            p.sendMessage(ChatColor.RED + "You have been un-crowned!");
        } else {
            sender.sendMessage(ChatColor.RED + "Player Must Be Online");
        }

    }

    @Default
    @HelpCommand
    public static void onHelp(CommandSender sender, String[] args) {

        sender.sendMessage(ChatColor.RED + "Usage: " + ChatColor.GRAY + "/crown <on/off> <player>");
    }
calm star
#

when doing this:

    public void kothTimer() {
            BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
            scheduler.runTaskTimer(KothMain.getInstance(), new Runnable() {
                @Override
                public void run() {
                    for (Player tempPlayer : KothMain.getInstance().playersInBorderList) {
                        KothMain.getInstance().playerTimer.put(tempPlayer, KothMain.getInstance().playerTimer.getOrDefault(tempPlayer, 0) + 1);
                        System.out.println(KothMain.getInstance().playerTimer);
                    }
                }
            }, 20, 20);
        }

it goes up by 12 every second

#
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1188}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1189}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1190}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1191}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1192}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1193}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1194}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1195}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1196}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1197}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1198}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1199}
[10:34:46 INFO]: {CraftPlayer{name=Oscimate}=1200}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1201}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1202}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1203}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1204}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1205}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1206}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1207}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1208}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1209}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1210}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1211}
[10:34:47 INFO]: {CraftPlayer{name=Oscimate}=1212}
tulip owl
manic furnace
#

How can i can execute all events in a new Thread?

void coral
#
java.lang.NoClassDefFoundError: net/minecraft/network/chat/Component
        at devs.sparepartsmrflyn.ClashwarsAddon.Main.setupManager(Main.java:548) ~[ClashwarsAddon-1.0-SNAPSHOT.jar:?]
        at devs.sparepartsmrflyn.ClashwarsAddon.Main.onEnable(Main.java:62) ~[ClashwarsAddon-1.0-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.18.1.jar:git-Paper-77]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:477) ~[paper-1.18.1.jar:git-Paper-77]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:727) ~[paper-1.18.1.jar:git-Paper-77]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503) ~[paper-1.18.1.jar:git-Paper-77]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:313) ~[paper-1.18.1.jar:git-Paper-77]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[paper-1.18.1.jar:git-Paper-77]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-77]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.minecraft.network.chat.Component
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:151) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
       ```
tulip owl
void coral
#

i followed the nms tutorial posted in spigot forums but its still not working can someone tell me the fix? it compiles fine

ivory sleet
#

Create a thread executor

#

And then use Executor::submit

manic furnace
#

Can you give me an exmaple?

ivory sleet
#

Executor executor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setDaemon(true).build());
executor.submit(() -> {
MyEvent event = new MyEvent(…);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}

//TODO
});

manic furnace
#

Ok thanks

#

When i use . newSingelThreadExecuter, it can't find the refernce

ivory sleet
#

might be newSingleThreadedExecutor

#

Oh nvm

#

Yes it’s jd 7 but it’s there :p

manic furnace
#

The code dont't work when i try to use it

ivory sleet
#

You do something wrong then

#
  • why even use another thread in the first place
manic furnace
#

I can't use new ThreadFactoryBuilder

ivory sleet
#

It won’t make your code faster

#

Are you even coding in spigot?

tired dagger
#

Quick question: so, I was trying to remove all the tab completions (namely the "minecraft:", and "bukkit:" as others are hidden by a perms plugin) but I have a concern in the way I am doing it.

Wouldn't this remove the help map globally? How can I do this for just one player? (The last line)

manic furnace
#

But i have to use it because i do a lot of things in this event that make the server lagging

ivory sleet
#

No that’s now how threads are supposed to be used

#

You have to optimize whatever you do first

#

Not just, oh it lags, let’s do it on another thread

#

Because you’re simply neglecting thread safety now

manic furnace
#

I get the location and append it to an string builder evry 10 seconds

ivory sleet
#

that shouldn’t lag at all

manic furnace
#

And than every 10 mins, i safe the string builder to an text file

ivory sleet
#

Oh well

#

Then just do the save operation asynchronously

#

And for the 10 min and 10 sec, use the BukkitScheduler::runTaskTimer

manic furnace
manic furnace
ivory sleet
#

Use BukkitScheduler::runTaskAsynchronously

#

It’s adequate for your level

tired dagger
#

Hey, Conclure, thoughts?

ivory sleet
#

PlayerCommandSendEvent won’t remove the commands for every player

#

Or well if you remove then in the callback

tired dagger
#

Okay, thanks

ivory sleet
#

But yes the help map would be cleared globally

tired dagger
#

oop

ivory sleet
#

I think?

tired dagger
#

Know any way to get around that?

#

I suppose I could just block each command individually but I feel there should be a better way of doing that

ivory sleet
#

No not really, but why would you remove something from the help map?

tired dagger
#

I don't want players who don't have permission to see all the plugins and their respective menus

ivory sleet
#

Hmm, well, sadly Bukkit haven’t implemented a per player help map feature

#

So you could inject your own implementation of HelpMap which does this I think altho that’s quite unsafe

#

Or just block the /help permission

tired dagger
#

^ Yeah, I'll prob just do that

tardy delta
#

what will this load?
YamlConfiguration bukkitYml = YamlConfiguration
.loadConfiguration(new File(Bukkit.getWorldContainer().getAbsoluteFile(), "bukkit.yml"));

#

the bukkit.yml ile in the server root?

quaint mantle
#

yup

#

it should

ivory sleet
#

Yes if the world container is the same directory as the server root directory

#

However, on startup, it might be changed

#

(World container)

#

So you could just new File(".","bukkit.yml");

tardy delta
#

ok

#

also is it worth using multiple databases at the same time

#

i saw a plugin for a big server doing it

ivory sleet
#

Depends what type of databases we talk about

tardy delta
#

using a connection pool obviously

#

homes, kingdoms, players etc

ivory sleet
#

Because different ones have different purposes or well, use cases

onyx shale
#

hmm yes and no

ivory sleet
#

The word database is still quite an abstract word

onyx shale
#

i guess if you like to keep them clean but unless ur expecting a huge amount like 100k requests per minute i doubt it will matter

tardy delta
#

that wont happen

onyx shale
#

then im not sure its worth the husstle

tardy delta
#

i'm also wondering

ivory sleet
#

FourteenBrush

For instance we have flat files which work great to store configurations, then we have in memory databases which work great as caches such as redis. We also got the non relational databases and are usually used to store unstructured data namely mongodb, then we got the relational ones such a mariadb, mysql and postgre. shrug

onyx shale
#

mysql ftw

#

sqlite second king

ivory sleet
#

Well, point is, there are a lot of them, not all are fit for x purpose

tardy delta
#

true

vale ember
#

hey, can anyone help? i use "shadow("com.github.InventivetalentDev:MineskinClient:1.1.0-SNAPSHOT")" in my build.gradle.kts but when i start server it throws ClassNotFoundException

ivory sleet
#

Do you use shadowJar?

vale ember
#

i use this plugin id("com.github.johnrengelman.shadow") version "7.1.1"

#

and just add that line in dependecy

#

shadow("com.github.InventivetalentDev:MineskinClient:1.1.0-SNAPSHOT")

ivory sleet
#

Well use implementation then

vale ember
#

it throws the same exception

ivory sleet
#

you need to build with shadowJar as opposed to build or normal jar task

vale ember
#

oh it worked, thanks

mortal hare
#

I hate InventoryDragEvent

#

its clunky

#

and doesnt want to work properly

#

since its fired in the middle of inventory calculations

visual tide
#

does PotionEffect::getAmplifier() start counting from 0 like the command or 1 like the display?

mortal hare
#

also event.getNewItems() for some reason is wrapped as unmodifiable

#

why we couldnt modify what items are being added to inventory in the drag

#

now i need to make a new task which runs 1 tick later to execute the code after the cancellation of the event

#

because event.setCursor() just says fuck you

#

if the event is cancelled

#

and inventory.setCursor() doesnt work, since its in the middle calculations

torn shuttle
#

I am so triggered that my IDE doesn't know the words teleport and cooldown and keeps trying to suggest autocorrections

#

literally unusable

#

give me my money back jetbrains

torn shuttle
#

huh

tardy delta
#

oh i have typos check thing disabled

torn shuttle
#

does it not complain when you set it as a variable name

tardy delta
#

🤡

torn shuttle
#

well that too

visual tide
#

does PotionEffect::getAmplifier() start counting from 0 like the command or 1 like the display?

torn shuttle
#

0, potions are 0-indexed

#

don't ask why

#

I mean not even indexed

#

they start counting at 0, it's not even a list

#

I look forward to when minecraft will add set bonuses that start counting at -5

mortal hare
#

do you guys get annoyed when IDE suggest that this object could be null

#

but you know from cirucumstances thats impossible, since method inside it doesnt allow that

torn shuttle
#

I used to get annoyed until some very "special" item plugins managed to make those impossible nulls possible

#

also fake player entities

mortal hare
#

just spawn in via packets

torn shuttle
#

but then how will they attack other server entities and be attacked by them

mortal hare
#

code your own pathfinder 😂

#

i mean yea

mortal hare
#

i made server entity tracking fully possible in packet level

torn shuttle
#

I'm unironically currently unravelling all the stuff I "just ignored" for 4 years

mortal hare
#

but im too dumb to code pathfinders yet

#

but im keen on developing pvp bots

#

in the future

torn shuttle
#

not that it really matters but I just want the code to be more uniform and better in general

#

still... 2879 issues to go

quaint mantle
#

nms

mortal hare
#

do you mean advancement?

torn shuttle
#

boy sonarlint does not like modifying static fields from non-static methods

quaint mantle
mortal hare
#

i believe 1.8 achievements are deprecated and clientside

#

while advancements are serverside

quaint mantle
vale ember
#

how do i check server version? like 1_14_R1?

mortal hare
#

check OBC package

#

via regex pattern

vale ember
#

will .contains() work?

#

like

Bukkit.getServer().getVersion().contains("1_14_R1")
torn shuttle
#
    /**
     * Compares a Minecraft version with the current version on the server. Returns true if the version on the server is older.
     *
     * @param majorVersion Target major version to compare (i.e. 1.>>>17<<<.0)
     * @param minorVersion Target minor version to compare (i.e. 1.17.>>>0<<<)
     * @return Whether the version is under the value to be compared
     */
    public static boolean serverVersionOlderThan(int majorVersion, int minorVersion) {

        String[] splitVersion = Bukkit.getBukkitVersion().split("[.]");

        int actualMajorVersion = Integer.parseInt(splitVersion[1].split("-")[0]);

        int actualMinorVersion = 0;
        if (splitVersion.length > 2)
            actualMinorVersion = Integer.parseInt(splitVersion[2].split("-")[0]);

        if (actualMajorVersion < majorVersion)
            return true;

        if (splitVersion.length > 2)
            return actualMajorVersion == majorVersion && actualMinorVersion < minorVersion;

        return false;

    }

ayy

#

quick n dirty

mortal hare
#

there's no simpler method out here

#

it uses NMS to provide you an API

#

since spigot api doesnt provide you one

#

NMS is a native minecraft server

#

its the guts of your server

#

these apis use internal minecraft methods to get advancements working

#

thats OBC not NMS (CraftBukkit internal methods)

#

NMS goes deeper than OBC

torn shuttle
#

too deep

mortal hare
#

OBC is the wrapper around NMS, Bukkit is an API provided around OBC

young vine
#

wrong

quaint mantle
#

ok

young vine
#

better

torn shuttle
#

stare into nms code for too long and it will stare back at you

young vine
#

craftbukkit implements the bukkit api

quaint mantle
#

because spigot dont use mojank mappings so it is really curse lul

young vine
#

thats not debatable, lmao

quaint mantle
#

there is literally doc there

mortal hare
#

you're dwight like persona

young vine
#

craftbukkit literally implements the bukkit api

eternal oxide
#

^

torn shuttle
#

anything is debatable if you're willing to be wrong

quaint mantle
#

wait do you know java? just in case

young vine
#

anything is debatable if you stink like magma

torn shuttle
#

please

#

I'll have you know I smell of pure manly musk

manic furnace
#

When i make a thread in my plugin, how can i change the name of it?

opal juniper
#

mank

quaint mantle
torn shuttle
#

ladies faint when I enter a room

quaint mantle
#

toto

opal juniper
torn shuttle
#

it's very inconvenient and has gotten me banned from most enclosed spaces

young vine
#

not only ladies, everything in a 5 m radius just ceases to exist 😄

torn shuttle
#

you guys just can't comprehend my true power level

#

it is beyond you mere mortals

#

I belong up there with shaggy and rich evans

young vine
#

I had to google who that is

torn shuttle
#

you's uncultered

young vine
#

(rich that is, I do know shaggy, lol)

torn shuttle
#

you'd be better off the other way around

#

red letter media is bae

young vine
#

no scooby doo is bae

torn shuttle
#

they are all bae, as am I

young vine
torn shuttle
#

you need to go watch every single rlm video several times

#

I wonder who does the mixing for tiny desk

young vine
#

gimme one vid and ill consider it

torn shuttle
#

hm

young vine
#

lets switch to #general tho before mods get angry

torn shuttle
#

mods never get angry at me, I'm too kawaii

wild marten
#

can i get rid of this?

young vine
#

stop the server, lol

wild marten
#

ye but like such a trek

#

like i can disable the plugin with plugman and then upload it but its kinda annoying after a while

torn shuttle
solid cargo
#

boi why. i can import them, why doesnt it compile?

quaint mantle
#
@EventHandler
    public void join(PlayerJoinEvent e) {
        String UUID = e.getPlayer().getUniqueId().toString();
        e.getPlayer().getServer().broadcastMessage(UUID);
        e.setJoinMessage("hi "+e.getPlayer().getName()+" :)");
        if(UUID.toString() == spaceID.toString()) {
            e.getPlayer().getServer().broadcastMessage("this message SHOULD only run when i join.");
        }
    }```
#

i have this code to test stuff

#

but the server doesnt run this?

if(UUID.toString() == spaceID.toString()) {
            e.getPlayer().getServer().broadcastMessage("this message SHOULD only run when i join.");
        }```
#

the UUID is the right id

eternal oxide
#

.equals not == on Strings

quaint mantle
#

ah

#

thanks

smoky oak
#

is it possible to check if a specific structure exists in the world? I once wrote my own method but i wonder if there'S a simpler solution

#

at specific coords

eternal oxide
#

no simple way, no.

smoky oak
#

is there a way to convert a structure into a 3d array of materials/blocks?

#

or do i have to get such an array manually too?

eternal oxide
burnt current
#

Hey! short question:
i try to create a plugin, where its possible to claim a Minecraft biome like in CityBuild. For that i thought if use a tutorial of creating a citybuild plugin i can create this plugin too. Unfortunately i couldnt find a tutorial for this on google. Does anyone happen to know of a tutorial I could use for this?

hexed hatch
vale ember
#

should i use interactentity or interactatentity for invisble armor stands?

burnt current
quaint mantle
#

what packet will be sent to the server when someone loads a hotbar in creative ?

calm star
#

when i do

server.getScheduler().scheduleSyncRepeatingTask(this, new  Runnable(){
            public void run(){
                if (KothMain.kothStarted) {
                    KothMain.getInstance().kothTimer();
                }
            }
        }, 20, 20);
``` and
```java
public void kothTimer() {
        BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
        scheduler.runTaskTimer(KothMain.getInstance(), new Runnable() {
            @Override
            public void run() {
                for (Player tempPlayer : KothMain.getInstance().playersInBorderList) {

                    KothMain.getInstance().playerTimer.put(tempPlayer, KothMain.getInstance().playerTimer.getOrDefault(tempPlayer, 0) + 1);
                    System.out.println(KothMain.getInstance().playerTimer);
                }
            }
        }, 20, 20);
    }
``` it runs the sout multiple times a second instead of just once a second any ideas on how to fixc this?
eternal oxide
#

biomes also have height now so you can have two biomes on top of each other

burnt current
#

so it would only be about the biomes at the surface. there everything should then be claimed up to the very top and bottom

eternal oxide
#

You can still have two biomes next to each other of the same type

young knoll
#

That would just be considered one biome

eternal oxide
#

if you are ignoring biome changes top to bottom there is no point in claiming a complete biome on teh plane

#

Most claim plugins do it by chunk or defined area

#

trying to do it by biome is going to be wildly inaccurate

vale ember
#

if i have an npc and armorstand in exact same position, how can i handle click on armorstand?

quaint mantle
#

how to check if it is loading a hotbar

young knoll
#

PacketType.Play.Client.SET_CREATIVE_SLOT

#

Is what I use to detect items being created in creative

eternal oxide
#

read the post in announcements about nms and special source

young knoll
#

I don’t think you can technically detect a hotbar load

burnt current
misty current
#

how do I connect intellij to a git repo? I have already created the git and local repo

vale ember
#

how do i add npc right click handler with plain nms (NO API)

mellow gulch
#

(all of these suggestions are part of spigot, which is an API)

vale ember
mellow gulch
#

ok, thought you meant villager when you said npc.

#

my apologies, im not sure how you'd be able to do it if the npcs are fictional things on the serverside

vale ember
#

i need to listen to packets, and there's plenty plugins providing such APIs but they all are external dependencies which i want to avoid

mellow gulch
#

if you scroll up a bit i made a thread that says some of the info about how i went about making a packet handler, i didn't provide much info because i was unsure if it was outdated, but it might help

#

(assuming you do need packets)

loud swift
#

Hey guys, is there any way to know what noteblock sound is associated with a material? I can't seem to find a way to get that sound programatically, without hardcoding this table https://minecraft.fandom.com/wiki/Note_Block

vale ember
#

which citizensapi version shud i use to work with 1.14-1.18.1?

quaint mantle
#

latest i guess?

mortal hare
#

ok guys

#

my life is a lie

#

did you guys knew that inventory splitting doesnt care how much are there in the itemstack

quaint mantle
#

everyone's life is a lie, exept for mdaddy_5

mortal hare
#

you can literally split 64 items into three pieces and go through stack via mouse

#

and it would still split to 3 equal parts

#

21 + 21 + 21 = 64

#

it doesnt care if the splitting available slot is full or not

#

well atleast cursor is updated

#

but this makes no sense that client doesnt recalculate the values of the splitting slots

proven river
#

I'm trying to get a basic clear command to work but my server keep throwing this error that it cant register the command even though I've got the command executor setup properly from what I know, I've looked around but cant find whats causing the issue?
Console error : https://paste.md-5.net/aminexipam.coffeescript
Command: https://paste.md-5.net/lurimokaqu.java
Executor: getCommand("clear").setExecutor(new ClearCommand());

mortal hare
#

it should be: NETHERITE_BLOCK x 31, NETHERITE_BLOCK x 64, NETHERITE_BLOCK x 31

CURSOR: NETHERITE_BLOCK x 1

#

instead it just gives up recalculating the slots

vale ember
#

anyone know wtf? java.lang.ClassCastException: class net.citizensnpcs.Citizens cannot be cast to class net.citizensnpcs.Citizens (net.citizensnpcs.Citizens is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @7c465a52; net.citizensnpcs.Citizens is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @4a60d822)

#
        CitizensAPI.setImplementation((Citizens) Bukkit.getPluginManager().getPlugin("Citizens"));
        npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, "Test");
mortal hare
#

wtf

#

why it doesnt cast it

#

well i cant really tell since i havent used the citizens API