#help-development

1 messages ยท Page 1100 of 1

shadow night
#

why is it so huge

grim hound
#

They just liked it this way

swift dew
#

who? tell em to change it

shadow night
#

Yeah

#

600 chars for a fricking token?

grim hound
shadow night
#

1200 bytes in UTF-8

pliant topaz
#

that token is safer than sha256 ๐Ÿ’€

grim hound
#

xD

swift dew
#

can these people join a discord server and send the token there?

shadow night
#

That's a whole friggin' kilobyte

swift dew
#

if yes use jda

shadow night
#

Sounds like command block gui is the best

pliant topaz
#

be takin 10x heat death of our universe until that shit be brutefor ed

grim hound
#

Okay

shadow night
#

I wonder if we have command block screen api

pliant topaz
#

not really

#

but u can get the cmd

grim hound
#

Yep

pliant topaz
#

so players would need to paste it and then press save

grim hound
#

Yep

shadow night
#

do we atleast have API to open the command block screen

grim hound
#

I'm still gonna do it with packets

pliant topaz
shadow night
pliant topaz
#

yea

grim hound
#

Do you guys know

pliant topaz
#

i mean, i wanted to contribute but i seem to stupid to understand what excactly i gotta do to make sure it gets approved

grim hound
#

Whether I can at least modify the ui's text?

shadow night
#

Resourcepack?

grim hound
#

Couldn't find it

shadow night
#

Or what do you mean by change the ui's text

#

Like, change what the UI says?

grim hound
#

Ye

pliant topaz
#

you want to use a ressourcepack with custom lang file

grim hound
#

Ye

blazing ocean
#

command block guis are hardcoded

#

they have no textures

pliant topaz
#

you can basically copy the lang file from given version and modify that to fit your needs

grim hound
pliant topaz
blazing ocean
pliant topaz
shadow night
blazing ocean
#

yeah

#

but there's no way to change the texture of any of that

shadow night
#

Not much you could softcode here tbf

blazing ocean
#

iirc the buttons are still default textures ๐Ÿ’€

pliant topaz
#

yea

blazing ocean
#

and you can't change their texture by changing the button texture

#

mojank moment

shadow night
#

Where tf is it fetching shit from

pliant topaz
#

i just realised

shadow night
#

That might be illogical

blazing ocean
shadow night
blazing ocean
#

they might've changed it in some version? not sure

pliant topaz
# pliant topaz i just realised

as the language file can modify the text, you could use a custom font to create custom backgrounds for the cmdblock ๐Ÿ˜ฎ

blazing ocean
#

i tested back in like 1.20.2

blazing ocean
#

which you should never do unless for stuff like that and you need to be 100% sure the users cant paste it in game

shadow night
#
this.redstoneTriggerButton = this.addDrawableChild(
            CyclingButtonWidget.onOffBuilder(Text.translatable("advMode.mode.autoexec.bat"), Text.translatable("advMode.mode.redstoneTriggered"))
                .omitKeyText()
                .initially(this.autoActivate)
                .build(this.width / 2 + 50 + 4, 165, 100, 20, Text.translatable("advMode.triggering"), (button, autoActivate) -> this.autoActivate = autoActivate)
        );```
blazing ocean
shadow night
#
private static final ButtonTextures TEXTURES = new ButtonTextures(
        Identifier.ofVanilla("widget/button"), Identifier.ofVanilla("widget/button_disabled"), Identifier.ofVanilla("widget/button_highlighted")
    );```
pliant topaz
#

i like that, even tho minecraft has so much hardcoded and sh*t

#

its still really customizable

blazing ocean
#

shaders

shadow night
pliant topaz
#

true

shadow night
#

With all the coreshaders and data driven shit

blazing ocean
shadow night
#

Back in the days we had no datapacks, only texturepacks and a barely working forgemodloader without mixins

pliant topaz
shadow night
blazing ocean
#

mojang

pliant topaz
#

i think it was in like 1.3

#

they announced an official modding api for java

shadow night
#

Please no

pliant topaz
#

but they scrapped it as there were enough community made ones

shadow night
#

I don't wanna write js code for my mods

blazing ocean
#

it would be even jankier

rough drift
pliant topaz
#

it wouldve been a java api

#

probably similar to todays forge/fabric

shadow night
pliant topaz
#

but it wouldnt have required you to restart the game

shadow night
#

Where they don't show any internals, only API

pliant topaz
#

instead you could have different mods for different worlds etc and maybe even a mod workshop ingame and stuff

#

but as they scrapped it

shadow night
#

We can do everything with mods these days

pliant topaz
#

ik

#

but you still have to restart your game

shadow night
#

With a few (not so) simple mixins we can create more than mojang ever will

blazing ocean
shadow night
#

Freezing and unfreezing registries has been a common practice always

#

With mixins we can do anything

#

Including dynamically enabled and disabled mods (and possibly mixins)

pliant topaz
#

oooooh since when?

#

well, okay, since mixins xd

shadow night
#

It was always possible

rough drift
#

my idea is to just make a spigot-like API but with the power of fabric mods, I'm cooked ๐Ÿ’€

shadow night
#

Just nobody wanted to do it

karmic falcon
#

Hi, I have a question let us say my configuration file looks like this:

Pets:
     Cat:
           -Data about this pet
     Dog:
           -Data about this pet

How would I go about getting a String[] which contains the names of those pets, in this case it would be: {Cat,Dog}

pliant topaz
rough drift
karmic falcon
#

I'm using yaml configuration BTW idk what's the difference

rough drift
#

I just have too little time this month to make a proper release ๐Ÿ˜ญ so it's a bit half assed

shadow night
#

Imo an API currently is completely unneeded

shadow night
# rough drift wym

Everything works by basing on minecrafts internals, besides bukkit ofc, that's a special case

rough drift
#

my goal is to kinda make a universal API, I am like 3 classes away ๐Ÿ˜ญ

It would allow you to take the same jar and run it on a spigot server, a fabric server, a forge server, a fabric client, a forge client

shadow night
shadow night
rough drift
rough drift
#

it is much more effort to do that than use a standardized API

shadow night
shadow night
blazing ocean
#

i love the bukkit api and hate it at the same time

rough drift
#

Honestly, not really, most of it can be abstracted even further from minecraft

blazing ocean
#

like, no async? nobitches

rough drift
blazing ocean
#

you can do some vanilla stuff async

rough drift
#

fair

pliant topaz
#

When mc always runs multithreaded it would be a hella lot faster i believe

#

(if done properly)

rough drift
shadow night
torn badge
shadow night
#

I was writing a big ass text but got bored and deleted it

blazing ocean
rough drift
#

send it

#

I want to know

shadow night
rough drift
#

well

#

summarize

shadow night
#

Libraries

rough drift
pliant topaz
rough drift
#

no it would take a while

#

but much less than multithreading

#

and would be HUGELY more performant

#

I'm talking about

#

ensuring memory locality ๐ŸŽ‰

#

there are 3 arrays in mc

#

that are

#

so fucking sparse

#

it's sad

shadow night
pliant topaz
rough drift
rough drift
#

man I want to do that now

shadow night
#

An API wrapping around a system will always be atleast a bit restrictive

rough drift
#

it lets you do anything

shadow night
rough drift
shadow night
rough drift
shadow night
rough drift
#

also it runs on the server

#

so like

#

๐Ÿ˜ญ

rough drift
shadow night
#

There is always some scenario which you just can't think of

rough drift
#

make an issue

#

add it to the API

shadow night
#

I wouldn't even know that the FogRenderer class existed if I didn't have to write a mod that mixined into it

torn badge
#

FogRenderer on the server, gg

rough drift
shadow night
# rough drift add it to the API

And then you'll have to work on some god damn API for the rest of your life adding features like "add newly added method removeShit(World world) to ShitManager"

rough drift
shadow night
eternal night
#

Sponge moment

shadow night
#

A fuckton of mod devs will never quit their ancient ass forge or their beloved fabric (or for the femboys, quilt)

rough drift
shadow night
#

I'm even pretty sure it has been done before, to some degree

eternal night
#

Sometimes you gotta reinvent the wheel

#

Otherwise the wheel won't get better

rough drift
#

^

shadow night
rough drift
#

it would be what bukkit tried to do, but more modern

eternal night
#

And hey, it is a fun project. Yea, chances are it'll die as a brick disguises as a wheel, but it's always a learning.

shadow night
eternal night
#

And maybe it will actually be a wheel

shadow night
rough drift
eternal night
#

Not like you loose anything attempting

river oracle
#

The bukkit approach is actually great imho.

eternal night
#

Wellll

shadow night
rough drift
#

not always

eternal night
shadow night
river oracle
rough drift
#

it's a learning experience that may do something useful

eternal night
#

Both approaches have their merit

#

Fabric fails in some spots that paper doesn't and the other way around

rough drift
#

also I can literally add mixins if you want lmao

shadow night
shadow night
river oracle
#

Adding mixin support is pretty easy

rough drift
river oracle
#

Hot take chat but spigot switches to mojmaps???

eternal night
#

Maybe remove CB relocation???

rough drift
shadow night
eternal night
#

That would be crazy

river oracle
shadow night
#

I have done remapping countless time

eternal night
rough drift
river oracle
shadow night
#

Mixins break on bukkit because

  1. Bukkit makes some private methods/fields public
  2. Bukkit does not support mixins
rough drift
#

automatically converts to the relocated packages

rough drift
#

hell my friend literally got them running on spigot

shadow night
#

CVN handles remapping and cb relocation too, Paulem did it, Idk how ngl

river oracle
#

Mixins aren't hard to add

#

Don't act like this is some monumental.task

shadow night
rough drift
#

well, I'll show you

#

I'll implement it and you'll see what I mean

#

granted it'll take a while

kindred valley
#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

shadow night
rough drift
#

first version is nowhere near my goal for a first version at ALL

river oracle
#

It's just mapping

eternal night
#

Mixins work until you realise you just gave the equivalent of a nuclear powered hammer to someone that has ~3 months of coding experience

shadow night
kindred valley
river oracle
#

For loops go crazy

#

ASM is glorified for loop just look at commodore khajiit

eternal night
#

I always considered the upside of the Bukkit approach and a stable API that is is a lot harder for plugins to fuck each other up

river oracle
eternal night
#

Incompatibility between projects becomes a lot easier when one project just casually replaces the entire method logic

shadow night
#

I should inform all the people who use redirect and overwrite in mixins that that is a bad approach and causes lots of incompat

eternal night
#

Emily (idiot staff)?

slender elbow
#

paper is idiot

#

got it

shadow night
#

Paper is meeh

eternal night
#

Facts, all my homes work on

#

Carbanetty MC

shadow night
#

How dare they patch my tnt duping

eternal night
#

Or whatever

river oracle
stuck oar
#

anyone know how i get like animal heads in 1.8 because i cant setOwningPlayer on a playerhead

shadow night
eternal night
river oracle
river oracle
shadow night
stuck oar
#

my server is 1.8?

shadow night
#

why

stuck oar
#

factions

river oracle
#

Ok

shadow night
#

Factions?

river oracle
#

Then figure it out yourself

eternal night
#

@slender elbow do you have a ready to use set and get nbt class for 1.8 for me

#

Thanks

stuck oar
shadow night
#

Why should anybody here help with a version of the software that is almost a teenager

stuck oar
#

aight bro chill out

river oracle
#

Hey it just happened to turn 9

stuck oar
#

legit just asking

river oracle
#

We still got 4 more years

echo basalt
#

shit's fucked when your audience is younger than the minecraft version

shadow night
shadow night
stuck oar
#

i have

river oracle
#

This version released 3 years before you were born kid

stuck oar
#

lots

shadow night
#

Then you have done it wrong?

eternal night
stuck oar
#

not everything on google is true bro trust me ive tried

river oracle
stuck oar
river oracle
#

Checks out

shadow night
river oracle
#

If you have a server and have in-house developers you should probably run your own fork and upstream performance patches

#

Just sayinnn

shadow night
#

Also, I have taken part in atleast 2 factions servers that were running on 1.20.4

#

No idea why you'd run 1.8

eternal night
slender elbow
#

upstream? what's that

slender elbow
# shadow night No idea why you'd run 1.8

you'd also figure that if you're gonna run 1.8 you should know what you're doing but you'd be surprised by the amount of people that run unpatched spigot/paper 1.8 that are absolutely littered with exploits

blazing ocean
#

tfw people crash their server within 4 packets:

river oracle
#

I'm not good enough to notice lag

#

I don't have enough friends to cause lag either

blazing ocean
#

use offline mode and a botting tool :)

eternal night
remote swallow
#

OFFLINE MODE?!

remote swallow
eternal night
#

We just got the issue on paper

eternal night
remote swallow
#

nah

#

make it not laggy

eternal night
#

There is no saving

remote swallow
#

asycn will fix everything

blazing ocean
#

make vanilla async

eternal night
#

Async class loading stonks

rough drift
#

hey lynx how about ya'll upstream some patches

remote swallow
#

async cow movement paper fork when

rough drift
#

only the good ones though

#

absolutely fuck the api changes

eternal night
#

Nah I think we are good

blazing ocean
rough drift
eternal night
#

I thinking bringing components and API improvements to your common smp plugin Dev would be a bit overwhelming

rough drift
eternal night
#

Mhm, for sure

#

Truely terrible abstraction over mojangs used text representation

#

Gimme those incomplete dataloosing legacy strings babyy

rough drift
#

no fuck legacy strings

#

but also fuck paper components

ivory sleet
#

We love strings :(

rough drift
#

I want something actually good that isn't... well, whatever ya'll have going on

eternal night
#

?

blazing ocean
#

genuinely

ivory sleet
blazing ocean
#

wtf is wrong with adventure

ivory sleet
#

if it just were so easy

eternal night
#

Adventure component API is as close of a representation of internals as it gets

#

You can build formats or whatever you want on top of it

pseudo hazel
#

you are free to write something thats actually good

rough drift
pseudo hazel
#

sadge

rough drift
#

it's on my todo list to actually do that, which will probably happen in a bit

eternal night
#

Well let us know once you abstracted Mojang internals into an API that isn't components but allows all the same things

blazing ocean
#

mm:

#

i mean

#

still components

slender elbow
#

mm is not components

#

it's just a string representation of a component just like json is, you still need a java object and api to represent them

ivory sleet
#

i mean dont get me wrong, adventure is cool and all that, even so I think its a bit over engineered at times for example implementing the examinable api (its been with adventure for a long time so its understandable, would be hard to just rip it out), ofc examination has its use cases but still

eternal night
#

Yea, some of the non component parts go places

slender elbow
#

i'm not a fan of the api and i think it's overhyped how many people in paper discord say "it's the most significant and valuable change paper does" like okay lmao sure

blazing ocean
#

i mean it is pretty important

slender elbow
#

also adventure itself carries quite its own legacy crux and half the methods are deprecated because brr breaking changes

eternal night
#

Yea the time for adventure 5 is

#

Uhhh

#

Someday

blazing ocean
#

soonโ„ข

slender elbow
eternal night
#

Well, I guess you can kinda get that impression because spigot has 0 support for any component stuff outside messages

#

So it isn't really adventure that is the best change it's the "any way to do components"

river oracle
#

Oh it's other player inventories

#

Oh my god ๐Ÿ˜ญ fucking hate that you can do this

eternal night
#

Iirc md brought it up here too

#

Haven't looked at it

#

But I guess I'll have to

river oracle
eternal night
#

Given that the spigot inventory expert refuses work

river oracle
#

My guess is craft container botch or something

eternal night
river oracle
river oracle
#

The issue is that the player inventory is bigger than MenuType 9x4 but also

#

Switching it to 9x5 might cause issues for existing plugins

eternal night
#

Yea XD

#

It'll be a fun slap into inventory view concertSlot or something

river oracle
#

Later stages of inventory PR should fix if you use MenuType but like blegh

#

Opening non openable containers is tough

eternal night
#

Well at least I'll finally make it home to my beloved setup in like 2 hours

river oracle
#

Woooo fun

#

I have 3 hours of work left

stuck oar
#

is there any way to make my own variable

quaint mantle
#

Object myVariable = null

river oracle
shadow night
#

I have a geniusly stupid idea

#

What if we mix NotNull/Nullable annotations with Optionals and get: Nullable<T>, NotNull<T>

river oracle
#

๐Ÿ’€

shadow night
#

Basically, optionals but shitty

#

And then force them on all spigot users

#

Good idea?

blazing ocean
#

lgtm

kindred valley
#

?learnjav

worthy yarrow
#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

kindred valley
#

I intentionally missed it

#

Ty for doing it for me

stuck oar
#

like players amount of something

worthy yarrow
#

Thatโ€™s held within their inventory

stuck oar
#

nono

#

like

#

a players balance

#

ik theres eco plugins n stuff

chrome beacon
#

Use the Vault API

worthy yarrow
#

Thatโ€™s held with like vault / essentials

stuck oar
#

ok thanks

hybrid turret
#

Is there an npc guide?

tardy delta
#

just use the citizens api

chrome beacon
#

^^

viscid carbon
#

Why would a configurationSection be always returning null if its not?

#
 public User(UUID playerUUID, FileHandler fileHandler) {
        this.playerUUID = playerUUID;
        this.fileHandler = fileHandler;
        if (this.fileHandler.getConfig().contains("Rank")) {
            this.playerRank = fileHandler.getConfig().getString("Rank");
        } else if (this.fileHandler.getConfig().contains("Allowed-homes")) {
            this.allowedHomes = fileHandler.getConfig().getInt("Homes.Allowed-homes");
        } else if (this.fileHandler.getConfig().isConfigurationSection("Homes")) {
            this.playerHomes = fileHandler.getConfig().getConfigurationSection("Homes").getKeys(false);
        }

    }
Homes:
  home:
    ==: org.bukkit.Location
    world: world
    x: 6.485744877474398
    y: 105.0
    z: 10.694169240023918
    pitch: 67.80005
    yaw: -67.95006
#

Where the error is coming from

            if (!user.getFileHandler().getConfig().contains("Homes") || user.getPlayerHomes().isEmpty()) {
                send(sender, "&4You don't have any homes!");
                return true;
            }```
chrome beacon
#

What's the error

viscid carbon
#
        at me.arkallic.core.commands.homes.HomeCommand.onCommand(HomeCommand.java:29) ~[?:?]```
chrome beacon
stuck oar
#

oh ok thanks

chrome beacon
viscid carbon
#

no, its a ConfigurationSection.

#

The home is also a ConfigurationSection with the data inside

chrome beacon
#

Then that code would give a compile error

viscid carbon
#

.contains() only works for Stringlists?

chrome beacon
#

You're assigning playerHomes to a list of Strings

viscid carbon
#

oh...

#

my.

#

uhmm

#

ignore me

#

thanks xD

halcyon hemlock
#

only sigmas would understand

tardy delta
#

smh?

blazing ocean
blazing ocean
#

ok buddy

halcyon hemlock
#

that looks cleaner tbh

#

unless there are 2+ trait bounds

halcyon hemlock
#

i think i stole this one from rad

cedar saffron
#

thats mine ๐Ÿ’€ he stole that from me

halcyon hemlock
#

W

#

average programmer

#

"I stole your code"
"That wasn't mine"

cedar saffron
#

based?

sand spire
#

Is it fine to store a MongoDB document in memory for every online player or should I only get their active profile from the document and dump the rest since they can have multiple profiles

river oracle
#

If a player can have multiple profiles only storing their active profile is good

sand spire
#

Alright thanks, cause I turned the active profile into something meaningful already and I thought I could just save the document for when the player switches profiles but I will just get it from the database async

rigid loom
#
if (!kingdoms.isEmpty()) {
            Configurable config = kingdomsConfig.getConfig();
            if (config != null) {
                for (Map.Entry<String, String> kingdom : kingdoms.entrySet()) {
                    if (!kingdoms.containsKey(config.getNode(kingdom.getKey()).toPrimitive().getString()) || !kingdoms.containsValue(config.getNode(kingdom.getValue()).toPrimitive().getString())) {
                        config.set("kingdoms." + null, null);
                    } else {
                        config.set("kingdoms." + kingdom.getKey(), kingdom.getValue());
                    }
                }
            }
            config.save();
        }

for some reason this removes all players from the kingdoms node whenever i execute the /k leave <kingdom> command

#

kingdomsConfig.getConfig() is just defining where the config should go in the server files

torn badge
#

Why is that looking so complicated

rigid loom
#

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

torn badge
#

It would be way easier to debug if you introduced some more variables

#

Instead of chaining 50 calls

rigid loom
# torn badge It would be way easier to debug if you introduced some more variables
if (!kingdoms.isEmpty()) {
            Configurable config = kingdomsConfig.getConfig();
            if (config != null) {
                for (Map.Entry<String, String> kingdom : kingdoms.entrySet()) {
                    boolean configContainsKingdomKey = kingdoms.containsKey(config.getNode(kingdom.getKey()).toPrimitive().getString());
                    boolean configContainsKingdomValue = kingdoms.containsValue(config.getNode(kingdom.getValue()).toPrimitive().getString());
                    
                    if (!configContainsKingdomKey || !configContainsKingdomValue) {
                        config.set("kingdoms." + null, null);
                    } else {
                        config.set("kingdoms." + kingdom.getKey(), kingdom.getValue());
                    }
                }
            }
            config.save();
        }```
torn badge
#

"kingdoms." + null?

rigid loom
#

dont know how else to remove the person from the kingdom

#

but it removes everyone from the thing

torn badge
#

Save it as a string list

rigid loom
#

wdym?

torn badge
#

And then get the list, remove the player, and save the list back to config

rigid loom
#

ill work on it then send here once i think ive figured it out

torn badge
#

Is that a member list or what is it?

rigid loom
#

member list

tardy delta
#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

rigid loom
#

not bukkit

frosty current
#

Hey i'm using a scoreboard and the placeholder from spigot and when i try to configure how much entity "modded" is kill seems like no recognize the entity, there is a way to find the entity ?

magic solar
#

Hey i'm very new to plugin dev so sorry if stupid questions. what is the correct way to log inside another package as the way i'm trying is giving me an IDE warning. It works but I feel there is a butter way.

#
    fun creatureSpawnEvent(event: CreatureSpawnEvent) {
        Bukkit.getLogger().info("Tried to spawn " + event.entity.name)
        event.isCancelled = true
    }```
#

this gives a yellow line under .getLogger()

golden turret
#

how can i update the light of a chunk? I ||took the code from nms||wrote a method to place blocks faster than Block#setBlockData but that does not update the light. 1.20.1

onyx fjord
#

yall know why BlockGrowEvent -> getBlock -> getType returns AIR for SUGAR_CANE?

sleek creek
#

I think you have to look if its the type you want

onyx fjord
#

i have a listener like this:

    @EventHandler(ignoreCancelled = true)
    public void onGrow(BlockGrowEvent event) {
        System.out.println(event.getBlock().getType());
    }

i have a sugarcane growing and this returns AIR

#

wtf

sleek creek
#

Try this

public void onGrowEvent(BlockGrowEvent event){
           if(event.getBlock().getType() == Material.WHEAT_SEEDS){
               Bukkit.getServer().broadcastMessage("Test");
        }
    }
onyx fjord
#

the issue is sugar cane never appears tho

#

when sugar cane grows on the server air prints

sleek creek
#

Hmm

onyx fjord
#

ill do a loc check

sleek creek
#

Try

event.getNewState().getBlock().getType()
onyx fjord
#

oh interesting

#

ill look into that

#

nah, but ill just use relative faces to get bottom block for air

pale hazel
#

In IntelliJ does anyone know how to output a JAR to another folder when building the JAR?

ivory sleet
#

yea

#

U using ant maven or gradle?

pale hazel
#

gradle

grim hound
#

does anyone here know brigadier?

blazing ocean
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

grim hound
#

I want to make a command directly

#

but I'm not sure how it works

#

specifically, the redirect index

#

and child indicies

#

not sure how that one works

ivory sleet
grim hound
#

oh

#

could you help out?

ivory sleet
#

Im out w my dog but I could probably help after that ^^

grim hound
#

ok

young knoll
#

Can the dog help

dull schooner
#

does anyone know?

#

Oh, i have to do it manually then, thats a shame

#

Thanks

alpine swan
#

is it possible to make it so when a player takes damage it is as if they have a different armor set on (like the damage they take)? accurate explosion damage is important so a basic multiplier wont work

golden turret
muted otter
#

Hey, I am having an issue with YAML. For some reason, when I try to access buttons as an integer list, it is always empty, which means that it is null. Does anyone know why this is?

alt-menu:
 title: "<green>My Epic Menu</green>"
 rows: two
 buttons:
  - 0:
    item:
     type: diamond_sword
     amount: 3
     name: "<green>Ultra <bold>SWORD</bold></green>"
  - 1:
    item:
     type: netherite_leggings
     amount: 3
     name: "Gucci Leggings"
lost matrix
#

"buttons" is a list of objects

muted otter
#

how can I make it a list of integers?

#

or is that not something i could do in this situation

lost matrix
#
 buttons:
  - 0
  - 1
  - 2

Or

buttons: [0, 1, 2]
muted otter
#

oh, so it cannot have sub-categories if it is a list of integers?

quaint mantle
#

Keys are strings

lost matrix
#

A list of integers will always be a list of integers and a list of objects will always be a list of objects.
I have no idea what sub-categories for integers are.
What are you trying to do? Maybe a List isnt the right choice here.

#

This for example would be a Map<String, Object> or even Map<Integer, Object> if read correctly:

 buttons:
  0:
    item:
      type: diamond_sword
      amount: 3
      name: "<green>Ultra <bold>SWORD</bold></green>"
  1:
    item:
      type: netherite_leggings
      amount: 3
      name: "Gucci Leggings"
muted otter
#

Hey, I am still having a little trouble:

alt-menu:
 title: "<green>My Epic Menu</green>"
 rows: two
 buttons:
  - 0:
    item:
     type: diamond_sword
     amount: 3
     name: "<green>Ultra <bold>SWORD</bold></green>"

for some reason, the key at alt-menu.buttons.0.item.type is null. I have a feeling that it is not formatted correctly though

carmine mica
#

is this YAML? You have a list in that, which you can't go into via the string key

#
alt-menu:
  title: "<green>My Epic Menu</green>"
  rows: two
  buttons:
    0:
      item:
        type: diamond_sword
        amount: 3
        name: "<green>Ultra <bold>SWORD</bold></green>"
#

that would be the format you want which would match the key

#

I'm actually not sure if just a number is a supported key, but if it is, then thats it

muted otter
#

oh i see what it means now, thank you

humble tulip
#
    private final Map<String, Map<String, FactionBoost>> factionBoosts = new HashMap<>();

This is essentially a Map<String, Map<Identifier, Boost>>
Boosts that are applied may be effects that applies to all players in the faction. I'd like to make some of the boosts temporary. What are some ways I can go about doing so cleanly?

I was thinking save the endtime and timertask scheduled to run at endtime of the boost into a Map<String(Faction ID), Map<BoostName(String), Pair<TimerTask,Long>>>. If a boost is manually cancelled beforehand, i remove it from the map and cancel the timertask

This does seem a bit convoluted so if anyone has a cleaner solution, please lmk. ping when repsonding please

#

5 ticks

muted otter
#
PATH IS: alt-menu.buttons.0
SLOT IS: 0

PATH IS: alt-menu.buttons.1
SLOT IS: 0

This is a sample configuration:

 buttons:
  0:
    item:
     type: diamond_sword
     amount: 3
     name: "<green>Ultra <bold>SWORD</bold></green>"
  1:
    item:
     type: netherite_leggings
     amount: 5
     name: "Gucci Leggings"

The issue is that I am trying to get the slot based on the path, using ConfigurationSection#getInt, however, it is returning 0 and I am not sure why.

drowsy helm
humble tulip
#

you need to get the Config Section for buttons

#

Then do getKeys(false)

#

That'll return a set<string>

muted otter
#
public Button getButton(final String path) {
  int slot = getInt(path);
  System.out.println("PATH IS: " + path);
  System.out.println("SLOT IS: " + slot);
    }
for (String key : section.getKeys(false)) {
  Button button = getDisplayButton(path + ".buttons." + key);
  addButton(displayButton);
}
#

This is what I have

humble tulip
#

Which contains {0,1,2} etc

drowsy helm
#

whats in getDisplayButton?

muted otter
#

that is same as getButton basically

humble tulip
#

You're doing something wrong

drowsy helm
#

well button is not an int

#

it's a section

humble tulip
#

Are you calling integer.parseInt anywhere?

muted otter
#

No..

humble tulip
#

That's the issue

muted otter
#

Oh, so it reads it as a string?

humble tulip
#

Nothing is giving you an int

#

You gotta parse it yourself

#

Yes

muted otter
#

ah ok i see

humble tulip
#

And it's the section name

muted otter
#

oh, and that is a string

#

i see

humble tulip
#

Yep

pale hazel
#

not sure what is going on

drowsy helm
#
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml```
humble tulip
#

No plugin.yml in jar

#

It says that in the error

pale hazel
#

Okay yeah but weird. I am building and exporting the JAR to plugin directory within Intellij it must not be including the plugin.yml and I dont know why

drowsy helm
#

what are you building it with?

pale hazel
#

building it as an artifact within Intellij

humble tulip
#

Ew

drowsy helm
#

use maven or gradle

humble tulip
pale hazel
#

ohhhhhh

drowsy helm
#

then you wouldn't need a nested map

humble tulip
#

Ah true

#

Ok

#

Faction data can eliminate both nested maps

drowsy helm
#

then you can just do Map<Boost, Long>

humble tulip
#

I haven't coded in a while

drowsy helm
#

being boost applied, and expiration time

humble tulip
#

But i dont wanna keep checking all boosts for expiration time, hence the timertask

drowsy helm
#

yeah, you can have one iterating every few ticks to check expiration

#

multiple tasks will be less efficient then one iterating over expirations

humble tulip
#

Okay ty

wet breach
# humble tulip Is the timer task idea a good one?

I would probably make my own event scheduler thing for this. This way you know when a boost has been cancelled and if you want to do anything etc. a bit more code to setup but in the long run beneficial and makes things easier

#

Custom events are a thing you can do

near furnace
#
public class SpawnListeners implements Listener {

    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent e) {
        Plugin plugin = Main.getPlugin();
        Player p = e.getEntity();

        Location bedSpawnLocation = p.getBedSpawnLocation();
        if (bedSpawnLocation == null) {
            double x = plugin.getConfig().getDouble("spawn.x");
            double y = plugin.getConfig().getDouble("spawn.y");
            double z = plugin.getConfig().getDouble("spawn.z");
            float pitch = (float) plugin.getConfig().getDouble("spawn.pitch");
            float yaw = (float) plugin.getConfig().getDouble("spawn.yaw");
            String worldName = plugin.getConfig().getString("spawn.world");

            if (worldName != null) {
                Location spawnLocation = new Location(Bukkit.getWorld(worldName), x, y, z, yaw, pitch);
                p.setBedSpawnLocation(spawnLocation, true);
                p.sendMessage("You have no bed spawn point set! You have been teleported to the spawn");
            } else {
                World world;
                world = Bukkit.getWorlds().getFirst();
                p.setRespawnLocation(world.getSpawnLocation(), true);
            }
        }
    }
}```

I've been trying this code to do the following:
1. On player death, if no bed respawn point set, teleport them to the set spawn with a message
2. Else, if there is no set spawn set, enable natural spawning

Problems:
1. If I set the spawn and delete the config, and restart the server to remove the set spawn data. It still somehow sends the player to that spawn on death. Minecraft probably caches it somewhere



*Tried at the paper server, they couldn't help. You guys are my last hope ๐Ÿ˜ญ
worldly ice
#

bed spawnpoints are saved in player nbt

near furnace
#

owh

#

owh how should i enable normal bed spawning in the else condition?

worldly ice
#

this would probably work better in a PlayerRespawnEvent

#

if they don't have a bed spawnpoint, tp them to the location in the config

#

you might have to wait a tick before doing that im not sure

#

actually nvm it has a #setRespawnLocation method

#

so you dont even have to tp

near furnace
near furnace
#

@worldly ice its not even tp'ing me to the spawn even when there is a setspawn

worldly ice
#

send code

near furnace
# worldly ice send code
package me.lolnypop.myplugin.plugins.SpawnPlugin;

import me.lolnypop.myplugin.Main;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.plugin.Plugin;

public class SpawnListeners implements Listener {

    @EventHandler
    public void onPlayerRespawn(PlayerRespawnEvent e) {
        Plugin plugin = Main.getPlugin();
        Player p = e.getPlayer();

        Location bedSpawnLocation = p.getBedSpawnLocation();
        if (bedSpawnLocation == null) {
            double x = plugin.getConfig().getDouble("spawn.x");
            double y = plugin.getConfig().getDouble("spawn.y");
            double z = plugin.getConfig().getDouble("spawn.z");
            float pitch = (float) plugin.getConfig().getDouble("spawn.pitch");
            float yaw = (float) plugin.getConfig().getDouble("spawn.yaw");
            String worldName = plugin.getConfig().getString("spawn.world");

            if (worldName != null) {
                Location spawnLocation = new Location(Bukkit.getWorld(worldName), x, y, z, yaw, pitch);
                p.setRespawnLocation(spawnLocation, true);
                //p.setBedSpawnLocation(spawnLocation, true);
                p.sendMessage("You have no bed spawn point set! You have been teleported to the spawn");
            }
        }
    }
}```
worldly ice
#

and you're getting the message in chat?

near furnace
#

yea

near furnace
#

because, i need to check if the player has a bedspawnlocation or not, if not teleport them to spawn

worldly ice
#

might be a paper issue, it looks like they added extra params to the setRespawnLocation method

dawn flower
#

why does super.clone() suck at 2d arrays

#

it just sets any 2+d array as null

worldly ice
near furnace
near furnace
worldly ice
#

curse you 1 letter variable names

near furnace
near furnace
worldly ice
near furnace
#

or i could just use the location object

worldly ice
#

oh yeah and on the topic of that message, i would use a guard clause instead

#
if (e.isBedSpawn()) return;

// rest of code
near furnace
#

owh thats neat

#

but lets see if it works first, then we can make the code more better and efficient

worldly ice
near furnace
#

yessirrrr setting it to e.setRespawnLocation worked

worldly ice
#

hooray

near furnace
#

if's and else's

near furnace
worldly ice
#

fr sometimes it would get so nested it would go outside of my monitor

#

i'd have to scroll horizontally to look at it

#

a lot of my old code came from eclipse ( ๐Ÿคฎ ) and lemme tell you it was a sight for sore eye

#

thats so bad

#

reminds me of some decompiled mc code

near furnace
#

omg yes yes yes yes yes, when there is no setspawn it turns on regular spawning parameters

#

spigot thank you

worldly ice
#

i think i was doing something with entity attributes and the entire class is just one unmodifiable map that got initialized with every single entity all on a single line

drowsy helm
#

??????

worldly ice
#

jesus christ

dawn flower
#

that's the case for every developer, you could look at your code now like 1 year later and also hate it

#

oh my god

near furnace
#

i tried getting help from the paper server but to no avail

drowsy helm
#

who the fuck wrote that

#

to the slammer

dawn flower
#

that still doesn't justify that

#

that's a war crime

worldly ice
#

fr

dawn flower
#

what does it do tho

worldly ice
#

yeah we dont talk about the project that im working on rn that just has a gigantic enum with all my custom items ๐Ÿ‘€

#

its fine i'll move to like a registry eventually

dawn flower
#

imagine if hypixel stored it in the same way

worldly ice
#

hypixel skyblock

#

10k lines of items

dawn flower
#

you forgot an extra 0

#

they already got 50k items

drowsy helm
#

had someone for one of my uni projects write this last year

worldly ice
#

thats actually crazy

dawn flower
#

...

#

i was being sarcastic lmao

#

but they do have alot

worldly ice
#

oh my fault gang

#

they have too many lets be honest

worldly ice
#

man you dont even need a helper function for that ๐Ÿ˜ญ

drowsy helm
#

like a function for that is bad enough

#

but it couldve been done in one fucking line

worldly ice
#

fr

normal thicket
near furnace
#

@worldly ice
look,
When I set my bed spawn and then break it, killing myself afterwards. Instead of sending just the "You have no bed spawn point! Teleporting you to spawn", it also sends the minecraft "You have no home bed or respawn anchor, or it was obstructed". Both of them together at the same time

worldly ice
#

not sure if you can change that

#

not without cancelling the event

dawn flower
near furnace
drowsy helm
#

c++

dawn flower
#

ah

drowsy helm
#

stupid naming convention

worldly ice
#

c++ ๐Ÿ˜”

#

i refuse to learn c++

drowsy helm
#

shitty syntax aside, it's a great language

near furnace
drowsy helm
#

super powerful, but i wouldn't recommend it for most projects

worldly ice
#

yeah but i've been learning rust the past like year or two and it seems to be able to do anything i would need c++ for

drowsy helm
#

ah yeah rust>>>> any day

worldly ice
worldly ice
#

gotten to that point when im searching up mc servers written in rust

drowsy helm
#

lmao

worldly ice
#

and then seeing a graveyard of like 3 abandoned projects

#

last commit 3 years ago

dawn flower
#

dear lord

near furnace
#

datasian do you know any methods to cancel any events that says "You have no home bed or respawn anchor, or it was obstructed" from the game code. Like disable it

worldly ice
#

"yeah how many graveyards do you have?"

dawn flower
#

"10"

worldly ice
worldly ice
dawn flower
#

fr

near furnace
normal thicket
worldly ice
#

yeah its a bit jank but i dont see why that won't work

near furnace
#

didnt understand shi-

#

im half brained

worldly ice
#

along with room temperature iq

near furnace
#

it happens when i set a bed respawn point and break it, and then kill myself afterwards

#

then it prints the message

near furnace
worldly ice
#

if you wanna go that route

near furnace
#

he tried setting the player's bed respawn location as of respawn location

#

and i used that too and i faced problems like if you remove the setspawn, it will still send you to that spawn location even though its not there

worldly ice
#

im more talking about the beginning of the thread

near furnace
#

alr im really not gonna go that route, ive been working on this for hours lets just move on haha

worldly ice
#

intercepting a game event packet

#

if you really really need to

near furnace
#

as i said, im half brained lmao

worldly ice
#

then what potato said would probably be easiest

#

setting the bed spawn for 1 tick so you never get the message

near furnace
#

wai wai so set the players bed spawn location but only for a moment

#

so it wont get saved in the nbt data either

worldly ice
#

yes

#

i mean if it works it works

#

me trying to justify my thousands of lines of spaghetti code:

#

it should

#

i mean unless the bed spawn location is obstructed

#

then i think you'd also get the message

#

yeah..

#

im sure it'll be fine

#

huh now im curious as to how the server knows your bed was destroyed

#

right exactly

#

so then setting the bed spawnpoint wouldn't work?

#

but they've tried that before and im assuming they didn't get the message

#

yeah this makes no sense to me

#

i love mojank code

sweet pike
#

how on earth do i use setTeleportDuration to smoothly move a display entity from one location to another?

for context, im trying to spawn a display entity in the middle of an open shulker, and move it towards the player's eye-location. nothing i do ends up as a smooth movement, but rather just a single teleport:

ItemDisplay itemDisplay = shulkerBox.getWorld().spawn(shulkerBox.getBlock().getLocation().clone().add(.5, .5, .5), ItemDisplay.class);
            itemDisplay.setItemStack(new ItemStack(Material.DIAMOND));
            itemDisplay.setTeleportDuration(59);
            itemDisplay.teleport(player.getEyeLocation());
worldly ice
worldly ice
#

you can change the translation of an item display

#

and change its like smoothing

#

i forgor word

#

interpolation

#

there we go

sweet pike
worldly ice
#

change interpolation and translation of the display

#

iirc translation has to be set a tick later

sweet pike
worldly ice
sweet pike
#

then i'll try interpolation + translation

worldly ice
#

but generally you should be using translations on display entities rather than tping them

sweet pike
# worldly ice oh yeah was gonna also recommend that

yeah, even this approach doesn't work.

ItemDisplay itemDisplay = shulkerBox.getWorld().spawn(shulkerBox.getBlock().getLocation().clone().add(.5, .5, .5), ItemDisplay.class);
            itemDisplay.setItemStack(new ItemStack(Material.DIAMOND));
            itemDisplay.setTeleportDuration(59);
            new BukkitRunnable() {

                @Override
                public void run() {
                    itemDisplay.teleport(player.getEyeLocation());
                }
            }.runTaskLater(this, 1L);```
sweet pike
#

let me try your suggestion now

worldly ice
#

when creating entities like that all changes are made a tick after they spawn

#

meaning even with the runnable you're still changing its tp duration and its location during the same tick

crude coyote
#

would here be the place to look for a developer to hire?

worldly ice
#

?services

undone axleBOT
crude coyote
#

ohh tyty

worldly ice
sweet pike
#

but i didn't add the runnable

#

let me try that

sweet pike
# worldly ice you should use the method with the consumer to have changes be made before its s...

do you mean something like this?

ItemDisplay itemDisplay = shulkerBox.getWorld().spawn(shulkerBox.getBlock().getLocation().clone().add(.5, .5, .5), ItemDisplay.class, spawnedDisplay -> {
                spawnedDisplay.setItemStack(new ItemStack(Material.DIAMOND));
                spawnedDisplay.setInterpolationDuration(50);

                new BukkitRunnable() {
                    @Override
                    public void run() {
                        spawnedDisplay.teleport(player.getEyeLocation());
                    }
                }.runTaskLater(this, 1L);
            });```
worldly ice
#

yeah

#

in theory that should work

sweet pike
#

ah wait

sweet pike
#

perfect! thank you so much

worldly ice
#

np

sweet pike
worldly ice
#

not sure, probably a mojang limitation?

#

although i have found instances where spigot's api causes more limitations than mojang

near furnace
#

really? darn you a genius, you and datasianboi

sweet pike
#

my fair guess would be something to prevent too many intervals but interpolation doesn't seem to have this upperbbound

worldly ice
#

yeah i was about to say

#

if you really need a longer duration then id just do multiple tps (or just use translations wink wink)

near furnace
#

datasianboi thanks so much for helping me, i tried asking for help in the paper server and as much as i got mad at them for telling me to go learn java instead of helping me with this simple spigot-api related code problem, i also think to myself... im half brained i really should learn java

worldly ice
#

yeah np

#

spigot community > paper community

#

imposter syndrome really hitting you hard

near furnace
#

idk why they tell me to go learn java even if its not that java related

#

like asking should i use if(isBedSpawn) return; or if(p.getBedSpawnLocation == null). And they say go learn java instead of saying use isBedSpawn

worldly ice
#

dang yeah that's barely java related

#

and even then that's more of a stylistic choice imo

near furnace
#

exactly haha

#

but i get it, sometimes i do ask random stupid questions because i do not know java, like i once asked what is a stacktrace and the gentleman just said "learn java"

#

another gentleman explained what it is

#

okay sure

worldly ice
near furnace
#

i might have to go in a while though, ill start implementing the method now

worldly ice
#

its mostly the latter that people have problems with

dawn flower
#

what happens if you Integer.parseInt a double string

worldly ice
#

numberformatexception?

dawn flower
#

ok

worldly ice
#

idk dont quote me on that

dawn flower
#

hm

#

test time

near furnace
worldly ice
#

yeah im saying you're more of the type who is willing to put in the effort

#

so real

#

actually i never really "learned" java

dawn flower
#

i just do alot of projects to "learn"

worldly ice
#

yeah, i'm a self taught programmer ๐Ÿ˜Ž

#

that was so cringe

#

im in aura debt

#

lost so much from that

#

i made the mistake of learning modded first before plugins

dawn flower
#

all my java projects

worldly ice
#

and 1.8 modded too

#

it was rough

dawn flower
#

only 2 aren't abandoned lmfao

near furnace
#

woah, i guess people expects me to learn java fully and become a PhD holder on it and only then i can learn spigot haha

worldly ice
quaint mantle
#

Proceeds to make unscalable code with static abuse

dawn flower
#

i have like at least 60 projects overall (including other languages and deleted projects)

rigid steeple
#

so im trying to make a server basicly from scratch and i have been working on it with gpt for the past week. and i was thinkning about letting my buddy make a smp server also. but like im not sure whats the newest best bungee cord type plugin for that but i think i need to understand what i should do in the future. so in the future should i just use something like velocity to connect everything or what ever is like that but good. and just make a smp server. and then a skyblock server. and then a lobby server? cause in the future im going to be buying the servers and running it through something like shockbyte. but have everything linked... im not sure how to go about doing these things lol. i just want to get a solid game plan down and figure things out in the future. cause when things are all like done with bungee and stuff like that doesnt there plugin folders only work when they are in that server?

dawn flower
#

dear lord

worldly ice
#

first half of the first sentence and im already scared

worldly ice
rigid steeple
#

if someone needs more info on what im trying to do lmk lmfao

worldly ice
#

oh jeez i didn't even read the with chatgpt part

#

it keeps getting worse

dawn flower
#

are you asking what proxy software to use

worldly ice
#

wait do you mean like server protocol or server as in you just have a spigot server with no other plugins

#

or ig in your case a bungee network

dawn flower
#

pls don't write another essay

#

simplify it

worldly ice
#

we gotta have the tldr

#

what

#

brainrot was instantly deleted

dawn flower
#

what does tldr stand for

worldly ice
#

too long didnt read

dawn flower
#

why is he still typing

worldly ice
#

its over

dawn flower
#

chatgpt

rigid steeple
#

right now i have one single spigot server. and ive made a plugin that makes people spawn on a "Lobby" world and they can do a /is create command and it makes a world based off a template and i have teams set up and shit like that. but i was going to add a smp game mode so it isnt just skyblock and i realized all the gamemodes will share plugins cause of how it is setup

worldly ice
#

do better chatgpt ๐Ÿ˜ 

dawn flower
#

but it has puncutation

worldly ice
near furnace
#

@blissful crow

if (worldName != null) {
                Location spawnLocation = new Location(Bukkit.getWorld(worldName), x, y, z, yaw, pitch);
                e.setRespawnLocation(spawnLocation);
                
                Bukkit.getScheduler().runTask(plugin, () -> {
                    p.setBedSpawnLocation(spawnLocation, true);

                    Bukkit.getScheduler().runTaskLater(plugin, () -> {
                        //cancelling the event here after two ticks?
                    }, 2L);

                });

                p.sendMessage(ChatColor.YELLOW + "Teleporting you to spawn... You do not have a home bed set");
            }```


I know im half brained but is this how you do itt?
worldly ice
#

remove the first task

#

you want the bed spawn location to be set before you actually respawn

quaint mantle
worldly ice
#

and then just change the timeout from 2 to 1

#

oh yeah instead of cancelling just set the bed spawn location back to null

#

dang

#

beat me to it

#

fr

near furnace
#

okie

#
if (worldName != null) {
                Location spawnLocation = new Location(Bukkit.getWorld(worldName), x, y, z, yaw, pitch);
                e.setRespawnLocation(spawnLocation);
                p.setBedSpawnLocation(spawnLocation, true);

                Bukkit.getScheduler().runTaskLater(plugin, () -> {
                    //cancelling the event here after two ticks?
                    p.setBedSpawnLocation(null);
                }, 2L);

                p.sendMessage(ChatColor.YELLOW + "Teleporting you to spawn... You do not have a home bed set");
            }```
worldly ice
#

looks good

near furnace
#

whats lgtm

worldly ice
#

i would try changing the timeout to 1 tick and seeing if that works

#

yeah

near furnace
#

ok

worldly ice
#

dang you were not joking with the hivemind comment

near furnace
#

owhh i dont really know all these internet idioms or abbreviation lul

near furnace
#

these bukkit schedulers are really confusing

#

i never really used them, kind of my first time hehe

worldly ice
#

they're really useful

#

especially for stuff like this

near furnace
#

do i still set the event's respawn point?

sterile breach
#

hi, is there a way to get all blocks id list into spigot? (not item id, block id) getId is deprecarted

near furnace
#

haha, it cancels itself anyways

undone axleBOT
sterile breach
#

not really

#

that item id

quaint mantle
sterile breach
#

to identifie blocks the client use block id, its hardcoded in minecraft client and I need it to send packets abouts blocs

quaint mantle
#

Material.class.getEnumConstants() then iterate. Push into list if material is block

near furnace
#

do you guys use java beautifier? i do and it helps a lot defeating pyramid codes

sterile breach
#

packet events

worldly ice
#

spigot has a sendblock method in its api pretty sure

sterile breach
#

why spigot deprecated getId method?

worldly ice
#

because its legacy

quaint mantle
sterile breach
sterile breach
dawn flower
#

what is the default Player#getMaximumAir?

worldly ice
#

not sure why you arent be able to use api to solve this

sterile breach
#

no Im just loking for a way to get Id from material

worldly ice
#

but im saying you might not even need a block id

worldly ice
undone axleBOT
worldly ice
#

maybe wiki has something about it

dawn flower
#

it's 300

worldly ice
#

good to know

worldly ice
#

using nms might be easier for this?

#

not sure how packetevents works ive never used it

#

but id assume they have some sort of way of converting a Material to an id

#

idk what a block state id is

sterile breach
#

it's simple with Material.getId but it has been deprecated without rasion but I can still use it or I make my own method, how to delete deprectation warnning? @supresswarning?

worldly ice
#

yeah

sterile breach
#

what should I put in args?
@SuppressWarnings(here)

worldly ice
#

deprecation or something?

sterile breach
#

I want to delete deprecation

worldly ice
#

if you're using intellij you can automatically suppress it

#

it'll auto-generate the annotation

sterile breach
#

ah good, how to do it?

worldly ice
#

if you hover over it you should just be able to suppress it

#

like in the quick fixes

blazing ocean
#

it only supports blocks with legacy ids

worldly ice
#

i cant give very good instructions dont have ij open rn

worldly ice
#

again, packetevents should have something builtin that turns materials into their ids

#

or just use nms

sterile breach
blazing ocean
#

something something registries

worldly ice
#

in the registry (im pretty sure)

#

yeah

sterile breach
sterile breach
worldly ice
#

very annoyingly yeah

blazing ocean
#

๐Ÿคท you could also just add nms and use it directly

worldly ice
#

^^

#

you'd have to navigate through obfuscated code

#

which'll make it even more of a hassle

sterile breach
#

yes I can

blazing ocean
#

i can look into how PE does it rq, haven't worked with it in a good while

sterile breach
#

whats PE?

hybrid turret
#

Iโ€˜m back at it again with my data handling stuff.
The following paste contains my BanListener and my PlayerDataListener.

Now the console tells me that data is null (dont have the log rn :( )

I already set the EventPrioritiesโ€ฆ. Does it even make sense to load the PlayerData if the Player is banned? Should I have a List of playerUUIDs on my serverdata instead, which is loaded upon enabling the plugin?

https://paste.md-5.net/upuqutuket.cs

drowsy helm
alpine urchin
#

For converting types from Bukkit to PacketEvents and vice versa

#

There's MaterialData if you want legacy support, and BlockData offered for modern versions

blazing ocean
hybrid turret
sterile breach
worldly ice
#

it has the highest priority, meaning it has the final say as to whether, for example, an event is cancelled

alpine urchin
#

Yes, that's how the priority system works @hybrid turret

worldly ice
#

im pretty sure

drowsy helm
hybrid turret
#

Oh wait what

alpine urchin
#

But docs say don't use MONITOR to modify the state

#

use HIGHEST

worldly ice
#

yeah yeah

hybrid turret
#

OHHHH

alpine urchin
#

MONITOR is used to see the result of the event.

hybrid turret
#

I seeee

#

So the one i want to have fire first should be LOWEST?

drowsy helm
#

yep

hybrid turret
#

Alright thank youuu

alpine urchin
#

Yep, but that means other plugins likely can easily modify your result.

#

or you can just be at NORMAL if none of this matters

hybrid turret
#

Oh

#

Hmm

#

I mean it would be kinda stupid if someone would use another plugin that includes eg a ban system in it if mine already has it, no?

drowsy helm
#

yeah thats sorta the server owners problem atp

hybrid turret
#

And well if it only matters for the result it only matters for the BanListener, no?

#

Bc in the other event i only load data

#

And the result is set by the banlistener

#

So i could leave the banlistener on highest and put the playerdatalistener on lowest

#

This helps a lot, ty

#

When I change a skin using the GameProfile (or similar ways like the integrated PlayerProfile), do I see the skin myself?

dawn flower
#

https://paste.md-5.net/otizirifuw.cs
so uh, i got this code and i have this thing called "target". for example if you want to send a message then the "target" would be a player
but this creates an issue because targets might require a target
example: if the target is the player's held item

how would i make parseTarget recursive?
so if the target was {@event-player} @held-item it would parse event-player first then parse @held-item with the target of the parsed event-player

#

god why am i so bad at explaining

silver eagle
#

Hi, I'm confused by the PlayerInteractEvent spec right now.
There is a function where a person whose GameMode is Adventure changes the text of the standing signboard when he or she hits the signboard while sneaking.
When I run this, PlayerInteractEvent is called twice for some reason.
In the non-sneak state and other GameModes, it is called only once.
Is this a bug? Is it possible to make it so that it is called only once in the case of specifications?

#

The text was created using translation software, so please ask again if you have any questions.

pseudo hazel
#

?interact

#

hmm

#

idk the command, but

#

the interact event is fired once per hand

#

so you just have to check the hand and return if its the offhand for example

#

?interactevent

undone axleBOT
#

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

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

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

ah there it is

silver eagle
#

When I just checked with those words, it seems that the event call has occurred three times.
The contents of event.getHand() are HAND, HAND, OFF_HAND
It seems that the events occur in this order.