#help-development

1 messages · Page 1581 of 1

quaint mantle
vague oracle
twilit vector
#

OOh TYSM

#

but with this how will i do the persistent data thing

quaint mantle
twilit vector
#

Thank you

vague oracle
#

BufferedWriter outStream= new BufferedWriter(new FileWriter("fileName", true));

#

or FileWriter.append() i think

tepid monolith
#

I have a command /clearinvetory <username> which opens an inventory where moderators can either completely clear player's invetory (including armor) or only clear items of the player in arg[0]. once the command has opened the first inventory, I made a different class called GUIEvent which controls the inventory. My question is, how do I get the args from the class where the command is on to the GUIEvent class so i can use them for a command perform of gui items?

quaint mantle
#

can you send the classes?

#

?paste

undone axleBOT
tepid monolith
quaint mantle
#

why not have the event and gui in the same class

tepid monolith
#

do i just make a public String?

quaint mantle
#

you can pass the player args into the constructor of the gui class

tepid monolith
#

as you saying its better to just make the eventhandler inside the command class

#

i believe i cant just call the argument inside the eventhandler

quaint mantle
#

i dont exactly know what your setup is so im trying to figure things out here

#

im assuming you want to make the command in one class, and the gui and event in another

quaint mantle
#

then somewhere in the command class call the gui constructor

tepid monolith
minor garnet
#

soo, i can get the direction of a certain euler angle ? like, when u set a headpose on the armor stand,

#

i know is possible transform euler angle in vectors

quaint mantle
twilit vector
#

I made this but i just wrote what came to my mind and now there is an error can someone please point out my mistake 😄

robust jolt
#

how i can send console command with a plugin?

twilit vector
#

oh

twilit vector
#

is everything else in that piece of code right?

#

in the whole method

eternal oxide
#

Hover over it and see what the error is

twilit vector
#

ok

summer scroll
#

..getPersistentDataContainer().get(namespacedKey, dataType)

twilit vector
#

ah

#

but now this is red it says cant resolve

summer scroll
#

bruh

#

add ()

twilit vector
#

oof

#

i am a noob lol

#

so now it should work right?

waxen plaza
#

Why can't I use EntityType in switch?

summer scroll
#

No need to do EntityType.ZOMBIE anymore.

waxen plaza
#

Oh, didn't know. Thanks.

summer scroll
twilit vector
#

does the code go in onBucketEmpty() after the bucket is emptied?

#

since i need to stop the person from placing is certain condition is satisfied

#

i.e. persistant container has the value

summer scroll
twilit vector
#

oh

#

so it goes into this method first then places?

twilit vector
twilit vector
#

aahh ok

summer scroll
#

The method will be called when the PlayerBucketEmptyEvent is called.

azure crow
#

what it the flag with worldguard for block claim?

#

its /rg global claims deny?

azure crow
#

please help me

gleaming hatch
#

hi, i have to compile a finished spigot plugin. If I try it with gradle build the process says that its need a spigot compileClass.
Is there no command to download that by gradle? I dont wana setup a whole IDE for that now

strange relic
#

Can you provide your gradle file?

strange relic
strange relic
#

Gradle should download it, you'd need to debug that problem or ask the plugin developer

#

Uhh wait, you need that nms stuff

gleaming hatch
strange relic
#

Iirc there should be a install option with the build tools

#

No, you need the nms stuff, Gradle can't do that

gritty urchin
#

How would I make an entity silent

#

Entity MetaData

#

using ProtocolLib

#

??

#

It's for an entity.

#

Thanks but only for specific players

ivory sleet
#

Though you’d be using paperweight for it

sour sand
#

is there a way to add a player to the whitelist from the code

gritty urchin
sour sand
#

ok thanks

quaint mantle
#

anyone can help?

analog inlet
#

How can i know is onDisable called by server close or /reload?

earnest lark
#

server close

#

reload does onEnable

waxen plaza
#

Can I change a skeleton's bow charge speed? or make it just shoot faster?

earnest lark
#

attributes i think

analog inlet
#

i remember my friend tell me a method using Thread.getAllStackTraces() then search with contains but i forget it

reef wind
analog inlet
earnest lark
#

no it wont

analog inlet
#

I want to check that in onDisable

analog inlet
waxen plaza
#

attributes don't work

earnest lark
#

i would thinkl it does

#

like bow speed or something

analog inlet
#

try send packets?

#

I remember bow speed isn't a attribute

earnest lark
#

no its now bow speed

#

i think its something like attack speed

#

or drawback speed

analog inlet
#

seems there is a attribute

waxen plaza
#

there is no draw speed attribute

analog inlet
#

what about change the attack speed?

waxen plaza
#

I did

#

I think that is melee attack speed

earnest lark
#

ranged attack speed mabey

analog inlet
#

if all of that aren't working then spawn a arrow earlier

waxen plaza
#

ye

analog inlet
#

I remember this will works

#

not sure at all

scenic hollow
#

Why after the passage of spigot in 1.8 to 1.9 my function ** public enum ** does not work anymore

package fr.moditetboss.mytntrun;

public enum Gstate {
    WATING,COUNT,STARTING,PLAYING,FINISH;
}

analog inlet
#

any exceptions?

quiet ice
#

That is unless you are using really old versions of java - but most java versions should be safe

torn shuttle
#

I have a really oddly specific question, if I have a HashMap<K, V1> which I want to convert to a HashMap<K, V2> and I know that V2 extends V1 and that all the contents in V1 are actually V2 classes, is there a way to cast the whole hashmap without having to iterate through it?

quaint mantle
#

.map the entry set

torn shuttle
#

or maybe I just shouldn't specify V1 in the first place?

quaint mantle
#

Off .entries call .map { do your mapping

#

Then boom you changed the value type

torn shuttle
#

I mean sure but that's still iterative right

#

I was just wondering if there was a way to cast the entire thing in one go

eternal oxide
#

? extends V1

quaint mantle
#

.map is fine….

torn shuttle
#

? extends V1?

#

as a replacement for v2?

eternal oxide
#

use generics and you shoudl be able to retrieve a V2

#

Unless its subject to type erasure. No clue on that

torn shuttle
#

aha what about

restive mango
#

Hello!

#

Does anyone know why, when you add certain dependencies, it makes other dependencies break?

#

is there a way to avoid this

torn shuttle
#

replace HashMap<K,V1> with HashMap<K,?> then cast to V2 via (HashMap<K,V2) firstHashMap

#

this should work right

analog inlet
fierce swan
#

Lmao

torn shuttle
#

I guess I can do that, does that have a material advantage?

quaint mantle
#

Nope

torn shuttle
#

I guess that's what elgar was saying earlier, thanks for the tip

#

and actually it sort of helps since the IDE already warned me that I fucked up class extensions lol

deft raft
#

thank you!

forest edge
#

Does anyone know if there is a reason for Location not having a getNearbyEntities() method that World has?

ivory sleet
#

Because Location may not contain a valid world reference

quaint mantle
#

And then you would constsntly have to updated every single location makes 0 sense

robust jolt
#
    public void AddUser(Player player) throws SQLException{
        Connection conn;
        conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/***", "***", "****");
            Statement st = conn.createStatement();
            String check = "SELECT * FROM users WHERE UUID="+player.getUniqueId();
            System.out.println(check);
            ResultSet rs = st.executeQuery(check);
            System.out.println(rs.next());
            //String q = "INSERT INTO users VALUES('"+ player.getUniqueId().toString() +"', '"+ player.getName() +"', '"+ player.getAddress().getAddress().getHostAddress() +"')";
            //st.executeUpdate(q);
            //st.close();
    }
#

Hi

#

console give me this error

#

and idk why

granite stirrup
#

Don't you need to use prepared statements

robust jolt
robust jolt
#

but when i put ResultSet don't work

#

if i delete it the method work

granite stirrup
#

but dont you have to use prepared statements so then you dont get sql injections

robust jolt
#

how i can fix?

granite stirrup
#

¯_(ツ)_/¯

#

idk much about mysql

#

but monald

#

if you read the error

#

it says its a syntax error in the mysql

robust jolt
#

yes, but i have already tried in SQL query

granite stirrup
#

¯_(ツ)_/¯

tepid monolith
robust jolt
#

i forgot ''

tepid monolith
#

to perform a command

quaint mantle
#

then you can store the player as a field or something

quaint mantle
#

move all of your gui code from the command class and the event into one gui class (so you have a class with just the command, and another class with the gui code and the gui handler event)

#

then you can call the gui class constructor in your command class, and pass in the player to the constructor, such as new GUI(player)

torn shuttle
#

aw

#

it gives class cast exception

#

what a shame

twilit vector
#

Hey guys!
I am planning to make a vehicles plugin and I am a beginner in this field so can some of you pros out there tell me what are the hard parts in this process so that I can start learning those concepts right away
Thank You! 🙂

chrome beacon
twilit vector
#

obviously yes

#

XD

chrome beacon
#

Not really sadly

twilit vector
#

umm yea

#

but i know

#

im not like a COMPLETE beginner

#

i have experience

quiet ice
#

beginning a plugin has always been a hard part for me

twilit vector
#

use intellij

quiet ice
#

IDE does not matter here

twilit vector
#

it does

quiet ice
#

Not at all

twilit vector
#

use intelij with minecraft plugin

unreal quartz
#

didn't you say you're a beginner?

#

why are you being so assertive with IDEs

quiet ice
#

vehicles plugins are even worse given that they require nms and special project structure otherwise you will be quite doomed in the long run

twilit vector
twilit vector
#

before this i was using eclipse

unreal quartz
#

and experiences developers are used to their tools

twilit vector
#

and i had to set up everything

unreal quartz
#

don't force people off what they are used to

twilit vector
#

but now with intellij minecraft plugin it does everything for me

#

im not forcing

quiet ice
#

Setting up maven/gradle is the easiest part of making a plugin

twilit vector
#

my bad

quiet ice
#

Getting a prototype to work is a lot harder

unreal quartz
#

as long as you actually understand what the minecraft plugin does then it is fine

quiet ice
#

which is the part I was referring to

unreal quartz
#

but you should at least have some experience doing it yourself

twilit vector
#

yea

#

got it

twilit vector
quiet ice
#

I think you confused me with another person on here

twilit vector
#

oh

quiet ice
#

I was just saying that starting plugins is generally complicated

#

You have to do a lot of design work, which mostly is jsut dependent on how YOU code, otherwise you will spent the rest of your life refractoring the code - and let me tell you, it isn't fun

twilit vector
#

yup refactoring sucks

#

so how should i start with the vehicles?

#

should i make the models first?

#

or the movement of cars

quiet ice
#

well, first you need to understand the basics of what you are doing, doing this serverside only is quite different from serverside + clientside

twilit vector
#

oh

#

so umm

#

oh

#

we need to write different codes for server and client?

whole stag
opal juniper
#

Spigot is limited to server side is what he means

#

Things like forge can do a bit of both which makes it easier to do complex stuff

twilit vector
#

Ah ok

#

Lol

twilit vector
# whole stag no

It was just a suggestion since I found it useful. Sorry if I hurt anybodys emotions. 🙏

whole stag
#

vscode or vim, every other editor I find to be extraneous

#

Why would I want a different editor for basically every single language and platform?

twilit vector
#

Can someone share the documention of stuff related to vehicles plugin. Since I don't know what to search on Google

whole stag
#

Having all my languages in one place is very nice

#

No worries about syncing themes, settings, or hotkeys

quaint mantle
twilit vector
#

I have all of them different for each language. When I was doing this I thought it was a great idea but later I realized that it was not 😂😅

quaint mantle
twilit vector
restive mango
#

i should also

#

still ask

twilit vector
#

Umm idts

restive mango
#

Does anyone happen to know how I might go about fixing some dependency breaking?

#

When I add a new dependency, it breaks some things for other dependencies!

#

I'm not sure how to fix it.

quaint mantle
twilit vector
quaint mantle
#

plugins are server sided, mods are server/client sided, you're talking about vehicles and custom models which would be a mod

#

it can be a server side plugin

#

just involves resource packs and optifine

quaint mantle
#

i meant the custom models

twilit vector
#

So u need to make a mod for a vehicle model

restive mango
quaint mantle
restive mango
#

for some reason

quaint mantle
#

its a lot easier to do it in a mod, yes

#

but not impossible for a plugin

quaint mantle
muted idol
#

do i use this instead of

                FileWriter updateJSONWrite = new FileWriter(mainClass.CheckpointsCounterFile);
                updateJSONWrite.write(jo.toJSONString());
                updateJSONWrite.close();
quaint mantle
#

yeah i agree

#

how would i use protocollib to change a players above-head username (intercept the packet)

twilit vector
#

But if it is in a mod then it won't work on a server right?

quaint mantle
vague oracle
restive mango
#

Adding a spigot dependency is breaking pieces of my code! How should I fix this?

#

im not sure if i can explain that in other ways

muted idol
restive mango
#

yup

ivory sleet
#

Look at the compiler and then try fix what the compiler complains about

opal juniper
#

What is the error

twilit vector
quaint mantle
#

it can, with resource packs

#

Mods can’t work on spigot servers though. Resource packs can

restive mango
#

Specifically, while I have the dependency loaded, I get the error:

java: cannot find symbol
symbol: method isGenerated()
location: variable loc of type org.bukkit.Location

For a number of different things.

#

If I remove the dependency, I don't have that problem, BUT.

opal juniper
#

Probs conflicting imports then but idrk

restive mango
#

import net.minecraft.server.v1_16_R3.EntityZombie;
import net.minecraft.server.v1_16_R3.World;

public class oldredgodsandme extends EntityZombie {
public oldredgodsandme(World world) {
super(world);

}

}

twilit vector
restive mango
#

I can't impor tthat!

#

yes

twilit vector
restive mango
#

How do I resolve conflicting imports?

opal juniper
#

Show Pom.xml

restive mango
#

<repositories>
<repository>
<id>enginehub-maven</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>destroystokyo-repo</id>
<url>https://repo.destroystokyo.com/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>lotc-release</id>
<url>https://maven.pkg.github.com/lord-of-the-craft/maven-packages</url>
</repository>
<repository>
<id>md_5-public</id>
<url>http://repo.md-5.net/content/groups/public/</url>
</repository>
<repository>
<id>papermc-repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
</repositories>

#

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>co.lotc</groupId>
<artifactId>tythan-bukkit</artifactId>
<version>1.15.2-R0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>

muted idol
#

?paste

undone axleBOT
restive mango
#

ty

#

probably one or two of the repos im not using anymore granted rofl

slow trellis
#

Hello, i have a question. I want to give every player in skyblock an item and when they right click on it, i want that it gives the skyblock GUI (execute the /is command), is that possible?

quaint mantle
#

yes

slow trellis
#

how

quaint mantle
#

when they join, add the item to their inv

opal juniper
restive mango
#

well

#

spigot lets me use net.minecraft.server

slow trellis
#

how do i make the item work?

restive mango
#

if i remove the spigot dependency it fixes everything else

#

but i want to do custom mobs

quaint mantle
#

ok but why are you depending on both spigot and paper

opal juniper
#

ok so remove paper api??

quaint mantle
# slow trellis how do i make the item work?

on inventoryinteractevent check if the item is the right type of item, to make it easier probably make the item something unobtainable and check if its a right click
then open the gui

opal juniper
#

Dont make it something unobtainable

restive mango
#

removing paper removes .getnearbyentities

opal juniper
#

Use the pdc

slow trellis
#

isn’t there like a plugin for that?

quaint mantle
quaint mantle
opal juniper
#

^^

quaint mantle
slow trellis
opal juniper
quaint mantle
#

oh

opal juniper
#

its like an extra "paper" method ya know

opal juniper
#

so just depend on paper

#

lmao

restive mango
#

is there a way to get like just the dependency for getnearbyentities

#

wat

restive mango
#

oh

#

lemme see

#

sorry about being a total moron btw

quaint mantle
#

Hello someone know how to set 0 into scoreboard?
it just disappear this line when it 0
like

kills:
0
deaths:
0

its just look like

kills:
deaths:

someone know how to fix that?

#

code:

            sidebar.getScore(translate("&eUsername&8:")).setScore(-1);
            sidebar.getScore(translate("&8➥ &7" + player.getName())).setScore(-2);
            sidebar.getScore(translate("")).setScore(-3);
            sidebar.getScore(translate("&cKills&8:")).setScore(-4);
            sidebar.getScore(translate("&8➥ &7" + kills)).setScore(-5);
            sidebar.getScore(translate("&cDeaths&8:")).setScore(-6);
            sidebar.getScore(translate("&8➥ &7" + deaths)).setScore(-7);
            sidebar.getScore(translate("&cKill Strikes&8:")).setScore(-8);
            sidebar.getScore(translate("&8➥ &7" + strikes)).setScore(-9);
            sidebar.getScore(translate("&cKDR&8:")).setScore(-10);
            sidebar.getScore(translate("&8➥ &7" + kdr)).setScore(-11);
onyx cradle
#

Any way to change the l4j config?

ivory sleet
#

log4j?

onyx cradle
#

yes

ivory sleet
#

Probably through the usual way

#

An xml config

kind coral
#

can i set the amount of an itemstack to 0?

onyx cradle
#

yeah but the xml config is owned by spigot

kind coral
#

will it remove it from the inventory?

ivory sleet
#

Thought spigot loaded the plugin config if one is present which is the implementation of Plugin#getLogger

#

Or maybe on paper at least shrug

quaint mantle
#

in higher versions just removes it

kind coral
#

OH THANK GOD THEY FIXED IT

random isle
#

moin moin kann wer von euch Welt-Generatoren programmieren?

ivory sleet
#

English buddy

sage swift
#

croissant hitler

random isle
#

can anyone programm a world generator or has a tutorial video

limpid bronze
#

Hey, I'm having a problem with one of my programs. I'm trying to make it so that when you click on an item it enchanted it, if you click on another item it enchanted it but it removes the enchantment of the other item. Basically, there would be only one enchanted item each time. Except that the enchantment stays on the item while I clicked on another item and the reason does not change. Here is the GUI and the setGlow function.

public static void setGlow(boolean glow, ItemStack itemStack) {
        if(glow) {
            if(ItemStackUtils.isAnArmor(itemStack)) {
                itemStack.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1);
            } else {
                itemStack.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 1);
            }
            ItemMeta meta = itemStack.getItemMeta();
            meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
            itemStack.setItemMeta(meta);
        } else {
            ItemMeta meta = itemStack.getItemMeta();
            for(Enchantment enchantment : meta.getEnchants().keySet()) {
                meta.removeEnchant(enchantment);
            }
        }
    }

https://hastebin.com/kuxegoguva.csharp (GUI)

sage swift
#

what if they use the armor for the knockback, lol

limpid bronze
sage swift
#

sure they can

#

hold armor in hand, punch

#

the best solution to making a glow is creating a new enchantment

#

the client won't be able to display the name at all but it will show the glow

limpid bronze
sage swift
#

because the client only has vanilla enchantment names

#

mmm a gui

supple surge
#

do you know any way to hide the hotbar, heart bar and food bar ...?

OriginRealms manages to hide this as if it were spectator and survival mode... I found something about custom game mode but I'm too lost about how to do it...

nova sparrow
#

I need help with this. Everytime I try to run the command, it displays that an internal error occrued, and I can't find it.

chrome beacon
supple surge
chrome beacon
#

Interessting

#

You can always setup a quick packet listener and see what the client is getting

#

(Using Fabric or Forge)

supple surge
#

But here you simply use a texturepack to make everything work, no mods or clients...

quaint mantle
nova sparrow
#

Yes

chrome beacon
#

We need that error though ;/

nova sparrow
#

If you want, I can show you the plugin.yml file

#

There was no wrror on the console

#

Just doesn't work when I try to run it

chrome beacon
#

Well it told you there was an error

#

So there is an error

earnest lark
#

show us the error

#

in the server dubuger

nova sparrow
#

There is none

#

Just on the consume in the server

chrome beacon
#

It will never tell you that unless there is an error

#

Send the full server log in a paste

#

?paste

undone axleBOT
nova sparrow
#

Ok

#

Here is the error

chrome beacon
#

So there was one .-.

earnest lark
#

code

nova sparrow
#

yeah, I was just dumb

chrome beacon
#

...

#

containsValue null

#

And put null

#

Also that while loop

#

You might just want to rewrite that entire thing

nova sparrow
#

how might you jsuggest to change that

#

the while loop

chrome beacon
#

What's even the point of that one

#

Also please follow conventions .-.

nova sparrow
#

Becauee entityType can choose things like area effect cloud and then you can't kill that

chrome beacon
#

?conventions

undone axleBOT
nova sparrow
#

yeah I forget to follow conventions a lot, I'm still fairly new to java

young portal
#

i know this is not spigot stuff, but can someone help me installing nms into my maven repo? afaik there is no online maven repository because it contains mc source code. However i could not figure out how to use/install nms in intellij. I even tried running Buildtools and importing that craftbukkit file manually

if im not allowed to ask it here because this is spigot pls let me know
also i could provide my current pom.xml if it helps

chrome beacon
#

Anyway avoid while loops as much as you can. It's better to use a loop with a set range or you might kill the server if you're not careful

nova sparrow
#

ok

fierce swan
chrome beacon
opal juniper
#

cant u just depend on spigot

#

instead of the api

young portal
#

is the path already starting in my directory and could i do like src/main/java/resources/nms.jar? Or do i need the full path like C:\...

fierce swan
opal juniper
#

Run build tools and depend on spigot

#

not spigot-api

young portal
#

also, which file? now the spigot-api.jar i got from buildtools?

chrome beacon
# fierce swan Wdym

That feature should not be used and might be removed in future versions of maven

fierce swan
#

Ok then explain what I should do lmao

young portal
#

oh okay whats the new method to do it

chrome beacon
#

After running BuildTools just switch spigot-api to spigot in your POM

young portal
#

this one? ```xml

    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.16.5-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>```
chrome beacon
#

Yeah

#

Change spigot-api to spigot

young portal
#

do i need to run buildtools in my project directory or just somewhere on my pc (like my desktop)

earnest lark
#

player.setSaturation(20.0f);

#

would this work?

fierce swan
#

If it doesn't work that answers your question

chrome beacon
young portal
#

alright i will try this

#

thank you

torn shuttle
#

Is there an easy way to tell if a user is not from the java edition?

chrome beacon
#

Geyser should have an API

opal juniper
#

they do

#

im not a fan of it

#

but it exists

earnest lark
#

?paste

undone axleBOT
onyx cradle
#

ok so im trying to track an item, and I have a json file which has the location the item was last seen.
When my plugin is enabled, I load this file and then I load the chunk the item was last seen in.
The problem is that after loading that chunk, there are no entities in the chunk. After logging on though, I can go to this spot and the entity is there, and in the place the json file says it should be. So why is it not in the list of entities after chunk load?

fluid cypress
#

for some reason, worldguard flag deny-spawn doesnt work for slimes, whats the best way of blocking a specific mob spawn? maybe there is already a command for that? if not, any way to iterate over all entities? or all mobs entities, or something like that

earnest lark
#

ok i need to know if all of my code will work in the subcommands section

chrome beacon
onyx cradle
#

sure

sharp bough
young portal
#

seems to work @chrome beacon thanks!!! ive been struggeling for a while <3

sharp bough
earnest lark
#

oh wait

earnest lark
#

yeaaaaa

onyx cradle
#
    fun load() {
        val file = File(plugin.dataFolder, "locations.json")
        file.createNewFile()
        try {
            val root = mapper.readTree(file)
            for(entry in root.fields()) {
                val location = Location(
                    plugin.server.getWorld(UUID.fromString(entry.value["world"].asText())),
                    entry.value["x"].asDouble(),
                    entry.value["y"].asDouble(),
                    entry.value["z"].asDouble()
                )

                location.chunk.load(false)
            }
            plugin.logger.info("Loaded $stoneLocations")
        }
        catch(e: IOError) {}
    }

    @EventHandler
    fun onItemSpawn(ev: ItemSpawnEvent) {
        val type = ev.entity.itemStack.infinityStoneType ?: return
        stoneLocations[type] = ev.entity
        save()
    }

    @EventHandler
    fun onChunkLoad(ev: ChunkLoadEvent) {
        for(entity in ev.chunk.entities) {
            if(entity is Item) {
                val type = entity.itemStack.infinityStoneType ?: continue
                stoneLocations[type] = entity
                save()
            }
        }
    }

Im using kotlin because im a chad but hopefully you can still tell what its saying (?: means if null)

earnest lark
#

?paste

undone axleBOT
ivory sleet
#

BanePig what’s the issue?

onyx cradle
#

also even when i manually log in, both ChunkLoadEvent and ItemSpawnEvent dont end up changing stoneLocations, even though theres pretty clearly an item in the chunk

ivory sleet
#

Oh sorry I am too tired for this complex problem, @chrome beacon do your stuff PES_Blush

onyx cradle
#

i want to say its a bug but if im wrong ill just end up feeling stupid so idk if i want to go that far

ivory sleet
#

Also I am not a native kotliner so makes it quite difficult altho I use kotlin dsl for gradle sometimes

onyx cradle
#

i can convert it to java

ivory sleet
#

Sure lol

onyx cradle
#

i mean really all that matters is the onChunkLoad event though

#

since I dont think its supposed to call onItemSpawn since its just loading in, and the issue occurs whether I load the chunk from code or from game

chrome beacon
#

Oh no Kotlin

onyx cradle
#

?paste

undone axleBOT
onyx cradle
chrome beacon
#

Anyway many of spigot events fire early

#

Try delaying checking all entities by one tick

onyx cradle
#

yeah i considered that

#

kinda sucks to do though :/

#

who knows what could happen during that tick

chrome beacon
#

True but does it really matter that much

whole stag
#

Can I not make a potion have two effects with different durations?

onyx cradle
#

well its still not working but might be something i can fix

chrome beacon
#

You can't have speed 1 for 30 and speed 2 for 5 seconds

whole stag
#

Any idea why it's not working then?

#

?paste

undone axleBOT
quaint mantle
#

Hey how can I detect that a player clicked on an item contained in an itemframe?

chrome beacon
whole stag
chrome beacon
#

So uh why are you looping all effects?

#

Actually nvm

whole stag
#

Easiest way to get all of them

chrome beacon
#

This should work

#

Any errors

whole stag
#

No errors

#

This is what it ends up with

fluid dust
#

Can you only do plugins in Spigot or can you create new blocks and items too?

whole stag
quartz plume
#

hello im looking for help i finnaly got a chat format to work with papichat but then when i loggen back in this morning it was the standard chat format with <name> message i have looked in all the config files but i dont know where the problem is

chrome beacon
whole stag
#

No, it doesn't work

quaint mantle
whole stag
#

See the picture

#

Nausea should be 30 seconds, blindness should be less than one second

chrome beacon
#

Yeah I see that now

#

Did you forget to use the latest version of your plugin?

whole stag
#

Nope, already checked that

chrome beacon
#

Odd I will have to check it tomorrow

#

If you can't solve it ping me then

whole stag
#

Okay

hasty prawn
#

@whole stag You're making blindness only last for 1 tick, and for Nausea, a lot of potion effects break if you give them too high of a level, try something lower for Nausea

earnest lark
#

i want to do something like /do heal adeptvail for a command but i do not understand how to get the subcommand can anyone help?

hasty prawn
#

I don't even think the level matters to Nausea, so 1 should be good

hasty prawn
earnest lark
#

how

#

lol

hasty prawn
#

args[<number>], so in your case, args[0] returns "heal" and args[1] returns "adeptvail"

fierce swan
#

Of course you should also make sure /do is not already a command on the server lol

earnest lark
#

its not lol

fierce swan
#

Because I feel like that would be more common than other commands

#

Alr

hasty prawn
#

Honestly /heal might be more common than /do

fierce swan
#

True

earnest lark
#

yea mabey heal do adeptvail

#

or /heal confirm adeptvail

hasty prawn
#

Or just get rid of do

#

./heal adeptvail

fierce swan
#

I'm p sure /heal is a builtin essentials command

earnest lark
#

well im practicing the subcommands

hasty prawn
#

It is

hasty prawn
earnest lark
#

yea

#

so how would i make it so args[0] is heal

#

do i do a string

#

like String h = args[0] or something

hasty prawn
#

Yes

earnest lark
#

and then for target i should do String t = args[1] right

hasty prawn
#

Yeah that's the gist, you'll have to do length checking too.

#

Also would name your variables something more useful

fierce swan
#

^

#

Like

earnest lark
#

well obviosly

fierce swan
#
String subCMD = args[0];
String target = args[1];
earnest lark
#

yea

#
            String subCMD = args[0];

            Player target = Bukkit.getPlayerExact(t);
            target.setFoodLevel(20);```
ive got this so far
#

this is the feed one not heal

sharp bough
#

what is it used to make that kind of input sytem? it like opens a sign and lets you enter text and number

quaint mantle
#

question.

fierce swan
#

ProtocolLib is fun

quaint mantle
#

do i need Vault to use permissions in Bukkit

sharp bough
#

what are you triyng to do

sharp bough
#

how are you doing it?

quaint mantle
#

NOT use any groups

#

but just adding perms to the player

fierce swan
# sharp bough how are you doing it?

To open a sign for a player you need to send a BlockChange packet to change an out of sight block that is currently loaded for them to a sign, then sent an OpenSignEditor packet to open the sign editor up, then once the player clicks done (sends an UpdateSign packet) you use the input and send another BlocckChange packet to change the block back

sharp bough
#

theres no way its that complex

fierce swan
#

It is

sharp bough
#

isint there an API or smth?

fierce swan
#

There might be idk

quaint mantle
#

yikes

chrome beacon
fierce swan
#

But personally I don't want to rely on an API that might either stop being updated or go unmaintained

chrome beacon
sharp bough
#

Only in 1.14.X for the moment

chrome beacon
#

No

#

1.17

#

Read me is outdated

chrome beacon
fluid cypress
#

how do i read this?

regions:
- - ==: org.bukkit.Location
    world: world
    x: 1.0
    y: 2.0
    z: 3.0
    pitch: 0.0
    yaw: 0.0
  - ==: org.bukkit.Location
    world: world
    x: 6.0
    y: 7.0
    z: 8.0
    pitch: 0.0
    yaw: 0.0
- - ==: org.bukkit.Location
    world: world
    x: 12.0
    y: 22.0
    z: 32.0
    pitch: 0.0
    yaw: 0.0
  - ==: org.bukkit.Location
    world: world
    x: 62.0
    y: 72.0
    z: 82.0
    pitch: 0.0
    yaw: 0.0
saveDefaultConfig();
FileConfiguration config = getConfig();
List<List<Location>> regions = config.getObject("regions", ???);

what do i have to send as the second parameter to the getObject method?

fluid cypress
#

what

sharp bough
#

or getConfigSection

fluid cypress
#

but i want to get the entire list

fluid cypress
#

with config.set("regions", listObject)

sharp bough
#

i think

fluid cypress
#

just to know the syntax

fluid cypress
#

now i want to get the list of lists of locations

chrome beacon
regal lake
#

Just use getList()

chrome beacon
#

Or that

fluid cypress
#

it says Cannot resolve method 'getObject(java.lang.String)'

chrome beacon
fluid cypress
#

can i ignore the unchecked warning

quaint mantle
#

what should i import for Iterator <stuff here>?

#

sorry ok thats weird

#

so im trying to see if this permission thing actually works, so im just gonna send the permissions to console (debug)

#

and i c ant just like, p.getPermissions();

#

i have to use some iterator magic stuff

regal lake
#

@fluid cypress
It should work, you also have to hast it to List<Location> etc.

fluid cypress
#

what was the class that created an area giving it 2 locations? And then i can check if a location is within that area or not, i remember using it like a year ago

quaint mantle
quaint mantle
sand orbit
#

Does anyone know about the changes in specifically (1.17.1) to the PacketPlayOutSetSlot class?
In 1.17 the constructor requires two integers and the itemstack--as per usual, however in 1.17.1 it has been changed to three integers and the itemstack.
I am unsure what the new integer specification is doing and there doesn't seem to be any references to this change.

earnest lark
#

oh no

manic helm
#

Somebody tried to play with Protocollib?

earnest lark
#

thats not good

sharp bough
#

i wanna make the sign thing

#

but its a simple thing

#

cuz i dont wanna get involved with an overcomplicated feature

hasty prawn
manic helm
# sharp bough me

I'm trying to register my thing. but i get nullpointer on this line manager.addPacketListener(new PacketAdapter(this, ListenerPriority.HIGH, PacketType.Handshake.Client.SET_PROTOCOL, PacketType.Login.Server.DISCONNECT) {

prisma needle
#

Hey guys, would it be possible to register a bunch of commands from an array for bungeecord? I'm trying to make a plugin which let's you make aliases for commands, but I want the aliases to actually show up as registered commands...

manic helm
#

Idk if stuff was removed as i'm new to use protocollib

sharp bough
#

iv never used packets

manic helm
#

F.

sand orbit
hasty prawn
#

And I assume Core line 168 is manager.addPacketListener(new PacketAdapter(this,?

manic helm
#

yes

hasty prawn
#

manager is probably null

manic helm
#

wut?

#

ProtocolManager manager = ProtocolLibrary.getProtocolManager();

hasty prawn
#

🤔 try printing it and see what it says

manic helm
#

sec

#

._. manager is null but

sage swift
hasty prawn
#

Find respective class -> Ctrl click -> it sets those vars to that

sage swift
#

mojang more like stulpid

#

roostedd

manic helm
hasty prawn
#

Unsupported MC version for your ProtocolLib version maybe? Never worked with ProtocolLib but I assume getProtocolManager is dependent on the server version

manic helm
#

Ill try another ver and get back to u

quaint mantle
#

ayyy

#

any idea why commands arent showing up even if the uesr has the permission?

#

i.e;

setrank requires nectar.admin, but it does not appear if i try to tab it

sage swift
quaint mantle
#

i dont think its a server-issue

fluid cypress
#

plugin.getConfig() gives me the old config, do i need to do something to make it read the config file again?

sage swift
#

JavaPlugin#reloadConfig

quaint mantle
fluid cypress
#

instead of getConfig or before getConfig?

sage swift
#

I like to saveDefaultConfig right before i reload it too in case the user deleted it

quaint mantle
sage swift
#

"refresh"

quaint mantle
sage swift
#

nah it's easier than working on servers, it's basically what i procrastinate with

fluid cypress
#

is there any way to listen to a command without blocking or overwriting it? also, is there a way to overwrite a command? like the /gamemode command ie

sage swift
#

if you register a spigot command it will overwrite vanilla commands

#

you can listen for a command with CommandPreProcessEvent

#

or whatever it's called

fluid cypress
#

what about another plugin's command

drowsy helm
#

PlayerCommandPreprocessEvent

#

and i believe its called for any command

drowsy helm
#

not just your plugin related

quaint mantle
#

no point

drowsy helm
sage swift
#

Player*

quaint mantle
#

chill

quaint mantle
cold tartan
fluid cypress
quaint mantle
cold tartan
#

like they arent entirely set to air

sage swift
#

chunk.getX()*16

#

you probably removed some other area lul

cold tartan
#

ahhhh

#

thats what i forgot

#

tysm

sage swift
#

(or do both run?)

#

never mind, no they don't

quaint mantle
#

?warn @sage swift name calling/insult

undone axleBOT
#

That is not a registered reason!

sage swift
#

waah

#

too sensitive

quaint mantle
quaint mantle
sage swift
#

im saying others are too sensitive

#

you ||friend||

quaint mantle
#

anyways thats a warning just dont do it again

drowsy helm
#

so edgy

sage swift
#

i don't know if i can contain my power bro

quaint mantle
#

?warn @quaint mantle doing his job 2 days later

#

?

#

it only was reported now lol

unreal quartz
sage swift
#

by whom, i wonder

unreal quartz
#

me

quaint mantle
sage swift
#

@quaint mantle thanks dude

quaint mantle
#

sure

quaint mantle
sage swift
#

black people

quaint mantle
#

im white

sage swift
#

don't even get me started

quaint mantle
#

oh god

#

?kick @sage swift

undone axleBOT
#

Done. That felt good.

quaint mantle
#

lmao

sage swift
#

based

eternal night
#

The spigot communit never fails to amaze me

quaint mantle
#

agreed

#

agreed

sage swift
#

I know this is fun

eternal night
#

I think I'd rather have someone ask for help because they can't figure out how to listen to events than having trolls like this around 😅

sage swift
#

how do I listen to events

#

just kidding i know 😎

quaint mantle
sage swift
#

it dosent worke!

quaint mantle
#

oh well

sage swift
#

also single-letter variable names outside of for loops? cmon bro

cold tartan
#

single letter variable names are great???????

#

like "Block b"

quaint mantle
sage swift
#

you're joking

quaint mantle
#

so much cleaner

sage swift
#

christ

cold tartan
quaint mantle
#

OR NUMBERED

quaint mantle
#

Block b2 =

eternal night
#

Hmmm yes

cold tartan
#

i also think outside of loop = bad

sage swift
#

well yeah

cold tartan
#

i didnt see the edit at first

quaint mantle
#

i just prefer using the shortest name possible

#

it looks more clean && organized

sage swift
#

i, j, k, x, y, z is fine

#

but for an iterative for loop should still write out the variable

#

for (Block block : blocks) {

quaint mantle
#

😳 ew

#

Block b : blocks

cold tartan
sage swift
#

mhm, come back when your plugin has more than 5 classes and you don't know what's what

quaint mantle
sage swift
#

you can't tell me what to do

#

i have a resource on spigot

eternal night
#

Pfft what a lame flex

sage swift
#

it's a poisoned plugin

#

that was a joke 👍

#

(you never know)

quaint mantle
#

Really arguing over variable names got me dead

quaint mantle
#

Could matter less

#

¯_(ツ)_/¯

sage swift
#

But it doesn't matter less

quaint mantle
#

im just saying that i prefer shorter variable names

#

I don’t but idc that you do. Do what you want idk why gecko would even care

#

because hes a troll lol

sage swift
#

I have ascended past helping

#

Don't worry

quaint mantle
#

idk what that means

sage swift
#

||of course you don't||

eternal night
#

Does anyone know a tool that exposes Minecrafts gametestinf framework that was included in 1.17?

cold pawn
#

Dose anyone know how id be able to reload a players Game Profile without them re-logging? For some context I wanna change the player skin to something else and I do this through the game profile of the player. The only issue is the game profile dosent get updated and hiding and showing the player only makes there skin visible to those around but not the player. Dose anyone know a fix to updating the game profile without re-logging?

quaint mantle
#

packets

#

use a respawn packet

#

and player info packets

eternal night
#

Does player.spigot().respawn() not get close ?

sage swift
#

you could take a look at how SkinsRestorer does it

cold pawn
#

Im taking a look at that now

dense pulsar
#

anyone have an open source 3x1 pickaxe

sage swift
#
  player.breakBlock(event.getBlock().getRelative(BlockFace.UP); //yes this is an api method now
  player.breakBlock(event.getBlock().getRelative(BlockFace.DOWN);```
dense pulsar
#

oh you can access the blocks like that?

#

i had this ```java
Location location = event.getBlock().getLocation();
for(int x = -1;x <= 1;x++){
for(int y = -1;y <= 1;y++){
for(int z = -1;z <= 1;z++){

                        Block block = location.getWorld().getBlockAt(
                                location.getBlockX() + x,
                                location.getBlockY() + y,
                                location.getBlockZ() + z);

                        if (!(block.getType() == Material.BEDROCK)) {
                            block.breakNaturally();
                        }
                    }
                }
            }
distant forge
#

Heyo, looking for a way to ride other players, without blocking their view or interactions. Tried armor stand with isMarker already. Anybody experience?

sage swift
#

if it doesn't block the view where would the riding player be? just higher up?

#

could probably make an invulnerable baby armor stand between them

waxen plinth
#

Marker is size 0

#

It doesn't change anything

sage swift
#

i thought markers were server side

waxen plinth
#

Use a small armor stand

distant forge
waxen plinth
#

Hm

sage swift
#

anything riding a player will block that player's interaction

waxen plinth
#

Invisible silent size 1 slime?

distant forge
waxen plinth
#

¯\_(ツ)_/¯

distant forge
#

Are you guys familiar with custom entities? How about a custom armor stand?

sage swift
onyx cradle
#

what event tracks items eploding

#

exploding*

sage swift
#

only way to stop the player from being unable to interact would be to do the riding server-side which wouldn't look good for the player

waxen plinth
#

If you cancel the EntityDamageByEntityEvent it should prevent the items from being destroyed by an explosion

distant forge
#

Thought about using raytrace. Can I somehow trigger a right-click on found entities?

distant forge
sage swift
#

not on the client end

distant forge
#

So possible with nms?

waxen plinth
#

...

distant forge
quaint mantle
#

i've never noticed anything with it

#

i dont really work with armour stands often so thats why, but what is the Marker

quaint mantle
distant forge
#

No. Not really. I try to avoid interacting with a passenger, when he is riding the player

quaint mantle
#

You can hack into the netty pipeline and cancel certain packets.

#

Therefore the server won’t do shit

waxen plinth
#

...

quaint mantle
#

?

#

Puts dots with no logic. Cringe

distant forge
#

He did this to me as well xD

distant forge
quaint mantle
#

That just means he doesent know the answer but tries to talk on other responses nice ego bud. And can you explain more

#

...

#

What’s doing what with another entity

quaint mantle
#

...

#

is recommend async for playsound? or send normal?

quaint mantle
#

Normal

#

    public static void playSound(Player player, Sound Sound, float volume, float pitch) {
        new BukkitRunnable() {
            @Override
            public void run() {
                player.playSound(player.getLocation(), Sound, volume, pitch);
            }
        }.runTaskAsynchronously(mainEssentials.getPlugin());
    }
#

or player.playSound(player.getLocation(), Sound, volume, pitch);

#

Don’t do something async without good reasoning

#

wait

#

why not just use player.playSound

#

idk why you're using a void for it lol

#

Looks like he was trying to do it async

quaint mantle
quaint mantle
#

A user said I was using the sound too much and should do a function.

#

duke i`m confused

#

Yes but you don’t need to make it async

#

That’s really the issue

#

oh ,ok

drowsy helm
#

whats the point of that function

quaint mantle
#

same

quaint mantle
#

that does play a sound for one player

quaint mantle
#

player#playSound()

drowsy helm
#

its just moving the args around and making it async

quaint mantle
#

yeah lol

sage swift
#

scheduling a bunch of async tasks to play sounds is arguably worse for the cpu

quaint mantle
#

yeah

#

just use the bukkit one

#

Do I still use a function to send a sound or do I use the code directly?

#

function

#

code: player.playSound(player.getLocation(), Sound, volume, pitch);

#

nah, i'd personally just delete that

#

it literally does nothing lol

#

Yea it’s pointless

#

oh ,ok

drowsy helm
#

only benefit is getting player loc

quaint mantle
#

Not even

#

I'm thinking about developing a simple chat plugin for my server.

#

okkk

sage swift
#

Ok.

quaint mantle
#

just using global and local chat

sage swift
#

Sounds like a plan.

quaint mantle
#

seems legit 👍

#

A friend sent me a code of his, what do you think?

#

one moment.

sage swift
#

?paste

undone axleBOT
quaint mantle
#

that looks so overcomplicated lol

#

needs perms to chat

quaint mantle
drowsy helm
#

do you need source for it?

#

source code

#

why post in dev channel then

#

yeah

soft moat
#

sorry

quaint mantle
dense pulsar
#

hey I have this line ```java
(player.getFacing() == BlockFace.UP || player.getFacing() == BlockFace.DOWN)

sage swift
#

i think facing is only for the 4 sides

dense pulsar
#

how do I do the up down one

sage swift
#

i have some code for all 6 involving yaw

dense pulsar
#

hmm

sage swift
#

pitch, whatever

dense pulsar
#

that mihgt do the trick, let me try

#

yep that does it

#

thanks @sage swift

sage swift
#

:)

fierce salmon
#

I am getting this error in console when I send the command that I made. Let me know if you need me to send the code

sage swift
#

custom inventory is size 1

proud basin
#

866493661809082418

sage swift
#

has to be multiple of 9, just like the error says

fierce salmon
#

ok okay ty

proud basin
#

@naive fox

granite burrow
#

Is there anyway to remove this without editing the jar file or setting the players bed spawn location?

silk mirage
#

No, You'll need to edit the bytecode or compile it through compiler from source code after changes.

silk mirage
#

yes

granite burrow
#

oh alright, I mean I found a way to edit it with winrar but if theres no other way I guess thats the end of this case lmao

silk mirage
#

You can use recaf.

#

If you know java, you can use recaf and Do the thing.

granite burrow
#

yeah, unfortunatly I don't want users to have to edit the spigot.jar in order to properly use my plugin so I just removed that part of the plugin

whole stag
#

Theoretically couldn't you set the player's respawn point to suppress that message?

granite burrow
#

yeah I just don't want to set the players respawn point as I use that to check if the player has a respawn location while setting their home bed

quaint mantle
#

i think i found a bug when making a plugin, i have a listener for the playerTeleport event but if the cause of the teleport is by chorus fruit, then the player.teleport function won't work but it does when the cause isn't chorus fruit, like an ender pearl

silk mirage
#

which version?

sharp bough
#

send the code

#

error

#

etc

#

?paste

undone axleBOT
sharp bough
#

use that

silk mirage
sage swift
#

either cancel and do yours, or delay it by a tick

quaint mantle
#

i tried cancelling it and not cancelling it but neither worked

#
public class PlayerTeleport implements Listener {
    @EventHandler
    public void onPlayerTeleport(PlayerTeleportEvent event) {
        Player player = event.getPlayer();
        System.out.println("First");
        if(event.getCause() == PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT) {
            System.out.println("Second");
            System.out.println(player.getLocation().getX());
            if(player.getItemInUse().getItemMeta().getDisplayName().substring(0, 4).equals("warp")) {
                event.setCancelled(true);
                System.out.println("Third");
                player.teleport(new Location(player.getWorld(), player.getLocation().getX() + 5, player.getLocation().getY(), player.getLocation().getZ() + 5));
                System.out.println("Fourth");
            }
        }
    }
}

this outputs first second third first then fourth but no teleportation happens

#

but it does work when the cause is an enderpearl somehow (although i don't use getItemInUse for the pearl)

silk mirage
#

which version smh

quaint mantle
#

i installed the latest bukkit build tools?

#

and my mc version is 1.17

#

or.. wait version of wot?

#

i'm using spigot 1.17

sage swift
#

yeah no that definitely seems like a spigot bug to me, i see nothing wrong with that code

#

workaround would be to do it a tick later though, as i said

#

i would report it on the bug tracker

quaint mantle
#

where could i find the bug tracker?

#

also.... how do i uhhh delay something by a tick?

quaint mantle
#

how do i execute a method a tick later*(?)

sharp bough
#

with a scheduler

#
    // code
}, 1L);```
fluid cypress
#

this is returning null: instance.getServer().getWorld("world"). i can assure you that world exists, maybe onEnable is too early to use this? i cant think what the problem might be

undone axleBOT
hardy swan
#

#runTask means one tick later

quaint mantle
#

i've never heard of schedular before, so would the runnable be player.teleport or

fluid cypress
# sharp bough send code
    private static Plugin instance;

    @Override
    public void onEnable() {
        instance = this;
        stuff here...
        setArea();
    }

    public static void setArea() {
        ArrayList<BoundingBox> regions = new ArrayList<>();
        World world = instance.getServer().getWorld("world");
        more stuff...
hardy swan
fluid cypress
#

i mean, its not much, i dont get it

hardy swan
#

just like opening an inventory on inventory close

sharp bough
sharp bough
#

and not bukkit

gloomy edge
#

Question I'm using maven modules for NMS and of course Minecraft java version has been bumped to 16 from 8 for my 1.17 nms maven module I'm using the special source maven plugin do I have to compile it in Java 16 or can I compile the module in java 8?

hardy swan
#

Just getServer() will do

#

It is a static method of JavaPlugin

fluid cypress
quaint mantle
#

so would i do something like this?

if(event.getCause() == PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT) {
    if(player.getItemInUse().getItemMeta().getDisplayName().substring(0, 4).equals("warp")) {
        event.setCancelled(true);
        Bukkit.getScheduler().runTaskLater((Plugin) this, () -> {
            player.teleport(new Location(player.getWorld(), player.getLocation().getX() + 5, 80.00, player.getLocation().getZ() + 5)
        }, 1L);
         System.out.println("Fourth");
    }
}
wispy fossil
#

theyre the same I think
onEnable is probably too early to get a world

hardy swan
quaint mantle
#

hmmmm i'm getting an error The method runTaskLater(org.bukkit.plugin.Plugin, java.lang.Runnable, long) in the type BukkitScheduler is not applicable for the arguments (org.bukkit.plugin.Plugin, java.lang.Runnable, long) but when i do a quick fix by casting argument 2 to consumer<bukkittask> i get another non quick fix-able error

#

since it shows an error under runTaskLater

sage swift
#

dont cast it to Plugin

#

is this your class that extends JavaPlugin?

quaint mantle
#

oh wait shoot forgot a parenthesy

sage swift
#

then you don't need to cast it

quaint mantle
#

it fixed it

#

sry

fluid cypress
#

is there an event for a plugin being loaded or something?

sharp bough
#

the hard dependency

#

im not sure tho

hardy swan
#

there might be a worldloadevent or sth like that in the plugin's api?

#

perform whatever operations you want in its listener

hardy swan
#

spigot probably creates a dependency graph of plugins to be loaded and toposort it

dense pulsar
#

is it possible to do player.damage but have the damage come from another player?