#help-development

1 messages · Page 2215 of 1

drowsy helm
#

thats how i would do it yeah

glossy wren
#

aight tyvm 🙂

drowsy helm
#

nws

#

keep in mind that creates a new item each time its called

#

but thats not that bad honestly

polar cypress
#

can i run 1.18 on java 15

#

or does it have to be 17

slow mica
#

17+ only if I remember correctly

polar cypress
#

ok

winged anvil
#

when would I use static blocks in a project

polar cypress
#

downloading new java versions can be quite painful

quaint mantle
#

how

polar cypress
#

or something similar

quaint mantle
#

no you dont

#

download, run

#

add to path

#

done

polar cypress
#

ok ig

river oracle
#

I mean if you wanna hve multiple JDKs you can just switch the env variables its quite easy

river oracle
#

you know what environment variables are right?

polar cypress
#

i used to have to tell run.cmd which java version to use if i were to run like a 1.16 server

river oracle
#

:/ how is that easier than changing the environment variable

polar cypress
river oracle
#

👀 so you code

polar cypress
#

edit system enviromental variables?

river oracle
#

I'm quite honestly surprised

polar cypress
#

🤷‍♂️

river oracle
#

I had to even post this link

polar cypress
#

thanks? i guess...

river oracle
#

You can just change your jdk version by changing the JAVA_HOME path

#

its super easy and you could even automate it easily

#

not sure how to on windows 🤷‍♂️

delicate lynx
polar cypress
#

is it possible to give players the block selection menu in creative mode without giving them the ability to fly or the invulnerability

#

this

#

i cant post image

#

wow

delicate lynx
#

player inventories are client sided

#

as in opening

polar cypress
#

can i not send a packet to the client

#

like how i can make them open a fake chest

delicate lynx
#

create an inventory and send it to the player

river oracle
#

you could probably make a custom menu with a listener rather than sending the actual creative menu but its all preference

#

with teh first approach you won't need to mess with packets at all

polar cypress
#

there is a command for it

#

method*

delicate lynx
#

there's a method for getting last damage cause

#

I think it's on the player

slow mica
sharp token
#

Hey I'm trynna create a chest and have it placed on the ground upon player death

#

how can I do that?

slow mica
sharp token
#

how do I create an item and have it placed on the ground is a better way to phrase my question

polar cypress
#

so you are not having the item be placed in the chest?

sharp token
#

Yes but I know how to do that I can use the setContents method

#

My thing right now is I'm trying to figure out how to place a chest down

polar cypress
#

setblock

#

i think

slow mica
# sharp token placing chest is the part I'm trying to figure out
sharp token
#

Tysm!

#

appreciate it guys

quaint mantle
#

how do I make a block will drop the items when I break it with a specific tool?

slow mica
quaint mantle
#

Okay

#

I did the spawning part but was stuck at tool part

slow mica
quaint mantle
#

kk ty

polar cypress
#

so your trying to identify if a zombie was knocked into lava by a player?

#

thats like player tried to swim in lava to escape zombie

#

but in reverse

polar cypress
#

oh

#

you can get death message and put it though some sort of method

#

to check

#

and see if it is one of those where the player dies in lava running away from zombie

#

check for the string "tried to swim in lava to escape zombie"

slow mica
polar cypress
#

checking the name of the mob in the death msg is one way but thats just brute forcing it, there might be a method you can use

#

in the spigot api but i doubt it

polar cypress
#

yea, do you know of a list of all mc items in their respective groups?

slow mica
#

You can use this enum from api

polar cypress
#

thats ordered in aphebetical, so i still have to sort the items in their respective groups

#

building blocks, decorations, redstone, etc

slow mica
polar cypress
#

oh dayum

slow mica
#

There is a method for it

polar cypress
#

that thing exists?

#

i never knew

#

well i dont think you can get the type of entity from .getDamageCause

#

your gonna have to track it some other way

#

maybe someone else can help

sharp token
#

following up with my previous question, how can I set the items dropped upon death to the chest then have the chest disappear once the player removes all the items from it?

#

That would require me to check for a chest open and empty event, however how can I distinguish a death chest vs a normal chest, because I don't want normal chests disappearing when empty

polar cypress
#

maybe store its location

sharp token
#

but I only know how to use that with items in inventory not blocks on the ground

#

also I can't figure out how to set contents to a chest? For some reason it's not allowing me to use the method

#

For example, this is what I have

#

`
Material deathChest = Material.CHEST;
playerLocation.getBlock().setType(deathChest);

`

#

but I can't do deathChest.setContents()?

delicate lynx
#

because that is a material

polar cypress
#

your setting the contents to a material, is that how it works :/

#

playerLocation.getBlock().setType(Material.CHEST)

#

you only need one line

sharp token
#

Thanks for the information, I can see why that is now

#

So in that case, how can I set contents to the chest after I created it??

delicate lynx
#

cast chest to the blockstate

polar cypress
#

do you not getBlockInventory() and addItem()?

delicate lynx
#

which is from the chest

#

which you have to get from the blockstate

#

Chest chest = (Chest) playerLocation.getBlock().getState();

polar cypress
#

ok

#

and then you do the getblockinv :>

slow mica
warm light
#

got it already. thanks

rocky rampart
#

Hopefully a quick question - Armor stands don't render if outside the player's FOV, but if armor stands are a passenger of the player, they are always in the FOV. Is there a way around that? Trying to get an armor stand to be invisible in first person, visible in third person.

slow mica
rocky rampart
#

Something like it is certainly possible, if not specifically for an armor stand, because I saw Origin Realms has cosmetic equipment - things you can wear on your back like a backpack. Talking to people there, it seems you can't see it in first person (e.g. backpack straps), but you can see it in third person.

#

It almost certainly has something to do with player FOV and the entity not being rendered, because there is no way server-side to detect the third person view.

#

My attempts to recreate it locally are perfect except for first person view

slow mica
rocky rampart
#

afaik that's only supported if you have Optifine, vanilla doesn't have that.

#

From what I've seen, most of what Origin Realms does uses armor stands, including their really cool gesture system.

#

Here's my attempt to recreate it so far - https://imgur.com/a/dBHPdVL
It's super close. One idea I had was changing the body rotation of the armor stand, but that doesn't move where the neck of the armor stand is.

#

It just needs to be even a pixel or two behind the player's head, but the passenger system in Minecraft doesn't support offsets

#

My next thought is, maybe they aren't using an armor stand, maybe it's a different entity. But armor stands are the only thing with the Marker behavior, so it would introduce false raycast collisions for that client.

brave sparrow
#

I would guess that’s a resource pack with something equipped in the offhand

rocky rampart
#

It's definitely the head slot looking at the model JSON. That's where my confusion comes in, is unless it isn't a passenger of the player, they're doing something sneaky to place it behind the FOV

brave sparrow
#

Could it be the player’s head slot?

rocky rampart
#

Nah the model is offset down by a big amount, it's definitely something above the player

brave sparrow
#

Does it follow you if you start lagging?

#

Or does it start clipping

rocky rampart
#

The only way for me to find that out specifically is to buy cosmetic crates and basically gamble for one I can verify with sadly

#

So the best I have to work with is people I randomly DM'd ingame saying they couldn't see it in first person

#

One thing I want to try is having two passengers - two small armor stands, the topmost one having the item on its head

#

I don't know how the game will handle that one

#

Looks like it makes no difference

sage coral
#

hello any help me wiht my plugins?

rocky rampart
#

What's wrong with your plugins?

wicked bluff
#

Anyone know how to tell if an Entity is inside a Structure in 1.19? Like an End City.

rocky rampart
#

There is a way to get nearby structures from a location. You'd then get its bounding box and check if it's inside. As for the specifics (e.g. inside a building vs next to it), not sure. You'd have to do some specific checks like proximity to floor/ceiling blocks

wicked bluff
#

How would I get the BoundingBox?

half ferry
#

How to Add Potion Effect On command plugin?

rocky rampart
# wicked bluff How would I get the BoundingBox?

If you have the Mojang mappings, there's a class called StructurePiece, which has a method getBoundingBox(). Obviously if you don't use the Mojang mappings it depends on what version you're writing against.

wicked bluff
#

Spigot

#

How would I get the StructurePiece cast from a CraftChunk?

west crag
#

How to add effect when ever any mob spawn?

#

Particle effect

tardy delta
#

Listen for mobspawn event

earnest forum
#

creature spawn event

west crag
#

how?

#

Means in my plugin when ever someone broke a block then in 3 second a random mob will spawn

#

So I have to make new method?

#

EntitySpawnEvent?

earnest forum
#

use CreatureSpawnEvent

west crag
earnest forum
#

no

#

listen to CreatureSpawnEvent

west crag
#

Okay...

terse raven
#

?eventapi

undone axleBOT
west crag
#

which one should I add

#

playEffect or addPotionEffect

#

I need effect just

#

Like particle effect

thorn isle
#

Read the docs

earnest forum
#

neither of those

thorn isle
#

The docs say what each method does

earnest forum
#

i think the World object has a spawnParticle method

thorn isle
#

Yes

rocky rampart
west crag
#

its showing me error but in my IDE there is no error

#

code

hybrid spoke
#

what do you want with the world as parameter

#

remove it

west crag
#

to use ```java
ev.spawnParticle(Particle.CAMPFIRE_SIGNAL_SMOKE,location,4);

hybrid spoke
#

take the world from the event

#

you cant just take a world out of nowhere

west crag
#

wait

hybrid spoke
#

get it from the block

west crag
#

you mean ```java
event.world().spawnParticle(Particle.CAMPFIRE_SIGNAL_SMOKE,location,4);

#

this?

quaint mantle
#

event.getblock.getworld or event.getblock.getlocation.getworld

#

dunno which it was

west crag
#
event.getBlock().getWorld().spawnParticle(Particle.CAMPFIRE_SIGNAL_SMOKE,location,4);
#

this?

west crag
#

lemme try

#

still showing same error

quaint mantle
#

location

#

whats that

desert tinsel
#

try with getLocation()

west crag
#

yea still getting error

quaint mantle
#

could you just paste the entire method in here?

desert tinsel
#

?paste

undone axleBOT
desert tinsel
#

paste your error

west crag
#

wait

#

i have to remove World

desert tinsel
#
@EventHandler
    public void onBlockBreak(BlockBreakEvent event){
      World world = event.getBlock().getLocation().getWorld();
}```
west crag
#

yea it worked

#

thanks :)

desert tinsel
#

no problem

#

I think you need to implement and CommandExecutor

west crag
#

wtf bedrock slab ;-;

magic raptor
#

Hi, i'm trying to developer a plugin with bungee 1.19 api, but seems that ServerKickEvent isn't fired when a subserver stops, did something change or am I stupid? The same code works well on waterfall and other forks.

onyx fjord
#

But where did crystal go

magic raptor
#

After some debugging seems that bungeecord is calling playerdisconnectevent instead of serverkickevent when a subservers turns off

onyx fjord
#

👍

magic raptor
#

What's going on with bungeecord?

#

Kick event isn't fired on server shutdown

tender shard
#

Seems right to me. When a spigot server stops, players also are not "kicked"

#

it's just the PlayerQuitEvent on spigot

#

imho "kick" = admin kicked them. Disconnect because server shuts down = Quit / Disconnect, but not kick

fierce terrace
#

so I have a question: How can I use a mapping with NMS that includes actual names for functions on classes?

tender shard
#

what version?

#

and are you using maven @fierce terrace ?

fierce terrace
magic raptor
fierce terrace
magic raptor
#

But now how am I supposed to work on it?

fierce terrace
#

which don't do anything

magic raptor
#

I can't cancel the playerdisconnectevent

#

And i won't do that

undone pebble
#

you want to prevent a player from disconnecting?

tender shard
#

wdym?

magic raptor
#

I use "serverkickevent" on waterfall and works fine

fierce terrace
magic raptor
#

I cover everything

fierce terrace
#

stuff like NBT don't appear

magic raptor
#

On Bungee 1.19 only the playerquitevent is fired amd i can't do anything

tender shard
#

for example "NBTTagCompound" is actually called "CompoundTag"

#

and it's not "EntityPlayer" but "ServerPlayer", and "World" is actually "ServerLevel", etc

magic raptor
#

Any idea?

tender shard
onyx fjord
#

Don't use NMS until you have to

magic raptor
#

On 1.18 was totally fine also on bungeecord, but is broken on 1.19 version

tender shard
#

hello kacper, we're going to the end today, you down?

onyx fjord
#

My head boutta explode

#

But I'll join anyway

tender shard
#

yeah not now lol

#

later

#

first we need some ender pearls

onyx fjord
#

How many hours from now

tender shard
#

btw @fierce terrace why do you need NBT anyway?

onyx fjord
#

Oh yea we have nbtapi

tender shard
fierce terrace
tender shard
#

it was made for that

fierce terrace
tender shard
#

it's basically the "API version" of NBT

#

added in 1.14.1

#

it's basically like NBT in better

tender shard
#

you can also create your own datatypes for PDC. for example you could store a Map<String,List<ItemStack>> inside a PDC

chrome beacon
#

I believe so yes

tender shard
#

well with mods they can

#

but the same is true for NBT

dark arrow
#

can we change the size of mobs in spigot?

tender shard
#

no

dark arrow
#

hitbox?

tender shard
#

maybe with NMS

#

well with NMS it basically must work somehow

chrome beacon
#

Isn't the client the one that sends the hit packet

tender shard
#

I thought it was about stuff like arrows hitting something

#

if it's about punching stuff, then yeah that won't work

dark arrow
#

oh

tender shard
#

idk why I thought about arrows

#

its probably because I just crafted some

#

lol

dark arrow
#

thats means it will not be possible with reource pack also

green prism
#

excuse me guys, do you have any ideas for optimizing and improving this code? Sorry for the emotional damage that could cause the viewing of the code
https://paste.md-5.net/sotoyufeqi.cs

tender shard
#

what is it supposed to do exactly?

green prism
# tender shard what is it supposed to do exactly?

I was scared of that question ahaha... So
I’m creating an Agencies Plug-in where when you do /agency create it opens up a 'menu' where it asks: Employees, name and initial value of the company. This code is about employees. When you click on that icon it splits the message of the player by comma and checks that for each player written it exists. If one does not exist, notify the player. If everything is valid, if the written player is only one, it takes the message that says "You added the %player% player" if they are more, it takes the message "You added %player% and other %othersnumber%".

tender shard
# green prism I was scared of that question ahaha... So I’m creating an Agencies Plug-in where...

ah okay. Well in general it looks fine for me, but you could definitely improve it by for example creating separate methods to parse the input. Then in the event you simply pass the message to your method. Also I think this would be perfect for the ConversationAPI which is included in Bukkit. It might seem a bit overkill at first but when you do stuff like "parsing chat answers" more than once, it's definitely really helpful

dark arrow
#

is it possible to create a command which works without typing slash?

tender shard
#

just listen to the chat event

dark arrow
#

like if player types hello it will reply hi

tender shard
#

but of course you wont get tab complete for it

#

just listen to AsyncPlayerChatEvent

dark arrow
#

ok

green prism
tender shard
green prism
#

ah

dark arrow
#

ok thanks 🙂

green prism
#

sorry i'm bugghy

dark arrow
#

AsyncPlayerchat or PlayerCommand

tender shard
#

he wants to basically do the same thing that you are currently doing lol. parsing normal chat input

calm whale
#

Hello, there is a problem when I use a custom biome provider, it works perfectly in 1.17, but in 1.18 the generation is totally broken. I have an ocean generated instead of a plains (F3 shows plains) for example. Does anyone has an idea ?

dark arrow
#

I have created a chatbot in python can i implement it in spigot by any means?

green prism
#

what is the ConversationAPI

calm whale
#
@Override
public @NotNull Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z) {


    if(x > 1024 || x < -1024 || z > 1024 || z < -1024){
        return Biome.THE_VOID;
    }

    return Biome.PLAINS;
}```
dark arrow
#

<Bot> Hi
[11:49:43] [Async Chat Thread - #0/INFO]: <Sammu212> hello

tender shard
#

in the asyncplayerchatevent, schedule a synced task

#
onChatEvent {
  Bukkit.runTask(plugin, () -> {
    // Chat message
  }
}
dark arrow
#

ok

#

thanks

wispy plume
#

How can I get the increment value of players armour level of an armour piece itemstack?

green prism
# wispy plume How can I get the increment value of players armour level of an armour piece ite...
          for (Player player : Bukkit.getOnlinePlayers()) {
                  Map<Enchantment, Integer> Enchants = player.getInventory().getHelmet().getEnchantments();
                  if (Enchants.containsKey(Enchantment.DURABILITY)) {
                      Integer level = Enchants.get(Enchantment.DURABILITY);
                          if (level == 1) {
                              //    DO STUFF HERE
                          }
                      }
                  }
          }```

Yes, this code does not completely make sense with what you asked for or almost but listen. You should take the level of the present enchant that you want to make (i++) then increase its value by 1 or as much as you want and then set a new enchant with its name to the itemstack. Even simpler can be making a foreach where you take all the enchants of an itemstack with getEnchantments() and rearrange them to the new itemstack. For the armor-stack storing, you can try to make a hashmap Player, ItemStack I assume
wispy plume
prisma steeple
#

any ideas?

#

wont work

misty current
#

there should be methods for that in ItemMeta

green prism
wispy plume
ivory sleet
misty current
ivory sleet
#

Because the command name is always feed

#

you’d have to use the label parameter to check which alias was used

ivory sleet
#

Well the issue isn’t the aliases, it’s his implementation of the command executor

misty current
#

^

green prism
#

ah, I didn't see the first image

misty current
wispy plume
misty current
#

this was completely unrelated to what the guy asked

#

and you did the same thing few days ago when i asked something

green prism
#

bro, I thought he spoke of enchant not of other... Excuse me of heart

wispy plume
#

Shall i check on the latest one?

tender shard
misty current
tender shard
#

aliases: [something]
or
aliases:

  • something
misty current
#

1.8?

#

1.18?

wispy plume
#

When I say, I get criticised for using "outdated and unsupported version" (that answers ur question btw xD)

ivory sleet
#

Snake yaml is kind enough

tender shard
misty current
wispy plume
misty current
#

if that answers your question

prisma steeple
#

I had a skill issue

#

I forgot to return true

tender shard
#

you sure it's snakeyaml and not the builtin yaml parser? because normally SnakeYaml can't even read an int as double

ivory sleet
#

Not sure but something in the implementation is nice enough to wrap it as a list value if needed

tender shard
#

alright, that's good to know

ivory sleet
#

Ye

misty current
wispy plume
#

I am, I've noticed ArmorItem class having information about that

misty current
#

also i remember i had found an api once

#

also, you can't do per-slot attributes in 1.8

#

so you can't make an attribute work only when you have a piece of armor equipped

wispy plume
#

I just want the static value of each armour piece, it's used only once to pre-gen loots

prisma steeple
#

what does "equalsIgnoreCase" do?

wispy plume
#

Checks if string equals to another string, ignoring the character case xD
"hello".equalsIgnoreCase("Hello") = true

misty current
prisma steeple
#

oh i see that makes more sense i thought it would check something else

misty current
prisma steeple
#

so if i'm using it for a command then that would mean to it

#

feed = Feed

misty current
#

i'd have to do some nms digging to try and find a working method

desert tinsel
#

yep

misty current
#

gimme few minutes

prisma steeple
#

okthx

wispy plume
#

I have found one, but it requires me to convert from bukkit ItemStack to nms ItemStack, and that fails for some reason and returns null (Using CraftItemStack.asNMSCopy())

wispy plume
#

?paste

undone axleBOT
wispy plume
#

On my utility client, methods for getProtectionValue() work

misty current
#

toNmsItemStack(new org.bukkit.inventory.ItemStack(material)); whats this method?

#

it's not included in the code snippet

wispy plume
#

I sent below the link

misty current
#

ah

#

are you sure the material is not air?

wispy plume
#

I'm sure.

#

The System.out.println() one returns normal material enum names, and it always stops on the null check.

misty current
#

hm kinda weird

#

can't test atm

wispy plume
#

I can test for you

#

I've tried a lot tho. Probably need another conversion, or just entirely use NMS

misty current
#

try to cast the itemstack to a CraftItemStack

#

then call getHandle

#

((CraftItemStack) itemstack).getHandle()

wispy plume
#

Pretty sure there's no getter, but I can make sure

misty current
#

actually that would not work

wispy plume
#

getHandle should return nms itemstack, but in this class, handle field is package-only without a getter

misty current
wispy plume
#

tru

#

I'll go for pure nms then, less effort and same result

calm whale
# calm whale https://i.imgur.com/RYYK63Z.png

ok so it's seems that in 1.18 the BiomeProvider is used as a decoration provider, it doesn't override anymore the world generation. Does anyone know a solution to get it's 1.17 effect in 1.18 without having a full custom world generator ?

misty current
#

[13:02:16 INFO]: stack:net.minecraft.server.v1_8_R3.ItemArmor@9785903

wispy plume
#

try ItemArmor#x_()

crude loom
#

Hi, I'm making a bedwars plugin and I would like to restrict the items the player can put in a chest
For that I'm using InventoryClickEvent but for some reason it doesn't always fire, here is the code:

 @EventHandler
    public void onInventoryClick(InventoryClickEvent e){
        Bukkit.broadcastMessage("fired");
        if(e.getView().getTopInventory().getType() == InventoryType.CHEST) {

            //If the player isn't placing an item
            if(!e.getAction().name().contains("PLACE")) return;

            //The player places an item onto a chest
            if(e.getClickedInventory().getType() == InventoryType.CHEST) {
                if (!insertSword(e.getWhoClicked().getInventory(), e.getCursor())) e.setCancelled(true);
            }
            //The player places an item onto his inventory
            else if(e.getClickedInventory().getType() == InventoryType.PLAYER) {
                int index = getSword(e.getWhoClicked().getInventory(), e.getCursor());
                if(index!=-1)
                {
                    e.setCancelled(true);
                    e.getWhoClicked().getInventory().setItem(index,e.getCursor());
                    e.getWhoClicked().setItemOnCursor(null);
                }
            }

        }
        verifyInventory(e.getWhoClicked().getInventory());

    }

Any idea why?

wispy plume
crude loom
#

Oh I see that, that's really odd

#

I will try to also use InventoryDragEvent
Thank you!

sage patio
wispy plume
#

It's specxified on the page

#

RobberyAPI#getInstance()

sage patio
wispy plume
#

Then try decompiling the return value of getInstance() and see its methods

misty current
#

go ask in their support server

#

best thing i can suggest is decompiling the class and checking yourself

wispy plume
#

unless obfuscated like a few plugins out there xD

sage patio
#

but there is a lot of errors in decompiled version (because dependencies in pom.xml)

#

this is what author said, i can't understand what to do

wispy plume
misty current
#

thats not what he said

sage patio
misty current
#

there is probably a jar with the api only

#

and another one with the entire code

sage patio
wispy plume
#

ah ok

misty current
#

ok then

#

get a Robbery object somehow

#

from an event or so

#

then you can cast it to a GeneralRobbery or a BankRobbery and that will give you access to more methods

sage patio
wispy plume
#

Robbery is probably an interface

#

do you care about General robbery or a bank robbery?

misty current
#

((GeneralRobbery) event.getRobbery()).

#

and check the autocompletions

#

or just decompile GeneralRobbery

wispy plume
#

make sure you check the right one using
if (!(robbery instanceof GeneralRobbery)) {
return;
}
GeneralRobbery generalRobbery = (GeneralRobbery) robbery;

sage patio
#

thanks, not it has a crew 👍

wispy plume
#

nonono

#

cast it first

sage patio
#

ok

wispy plume
#

BankRobbery br = (BankRobbery) event.getRobbery();

#

and check for methods on br.

sage patio
#

like this?

sage patio
#

nice its ok ig

wispy plume
#

Alright

sage patio
wispy plume
#

xDDD

#

Ye it's unique

thorn isle
#

Probably should use an enum or a registry for places rather than comparing strings

crude loom
#

I want to remove the item on the player's cursor but for some reason it only disappears after I try to place the item into the inventory
When I get out of the inventory it just throws out the item that I have 'removed'
Any Idea how to fix that?

river oracle
#

So there is no way to do this

crude loom
#

Oh I see, I will try to find a way around it then

brittle lily
#

I want to teleport each player to spawn points separately, how can I do it? Like Hunger Games

tardy delta
#

store the locations somewhere and tp each of them to a location

dense falcon
#

Player target = Bukkit.getPlayer(args[0]); How can I check if the player "exist" ?

eternal oxide
#

if (target != null)

tardy delta
#

getPlayerExact x)

dense falcon
quaint mantle
#

was org.apache removed from repo in 1.19?

eternal oxide
#

yes

#

there is a help thing about it somewhere

#

?apache

#

?libs

#

no clue

novel wyvern
#

YOO i am having problems with ip_fowarding in bungeecord say it is false but in reality its true
and it will not let me join unless resolved

eternal oxide
#
As foreshadowed with the 1.18 release, commons-lang has now been removed from the API. Plugins will not yet be broken as it is still included with the server, however it will eventually be removed in a future release. Please consider switching to Google Guava (which is a supported bundled API) or using your own copy of the much more recent commons-lang3.```
novel wyvern
#

??

quaint mantle
#

what could I use for StringUtils#isNumeric?

green prism
#

I have a string of indefinite length. In the mysql column I should give it VARCHAR(n) value but what number do I put in place of n in this case? Are you new to mysql?

green prism
#

Hello,Hello,Hello

tardy delta
#

a list of players in a varchar lmao dont do that

green prism
#

A list as string divided by a comma

#

or what else can I do?

eternal oxide
#

depends on why you have a list of player names

#

you should be identifying players by UUID for a start

green prism
#

ah okay

#

but how should I store the players (employees)

sand sphinx
#

I want to assign the names of players entering the game to a List
I've been looking through the Javadocs for hours and haven't been able to find anything about it
Could you show me an example?

eternal oxide
#

so these employees are members of the agency?

eternal oxide
#

you create a table for them with an agency and UUID

#

unique key pair

#

actually make the UUID unique

#

not a pair

green prism
#

Wouldn’t it be better to make a single string with all uuids and a character to which then associate a Split-Char?

eternal oxide
#

so they can only be in one agency

green prism
#

hm

eternal oxide
#

thats not how relational databases work

green prism
#

ah

eternal oxide
#

thats how strings work

sand sphinx
#

My problem is that I don't know how to assign a list

#

And I asked this

eternal oxide
#

Why do you want all the names in a List?

sand sphinx
green prism
eternal oxide
novel wyvern
eternal oxide
sand sphinx
#

For ManHunt plugin
If player interact, It means player is ready

novel wyvern
#

my issue is exactly that it says ip forwarding is on but when i join one of the server it tells me i must enable it in config which i already did

green prism
#

Elgar just a question, but then in case, how do I basically get all the employees of a given company? Did you mean to do something like that first?

{AgencyName}:
uuidD,
uuidD,
UUID,
uuid{52},
UUID{2},
UUID{1}

eternal oxide
sand sphinx
#

Yep

eternal oxide
eternal oxide
#

you pull from employees all where agency = whatever

twilit roost
#

How to make custom model?
Using ArmorStands or using something else

novel wyvern
#

my issue is exactly that it says ip forwarding is on but when i join one of the server it tells me i must enable it in config which i already did

eternal oxide
novel wyvern
#

yes

eternal oxide
#

make 100% certain you have ip_forward: true

novel wyvern
#

yes it is

#

100%

eternal oxide
#

Then I see no reason for you to be getting that message

novel wyvern
#

i can screen share for u

twilit roost
eternal oxide
#

do you have bungeecord: true in each servers spigot.yml?

novel wyvern
#

yup

sand sphinx
# eternal oxide and all players on the server have to ready up for teh game to start?
    @EventHandler
    public static void onJoin(PlayerJoinEvent e){
        List<String> list = new ArrayList();
        list.add(e.getPlayer().getName());
    }
    
    @EventHandler
    public void onInteract(PlayerInteractEvent e){
        List<String> list2 = new ArrayList<>();
        list2.add(e.getPlayer().getName());
        if(list2.equals(list));
            //do something
    }```
Do you think this will work?
#

Oh

#

1 min

twilit roost
#

Nah
you are creating new List every time

sand sphinx
eternal oxide
#

you don;t need a list at all

twilit roost
#

Well idk what you plan on doing
but you are creating 100's of lists that can't be ever accessed

twilit roost
#

So store some List somewhere where it can be accesed
and just add the value to it

eternal oxide
#
    Set<UUID> ready = new HashSet<>();

    @EventHandler
    public void onInteract(PlayerInteractEvent e){
        ready.add(e.getPlayer().getUniqueId());
        if(ready.size() == Bukkit.getOnlinePlayers().size());
            //do something
    }```
sand sphinx
sand sphinx
twilit roost
#

should work as a charm

sand sphinx
eternal oxide
novel wyvern
#

what vc

eternal oxide
#

I just need a pic

novel wyvern
#

its not letting me send screenshots

eternal oxide
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tender shard
#

get verified

paper crater
#

Do you guys know if it is possible to change Leather color armor based on permission?

novel wyvern
tender shard
#

it means your spigotmc forums username

paper crater
# subtle folio Very possible

So something like this is possible: If player gets/wears red armor but has the permission armor.blue the red armor changes to blue?

eternal oxide
#

yes

paper crater
#

awesome will look into it thankss

twilit roost
eternal oxide
#

Not sure I see a question in there

twilit roost
#

Its a reply to a reply
Please just open it to see "details"

harsh totem
#

Is using json in spigot any different than using it in Java generally?

harsh totem
#

Ok

eternal oxide
#

I've not read it so it may be absolute trash

novel wyvern
twilit roost
#

thx

novel wyvern
#

this is whats happening

twilit roost
wheat dock
#

those are public ips

#

are the servers hosted locally?

eternal oxide
# novel wyvern

looks like you are tryign to connect direct to the server and not to Bungeecord

novel wyvern
#

oh ok

silver pulsar
#

Im having some problems with accessing Lists from yml files. i have tested if the file is correctly loaded by also getting a string from the same file.

File:
Bukkit.getLogger().info(FileHandeler.getFile().getString("LoremIpsum")); //Test Bukkit.getLogger().info(FileHandeler.getFile().getList("Test").toString()+" FileHandler"); //Line Of error

Error:
Cannot invoke "java.util.List.toString()" because the return value of "org.bukkit.configuration.file.FileConfiguration.getList(String)" is null
File:
Test: {"Hello","World"} LoremIpsum: "Test"

wheat dock
novel wyvern
green prism
#

ElgarL, one question... How do I know if a player is already employed in another company? More specifically I asked if you can check all the tables of companies in the employee section and see if there is the uuid of the player. Thank you again so much for your help!

eternal oxide
#

they can only have one entry so only be in one agency at a time

green prism
eternal oxide
#

you use a SELECT statement to query the employees table

#

no

#

one table which has columns for UUID and agency

#

UUID is the PK

green prism
#

I'm doing something like that:

     PreparedStatement ps;
     try {
         ps = plugin.getMySQL().getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS "+ agency +
                 "(Employees VARCHAR(100), PRIMARY KEY (Employees))");
         ps.executeUpdate();
     } catch (SQLException e) {
         e.printStackTrace();
     }
 }```
eternal oxide
#

no

green prism
#

ohups

eternal oxide
#

Two tables. One called agencies, one called employees

green prism
#

obv!!

#

Sorry that's the entire code:

        PreparedStatement ps;
        try {
            ps = plugin.getMySQL().getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS agencies "
                    + "(AgencyName VARCHAR(100), AgencyOwner VARCHAR(100), balance DOUBLE(100), MaxBalance DOUBLE(100), PRIMARY KEY (AgencyName))");
            ps.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public void createAgencyTable(String agency) {
        PreparedStatement ps;
        try {
            ps = plugin.getMySQL().getConnection().prepareStatement("CREATE TABLE IF NOT EXISTS "+ agency +
                    "(Employees VARCHAR(100), PRIMARY KEY (Employees))");
            ps.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }```
#

Is that what you meant no?

eternal oxide
#

no

green prism
#

oHHHH okay wait

#

I’m almost there ahah

tardy delta
#

use a try with resources

eternal oxide
#

Table employees has columns UUID (which is the employee UUID, and agency which shoudl be the ID of the agency they are in

#

Table agency has an ID column, name and any other info you think it needs

quartz basalt
#

when a player dies, if they have a book in their inventory for example, i want the player to keep the item, is there a way to do this with the playerdeath event or would i need to use the respawnevent as well

eternal oxide
#

ID would be unique

#

so to find all players in teh agency with ID of 01 you SELECT * FROM employees WHERE ID = 01

#

that gets you the UUID of all players who are in teh agency with ID of 01

undone axleBOT
tardy delta
#

registered them?

green prism
#

I I haven’t tried but I think it works, anyway, wouldn’t it be the same if I associated the company name as id?

dense falcon
#

To make a temporary ban, I would have to put a date but how? And also how to check it.

sand sphinx
#
    private static void createReadyItem2(){
        ItemStack item = new ItemStack(Material.LIME_CONCRETE);
        ItemMeta meta = item.getItemMeta();
        if(meta != null){
            meta.setDisplayName(ChatColor.GREEN+" "+ChatColor.BOLD+"You are ready!");
            List<String> lore = new ArrayList<>();
            lore.add(ChatColor.AQUA+"When everyone is ready, game will start.");
            meta.setLore(lore);
            item.setItemMeta(meta);
            ready2 = item;
        }```
```java
    Set<UUID> ready = new HashSet<>();

    @EventHandler
    public void onInteract(PlayerInteractEvent e){
        if(e.getItem().isSimilar(SecondReadyItem.ready2)){
            ready.add(e.getPlayer().getUniqueId());
            if(ready.size() == Bukkit.getOnlinePlayers().size()) {
                Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "say a");
            }
        }
    }

Why not working :/
There is no error in the console

eternal oxide
#

if you use ID's you can change the name or anything about the agency and keep the same ID

green prism
#

Yeah but to get the new id, I count the values inside the agencies table and do +1?

eternal oxide
sand sphinx
#

Oh
My bad

#

I forgot

eternal oxide
green prism
#

Ahh okay! So I'll do VALUES(AUTO_INCREMENT,?,?)

green prism
eternal oxide
#

when creating a new agency you use null as the ID

tardy delta
green prism
#

ah no

#

nonono sorry

harsh totem
#

how do I check if a raid was finished because it was won?
because RaidFinishEvent gets executed also when the players lose

eternal oxide
green prism
#

Thank you Elgar!! 🙂

eternal oxide
#

you then read the entry you just added to get the ID

#

so in UPDATE you use the ID

green prism
#

Just a last question, what should I use as PK? The ID or the Name in ur opinion?

eternal oxide
#

ID

green prism
#

thanks

eternal oxide
#

however, you don;t want name clashes

#

so PK teh name instead., the ID is managed by sql

green prism
#

ah

#

So I'll take the name as PK

#

perfect

neon storm
#

What event get's triggered when a dispenser places water or lava from a bucket?

eternal oxide
#

probably

glass mauve
#

you could prob use BlockDispenseEvent and then check if Item a water/lava bucket is

glass mauve
#

then check this

#

prob

eternal oxide
#

um, linking paper here is not such a good idea

novel wyvern
# eternal oxide probably

thank you so much for helping even if it was that simple u just safed us weeks of this thank you andu r really good at this do have a degree in it or is it self taught?

glass mauve
eternal oxide
eternal oxide
atomic niche
# glass mauve you could prob use BlockDispenseEvent and then check if Item a water/lava bucket...

That seems like a lot of logic though?

There are cases where the dispenser will just dispense the empty bucket, water bucket, or lava bucket.

To cancel placement without changing any vanilla behaviour, you would need to check the dispenser, check what the block in front of the dispenser is, guess what the dispenser would do, and only cancel if applicable.

For example, if the dispenser is about to shoot out an empty bucket, and if the block in front of the dispenser is not fluid, you would not want to cancel the event.

Whereas, if the dispenser is about to shoot out an empty bucket, and if the block in front of the dispenser is fluid, you would want to cancel the event.

eternal oxide
glass mauve
novel wyvern
opal juniper
#

👴

novel wyvern
#

because ur more of a help than the actual inroled people here

eternal oxide
novel wyvern
opal juniper
#

?main moment

proper notch
#

Have you done any kind of debugging to find out where the code stopped/what is actually run?

silver pulsar
#

Hey.
Im having some problems with accessing Lists from yml files. i have tested if the file is correctly loaded by also getting a string from the same file.

File:
Bukkit.getLogger().info(FileHandeler.getFile().getString("LoremIpsum")); //Test Bukkit.getLogger().info(FileHandeler.getFile().getList("Test").toString()+" FileHandler"); //Line Of error

Error:
Cannot invoke "java.util.List.toString()" because the return value of "org.bukkit.configuration.file.FileConfiguration.getList(String)" is null
File:
Test: {"Hello","World"} LoremIpsum: "Test"

proper notch
#

I've never seen a YAML list in {}, so not sure if it's possible, try it like one of the following:

Thing: ["Hello", "World"]

Thing:
  - "Hello"
  - "World"
tender shard
#

where ~ means null

#

so for arrays/lists, use [ ].

green prism
dark harness
#

How can i check the cooldown in the interact event when a player uses a goat horn

tender shard
#

player.getCooldown(Material.GOAT_HORN)

tardy delta
eternal oxide
green prism
#

Ah!! Thanks!!!

#

Thank you guys

tardy delta
#

ElgarL, if you're using one db connection for your plugin, should you close it after every operation?

#

just wondering

green prism
#

(I'm closing it on the onDisable)

eternal oxide
#

depends how frequently you are accessing teh DB

eternal night
#

Evil people might say a connection pool is pretty cool

quaint mantle
#

Okay so an off-topic question about development,

If I want to send information from Server 1 to Server 2, I should use an API Key, right?

Example usage: When a player joins a server that he isn't supposed to, send a message to all the staff members in other servers.

tardy delta
tardy delta
eternal oxide
#

Yep

eternal night
#

Cross server communication usually lives on pub sub systems anyway

#

Which require authentication

quaint mantle
#

What I want to do exactly is make a plugin, that'll generate a Token which will be later use in an mobile app that I'm currently making.
After that, once someone tries to send a message from the app a console command, it sends it to the plugin and the plugin executes it.

Does that make any sense ?

silver pulsar
eternal night
#

So a classic auth case ? You can pick anything from a session over JWT

#

If you don't want the user to have to input a password then yea

#

A access token works too

quaint mantle
#

The problem is that, it'll send an info, but how do I make it so it watches for changes ?

eternal night
#

Watch for changes ?

#

Am I missing something or are you literally just making a mobile client server side authentication

somber sequoia
#

Hey, I want to place the blocks only on a single client, could anyone help me with that?

somber sequoia
#

Ok thanks

eternal night
#

Tho that'll be a fake block obviously

#

The second they interact with it it will revert to its proper state

somber sequoia
eternal night
#

Ehhh not easily unless I missed smth

somber sequoia
#

alright thanks

eternal night
#

Idk if interact event might go through

twilit roost
#

I have moving object with its own location
And then I have player

But I need to calculate location which will be equalivent to the x blocks the object has moved

eternal night
#

You could check that

somber sequoia
eternal oxide
twilit roost
#

So I have a ship
its being moved using WorldEditAPI
and I know the ships Location
But when it moves, the player stays on same place
So I somehow need to teleport him

eternal oxide
#

location.add(location.getDirection().normalize().multiply(10))

#

10 being how many blocks youi are moving

twilit roost
#

oh right
thx

silver pulsar
#

how do you make a hashset get stored within [] instead of {} in a FileConfig

eternal oxide
#

use a List or array

silver pulsar
#

can you store multiple coordinates in a list or array

eternal oxide
#

coordinates?

silver pulsar
#

org.bukkit.Location

eternal oxide
#

Odds of two Locations being a Match is tiny

#

unless they are teh same object

silver pulsar
#

attempting to make a custom object that acts like a drill

dark harness
summer scroll
#

Is in ticks, no?

dark harness
#

Time is in ticks yes

summer scroll
#

Yeah, the value is in tick.

#

What are you trying to do?

dark harness
#

Remove the cooldown from the horn. Setting it to 20 worked but no other players hearing the horn

summer scroll
#

When are you setting the cooldown?

summer scroll
#

Alright, try to give it a delay like 1-2 ticks.

tender shard
covert karma
#

how do i set up my intellij javadocs for them to display the proper descriptions and or have a link to the online javadoc using maven?

gleaming olive
covert karma
covert karma
dark harness
silver pulsar
#

What does this error mean?
Could not pass event BlockPlaceEvent to MyFirstPlugin v1.0-SNAPSHOT org.bukkit.event.EventException: null

worldly ingot
#

Doesn't tell us much. The whole error and relevant code would be useful

misty current
#

how can I get the face of the block the player is looking at?

worldly ingot
#

You'd have to run a ray trace

misty current
#

thanks

quartz basalt
worldly ingot
#

e.g. if (Material.APPLE.getCreativeCategory() == CreativeCategory.FOOD)

quartz basalt
#

ty

#

if i have a plugin jar in the libraries but im using maven is there a way to make a local maven or smthn? cuz the plugin doesnt have a maven but i need to use its library

chrome beacon
#

Yes you can install the jar in to the maven local

misty current
worldly ingot
#

Looks like decompiled bytecode

#

Was probably set to 1

misty current
#

spigot classes are weird sometimes lol

#

yeah

#

guess so

#

it's an hashcode method so makes sense

prisma steeple
#

Caused by: java.lang.IllegalArgumentException: 100.0 is too high

if(!player.getAllowFlight()) {
                player.setAllowFlight(true);
                player.setFlying(true);
                player.sendMessage(ChatColor.GREEN + "Flight Enabled");
                player.setFlySpeed(100);
#

flight is enabled

#

however

#

"an internal error occured while trying to preform this command"

#

any ideas?

golden turret
#

when I get an entity using the entity's id with nms, does it returns the entity only if it is loaded?

prisma steeple
#

yes

#

does it have to be decimal by force?

#

well no

harsh totem
prisma steeple
#

yep i know, however i didn't notice anything above 1 was too high

sterile token
#

Where i can download the JDk 17? Oracle doesnt allow me to log in their website, so i cannot download it

eternal oxide
#

AdoptOpenJDK

sterile token
#

Alrr thanks

dusk flicker
spiral cape
#

Hello! anyone knows how I can easily get the block player is standing on when they are on the edge of the block?

dark harness
#

How can i cancel the achievement message when a player is vanish? PlayerAdvancementDoneEvent is not the right event i think

formal bear
#

How to set aliases from config file?
getCommand("fly").setAliases(Lists.newArrayList(plugin.getConfig().getString("commands.aliases.fly").split("\\|",-1));
And for example config.yml

commands:
  aliases:
    fly: "f|flyyy"
ivory sleet
#

aliases: [ "f", "flyyy" ]

sterile token
#

I have download it but its not a java file, its a zip

eternal oxide
#

download the correct one then

formal bear
sterile token
eternal oxide
sterile token
eternal oxide
#

If on Windows DL the MSI not teh zip

sterile token
#

Hmn

eternal oxide
#

msi not zip

sterile token
#

Oh ok

#

What its .msi?

#

My bad

eternal oxide
#

Microsoft installer

sterile token
#

Oh ok

#

Sorry for losting your time

waxen plinth
#

That won't work

spiral cape
#

its the same thing

#

cause i use getblock the same way

#

and it's just meh :/

eternal oxide
#

There is no reliable way to get the block you are hanging off, even if the block under you is air

sterile token
#

It possible to cancel only fall damage right?

sterile token
#

You always help it really apreciated

formal bear
# ivory sleet aliases: [ "f", "flyyy" ]

getCommand("fly").setAliases(Lists.newArrayList(plugin.getConfig().getString("commands.aliases.fly")));
Is there something wrong with this code bcs it won't set the aliases when reloading?

spiral cape
#

@formal bear ```yml
adventure:
description: Manage adventure parkour courses
permission: adventure.play
aliases: [adv, advcontinue, advset, advadd]

#

take this as an example on how to do aliasses

formal bear
spiral cape
#

and in this case you just do this.getCommand("adventure").setExecutor(new AdventureCommand(this));

prisma steeple
#

doesn't seem to work

formal bear
#

so set executor not set aliases?

spiral cape
#

setExecutor sets my command object

eternal oxide
#

@green prism sql CREATE TABLE IF NOT EXISTS agencies ( ID MEDIUMINT NOT NULL AUTO_INCREMENT, AgencyName VARCHAR(100), AgencyOwner VARCHAR(36), Balance DOUBLE, MaxBalance DOUBLE, PRIMARY KEY (AgencyName) ) checked in https://www.eversql.com/sql-syntax-check-validator/

formal bear
spiral cape
#

no

#

you dont do setAliases, as you have them set in plugin.yml already

formal bear
#

From config nto from plugin yml

#

I meant custom aliases loading on onEnable

prisma steeple
green prism
spiral cape
#

so you want to set an alias for a command that exists in a different plugin. correct?

tardy delta
formal bear
#

I want to give option to set custom aliases for user

getCommand("fly").setExecutor(new Fly());
getCommand("fly").setAliases(bla bla);
tardy delta
#

define aliases in the plugin.yml

#

?plugin.yml 💀

formal bear
#

i want to set it from config file

#

on enable

spiral cape
#

why?

formal bear
#

why not? XD if its possible why not, idk for example fly in other language or smh

eternal oxide
spiral cape
formal bear
#

from config?

spiral cape
#

from plugin.yml

spiral cape
formal bear
#

i dont want plugin.yml, user cannot edit it

#

i want to load them from yml file in plugins directory

eternal oxide
#

@green prism sql CREATE TABLE IF NOT EXISTS agencies ( ID MEDIUMINT NOT NULL AUTO_INCREMENT, AgencyName VARCHAR(100) UNIQUE, AgencyOwner VARCHAR(36), Balance DOUBLE, MaxBalance DOUBLE, PRIMARY KEY (ID) )

tardy delta
#

cant you do that in commands.yml?

sterile token
prisma steeple
#

why won't it work someone pls

#

no not work

spiral cape
sterile token
#

Is the bot down?

prisma steeple
#

yes

tardy delta
# prisma steeple

add an @EventHandler annotation
method names should start with a lowercase character

spiral cape
#

then setAliases should work

hasty prawn
prisma steeple
#

🤦‍♂️ thanks guys

sterile token
#

Are build toos working?

#

And nothing else happens

#

It had happen more than 1h

formal bear
#

in the part getCommand("fly").setAliases(Lists.newArrayList() something is incorrect?

upper vale
#

You’re getting a string not a string list

#

There’s a getStringList method

formal bear
#

i rtired with split

#

ah toList

#

nvm

#

forgor

upper vale
#

getConfig().getStringList

#

You don’t need to parse a string and convert it to a list yourself

formal bear
#

o really XD

#

thanks

formal bear
upper vale
#

That works

#

You can also do
aliases:
- foo
- boo

formal bear
#

oke! tysm

pale egret
#

how would I make it so you can do /heal (name)

onyx fjord
#

what are these called

formal bear
#

Hm, still nothing, maybe i will just paste the code

    public void onEnable() {
        this.saveDefaultConfig();

        getCommand("fly").setExecutor(new Fly());

        List<String> flyAliases = plugin.getConfig().getStringList("commands.fly.aliases");

        getCommand("fly")).setAliases(flyAliases);
sterile token
#

@onyx fjord do you hear me?

formal bear
sterile token
trail lintel
#

Hey guys, I have a bit of a logic issue you may be able to help me with. I am listening to PlayerInteractEvent and doing stuff based on if they clicked a block or a liquid source block. However, I also need to account for entities. So I am listening to both PlayerInteractEvent and PlayerInteractEntityEvent. Problem is, BOTH event handlers fire in the case of an entity. First PlayerInteractEntityEvent, followed by PlayerInteractEvent. Is there a way to approach this to only have the entity event fire if an entity was what was clicked?

tardy delta
#

dont do that

#

returning null will return all player names

pale egret
#

oh

trail lintel
#

I thought about checking if event instanceof PlayerInteractEntityEvent inside of the regular event handler, but it wont allow that comparison

vivid hill
#

I cant implement a Listener! It just shows me the import for an Web listener can some help me with that problem?

worn tundra
upper vale
formal bear
trail lintel
#

its not being called for entities

upper vale
#

Could you check if the action is right click air?

trail lintel
#

I found a thread about this from a while back

#

its calling entity for the cow, and also regular interact for the air around it

#

no real solution there though....

tall dragon
#

if the player has been on the server

#

yes

merry socket
#

is it possible to have exp not be clumped into one ball?

tall dragon
#

simply by using Bukkit#getOfflinePlayer, OfflinePlayer#getName()

trail lintel
#

I suppose I could put a "handled" flag on the persistence data container of the item? that seems weird though....

trail pilot
#

Could not find spigot-api-1.18.2-R0.1-SNAPSHOT.jar (org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT:20220524.110132-46).

wat

tall dragon
#

well yea

snow sluice
#

java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.lexih.Main.getCommand(String)" is null how do i fix this?

    public Test instanceTest;
    @Override
    public void onEnable(){
        instanceTest = new Test(this);
        getServer().broadcastMessage("server started");
    }
    @Override
    public void onDisable() {
        getServer().broadcastMessage("Server stopped");
    }

}```
```public class Test implements CommandExecutor {
    private final Main instance;

    public Test(Main mainClass) {
        this.instance = mainClass;
        instance.getCommand("testt").setExecutor(this);
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length >= 2) instance.getServer().broadcastMessage("Test");
        return true;
    }
}```
tall dragon
#

idk if thats possible too

#

you would need to check

sterile token
#

Lmao build tools doesnt works for me :(

delicate lynx
trail pilot
#

tf happens

#

lmao

snow sluice
#
main: com.lexih.Main
version: 1.18
commands:
  /testt:
      description: this is just a test relax
      aliases: /t```
#

yea

trail pilot
#

im not stupid man

delicate lynx
#

remove the slash

snow sluice
#

oh

#

theres no slash?

delicate lynx
#

nope

trail pilot
#

where tf is 1.18.2_

snow sluice
#

im dumb 😭

#

ty

#

it fixed it

sterile token
#

How do i fix build tools?

#

It have been more than 1h trying to build a spigot

trail pilot
#

compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'

its that version exists

snow sluice
#

did u put the repositories

#

might be that

trail pilot
# snow sluice might be that
repositories {
    mavenCentral()
    maven {
        name = 'spigotmc-repo'
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }
    maven {
        name = 'sonatype'
        url = 'https://oss.sonatype.org/content/groups/public/'
    }
}```
trail lintel
#

I see tons of examples online doing this check but for some reason my JDK complains about it. Has this been deprecated or something?

snow sluice
#

https://hub.spigotmc.org/nexus/content/repositories/snapshots/
https://oss.sonatype.org/content/repositories/snapshots

#

i use these 2

snow sluice
snow sluice
#

idk then sorry

trail pilot
eternal oxide
trail pilot
#

man i need to dev something

snow sluice
#

i use gradle cuz a friend told me to

trail pilot
snow sluice
#
repositories {
    mavenCentral()
    maven {url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'}
    maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
    compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
}```
trail pilot
#

wait maybe is ij idea issues

snow sluice
#

did u click the elephant?

vivid hill
#

where do i get the spigot 1.18 api from?

trail pilot
trail pilot
#

xd i know what i do lol

eternal oxide
#

or

#

?bt

undone axleBOT
snow sluice
trail pilot
#

its find me that

vivid hill
#

I used them

ivory sleet
#

basically you build the jars on your own system

vivid hill
#

I got like 6 folders

trail pilot
#

hello?

sterile token
#

hello?

trail pilot
#

gradle spigot are broken :'

ivory sleet
#

na

#

or well what error do you get

sterile token
#

Build Tools are broken that my conclusion

eternal oxide
#

he's got = in all his repositories. I've never seen any gradle.build have them

eternal oxide
#

xmotro

ivory sleet
#

the repos look right, but there might be a caching issue or sth

vivid hill
#

burh how do I donwload the spigot api?

#

isnt there a file for it

#

anywher