#help-development

1 messages · Page 995 of 1

storm crystal
#

Unlike you people I got help from other surfaces are actually nice, willing to provide concrete answers and sometimes explain things from basics

tender shard
#

I got like 826 haters on this server but dusk at least hasnt made a homophobic statement about me yet, so that's an absolute win

storm crystal
sullen belfry
#

how would i make a class be enabled on the OnEnable Listener?

i've been able to make make a GUI open when i have it on the main class but not when i have it in its own class how can i make it so it can be accessed via another class.

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

storm crystal
kind hatch
tender shard
storm crystal
#

So riddle me this, why no one Ive met except for this place is so butthurt about it

tender shard
#

must

#

not

#

make

#

pun

#

about

#

butthurt

storm crystal
#

Otherwise stop complaining about it

unkempt peak
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

storm crystal
buoyant viper
slender elbow
storm crystal
#

Its not my problem

kind hatch
#

But it is

tender shard
slender elbow
#

it does seem like it is your problem given you are here

#

... complaining

kind hatch
#

You don't understand the difference between the two

storm crystal
#

I am satisfied with my knowledge

slender elbow
#

clearly

storm crystal
#

Rest is maths and spigot quirks

kind hatch
tender shard
#

If I would complain, I would do so by pinging choco or md or sth. Simply saying that you're reluctant to learn is not complaining, it's just a fact

storm crystal
tender shard
#

"uhuhuhuhu nobody helps me here, how do I get nearby entities? Oh I won't look at that link mfnalex sent for World#getNearbyEntities because mfnalex sent it" <-- that is complaining

kind hatch
#

It's really just childish

storm crystal
#

Cool

tender shard
storm crystal
#

You wouldnt commit so deeply into it if you werent hurt by it

tender shard
# storm crystal Cool

however finding it "cool" that you think your "insults" are actually "hurting people" is some sign of mental disease

elder dune
#

?code

buoyant viper
#

?paste ?

undone axleBOT
tender shard
#

then tomorrow I'll wake up and he'll make me breakfast, then I'll go to work where I make more per hour than you in a week, because you're probably 13. And you will then still be here, trying to argue with people lmao

#

brb having a smoke

storm crystal
#

Ad hominem and irrelevant information to make urself feel better about urself

#

Classic from you, I havent seen it today yet

tender shard
#

ad hominem is also the only latin phrase you know right? You've used it 4 times already and none of the times did you use it correctly

storm crystal
storm crystal
#

Not ego inflated, not childish

#

Lmao

tender shard
sullen belfry
buoyant viper
#

oh, i wonder if i completely misunderstood what u asked LOL

storm crystal
tender shard
#

my boyfriend cooks bacon better than your non-existant SO

kind hatch
buoyant viper
#

significant other

tender shard
#

siginifant other

#

like, relationship partner

#

boy/girlfriend

storm crystal
#

What does it have to do with anything

sullen belfry
storm crystal
#

Blud claims one to be childish and then takes 3rd party people who arent even here to compare them

#

Okay

sullen belfry
slender elbow
#

so true bestie

kind hatch
broken nacelle
sullen belfry
#

this is development help not relationship help

broken nacelle
#

so you just put new stats_gui(this)

tender shard
# storm crystal Not ego inflated, not childish

you know what? I do indeed think that I'm better than you. Because I'm not acting like a stupid bully here for 3 full hours now. But you do you. And don't worry, I also once was a stupid jerk but then I got older and learnt from mistakes and meanwhile I think, that I'm at least a half-way decent person. Now see you later, I'll go have a smoke, bb

buoyant viper
sullen belfry
broken nacelle
storm crystal
#

Who am I bullying now

tender shard
#

me

storm crystal
#

From what Ive seen you and your friends take turns on me

broken nacelle
tender shard
storm crystal
#

You arent obligated to help

kind hatch
#

I need nitro.

kind hatch
#

I have better reactions that I can't use.

sullen belfry
tender shard
broken nacelle
sullen belfry
#

it is...

#

tf?

kind hatch
sullen belfry
#

the argument

broken nacelle
tender shard
storm crystal
#

But you keep doing that and get offended that I dont bow down to you after you give me help

tender shard
#

I'd opt for @worldly ingot to simply timeout @storm crystal . If you want, time me out too, because I too participated in this shit show a bit too much in the last 5 minutes

kind hatch
#

Your Main class is the argument you need to pass in

broken nacelle
#

this.getServer().getPluginManager().registerEvents(this, new stats_gui(// requires an argument \\)); was supposed to this.getServer().getPluginManager().registerEvents(new stats_gui(this), this);

kind hatch
#

The this keyword should rectify that

sullen belfry
#

Plugin no workie please help.

sullen belfry
#

^^^^ join please

kind hatch
#

Also gotta follow the correct parameter order.

#

:p

sullen belfry
tender shard
#

if you're bored @storm crystal we can still continue to talk in DMs lmao

kind hatch
#

Or, you could look at the BTGUI thread and tell me if I'm dumb

quaint mantle
#

@tender shard @storm crystal Flexing their yapping levels

tender shard
broken nacelle
#

bro's

#

thats a minecraft plugin server

#

lmao

tender shard
#

this is spigot, my friend

storm crystal
#

It is indeed 3:25 am

sullen belfry
#

?paste

undone axleBOT
broken nacelle
buoyant viper
#

that was my fault for what i told them

tender shard
#

ok guys, @kind hatch @remote swallow and idk who else had blocked @storm crystal , just a tiny heads up for everyone:

Dusk and me talked with DM, we were both a bit too snappy especially at the end and apologized to each other. I explained to him how this channel works and that when you ask questions and someone gives you an unsatisfying reply, it's better to say "sorry, I don't understand, can you please gimme a concrete code example" instead of just "yeah no!!!1".

I'd urge everyone to give @storm crystal a second chance, he promised to be less snappy and try to ask more concrete questions. How does this sound to everyone? Can we turn this into a happy ending pls? :3

kind hatch
#

The Good Ending

river oracle
#

The good ending??

worthy yarrow
glad prawn
#

Maybe a good ending

tender shard
river oracle
#

We need a new troll

#

Something refreshing

tender shard
#

hmmm I can try to troll

river oracle
#

But we all know the u u it's too late

tender shard
worthy yarrow
#

God I hope, I need to make some more medicine drink but I forgot the recipe!

tender shard
river oracle
tender shard
#

sadge

tender shard
worthy yarrow
#

Yeah but I need the 66% recipe as well

tender shard
#

"yeah I will PR soon"

#

"yeah I'll do it tomorrow"

#

"bla bla basics bla bla"

worthy yarrow
tender shard
kind hatch
worthy yarrow
#

Hmm

river oracle
#

Got busy sorry

tender shard
#

talking about basics - 701 commits and I bet 695 of those are mine -.- COMMUNITY PROJECT we wanted to call it guys, cmon 🥲

worthy yarrow
#

Community helped… for 6 commits

tender shard
worthy yarrow
#

I mean

tender shard
#

it's written in kotlin but modules can also be written in java.

it also uses its own command parsing system with its own kotlin DSL to parse arguments and stuff 100% automativally - for example, look at modules/tp

river oracle
#

Its time

river oracle
#

Alex...

#

It's time

tender shard
#

it is time for you to PULL REQUEST

river oracle
#

May is national basics month

tender shard
#

yes

river oracle
#

@remote swallow may is national basics month

tender shard
#

and as said: modules can also be written in java! (for all the kotlin haters)

river oracle
#

He's an enjoyer now

tender shard
#

that's great!

#

but tbh I'm really proud of basics, it started out so quickly and became so big within no time, but then unfortunately it died very quickly

#

also @rotund ravine

#

may is basics month

river oracle
#

I miss Jan🚚

worthy yarrow
#
public void applyWinterEffects(Player player) {
        if (playerToggleVisuals.contains(player)) {
            return;
        }
        winterTask = new BukkitRunnable() {
            @Override
            public void run() {
                if (player.getWorld().hasStorm()){
                    setWorldStormFalse(player);
                }
                if (isPlayerInWater(player)){
                    return;
                }
                spawnRandomizedParticles(player, SeasonsList.Seasons.WINTER.getParticleEffect());
            }
        }.runTaskTimerAsynchronously(NormalSeasons.getPlugin(NormalSeasons.class), 0, 10);

...

public void cancelAndRemoveTasks(){
        if (winterTask != null) {
            winterTask.cancel();
            winterTask = null;
        }...```
Is this appropriate?
worthy yarrow
#

Shit

#

my bad

river oracle
#

@staff

worthy yarrow
#

no pls no ban hammer

tender shard
#

@ adele

worthy yarrow
#

That's nsfw

tender shard
#

you know what's really nsfw?

#

choco's onlyfans

river oracle
worthy yarrow
#

Bet it's jam packed with hypixel secrets

river oracle
#

Yeah chocos only fans

tender shard
tender shard
worthy yarrow
#

Oh boy

tender shard
#

there is a reason why I got 2 accounts lmao

worthy yarrow
river oracle
tender shard
worthy yarrow
river oracle
#

I drink a ton of water

worthy yarrow
river oracle
#

I get dehydrated easily

tender shard
river oracle
#

I forgot it lol

worthy yarrow
# worthy yarrow Cuz I've got like 6 dif runnables in here lol

sorry 5*

public void cancelAndRemoveTasks(){
        if (winterTask != null) {
            winterTask.cancel();
            winterTask = null;
        }
        if (springTask != null) {
            springTask.cancel();
            springTask = null;
        }
        if (autumnTask != null){
            autumnTask.cancel();
            autumnTask = null;
        }
        if (randomParticleTask != null){
            randomParticleTask.cancel();
            randomParticleTask = null;
        }
        if (randomAutumnParticleTask != null){
            randomAutumnParticleTask.cancel();
            randomAutumnParticleTask = null;
        }
    }```
tender shard
worthy yarrow
#

Well

tender shard
#

or a Map<SeasonType,BukkitTask>

worthy yarrow
#

The tasks are gonna get split up into different levels of effects eg: light, mid, heavy. That being said there will be like 3 tasks per season

tender shard
#

tl;dr your current way is fine but not great in terms of OOP

glad prawn
#

well youll need a better design

worthy yarrow
river oracle
#

You'll get it eventually

tender shard
#

my best advice is: create a class for (literally almost) everything

worthy yarrow
#

Oh snap

river oracle
#

I still remember the day OOP clicked

tender shard
#

Have a SeasonType class, can be enum WINTER, SPRING, AUTUMN, SUMMER, RANDOM

#

then have a another enum for HEAVY_MID_LIGHT

worthy yarrow
tender shard
#

then have only exactly one class that extends Runnable (or BukkitRunnable?) that takes in the appropriate winter,spring,... and HEAVY, MID, LIGHT stuff and then does stuff accordingly

worthy yarrow
#

That class is in the middle of a structure redesign so dont hate

tender shard
#

alternatively make an interface WeatherRunnable and then you can have one WinterWeatherRunnable that extends WeatherRunnable, whatever

river oracle
tender shard
#

then you keep track of all of them in a Map so you can get rid of that "spaghetti" code

worthy yarrow
tender shard
#

tl;dr you can never have enough classes. only too many instances

river oracle
tender shard
worthy yarrow
#

We used to drink java, and now these damn kids are writing with it

river oracle
#

She died young

#

Oh the sorrow

tender shard
#

oh sry I read grandma

river oracle
tender shard
#

I GOT PERSONELL FOR THAT

worthy yarrow
river oracle
worthy yarrow
#

Also is it odd practice to encapsulate the enum as I'm doing?

worthy yarrow
#

Rather than just having the enum class, I put the enum in a class

river oracle
#

Enums trash use registry so plebs can register their own seasons /s

tender shard
#

imho switching over enums is rarely a good idea

river oracle
#

Like what else are you doing

tender shard
river oracle
#

If the object is just a Wrapper for the enum value get rid of it

worthy yarrow
#

hmm

#

I wanna put the repo up here but idk if you guys are that interested

#

It's more of a performance dilemma currently

river oracle
#

I can't look in bed

worthy yarrow
#

Imagine no git mobile

#

^ y2k

tender shard
worthy yarrow
#

Jim carrey man cmon

tender shard
#

THAT is jim carrey?! ok I would have recognized it in better quality maybe

worthy yarrow
tender shard
#

yeah anyway - anyone who does not contribute to Basics in may is a La-who-za-her too

worthy yarrow
#

Are you trying to say that you want me to contribute

#

Me and everyone else who hasn't

#

Because sir, I find that extremely offensive!

worthy yarrow
karmic sapphire
#

I feel like I made it a lot farther this time with compiling ImageFrames thankfully, I got all the dependencies compiled, or so I thought. Do I have to download anything for " net.minecraft.world" and etc import stuff? Like a jar

kind hatch
#

No, you just need to run BuildTools for whatever version you are writing for.

karmic sapphire
#

Oh

simple oracle
#

Does anyone have any experience with reading data from jigsaw blocks?
I can access the orientation of the block (which is in documentation).
But I can't seem to find a way to get the data that the block itself contains.
Target Pool, Target Name, Turns into, etc.

karmic sapphire
simple oracle
#

This is the data I am trying to access from spigot

kind hatch
karmic sapphire
# kind hatch The only one that may apply to you is the remapped option.

Thanks Shadow! I did had one last question. I didn't make this ImageFrame Plugin, so how would I know what version it is made for when it is has multiversion support? Would it normally be the latest. Would I just buildtool remap every version it supports? I am sure it is obvous, but it isn't clicking in my head.

noble cove
#

how do I make a fish appear and bite the player's bobber

#

like in vanilla minecraft

worthy yarrow
#

First you cast the rod then wait for a fish to bite 😛

kind hatch
karmic sapphire
kind hatch
#

Only for anything above 1.17

#

1.16 and below didn’t have mappings

#

So the option won’t really do anything

karmic sapphire
kind hatch
#

Nope, all you really need to do is just select the version and press compile.

eternal oxide
#

pretty sure it doesn;t use remapped

karmic sapphire
#

Oh ok, I have been spending the last hour compiling remaps lol

#

ree

eternal oxide
#

yeah they use the CraftBukkit dependency for nms

karmic sapphire
#

Oh ok. I downloaded all the craftbukkit's though

#

So shouldn't I be good?

eternal oxide
#

yes, if you install them to maven as you did the others

karmic sapphire
#

Ah ok

eternal oxide
#

?bt for me

undone axleBOT
karmic sapphire
#

Yea I used that

#

I can upload my commits, if it will help ( :

#

day 2 struggle

eternal oxide
#

did you install CB to the correct place? it goes under org.bukkit

karmic sapphire
#

Yes I beleive I did

#

Are you able to join vc?

eternal oxide
#

I may one sec

#

mic is probably off

karmic sapphire
#

oh ok

#

< 3

shadow night
#

Idk my friend sent that screenshot

proper cosmos
#

How can I get PersistentDataContainer from Block?

inner mulch
#

there is none, only in blockentities

proper cosmos
inner mulch
#

some1 made one tho :)

#

just google custom block data

#

then you find mfnalex

proper cosmos
#

Okey, thanks...

daring lark
pseudo hazel
#

wdym no

daring lark
#

give me a sec

eternal oxide
#

which 1.20.x requires java 21

pseudo hazel
#

for spigot iirc 1.20.4

#

there was a discussion about it yesterday

daring lark
#

i mean you can set persistent data on block withour nbt containers

pseudo hazel
#

how

daring lark
#

#setMetadata

#

on block

pseudo hazel
#

that changes the block though doesnt it

#

what pram does it take

eternal oxide
#

we can no longer build 1.20.5? it seems to build 1.20.6

pseudo hazel
#

idk

daring lark
pseudo hazel
#

there is no reason to use 1.20.5 though

daring lark
#

it worked for me and doesn't change block

eternal oxide
daring lark
#

i mean it changes block some way but if you would do this using nbt it would still change the block

pseudo hazel
#

did anything change between .5 and .6 in nms then?

eternal oxide
#

probably not

chrome beacon
#

1.20.6 just fixes a singoe bug

#

That being data loss with llamas

prisma relic
#

how do i move a display entity in a straight line. why there no helpful documentation or tutorial anywhere 😭

eternal oxide
#

They are fairly new so no tutorials

inner mulch
#

how does moving them in a straight line not work?

pseudo hazel
#

what have you tried?

prisma relic
#

ItemDisplay displayItem = player.getWorld().spawn(player.getLocation(), ItemDisplay.class);
final Vector direction = player.getEyeLocation().getDirection().clone().multiply(0.5d);

displayItem.setItemStack(/* sets to whatever itemstack instance here */);
Vector3f translation = new Vector3f(
        (float) direction.getX(),
        (float) direction.getY(),
        (float) direction.getZ());
Transformation transformation = new Transformation(
        translation,
        displayItem.getTransformation().getLeftRotation(),
        displayItem.getTransformation().getScale(),
        displayItem.getTransformation().getRightRotation());

displayItem.setInterpolationDuration(20);
displayItem.setInterpolationDelay(0);
displayItem.setTransformation(transformation);
#

no move

#

)):

ivory sleet
pseudo hazel
#

but why doesnt this work though

prisma relic
#

sits there does nothing

pseudo hazel
#

right I was just asking conclube

#

like the passenger method works, but im wondering why this doesnt

prisma relic
#

his solution is a little silly ngl

ivory sleet
#

like after all its a linear transformation

#

or am I wrong?

pseudo hazel
#

well its a transformation

#

so changing the transformation suggests that its moving

ivory sleet
#

a linear one

pseudo hazel
#

there is no set position

#

or well

#

i guess there is since its an entiry

ivory sleet
#

yes but these kinds of homomorphisms map 0 to 0 always right

pseudo hazel
#

im not sure

ivory sleet
#

me neither

pseudo hazel
#

imo if something has a translation of 1,0,0 it would be in a different place compared to 2,0,0

mortal hare
#

damn my school in the recent statistics was rated 42th worst school in my country

#

thank god i've finished it already 😄

#

im surprised how i did survived in there because it was really bad, but i didn't realised how bad it was

#

now im in 3rd best university in my country 😄

prisma relic
# ivory sleet me neither

so mojang added an entity that isn't capable of moving smoothly in a straight line with the tools provided

ivory sleet
#

idk

#

like I was just speculating

#

i havent touched display entities at all

#

but I know someone who has

#

@young knoll

worthy yarrow
ivory sleet
worthy yarrow
#

Sounds like a personal issue man D:

pseudo hazel
#

Id like to work with them but I gotta fix all the other shit first

young knoll
#

You can teleport them along a path

#

Just set their teleport delay to something non 0 so it gets interpolated

pseudo hazel
#

is that heavy on performance?

#

also I have a question regarding displays

#

they are server side right? but is there a way to only create a display so a single player can see them?

#

preferably without nms

young knoll
#

setVisibleByDefault and Player#showEntity

pseudo hazel
#

oh awesome

#

thanks

#

ah and also is it possible to show models of entities?

#

or is it limited to text mobs and items?

young knoll
#

Text, blocks, and items

eternal oxide
#

if you want an Entity you turn off AI and spawn

pseudo hazel
#

right I guess that would be the same thing haha

#

and can you also transform them like displays?

eternal oxide
#

no

#

thats specific to Displays

pseudo hazel
#

is there any way to scale them

#

i saw some vids but i dont remember if thats spigot or mods

young knoll
#

Yes

#

1.20.5 has a scale attribute

pseudo hazel
#

oh so its super new

#

I see

#

time to drop all my other supported versions 🙂

#

even with a resource pack its probably not possible to combine multiple textures in a single slot of an inventory right?

cinder abyss
#

Hello, how can I remove the color of a player in tab when he's in a team with color?

pseudo hazel
#

i dont wanna make an infinite omount of variations

cinder abyss
cinder abyss
#

It will still change the glow color based on the team color?

warm mica
#

It should

cinder abyss
#

okay let's try and SEEE

eternal oxide
sand spire
#
@EventHandler
    public void onSprint(PlayerToggleSprintEvent event) {
        if (event.isSprinting()) {
            event.setCancelled(true);
            event.getPlayer().setSprinting(false);
        }
    }```
Anyone knows why this doesn't work and what I can do to prevent a player from sprinting?
prisma relic
young knoll
#

Shouldn't be

#

Just make sure the delay between teleports matches the teleport delay

prisma relic
#

ItemDisplay ID = player.getWorld().spawn(player.getLocation(), ItemDisplay.class);
ID.setItemStack(/* Generate ItemStack here for display */);
ID.setInterpolationDelay(1); // ?

final Vector directionThing = player.getEyeLocation().getDirection().clone().multiply(0.25d);
Bukkit.getScheduler().runTaskTimer(getPluginInstance(), () -> {

    Location currentPos = ID.getLocation().clone();
    currentPos.add(directionThing.clone());
    ID.teleport(currentPos.clone());

}, 0L, 0L);
grim hound
#

how did I make the server crash

#

when it was perfectly runnable

prisma relic
frail pilot
blazing ocean
frail pilot
#

But you can make it translate with a transformation

grim hound
#

since I change internal thingies it could've broken that

grim hound
stoic tapir
#

OOG WAY?

#

MASTER

prisma relic
frail pilot
#

Well

young knoll
#

Yes but no

#

Translation can offset it, but if you translate it too far it won't render anymore

prisma relic
young knoll
#

Still not unlimited

frail pilot
#

If you teleport it like every two seconds or something during the process it will changes its coords and render correctly ? (Guessing)

young knoll
#

Eventually the chunk will unload

#

But if you don't need to go that far you're fine

pseudo hazel
#

with a custom font, is it possible to perfectly add an offset that has like a size of 0 so subsequent characters will overlap each other perfectly?

prisma relic
prisma relic
#

the funny solution to making display entities move on a vector smoothly


ItemDisplay ID = player.getWorld().spawn(player.getLocation(), ItemDisplay.class);
ID.setItemStack(/* Generate ItemStack here for display */);

ID.setTeleportDuration(1); // important! making this not = 0 will interpolate the displays movement when its position updates

final Vector directionThing = player.getEyeLocation().getDirection().clone().multiply(0.25d);
Bukkit.getScheduler().runTaskTimer(getPluginInstance(), () -> {

    Location currentPos = ID.getLocation().clone();
    currentPos.add(directionThing.clone());
    ID.teleport(currentPos.clone());

}, 0L, 0L);
#

^ if anyone ever needs that in the future (which they probably will there r 0 guides on this stuff)

#

ty @young knoll n @frail pilot n @pseudo hazel for u responses

grim hound
#

How can I change the number of online players the server replies with?

river oracle
#

ServerStatus packet

#

Idk what it's called but it's something along those lines

grim hound
#

but since I'm using PE

#

I don't have a need for the nms packets

river oracle
#

I can't provide support for bedrock

blazing ocean
river oracle
#

Ah

grim hound
river oracle
#

I thought PocketEdition

blazing ocean
grim hound
#

o

#

I guess I can parse this into json?

slender elbow
#

it hasn't been called pocketedition in a million years lol

river oracle
grim hound
#

wait

#

bedrock is pocket edition?

slender elbow
#

PE turned into bedrock

blazing ocean
#

because it only has the motd

grim hound
slender elbow
#

no

#

the status json contains the whole response, not just the motd

grim hound
wraith dragon
#

I havent heard someone say MCPE in a long long time

slender elbow
#

that packet only contains the motd it seems

grim hound
slender elbow
#

yes

#

it's a big json

#

but it isn't just the motd component

grim hound
grim hound
slender elbow
#

yes

#

which is not just the motd component

grim hound
slender elbow
#

1.7 or so iirc

vague topaz
#

I'm trying to change villager profession using GUI, everything was looking fine until I tried changing profession of villager, that never had the profession(it visually tries to change, but cancels it).

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event){
        if(event.getClickedInventory().getHolder() instanceof VillagerProfessionInventory inventory){
            event.setCancelled(true);
            List<MerchantRecipe> backup = inventory.getVillager().getRecipes();
            inventory.getVillager().setProfession(Villager.Profession.valueOf(VillagerProfessionInventory.PROFESSIONS_ID.get(event.getSlot()).toUpperCase()));
            //PROFESSIONS_ID is List.of("none","farmer","shepherd","fisherman","fletcher","librarian","cartographer","cleric","weaponsmith","toolsmith","armorer","mason","butcher","leatherworker","nitwit");
            inventory.getVillager().setRecipes(backup);
        }
    }

Console doesn't give any error/warning

chrome beacon
#

Can't have profession without somewhere to work

#

That will cause it to reset

vague topaz
#

Oh.. But it won't reset if villager already sold something, right?

#

If so, can I do it using code?

#

Looks like I found way: set villager expirience to at least 1

grim hound
#

YO HOW DID I MAKE THE SERVER CRASH EACH TIME I QUIT

icy beacon
#

lmfao

#

nice job

hushed spindle
#

what does one do against this

#

on 1.20.6 it cant access particle any more

#

previous versions are fine

remote swallow
#

its still public

icy beacon
remote swallow
#

nah

river oracle
#

A lot of names were synced with mojang names

hushed spindle
#

i mean the Particle enum entirely

#

i dont mean the entries in it

river oracle
#

It's still there

slender elbow
#

they're*

river oracle
slender elbow
#

yep

young knoll
#

thare*

hushed spindle
#

but i still cant access it so how do i use it lol

#

them'st'd've're

river oracle
#

Tell intellij to shape up

#

Get it's head in the game

hushed spindle
#

ight will do

#

gonna beat the shit out of my pc

slender elbow
hushed spindle
#

like father taught me

river oracle
hushed spindle
#

'tis*

river oracle
#

Dude idfk

#

English can go fuck itself

#

Literally the worst

slender elbow
#

i don't think it can do that

hushed spindle
#

krill issue

icy beacon
river oracle
icy beacon
#

лох

river oracle
#

Rocks

hushed spindle
#

yeah i still dont know, invalidated caches and stuff too

river oracle
#

Try destroying your .m2 for it

#

Force intellij to re-download it

hushed spindle
#

yeah it literally just doesnt appear to exist with this dependency

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.20.6-R0.1-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
eternal night
#

Are you using java 17

hushed spindle
#

21

grim hound
#

md5

#

help

grim hound
icy beacon
grim hound
#

fine

#

I replace the List of EntityPlayers as well as the Map by name and Map by uuid with my own

#

which do not add the EntityPlayer if he isn't logged in

grim hound
# grim hound

and I also replace the HandlerList of the events shown here

grim hound
#

and are only invoked after he logs in

#

like this

#

and if I remember correctly the server didn't mind

#

like everything worked great

grim hound
grim hound
#

like it stops responding

#

even tho the main thread is stated as RUNNABLE

#

...and it only occurs after reloads

#

what the hell

#

I do return the original server setup after my onDisable is called tho

#

and it stopped crashing

#

wait, it's so weird, it only crashes after an error occurs when I try to login in with a command

tardy delta
#

alix?

grim hound
wraith dagger
#

hi guys

#

how to spawn a beacon beam at location?

chrome beacon
#

You place a beacon

hushed spindle
#

think you gotta use nms for that

wraith dagger
#

i searched on google and they said it client-side only and server-side cannot modiflied

hushed spindle
#

to make a fake beam

chrome beacon
#

No you just need to place a beacon

wraith dagger
chrome beacon
#

A valid beacon will spawn the beam

wraith dagger
#

i want spawn "beam" not player place it norrmally

worldly ingot
#

Yeah you can't do that without a beacon unfortunately

chrome beacon
#

^^

worldly ingot
#

It can be a fake beacon with #sendBlockChange(), but there has to be a beacon on the client somewhere

hushed spindle
#

weird how it works like that

wraith dagger
#

nah why minecraft can't made a beam packet brrrr

#

they just limit them self

worldly ingot
#

They just don't need to :p

hushed spindle
#

im gonna ask again because i dont know how to deal with this but spigot 1.20.6 doesn't seem to include the Particle enum and i cant tell if this is an error or intentional

#

lower version dependencies work fine

remote swallow
#

invalidate caches

hushed spindle
#

already deleted 1.20.6 from my .m2 and had it reinstall, invalidated caches and restarted, stuff like that

#

using java 21

remote swallow
#

block_crack was removed

hushed spindle
#

right ill get to that until after i get my classes imported lol

wraith dagger
remote swallow
#

probably

worldly ingot
#

It's just "BLOCK" now I believe

remote swallow
hushed spindle
#

invalidated again, no result

remote swallow
#

use Particle.BLOCK

hushed spindle
remote swallow
#

see if you can manually write the import

hushed spindle
#

cant use a method of something that doesn't exist

#

i did, no result

#

"Cannot resolve symbol org.bukkit.Particle"

#

isn't just Particle btw but also Material so theres something wrong with the import as a whole

remote swallow
#

?paste ur build file

undone axleBOT
icy beacon
#

Take a look at your External Libraries, dig into the Spigot dependency and see if stuff is there

hushed spindle
#

sorry which is my build file again

icy beacon
hushed spindle
#

i have a multi module project so if more is needed lmk

#

this is just the module in which the dependency isn't working properly

brazen condor
#

How to open a smithing table for a player and put items inside?

hushed spindle
#

the iml of the module wasn't added to git, adding it fixed the issue

#

why the iml needs to be added to git i dont know though

#

and BLOCK_CRACK wasn't replaced i guess

remote swallow
#

rerun buildtools, block crack doesnt exist anymore

hushed spindle
#

wack

remote swallow
#

nah

hushed spindle
#

wack as in i did that twice now and it aint doing it lol

hushed spindle
#

yeah nevermind it was just pretending to be fixed

#

fuckin intellij giving me hope

inner mulch
#

im pretty sure ive seen it

frail pilot
young knoll
#

You can also just teleport it farther with a higher teleport duration

chrome beacon
#

in the ground somewhere

rotund spoke
#

i have a problem this Line here
switch (event.getCurrentItem().getItemMeta().getLocalizedName()) {
returns the DisplayName not the localized name with Spigot 1.20.4-R0.1-SNAPSHOT
pls Ping

vague topaz
#

Trying to cast Inventory i get from InventoryClickEvent#getInventory() to AnvilInventory gives me this error:
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryCustom cannot be cast to class org.bukkit.inventory.AnvilInventory (org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryCustom and org.bukkit.inventory.AnvilInventory are in unnamed module of loader java.net.URLClassLoader @45fe3ee3)

I'm 100% sure this inventory is anvil, here is full code: ```java
@EventHandler
public void onTextConfirm(InventoryClickEvent event){
if(event.getClickedInventory()==null) return;
if(!(event.getClickedInventory().getHolder() instanceof TextGUI)) return;
AnvilInventory inventory = (AnvilInventory) event.getInventory();
event.setCancelled(true);
if(event.getSlot()!=2) return;
String text = inventory.getRenameText();
Bukkit.getLogger().info(text);
}

hushed spindle
inner mulch
#

?gui

frail pilot
vague topaz
inner mulch
#

no how you are creating the inv

vague topaz
#
public void build(){
    inventory = Bukkit.createInventory(this, InventoryType.ANVIL, Component.text(title));
    inventory.setItem(0, ItemBuilder.buildItem(Material.NAME_TAG, Component.empty()));
}
chrome beacon
#

Not using Spigot API

chrome beacon
inner mulch
#

does some1 know how many bytes the average item has?

broken nacelle
#

ops

#

i think is better you use if(event.getInventory() == anvilinventory) {

stark onyx
#

This is probably a stupid question but when i try to use Version "1.20.6-R0.1-SNAPSHOT" in my code i loose some bukkit imports like Material. Does anyone know how i can fix that?

eternal night
#

update intellij

broken nacelle
#
@EventHandler
    public void onTextConfirm(InventoryClickEvent event){
        if (event.getClickedInventory() == null) return;
        if (!(event.getClickedInventory().getHolder() instanceof TextGUI)) return;
        if (event.getInventory().getType() == InventoryType.ANVIL) {
            AnvilInventory inventory = (AnvilInventory) event.getInventory();
            event.setCancelled(true);
            if (event.getSlot() != 2) return;
            String text = inventory.getRenameText();
            Bukkit.getLogger().info(text);
        }
    }
young knoll
#

oof holders

quaint mantle
#

Hello, I have a question, using the plugin messaging in Bungee and Paper with a channel to send messages or commands, is it possible to execute a command on the paper/spigot server and have it executed on the BungeeCord? by connecting channels?

broken nacelle
#

yes, i think

quaint mantle
#

I mean

#

I already have the 2 plugins

#

and its function, at least for my needs, is that

#

stores the status data that changes with a command in the bungee that has permissions, etc.

#

/rstatus <server> - does not need another argument as it is like a bool on and off

#

type /rstatus Bedwars (On) - /rstatus Bedwars (Off)

#

but what I want to do is

#

because that /rstatus command is only from the bungee, it does not exist on the paper server

#

I need the command to exist on the paper server and communicate with bungee and change the value and send that information again to the same paper plugin

#

I don't know if I understand myself

broken nacelle
#

but why?

river oracle
#

why anything

#

why go on living, why code at all?

fierce swan
#

Did you ever figure this out? I'm having the same issue rn

glad prawn
quaint mantle
stark onyx
fringe yew
#

I have a java file, and if I use Example file = new Example() a lot in my code to create an instance of that class so I can use it in another file, is that going to use a lot of memory?

#

and if so, is there any alternative to just creating a new instance in every single file

chrome beacon
#

You can pass the instance around

#

and how much memory it takes depends on the class

#

but probably not that much

pseudo hazel
#

you cant use anvil inventories to get a name without nms

#

and if you do find a way, please let me know haha

nova quail
#

How can I do a timer? I need to create a timer that will write on hologram how much time left to the end of the auction. I can't do it with bukkit runnable because after server restart the timer will also restart. How can I do it?

valid burrow
#

and when it enables again

#

make a new runnable using that data

pseudo hazel
#

you could still use a timer and then just take the system time to keep track of the time remaining

valid burrow
#

u shouldnt use timers in bukkit

pseudo hazel
#

but either way you have to save some time, be it the tome left or the time you started counting, because else there is no way

nova quail
valid burrow
#

we have runnables

nova quail
#

and in real life time has gone far away from that

valid burrow
#

theeen

#

save a real life time

pseudo hazel
#

yes thats what im saying

#

save the moment in real life time that the timer has started

valid burrow
#

when u create ur action calculate time the action ends

#

and then always refer to that time

pseudo hazel
#

then you know from any point how much time is left

#

yes or that

#

doesnt really matter which way

nova quail
#

oh i understand

#

thanks i'll try

valid burrow
#

should probably save both either way it’s usefull data depending on what kind of auctions you are making

pseudo hazel
#

yeah I guess

#

like either save how long it should take or save both end and start time

charred blaze
#

hey

#

when i give item to dead player (player who is on respawn screen) whenever they respawn they do not have that item

#

how do i solve this?

chrome beacon
#

wait for them to respawn

stoic parrot
#

How can I teleport a player after death & remove the respawn screen?

pseudo hazel
#

probably cancel the death event maybe?

stoic parrot
#

Cancel? I can make the player teleport to spawn after death but, the respawn screen is just there. Even if you click respawn it won't work.

pseudo hazel
#

yeah cancel

#

so they dont die

#

and wont see the screen

#

im not sure if thats possible

#

the player might get stuck

stoic parrot
#

What if it's a player kill? then the kill won't be counted.

pseudo hazel
#

then count it yourself

#

depending on how you keep track that doesnt have to be a problem

stoic parrot
#

I think

#

I can use the scheduler to delay the teleport to actually count the kill

#

and then

#

use player.spigot().respawn();

worthy yarrow
#

If there is a playerDeathEvent (I don’t remember if there is or not) it should hopefully be cancelable so you don’t have to do this

#

Cancel the event -> when this occurs, you know that would have resulted in a kill so mark that as a kill -> do whatever with the fact you’ve cached a kill

dawn flower
#

when i do hideEntity and the player unloads the chunk then reloads it, does the entity reappear

worthy yarrow
#

I think that’s a ?tas

#

Sounds like a client sided method

#

So maybe?

dawn flower
#

?

#

wdym client sided method, it's in spigot

worthy yarrow
brave canyon
#

Yo im new to forge. I just installed it today and I have an eclipse workspace with code for mods im designing using java import net.minecraftforge.fml.common.Mod; When I load Mincraft with forge and choose mods in the game menu can I just add my workspace directory in my mods ? will that just work? also does spigot have something similar to this java imprt for forge?

dawn flower
#

yll get more support in Forge dc

worthy yarrow
brave canyon
#

im so lost man

worthy yarrow
#

Otherwise people will just

#

?whereami

dawn flower
worthy yarrow
#

Yes?

#

He will get better support there because everyone here will just where am I

stoic parrot
#

Now it works perfectly as it should

dawn flower
worthy yarrow
#

Well there ya go

dawn flower
#

not sure how that happened

#

but if it works it works

worthy yarrow
young knoll
#

It's implemented in a spigot patch

#

Not in bukkit

dawn flower
#

ah

#

what happens if its called on an alive player tho...

stoic parrot
worthy yarrow
#

I thought you were tracking like kills lol not just removing the respawn prompt

dawn flower
#

can u unload all loaded chunks in all worlds

worthy yarrow
#

Probably but why

stoic parrot
# worthy yarrow I thought you were tracking like kills lol not just removing the respawn prompt

I meant like I had to add delay the teleport task or the player would get teleported instantly & the kill won't be counted. (In the PAPI placeholder)

    public void onPlayerDeath(PlayerDeathEvent e) {

        Bukkit.getScheduler().scheduleSyncDelayedTask((XStreamSpawn)this.plugin, () -> {
            Player player = e.getEntity();
            player.spigot().respawn();
            player.sendMessage(util.getPrefix()  + " " + util.getDeathMessage());
            new Methods(plugin).teleportPlayer(player);
        },1L);
    }
worthy yarrow
stoic parrot
#

lol, you just confused me too

#

lmfao

#

anyways, it's fixed so yeh

worthy yarrow
#

Well cuz if you don’t actually need to anything with the fact the player has been killed or a player killed something, then you could just do the death event, cancel it, and move on. Seems a bit easier than adding a delayed task

#

Ie: player dies -> you teleport them somewhere could be easily handled with the event

#

But hey if it ain’t broke don’t fix it

stoic parrot
#

I was about to say that

worthy yarrow
#

Haha no worries, just keep in mind for next time. Always try to find the least complex & expensive way to get your function working

golden ember
#

.

#

I just have one plugin and I don't know how to optimize it

worthy yarrow
#

Well some code would be cool

golden ember
#

[45.025s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.026s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.027s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.027s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.029s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.030s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.030s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.032s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.041s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.045s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.045s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
[45.046s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.

worthy yarrow
#

Do us a favor and put that into a

#

?paste

undone axleBOT
golden ember
#

it just creates an awful lot of threads

worthy yarrow
#

Yeah and based off that, you're not handling cleanup properly or somehow trying to create 3 tasks a second

#

The threading however,

#

We need some code to help with that

golden ember
worthy yarrow
#

Uh idk how tf you bombed your mem that hard but lets see the plugin code

golden ember
eternal oxide
#

not your plugin then?

worthy yarrow
#

It's not your plugin?

#

Uh

#

Welp you just might be shit outa luck then

eternal oxide
#

multiple threads in a item plugin?

golden ember
eternal oxide
#

many many threads

worthy yarrow
#

yeah good thing there are only 3 threads trying to create a second

golden ember
#

creates quite a few objects for the crops and custom food when loading them from the config

eternal oxide
#

pointless threading that

golden ember
#

what

eternal oxide
#

there is no point in creating multiple threads just to create items

#

ONE thread at most

golden ember
#

oh

#

Does anyone know how to fix it though ?

worthy yarrow
#

Uh

#

rewrite it

eternal oxide
#

Yes, ask the dev who wrote it to fix it

worthy yarrow
#

^ or try that but most cases you're not gonna get ahold of them

worthy yarrow
golden ember
#

but I wrote to him and he said he would try to optimize it...

worthy yarrow
#

Well look at that you found a decent guy

worthy yarrow
eternal oxide
#

btw its not encrypted. Source is on Github

worthy yarrow
#

breh

golden ember
#

its a private plugin

golden ember
#

nah not this plugin bro

#

its a custom plugin

eternal oxide
#

its teh package in your error log

#

if you were charged for it, you didn't get it from the spigot site

golden ember
#

it's caused by the plugin because I turned on the plugin and everything went fine but when I turned it on it started to crash

eternal oxide
#

Its not an encrypted paid plugin

golden ember
#

nah dont wory be happy uwu

eternal oxide
#

The back end is paid for, the plugin is free

golden ember
#

bro name the plugin its godcore

eternal oxide
#

there is no mention of godcore in any of yoru log

golden ember
#

I just disabled godcore and left everything else running and when I turned on godcore it started crashing

tardy delta
#

they explcitely using pthread or thats an os error?

eternal oxide
#

no clue, its taken ages just to find out what plugin he has issues with

tardy delta
#

EAGAIN, the best one hehe

#

dude created too much threads or smth

golden ember
eternal oxide
#

possible, or somethign else stackoverflowed adn caused everything to blow up

#

can't create anything if you are out of memory

tardy delta
#

stackoverflow killing a native thread lol

golden ember
#

max threads on the hosting 512

tardy delta
#

good enough

golden ember
#

on vps server its just fine everithing

#

all load

tardy delta
golden ember
#

linux

clear elm
#

does the permission get created?
if (p.hasPermission("hxmes.home.14")){}

eternal oxide
#

created?

clear elm
#

yea

eternal oxide
#

created?

clear elm
#

like if i enter an permission in plugin.yml

eternal oxide
#

Not understanding your question

clear elm
#

if i do .haspermission can i give the permission in luck perms

eternal oxide
#

no

clear elm
#

how can i do it

eternal oxide
#

LP will only recognise registered permissions

#

add it to your plugin.yml

clear elm
#

and how can i register it

#

permissions:
home.1:
like this?

eternal oxide
young knoll
#

You can still add it

#

LP just won't have tab complete for it

chrome beacon
#

I believe you can create a permission object too

#

Luckperms should be able to detect that

#

though ideally you'd use the plugin.yml

solemn juniper
#

Hi I am trying to log back into my spigot account. I have been locked out because I lost access to my verification device

chrome beacon
white root
#

Is there a way to get the drops from a Material?
e.g. given a Material, is there a way to get what would be yielded if a player had broken a Block of that type?

alpine urchin
white root
# alpine urchin Why do you want to get it from a material? Is Using BlockBreakEvent#getDrops not...

I'm making a plugin that makes trees fall when you break any block of them so I'm setting all of the blocks of the tree that you are hitting to air and spawning a falling block for each block from the tree

Then in the entityChangeBlock event (where the falling block lands) I cancel the event and call world.dropNaturally for each block landing

The problem is that the leaves drop the leave blocks themselves cause currently I just use the blockdata from the falling block to decide what to drop

Which is why I was wondering if you can get a Material's drops were that Material a Block broken by a player

young knoll
#

use the block data?

#

Oh block data doesn't have any methods for that

#

wack

alpine urchin
white root
#

I could just use (the kotlin equivalent of) a switch statement and manually assign each Material a drop, but if there is a built in method to find it somehow I want to use that since idrk what percentage chance there is to get a sapling or an apple etc

alpine urchin
#

since your starting point is a block anyway

elder dune
#

Looking for some help

How would I make so a block(Sign) spwans in the different side
of a chest if their is another block blocking it from spawning

because right now when the sign spwans on the chest and if their
is a block in its way it just deletes the block.

eternal oxide
#

check teh block where you are going to spawn

#

make sure its air

stray lodge
#

How do ifix this?

#

been trying for hours

icy beacon
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

icy beacon
#

Are you by chance sending a TextComponent message to a player/console with commandSender.sendMessage(component.toString()) instead of commandSender.spigot().sendMessage(component)?

eternal oxide
#

does chat even support components in 1.8?

icy beacon
#

Honestly no idea

#

It should

eternal oxide
#

I don;t remember when they switched

icy beacon
#

E.g. clickable and hoverable messages have been a thing for a looong while

eternal oxide
#

1.8 is a long time ago too 🙂

icy beacon
#

I can recall using them in 1.8

#

So yeah they should be a thing

eternal oxide
#

okies

icy beacon
#

?1.8

undone axleBOT
icy beacon
#

Damn.

stray lodge
#

It happens when I try to teleport to a world. Instantly crashes the server, when I try to regenerate the world file by deleting the current one, logging on crashes the server lol

eternal oxide
#

still no code

#

we can't help you with no code

#

@stray lodge ^

stray lodge
#

Im looking into it. It doesnt give me a crash report, but a ton of info in the console, it will take me a second to recreate the issue.

eternal oxide
#

Clearly you are not writing code so you are in the wrong channel. You want #help-server .

stray lodge
#

thx

torn shuttle
#

if someone knows transformation matrices and quaternion math and can help me fix this I will unironically pay you cash, I am beyond done with this

elder dune
#

?paste

undone axleBOT
elder dune
eternal oxide
#

it would be simplest to just put the sign on top of the chest

#

player is two blocks high so you know its going to fit

tardy delta
#

thats some crazy duplication

nova notch
young knoll
#

Uhh

#

I'd have to check how mine handles it

trail coral
#

how do i get all nearby blocks of one type? like all sponge blocks in a 15 block radius, but they have to be the highest block at that cord

#

like a list of them

sullen marlin
#

Sounds like a job for a for loop

#

Can you be more specific about which part you're having trouble with?

#

What code have you written so far to try and do this?

quiet ice
#

highest block at that cord - with that you mean like height-map highest or?

valid burrow
#

first get all highest blocks

#

then check if they are sponge

#

done

solemn juniper
quiet ice
eternal oxide
#

too many hacked accounts distributing trojans

trail coral
#

to loop thru blocks i need to first have a list of@blocks

#

idk how to get the list of blocks

valid burrow
#

get all blocks in the radius

#

its math

#

nothing more

#

u only need x and z cords

#

u dont need all blocks

#

since u only have to test the highest block

#

get a map of all

#

what ever you wanna call them

#

locations

#

and then get the highest block on each location

trail coral
#

how do i check a blocks material?

#

also isnt the highestblock always air?

blazing ocean
trail coral
#

how do i spawn structures? like i have these "spawner blocks" that are basically where trees go in my map. so im detecting all the spawner blocks, and i want to spawn trees on top of them

#

I know how to set blocks or something but what about structures

#

like keep a hashmap of all the blocks and their locations?

blazing ocean
#

structure manager or something

#

for nbts

trail coral
#

elaborate

blazing ocean
#

Bukkit#getServer#getStructureManager

#

if you're using structure block structures

trail coral
valid burrow
#

SCHEMATICS EG

#

caps lcked

elder dune
#

?paste

undone axleBOT
elder dune
#

Im going to go mad trying to figure this out

Im trying to make it so if the user has more than 27 items in their invin it spawns 2 chest
if less than 27 it spwans 1 chest the with players item in it

Iv tried doing it in a else statement tired doing it in two different IF statement
iv tried creating the chest twice in the else statement and IF statement

but I seem to only be able to get one chest so spwan with half the users items in it

Code: https://paste.md-5.net/ojitiqocam.cs

anyone got any idea please would appreciate the help

vast ledge
#

hm

vast ledge
#
int actualSize;
for (int i = 0; i < p.getInventory().getSize(); i++) {
  if(p.getInventor().getItem(i) != null) actualSize++;
}

if(actualSize > 27) {
  //Code Here
} else {
  //Code Here
}
vast ledge
valid burrow
#

not sure i thought it returns all itemstacks

#

i dont think getContent returns empty slots

vast ledge
valid burrow
#

mhm

tender shard
young knoll
#

It does

valid burrow
#

ah damn

young knoll
#

Otherwise setContents would be kinda weird

valid burrow
#

true

vast ledge
#

true

valid burrow
vast ledge
#

Why is there a demon cat staring at me

remote swallow
#

thats bingus

vast ledge
#

who's bingus??

valid burrow
#

this cat is

tender shard
valid burrow
#

im pretty sure thats all the content that exists of bingus

#

sadly

vast ledge
#

what a shame

valid burrow
#

yeah

#

really sad

#

i wish i could enlargen my bingus database

tender shard
#

i wish I could read more books about baboons

#

but there aren't that many good baboon books

valid burrow
#

wtf is a baboon

tender shard
#

orang utan