#help-development

1 messages ยท Page 2059 of 1

noble lantern
#

False

west oxide
#

lol

#

jkjkjk

#

is this the one am looking for if i want to do something when they touch an item in inventory ?

#

or this ?

crisp steeple
#

no

#

InventoryClickEvent

young knoll
#

^

west oxide
#

oh okay thank you

young knoll
#

First one is for hoppers

#

Second one is abstract and cannot be listened to

west oxide
#

then how can i cancel players moving items around their inventory ?

#

is it the same one ?

crisp steeple
#

its just inventoryclickevent

noble lantern
#

^

west oxide
tall dragon
#

InventoryClickEvent

crisp steeple
#

yeah but they could still drop by pressing q

#

if you want to disable that that would be itemdropevent

west oxide
tall dragon
#

that also fired inv click

west oxide
tall dragon
#

dropping with q ^

young knoll
#

Yeah thatโ€™s still a click if an inventory is open

west oxide
crisp steeple
#

might not have been the exact name

tall dragon
#

its fired for dropping with q as well.

west oxide
#

amma try

#

and see if it works

crisp steeple
#

the actual name is PlayerDropItemEvent

west oxide
#

i tried it

crisp steeple
#

ok yeah

#

playerdropevent is for dropping it from your hotbar

#

if you're cancelling all inventoryclickevents in the inventory it should stop items dropping in the inventory

tall dragon
#

ah wait

#

i read wrong ingore that

sand vector
#

would you use the var UUID to transfer a uuid over files? or just Strings

young knoll
#

You want to convert a uuid to something you can store in a file?

noble lantern
#

uuid.toString()

#

UUID.fromString(string) for loading

young knoll
#

^ best way for text files

sand vector
#

cheers

craggy sapphire
#

?paste

undone axleBOT
craggy sapphire
#

could anyone help me with these issues?

noble lantern
#

Inventory.getView().getName() for newer versions

#

But yes, use holders

echo basalt
#

having an extremely weird issue rn

#

I made a system where you can grab entities and throw them

#

for some reason, falling blocks seem to change their UUIDs whenever collisions are checked

#

either that or Bukkit.getEntity doesn't work for falling blocks ๐Ÿค”

young knoll
#

No holders bad

#

Use views

echo basalt
noble lantern
#

I cant tell if hes meming or not

echo basalt
#

just use the nms container ID

dire marsh
#

components bad

echo basalt
#

guaranteed to work

#

trust me

dire marsh
#

dont use components

noble lantern
#

Falling sand would get considered an entity only for the time its falling

echo basalt
#

that might be the problem tbh

young knoll
#

Should still be an entity

echo saddle
#

Is there a meta implementation for experience on an experience bottle

noble lantern
#

Not sure about that method tbf

noble lantern
#

Could be wrong

echo basalt
#

you need to use events for that

echo saddle
#

nms has methods for the itemstack, but seems like no meta for item in bukkit, only event

#

i don't want an event

noble lantern
#

Then as illusion said, events

echo basalt
#

pretty sure experience bottles are entities that drop exp when they "die" aka get thrown

#

might be wrong

noble lantern
#

PotionSplashEvent might get called using it, not sure

echo saddle
#

well, experience bottls are itemstack of Material.EXPERIENCE_BOTTLE that has methods for setExp and getExp.

#

in nms that is

echo basalt
#

odd

noble lantern
#

So why not use NMS to set the exp then?

echo basalt
#

NMS is kinda weird

#

items by default have food info

#

which is nullable

noble lantern
#

Mmm stone food info

echo basalt
#

but that's the only nullable type of data shared across all items

young knoll
#

I mean if it has methods for that

#

Then make a pr

tall dragon
#

ahh yes some bedrock. that will fill my apetite.

young knoll
#

Or at least an issue ticket

echo basalt
desert musk
#

should i use custom config files for purely internal data storage

noble lantern
young knoll
#

Or sql

noble lantern
#

Spigot comes shipped eith a gson instance

#

^

echo basalt
noble lantern
#

Why

#

What

#

Who?

young knoll
#

Hold up

desert musk
#

huh?????

hexed hatch
young knoll
#

You can do that?

echo basalt
hexed hatch
#

If so, I want to see this code immediately

#

Oh

echo basalt
#

that I generated automatically

young knoll
#

Dangit

noble lantern
#

Okay was about to say

echo basalt
#

but hey I can eat any item in the game

hexed hatch
#

God damn it

echo basalt
#

and mobs too

noble lantern
hexed hatch
#

I really thought you had found some magical way to make nonedible items edible

#

I had so many ideas

young knoll
#

Still donโ€™t have a nice eating animation for my player heads

echo basalt
#

armor, crafting recipes

tall dragon
noble lantern
#

Can someone pin that cursed video pls

echo basalt
#

block breaking

young knoll
#

Thatโ€™s a lot of effort for a meme

echo basalt
#

not a meme

#

I actually got paid for this

#

:)

desert musk
#

this is what happens when you follow a bunch of separate tutorials for one project ๐Ÿ’€

#

does anyone wanna nag me so that i get better uhh

#

orthodox coding

echo basalt
#

The code is kinda funky

noble lantern
#

.options().copyDefaults()?

echo basalt
#

I went through all the items in the game and wrote a 100 line method that automatically maps each item to an ID

echo basalt
#

then I saved each ID on a yml file so I could parse it on the plugin

noble lantern
#

saveDefaultConfig()

desert musk
#

lmfao

echo basalt
#

Then I filtered invalid items

young knoll
#

People pay for weird things

echo basalt
#

the yml looks like this

desert musk
#

ok so from what i'm hearing this isn't that bad for java programmers

#

lol

echo basalt
#

I also had to go through the language files to get the original item names

noble lantern
echo basalt
#

which is mapped

noble lantern
#

You should know if its null or not

desert musk
echo basalt
#

and I also made a registry for all blocks each tool can break so I can automatically convert the "fake" tools to the real tools whenever you start breaking a block

echo basalt
#

I think that project took me like 3 days to make?

noble lantern
echo basalt
desert musk
#

idk i just find the non-scoped unrelated onEnable() bullshit to look weird

echo basalt
#

the first step is just extracting the resourcepack from the game

#

second step is opening all the folders

tall dragon
#

ctrl C + ctrl V is easier tho :(

desert musk
#

lol

echo basalt
#

you still have to parse stuff

#

all these items are namespacedkeys

craggy sapphire
#

can anyone

#

help me fix?

#

server wont start because of this

echo basalt
#

corrupted map most likely

noble lantern
#

^

craggy sapphire
#

no

#

my server is crashing

noble lantern
#

This is for Java development help, try #help-server like illusion said

echo basalt
#

I wonder

#

What is the most common usage for packets?

#

I'm thinking on writing an extensive packet tutorial and kinda need to know what are the most important packets to talk about

young knoll
#

Client side entities

noble lantern
#

I would say particles but that api got added to spigot a while ago

noble lantern
#

Client sided blocks too

echo basalt
noble lantern
#

Like Claims plugin

echo basalt
#

I've made client-side entities

echo basalt
noble lantern
#

Oh guess spigot api is evolving then

echo basalt
#

it was a client prediction

young knoll
#

sendBlockChange is old

echo basalt
#

true

noble lantern
#

Tf

young knoll
#

Like, 1.8 old

noble lantern
#

Alright then

#

Never done it myself always assumed it just used packets

echo basalt
#

I think the most repetitive code I've made and always hated

#

was writing a schematic -> clientside block parser

#

where stairs actually worked

#

client-side entities are fun because metadata packets are horribly designed

#

and I crashed my client enough times to know what to avoid

desert musk
#

do you have a guide that you can recommend?

noble lantern
#

Yeah naw that guide is dookie

#

One sec

echo basalt
#

just write your data to a byte[]

noble lantern
#

You can save and load json against Java classes

echo basalt
#

then write that into a file

noble lantern
#

Using serialization

echo basalt
#

then load it

#

and instead of having a neat human-readable file

#

you get an extremely small file that needs a hex editor to debug

desert musk
#

lol

young knoll
#

At that point why not just use sql

echo basalt
#

but hey you can turn millions of records into a 20kb file

desert musk
#

idfk i'm using this so i can store data for a custom structure i'm making in my plugin

echo basalt
#

proprietary it is

desert musk
#

trying to have a structure that's bound to an entity and stores ids of multiple users

echo basalt
#

What type of structure?

#

hmm

noble lantern
#

๐Ÿ‘Œ

desert musk
#

basically the plugin is making a custom entity that can hold multiple players' respawn points

#

it's less dumb than that

echo basalt
#

hmm

desert musk
#

but that's all you need to know

echo basalt
#

if you want absolute minimal file size

desert musk
noble lantern
#

Object serialization is as simple as you can get for raw json storage especially if your new to java

echo basalt
#

you can do it in about 17 bytes + 16 bytes / player

#

๐Ÿค”

desert musk
#

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

#

i just wanna know the best course of action

echo basalt
#

or just do it in YML as like

noble lantern
echo basalt
#
<id>:
  - id1
  - id2
desert musk
echo basalt
#

json is just yml but with braces

desert musk
#

really?

noble lantern
#

Json is faster than yaml

echo basalt
#

and faster to read because the braces are a guide

desert musk
#

so it's not uncommon practice to store stuff like this in yml?

desert musk
#

oh ok

#

sweet

noble lantern
#

You CAN use yml, but imo you shouldnt

desert musk
#

but i still wanna learn json storage

echo basalt
desert musk
#

yeah i figured alr

echo basalt
#

if you have a big yml file, and it's not being loaded async

#

your server might take minutes to start

noble lantern
#

^

desert musk
#

it's not big

#

it'd only be like at most 50 lines

noble lantern
#

By the sounds of hes not storing much data though

desert musk
#

yeah

echo basalt
#

which is why I go proprietary and make a 5kb file containing everyone's ip address and social security number

desert musk
#

i should still learn json storage though

#

i really don't like to do stuff like this non-canonically

noble lantern
#

So yml would be fine for him, but if your wanting to learn more use json/sql

desert musk
#

or traditionally rather

noble lantern
desert musk
#

how'd that message go unnoticed to me

noble lantern
#

PlayerJoinEvent#getSocialSecurityNumber()

desert musk
#

lol

echo basalt
#

an ip address is 4 bytes

noble lantern
#

Md_5 get to adding that method pls

echo basalt
#

it can be represented as an int

noble lantern
#

Typically with Java plugins theres no real need to shrink things down so far

#

Enterprise applications; sure yeah

#

But for player data files I wouldn't see a purpose

#

Even with 10k players joining if your just storing say stuff for your own vault economy I doubt you'd go over 100mb in storage

ivory sleet
#

I mean even enterprise sometimes uses cheap mock implementations such as just yml flat file to test a few things out

noble lantern
#

Hell, doubt it would even hit 50mb

noble lantern
echo basalt
#

given an SSN is restricted to 9 digits, and each digit has 10 combinations, I can probably assign a specific bit set and store an entire ssn in about 5 bytes

#

๐Ÿค”

noble lantern
#

๐Ÿ˜‚

#

Jkjk

ivory sleet
noble lantern
#

Please don't tell me it's chase

ivory sleet
#

Sorry to tell you

noble lantern
#

NOOOO

ivory sleet
#

Without fail itโ€™s what they use

#

Lol

noble lantern
#

๐Ÿ˜ข

#

God damnit

echo basalt
ivory sleet
#

Lol

echo basalt
#

I'd only be disgusted if it wasn't compressed

noble lantern
#

Twitch leaks but instead its chase leaks

ivory sleet
#

Well I heard it from a friendโ€™s dad, who is a Java fundamentalist, not sure if they still use that thing but yeah

noble lantern
#

im sure they are

ivory sleet
#

I think they compressed it

#

Not sure

noble lantern
#

"If it aint broke dont fix it"

ivory sleet
#

Lmao ye

echo basalt
#

then it's fine

#

bet they just sync it across all machines

#

and run a big if check

noble lantern
#

cpu usage go brrrrt

ivory sleet
#

Lmao bet

echo basalt
#

which is why ATMs take forever to read cards

desert musk
echo basalt
#

they can't afford the ram to cache the bank details or something

noble lantern
#

might have an example on one of my projects

desert musk
#

oo

noble lantern
#

use transient for variables you dont want written to a JSON object

desert musk
#

oh sick

ivory sleet
#

Interesting that you decided to go with a record class

noble lantern
#

wait wtf

#

just realized that

#

oohhh fuck

ivory sleet
#

Lol

noble lantern
#

mixed those 2 classes up

desert musk
#

lmfao

noble lantern
#

JsonDataFile should of been a record

#

smh

#

But, dont look at classes, just how the gson is actually used

I do reccomend you look into how all this works though, so you know how to write it yourself without needing an example

desert musk
#

yeah

#

for now i'll just use yml because i already have that in my project and people are waiting on me to release this to a server lol

noble lantern
#

i hope this is your own server and not someone hired you to do this lol

desert musk
#

my own lmao

noble lantern
#

okay good

desert musk
#

yes i'm get paid $800 to do this ๐Ÿ˜„

waxen plinth
#

brag

noble lantern
#

would be awkward if you got hired onto a server and said you knew how to do everything and got paid for it lmao

desert musk
#

hehehe

#

that would be funny

noble lantern
#

meanwhile, i offer servers free java development and get denied

desert musk
#

i wanna do that now

#

rip

#

maybe you can help develop my garbage

waxen plinth
#

maybe you need to be better at java

desert musk
#

but i feel like its my mess to sort

waxen plinth
#

go to java dot com to learn more java

#

level up your java skills

desert musk
#

lol

noble lantern
#

sorry im working with AE currently so that offers of the table

desert musk
#

nice

eternal night
#

java.com do be the best tutorial place out there

#

Nothing beats that ๐Ÿ™

noble lantern
waxen plinth
#

you know it

noble lantern
#

30/50 EXP for level 4

desert musk
#

lmao

noble lantern
#

codecademy ftw

#

cant remember if i used java.com when i first started learning

waxen plinth
#

there is no other way

noble lantern
#

wait thats just the site to download java LMFAO

#

dev.java

#

making my first class boys

#

ngl, totally forgot how to compile java without gradle/maven by now

echo basalt
#

I legit don't know what I'm doing wrong

#

fallingsand just seems to not want to have a UUID

#

"entity not found"

noble lantern
#

Does that setGravity turn it back to a solid block?

#

or still make it so you can pass through it

echo basalt
#

no

#

it makes a weird state where removing the block makes a ghost entity

#

but it's the best I got

#

and it still has gravity

#

I just honestly just set a counter-gravity speed every tick

noble lantern
#

weird, ive never really experimented with this so its odd you cant grab that entity by UUID, maybe @quaint mantle might have an idea about this

echo basalt
#

let's hope this works

desert musk
#

should I store a playerlist as a list of UUIDs? ๐Ÿค”

noble lantern
#

wait

echo basalt
#

that's not the fallingblock

#

that's just the regular block

noble lantern
#

Storing UUID's > Storing Player instances

desert musk
#

gucci

echo basalt
#

I don't think block data is mutable

#

might be wrong

noble lantern
#

best bet is to add debug logs after every line and figure out wheres it stops being an entity at

echo basalt
#

the entity just decides to not exist on the server

#

might be a hidden air fallingsand

#

because mutability

noble lantern
#

Have you checked if its an entity right after you spawnFallingBlock?

echo basalt
#

yeah it is an entity

#

I did some checks prior

#

calling getEntity on that tick works

noble lantern
#

and next tick it just decides it doesnt wanna be an entity anymore?

echo basalt
#

pretty much yeah

noble lantern
#

javadocs arent very helpfull on that class either :/

desert musk
#

is there anything wrong with this yet?

#

from the looks of it?

noble lantern
#

This is only for falling sand

#

but

#

might be useful

noble lantern
west oxide
#

hey so am getting this issue

noble lantern
#

IMO you should be creating a new yml file for each player

desert musk
noble lantern
#

instead of one large data file for all players

#

make the name of the file the players UUID

desert musk
noble lantern
#

and store data accordingly

desert musk
#

lemme see if i can find my thought process

west oxide
# west oxide hey so am getting this issue

and this is my code where the line of code with error is


        Inventory inventory = Bukkit.createInventory(
                null,
                45,
                "Server Selector:"
        );

        for (String server : servers.getKeys(true) ){

            ConfigurationSection serverSection = servers.getConfigurationSection(server);
            Bukkit.getLogger().info("start of section");
            Bukkit.getLogger().info(serverSection.toString());
            Bukkit.getLogger().info("end of section");

            inventory.setItem(serverSection.getInt("position"), getServerItem(server) );

        }

        return inventory;
    }```
hexed hatch
#

@echo basalt doubt this is what's causing your issue, but I do know falling blocks have weird properties with proximity to other blocks that can be fixed by changing a certain field on the falling block entity

echo basalt
#

probably the cause

#

I'm considering just making it client-side

hexed hatch
#

let me check real quick

echo basalt
#

but that's a whole other pain in the ass

west oxide
desert musk
hexed hatch
#

Time
The number of ticks the entity has existed. If set to 0, the moment it ticks to 1, it will vanish if the block at its location has a different ID than the entity's TileID. If the block at its location has the same ID as its TileID when Time ticks from 0 to 1, the block will instead be deleted, and the entity will continue to fall, having overwritten it. When Time goes above 600, or above 100 while the block is below Y=0, the entity is deleted.
Try modifying the time field, make it a high negative value perhaps

desert musk
#

i suppose that's why i'm doing it this way?

#

imma find my actual notebook

#

brb

west oxide
noble lantern
# west oxide okay thank you

For one your shouldnt be calling ConfigurationSection#toString(), thats kind of pointless

Whats the yaml file look like?

hexed hatch
#

It's resting time value may be 0 which is why it might be fizzling out of existence

#

I'd try setting it to -32768

echo basalt
#

Integer.MIN_VALUE it is

#

well shi

noble lantern
#

And just like each data file with a next ID

west oxide
echo basalt
#

structure is not that good

west oxide
#

what about it

desert musk
noble lantern
# west oxide what about it

How are you getting servers

And yes you should store those in likely seperate files in a servers directory

echo basalt
#

sand seems to actually float now

west oxide
echo basalt
#

still has the wrong uuid

noble lantern
west oxide
#

oh

#

i fixed it

desert musk
#

never worked wish hashmaps before but sounds promising

west oxide
#

it was just the true thing

echo basalt
#

Welp

#

I think I found a horrible solution

#

spawn the falling block on the player's eye view

#

then re-assign its uuid whenever it's not matching

noble lantern
desert musk
#

explain the benefits of doing it this way

noble lantern
#

Its simpler, but not how you should do data storage

#

Having alllll your data in one file is just generally bad practice

#

Imagine a bank, storing every single users data in one file

#

Im sure you can see the issues that arrise

desert musk
#

right

noble lantern
#

Look at how Essentials stores its users data

#

and from there, it then stores any information it needs about the user

#

ohh nooooo my ip address uwu

desert musk
#

lol

#

i mean this makes this certainly more daunting

echo basalt
desert musk
#

because a Nest is a whole structure on its own

desert musk
#

has its own properties

noble lantern
echo basalt
#

idk why

#

only fallingblocks suffer

desert musk
#

maybe I can let you scrutinize over my semi-updated notion page for this specific project

#

but maybe that's too much

west oxide
desert musk
#

lol

#

omw to ddos 127.0.0.1

hexed hatch
#

It might be easier to throw that sucker on top of an invisible armor stand

#

and just move the armor stand around

echo basalt
#

the armorstand's hitbox doesn't really match

hexed hatch
#

and when you "throw" it, just unalive the armor stand and apply velocity to it

#

I'm just saying use the armor stand for when it's in gravity gun mode, not in motion

echo basalt
#

but I see how that can work

#

how would I make a full block on an armorstand tho

hexed hatch
#

No no

#

Like

#

Put the falling block entity on the armor stand

#

as a passenger

echo basalt
#

hm okay

#

baby armorstand I see

hexed hatch
#

invisible and marker

#

well, marker is actually all you need

#

it removes it's hitbox and rendering entirely

#

I can't say I'm sure how well falling block entities play as passengers though

noble lantern
#

Thats what the article i linked said :((

hexed hatch
#

seems promising

echo basalt
#

the fallingblock is detatching

river oracle
#

just gonna ignore those buildings are better than anything I could ever even think of building

echo basalt
#

the marker tracks my cursor perfectly

#

the fallingsand does not

noble lantern
echo basalt
#

I think I just wasted hours on something extremely stupid

#

It might be that I'm running 2 clicks (1 for each hand) and it breaks stuff

#

lmao time to ctrl + Z for an hour

noble lantern
#

imagine it didnt store your undo history far enough

echo basalt
#

there's a limit

noble lantern
#

are you saying that as a statement or question

echo basalt
#

statement

noble lantern
#

ah xD

desert musk
#

oop

echo basalt
#

it's 2am and I wasted like 2 hours of my life trying to make throwable blocks

noble lantern
#

any programming after 12am typically doesnt go very well

#

unless your used to staying up till 5am xD

echo basalt
#

it got to the point where I'd wake up at 10pm, so I'd be in the depressing late-night coding environment 24/7

desert musk
#

jesus

#

programmers are animals

#

lol

echo basalt
#

huh what the fuck

noble lantern
echo basalt
#

if I don't set a passenger

#

it works

#

if I set

#

it doesn't

#

well I'm an idiot

#

trying to teleport entities with passengers

hexed hatch
#

Just a private smp which I lazily use as a testbed for plugins sometimes

#

Over 75% of the island is artificial and the basement system spreads like tumors

hexed hatch
echo basalt
#

I'm using a marker ye

hexed hatch
#

but it uses even less server resources and has no appearance whatsoever

#

Not a marker armor stand

echo basalt
#

hm

hexed hatch
#

a completely separate entity called a marker

echo basalt
hexed hatch
#

oh

#

so you are

#

weird that the armor stand is showing up for a split second

#

Wait, is the marker just a variant of an armor stand?

#

Have I been lied to?

echo basalt
#

not really

#

it's kinda a separate entity

#

but also a metadata of the armorstand

#

kinda weird

#

anyways it's like 3am

hexed hatch
#

in that video you posted, were you using an armor stand or a marker at the time?

#

I'm just trying to wrap my head around why one is visible for a split second

low temple
#

Is there an event for entity generation? Like item frames in the end naturally generating?

noble lantern
noble lantern
#

if block == that block

noble lantern
#

ChunkLoadEvent

#

check if chunk is new

#

And then check blocks in ChunkSnapshot (Saves resources) going from highest Y value down (Since end cities always generate in higher elevation rather than lower ones)

#

@low temple

#

if the block you run into is endstone, dont keep checking lower y values (save more resources of looping)

#

be careful with this event

echo basalt
#

Chunksnapshots are nice because you can check them async

noble lantern
#

^^^^^

#

almost forgot about that ty for reminding

low temple
#

Hmm okay, Iโ€™ll do some testing with it

#

Thank you for the help!

hexed hatch
#

chunk snapshot won't do you too much good I don't think

#

You're going to want to look for the item frame entity to identify it instead of looking for a specific block arrangement

#

that's the most performant solution I'd say

#

Chunk#getEntities perhaps?

#

Maybe look in to ChunkPopulateEvent and see if item frames on end ships are present on that event

noble lantern
hexed hatch
#

Item frame isn't a block

#

it's an entity

#

therefore iterating through blocks looking item frame will return nothing

noble lantern
#

Fair enough, kind of just assumed it would trigger some type of material match in there

It could trigger EntitySpawnEvent but not sure

#

And check if the spawn reason was of a natural cause

hexed hatch
#

I don't think I had much luck with that last time I attempted but I may very well be wrong

noble lantern
#

If a entity is already present in the world, i would hope it wouldn't call EntitySpawnEvent again ๐Ÿ˜…

#

If so thats definatly a bug

hexed hatch
#

well he's looking for entity generation, an event to get entities that spawn alongside chunks

#

but idk how spigot works with that lol

#

I imagine chunkpopulateevent will do but who knows

#

spigot is spigot

noble lantern
#

Yep EntitySpawnEvent/CreatureSpawnEvent won't work

#

Chunk_gen deprecated big sad

#

ChunkPopulateEvent it is

#

@low temple ^

#

Read up a lil bit

low temple
#

Will do thanks

glass mauve
#

how can I check if two players are the same?
With .equals or ==?

grizzled pollen
glass mauve
#

ok thanks, I think == is enough bc Player has no own implementation of .equals I think

grizzled pollen
#

well... I usually used getUniqueId for this

#

I don't think that == will work here

glass mauve
#

yea thats much safer

grizzled pollen
#

just check uuids

glass mauve
#

yea ty

low temple
#

event.getChunk().getEntities().length always returns 0

chrome beacon
#

Entities are loaded after the chunks

#

They have their own load event

low temple
#

Ah okay

maiden thicket
#

how would i check if an offline player has a permission

tardy delta
#

Vault has an API for that

maiden thicket
#

can i put * for the world?

tardy delta
#

A world or a world name?

maiden thicket
#

oh nvm it supports a null value

#

world name

#

haha

tardy delta
#

You need to provide a valid one i guess

#

Oh

#

Idk

summer scroll
#

How can I prevent player in spectator gamemode entering mob view?

glass mauve
#

maybe PlayerInteractAtEntityEvent

maiden thicket
#

is it possible to add libraries to the library loader on runtime

rotund pond
# grizzled pollen I don't think that == will work here

I think it would work.
If your store a player in cache, you can use ==:

  • If you check the player 1 and the player 2, both players have a different instance and so a different location in memory
  • if you check player 1 and player 1, that's the same instance and so the same location in memory.

I think you should use == btw, because you don't have to get the player UUID and your code will be faster. (Mainly if it's often called)

tardy delta
#

It checks for the unique id and the entity id

rotund pond
#

Ah, so it's just safer

glass mauve
tardy delta
#

Doesnt matter

glossy venture
#

can you apply a @SuppressWarnings to your whole project?

#

oh wait can i add a compiler flag for that

quiet ice
maiden thicket
#

xd

maiden thicket
#

i was told library loader violates maven central tos or smthn

#

?

quiet ice
#

I have heard it too

#

Whether that is really true I cannot verify

glass mauve
#

How can I set the bottom right item in an player inventory?

summer scroll
glass mauve
#

hm let me check

glossy venture
#

and use that with ```java
player.getInventory().setItem(index /* 8 in this case */, item)

glass mauve
#

thanks

glass mauve
glass mauve
earnest forum
#

no

#

whole inventory

summer scroll
glass mauve
#

but then index 8 should be wrong

earnest forum
#

is it 8?

#

yeah that's what I'm saying

#

it starts from the top

glossy venture
#

oh

earnest forum
#

so it would be 35

glossy venture
#

well then 35

glass mauve
#

yea thats what I thought

glass mauve
#

Ok and how can I check at an event that it is this particular item and not the vanilla version. For example, I give the player a stick while joining, how can I check that it is also this stick and not a vanilla. With ItemMeta?

summer scroll
glass mauve
#

ok thanks, how can I use pdc?

summer scroll
#

?pdc

glass mauve
#

ty

buoyant viper
#

@maiden thicket @quiet ice i have 80% certainty the library loader doesnt not violate mvn central ToS

buoyant viper
#

the one in spigot for plugins

noble lantern
buoyant viper
#

the libraries: [] u specify in plugin.yml

#

it uses eclipse aether to traverse repos and resolve deps which if maven didnt like, im sure they wouldve contact eclipse over

noble lantern
#

No that shouldnt violate anything on maven as long as you arent shipping any additional jars in it that shouldnt be allow (IE, premium resources, things like the MC server jar)

#

If that wasnt allowed, you basically wouldnt be allowed to have an ClassLoader classes in your project

buoyant viper
noble lantern
#

i wonder what they consider mass downloading

buoyant viper
#

Attempting to download all or large portions of Central (a.k.a., scraping or mirroring any content) Excessive consumption of artifacts or metadata Excessive requests or bandwidth

noble lantern
#

And you dont do any of that?

buoyant viper
#

not personally, no

noble lantern
#

So then you should be fine

modern valley
#

I want to have a custom texture on my custom item, how can I do this?

quasi flint
#

resourcepack

modern valley
glass mauve
#

which is the correct event for player right click?

noble lantern
#

A integer

#

one sec

modern valley
#

can you give me a example?

noble lantern
#

there is a guide for this on spigot

noble lantern
#

and check if ClickAction is RIGHT_CLICK

glass mauve
#

ok ty

quasi flint
modern valley
#

ok

quasi flint
#

but here

#

because i have fun for it

noble lantern
#

theres a video tutorial somewhere i used a few years back but dont remembe the exact video

quasi flint
#

resourcepack still needed tho

noble lantern
#

yep

quasi flint
#

no serverside only way here

noble lantern
#

well, it technically could be server sided if you set the resource pack in server.properties

Or send the resource pack to the client via code

modern valley
#

ok tysm

quasi flint
#

yea but thr client still has to do smth

noble lantern
#

all the client would have to do is click a button

#

"Yes accept this pack"

quasi flint
#

which is not 100% serverside

#

but ig it works

noble lantern
#

server sided in the sense that the player doesnt need to manually download anything

#

now for armor models though

#

that needs to be done on the client side, as you need optifine to render those in

quasi flint
#

most servers just go with normal armor

#

hypogxel etc

modern valley
#

but if i give my custom item model data 12345, then how do I define this in the resource pack?

glass mauve
#

what is the best way to store information for each player, that will not reset

crimson terrace
#

making a .txt or yml file for each player imo

#

depends on what information and how much information it is

#

if its for a very small server storing it in the config file is viable too

rough drift
#

no

#

don't store in the config

#

comments will get reset

#

and options as well

marble granite
#

Hey so, if i make a custom entity by extending lets say the zombie class, i assume it wont be custom upon restart, how would i handle restarts with custom entities?

chrome beacon
#

On chunk unload remove and save your entities somewhere. On chunk load spawn them again

#

That's the easiest way

marble granite
#

ahh

#

alright thanks, thats what came to my mind aswell, but maybe there was another way. guess not

#

thanks!

chrome beacon
#

There are other ways it's just that they are harder to implement

#

Anyways you can use pdc to store your entities

#

?pdc

grim ice
#

if its too big

#

a yml file for each player

grim ice
#

you would need to parse the text file yourself

crimson terrace
#

its easy if you know what youre doing

#

and as I said, depends on what data you want to store

#

if you wanna store something like a set of strings or ints you could just write them all with a / in between and then get the string and split it up at the /

modern valley
#

how do I use apply custom texture to my custom item using customDataModel?

craggy cosmosBOT
#

:dynoError: The Fun module is disabled in this server.

west oxide
#

hey

grim ice
#

dont

#

thats the worst advice

#

youre reinventing the wheel

#
  • its not gonna be as good as whats included with spigot
#

txt for key value data storing is shit

#

dont follow that advice

eternal night
#

Well you need a resource pack that matches the material and custom data model

#

And then you can just just that number on an items item meta

noble lantern
modern valley
noble lantern
#

As in

#

CustomItems the plugin??

modern valley
noble lantern
#

ohh

#

This is help for Java related questions

#

Ask about textures in theyre discord

modern valley
sharp flare
#

can setLore and getLore be done async or its just not thread safe

noble lantern
modern valley
noble lantern
noble lantern
#

So that article will work fine

modern valley
#

I did everything but it didn't work

noble lantern
#

CustomItems are vanilla items just with spedical PDT/NBT tags that make them function as other things, and have theyre MetaData changed to have a different CustomModelData

#

So that article should work just fine and just use getMetaData().setCustomModelData(int)

modern valley
#

ohk tysm ๐Ÿ˜„

#

In the json file of resource pack, do I have to use the ItemStack name or the set display name of the item?

halcyon mica
#

So here's a puzzle

#

I have several marker armorstands

#

Which use nametags to form a image

#

How would I verify and do something if the player is looking at those nametags

#

My first though was a custom AABB, but how would one consistently raycast for a hit to those without murdering the tickrate

hybrid spoke
halcyon mica
#

No, hence why I'd need some sort of custom collision

#

The idea is to raycast to the custom colission on left/right click and process from there

eternal night
#

Ray hitbox intersection is relatively cheap iirc

#

You can also do some very basic range check using distanceSquared

#

Iirc the spigot BB has a raytrace method already

#

Like, your raytrace becomes cheap because you don't actually have to run an in world raytrace that includes blocks and entities etc until your initial plain ray from player head only against your inflated BB of the armourstand group lands

#

(if you even need an in world ray)

noble lantern
#

Hey, what version was this method deprecated in would anyone know by chance?

#

ah in 1.13, nvm

onyx wasp
#

What software do you think I should use on a 1.16.5 server?

tender shard
#

that version is over a year old

onyx wasp
tender shard
#

just use paper

halcyon mica
#

Is there a way to get the width of a nametag in world coordinates?

tender shard
onyx wasp
#

but I can't find 1.16.5 papaer software

tender shard
halcyon mica
tender shard
halcyon mica
#

We're assuming default resourcepack here

onyx wasp
tender shard
onyx wasp
tender shard
onyx wasp
tender shard
tender shard
#

I just got sent this log:

[14:31:39] [Server thread/INFO]: [AngelChest] [DEBUG] * PLAYER INVENTORY CONTENTS END
[14:31:39] [Server thread/INFO]: [AngelChest] [DEBUG] *********************************
[14:31:39] [Server thread/ERROR]: Could not pass event PlayerDeathEvent to AngelChest v7.3.0
java.lang.NullPointerException: null
[14:31:39] [Server thread/INFO]: GaetanoXD fell out of the world
[14:31:39] [Server thread/INFO]: [GaetanoXD: Killed GaetanoXD]
#

does someone know why the full error message isn't shown?

#

they use pufferfish as server software

#

does anyone know if there's some setting that suppresses the full stacktrace?

tall dragon
#

hmm

#

you might wanna ask them

#

they have a discord.

#

on their github

#

they do also have this on their github Sentry Integration Easily track all errors coming from your server in excruciating detail

#

tho idk what that means.

tender shard
#

hmmm

young shell
#

Is Location#equals() the recommended way to compare Locations?

tall dragon
#

yea. that should be fine

#

but depending on your needs it might be different what u want.

#

because that will test an exact match. while you might want to test wether or not its the same block location.

sonic cosmos
#

hi, i have problem with Tntprimed because it doesnt destroy obsidian

#

code;

#
TNTPrimed tntPrimed = player.getWorld().spawn(
                    new Location(player.getWorld(), location.getX(), location.getY() + 1, location.getZ()), TNTPrimed.class);

            tntPrimed.setVelocity(location.getDirection().multiply(ConfigLoader.velocity));
            tntPrimed.setFuseTicks(ConfigLoader.fuseTick);
eternal night
#

Tnt doesn't break obsidian?

sonic cosmos
#

yes

eternal night
#

What's your issue

#

That is plain vanilla behaviour

sonic cosmos
#

no

eternal night
#

Yes

sonic cosmos
#

tnt destroys obsidian

eternal night
#

Wait is it first of April

#

Hmmm

#

No not yet for me at least

#

Smh bad joke XD

sonic cosmos
#

wait, i must check it XD

tall dragon
#

u cant blow obsidian with tnt

#

by default at least

sonic cosmos
#

a

#

so how i can break obsidian with tnt?

eternal night
#

Ya can't

#

You'd have to manually try to find obsidian blocks when the entity explode event triggers

sonic cosmos
#

a to chuj za duzo pierdolenia sie

#

translate

eternal night
#

Nah, this isn't worth it

tall dragon
#

so its pretty weird on the wiki obsidian's blast resistance is set to 1200

#

as opposed to the 3.6 million from something like barrier.

tender shard
sonic cosmos
#

I'm an idiot and I thought it destroys

quaint mantle
#

yea thing is my shitty school only has delphi courses and i had to learn java from w3schools and google

tender shard
#

wtf

#

they still teach delphi? ๐Ÿ˜„

quaint mantle
#

yea

tender shard
#

RIP

quaint mantle
#

shit school in a shit country

tender shard
#

delphi was already dead when I started coding like 20 years ago lol

quaint mantle
#

yep

tall dragon
quaint mantle
grim ice
#

Cool

#

@quaint mantle where do u live btw

halcyon mica
#

Is there a non-axis aligned bounding box in bukkit?

eternal oxide
#

no

#

hit boxes only, but not in bukkit

halcyon mica
#

Guess I'll have to make my own then

solemn crown
#

hello, im currently looking for a way to set my players in spectator for a specific amount of time and then back to survival when the times up after death, ideally only for one of the worlds tho, i couldn't find any plugin that would fit my need? do you guys know a plugin that can help me with that?

elfin atlas
#

Is there a way to check if a player is holding a item with a specific custom name?

hybrid spoke
elfin atlas
#

And detect if he is not holding anymore?

quaint mantle
solemn crown
#

i was also thinking someone would like to code that?

elfin atlas
hybrid spoke
elfin atlas
desert tinsel
#

I have that code:

@EventHandler
public void InventoryClick(InventoryClickEvent e){
        Player p = (Player) e.getWhoClicked();
        if (e.getView().getTitle().equals(p.getInventory().getItemInMainHand().getItemMeta().getDisplayName())){
            String name = p.getInventory().getItemInMainHand().getItemMeta().getDisplayName();
            switch (e.getCurrentItem().getType()){
                case GRASS_BLOCK:
                    plugin.getConfig().set(name+".spawn", p.getLocation());
                    p.sendMessage("Ai setat spawn");
                    plugin.saveConfig();
                    break;```
and I get an error: ``Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because the return value of "org.bukkit.event.inventory.InventoryClickEvent.getCurrentItem()" is null``. Why?
hybrid spoke
#

probably clicked an empty slot

desert tinsel
#

not

tender shard
desert tinsel
#

why

granite owl
#

how can i get a player whos offline in a non deprecated way

#

by name*

tender shard
granite owl
#

xD

#

frl?

tender shard
#

yes

#

it's only deprecated because players can change their name

granite owl
#

iknow

tender shard
#

you can also loop over Bukkit.getOfflinePlayers

#

but it's not better in any way

hybrid spoke
#

doesn't Bukkit#getOfflinePlayer already does that?

tender shard
granite owl
#

so just getofflineplayer

tender shard
#

yes

hybrid spoke
granite owl
#

condition check it vs null

hybrid spoke
#

well

granite owl
#

and then process

#

xD

#

i mean

hybrid spoke
granite owl
#

hasplayedbefore

#

is a member of offlineplayer tho

#

then ill use that

#

i mean who targets players by their uuid?

#

makes sense server internally, but not for a user

clear raptor
#

Hi! Am I able to persist NBT data for item placed into armorstand? (head)

#

I have custom PLAYER_HEAD with custom NBT data, but they get lost when I put head into armorstand

grim ice
#

if the player hasnt logged in before

#

it will send a request to mojang servers

#

wont it

visual tide
#

yes

#

on the main thread :cringe:

tender shard
#

well

#

only getOfflinePlayer(name) does a web request

#

and also only if the player never joined before

#

so yeah better loop over Bukkit.getOfflinePlayers

#

getOfflinePlayer(String) should ONLY be used if you are sure the player joined before

eternal oxide
#

unless you have a user which has 20k accounts, which is a pain.

granite owl
#

tried to reverse the code ive been given before

#

this loops the array and returns the first result if there is one?

#
Arrays.stream(Bukkit.getOfflinePlayers()).map(OfflinePlayer::getUniqueId).findFirst();
#

returning the first uuid instance?

hardy swan
granite owl
#

how do i safely check this for being null

#
Optional<Player> pTemp = Arrays.stream(Bukkit.getOfflinePlayers()).map(OfflinePlayer::getPlayer).findFirst();
hardy swan
#

wdym safely check

granite owl
#

only found get() as member

#

if i want the Player p = pTemp.get();

hardy swan
#

Optional is supposed to be safe

granite owl
#

and pTemp is null

#

it throws an exception

hardy swan
#

whatchu wanna do

granite owl
#

i wanna get a player like this

#
public static Player getPlayer(String player)
        {
            Player p = Bukkit.getPlayer(player);
            
            if (p == null)
            {
                Optional<Player> pTemp = Arrays.stream(Bukkit.getOfflinePlayers()).map(OfflinePlayer::getPlayer).findFirst();
                
                if (pTemp.get != null)
                {
                    
                }
            }
        }
hardy swan
#

if you intend to do sth directly after, you can do ifPresent(Consumer<OfflinePlayer>)

#

If you intend to pass on a nullable

desert musk
#

?pastebin

hardy swan
#

you can do orElse(null)

granite owl
#

i wanna get a player regardless of if hes online or not, as long as he has been playing before

#

and write myself a standardtized method for it

#

which is not deprecated

hardy swan
#

like I said, Optional is meant for null safety

desert musk
granite owl
#

it still threw a nullptr expection

hardy swan
#

read what I wrote

tall dragon
tender shard
#
  1. fields should have lowerCaseNames
  2. methods should also have lowerCaseNames
desert musk
#

didn't mean to use that emoji but here we are

tender shard
#

also why are you setting only default values in a method that clearly is not supposed to only set default values? what is that code supposed to do at all?

tender shard
desert musk
#

๐Ÿคทโ€โ™‚๏ธ how do i not set default values

#

lmao

tender shard
desert musk
#

i don't see any addValues() method tho

#

how do i do that without setting defaults

desert musk
#

also i see some logical errors in my code

#

some stupid things

tender shard
#

I don't understand the purpose of that whole class in the first place tbh

granite owl
#

isnt there an indexed way to do it?

#

like if i iterate too many players it can get laggy doesnt it?

night copper
#

How can I make an NPC spawn naturally and rarely in the world, like zombies but only once (they can't respawn in the biome, or 100 block radius) and I want them to spawn in a group of 4-5

desert musk
tall dragon
# granite owl hm

your current way it always loops all entries then picks the first one it finds. while with a normal loop you can break the loop as soon as you find one.

granite owl
#

hm

#

so just

tender shard
desert musk
granite owl
#

for (OfflinePlayer p : Bukkit.getOfflinePlayers()) i guess

tender shard
desert musk
#

๐Ÿ‘Œ

tender shard
#

instead of addDefault(name, value)

tall dragon
onyx wasp
#

Is there a 1.16.5 bungeecord, I couldn't find it, could you please post it?

desert musk
hardy swan
desert musk
#

how do you iterate through entries of nests?