#help-development

1 messages · Page 1746 of 1

crimson terrace
#

oh I get you now

#

Ive never used it personally but Ill see if I can find out something

waxen barn
#

I need to detect it as soon as the air bar apperas on the client

crimson terrace
#

just read it. easy

#

I believe as soon as your head goes underwater you lose your first tick of air

crimson terrace
#

but ticks should be exact enough even if you lose the first tick right after you go underwater

patent horizon
#
        if (new Data().getPackageCount(String.valueOf(player.getUniqueId())) == null) {
            new Data().setPackageCount(String.valueOf(player.getUniqueId()), 0);
        }```
im getting a npe from this which doesnt make sense
quaint mantle
#

why are you making a new object twice in comparison

patent horizon
#

because i cant develop correctly 🤪

quaint mantle
#

you're so quirky 🤪

patent horizon
#

still shouldnt affect the outcome

slim kernel
quaint mantle
slim kernel
quaint mantle
#

the api version

#

to 1.16

#

or upgrade your server to 1.17

slim kernel
# quaint mantle the api version
<dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.16.5-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

I got it like this tho

quaint mantle
#

in the plugin.yml

slim kernel
slim kernel
quaint mantle
#

it should be 1.16

slim kernel
slim kernel
quaint mantle
#

Dude

#

your whole project is scuffed

slim kernel
#

Yeah I got that haha

quaint mantle
#

you're compiling with java 16 but you're using java 8

slim kernel
quaint mantle
#

send your pom

slim kernel
quaint mantle
#

change java.version to 1.8

#

under <properties>

slim kernel
#

Okay I will try that thanks

slim kernel
drowsy gust
#

Hello there

#

I want to ask for the best way to organize + optimize checks in InventoryClickEvent

#

I have like 20 if statements to check for the current item and handling the click

#

Is there any easier way to do that ?

#

I would to use switch statement but I can’t find the difference between it and the “if else statements”

lost matrix
# drowsy gust Is there any easier way to do that ?

Yes. You want only one single listener that has almost no logic in it.
Delegation is the keyword here. You should implement a way to check if the clicked
inventory is a custom inventory and then delegate the event to a handler for this inventory.
if - else chains are almost never a good option since we now have functional interfaces and hash maps to
route our workflow with O(1) complexity. Ill write you a short example.

drowsy gust
spare marsh
#

Question, I checked if the block state is a shulker box but I want to cast it to a shulker box then open the inventory but the casting part won't work.

lost matrix
lost matrix
misty current
#

what happens if I call hasPemission() with an empty string as a param?

#

does it always return true or false?

lost matrix
#

It will always return true

misty current
#

thanks

drowsy gust
lost matrix
spare marsh
lost matrix
spare marsh
#
if(event.getBlock().getLocation().getWorld().getName().equalsIgnoreCase("MiningZone")) {
            if (event.getBlock().getState() instanceof ShulkerBox) {
                ShulkerBox box = (ShulkerBox) event.getBlock().getState();
                event.getPlayer().openInventory(box.getInventory());
                event.setCancelled(true);
            }
        }```
spare marsh
lost matrix
# spare marsh there

This works for me:

  @EventHandler
  public void onPlace(final BlockPlaceEvent event) {
    final Block placed = event.getBlockPlaced();
    final BlockState state = placed.getState();
    if (state instanceof ShulkerBox box) {
      event.getPlayer().openInventory(box.getInventory());
      event.setCancelled(true);
    }
  }
carmine nacelle
#
    public void consumeCustomArrow(Player player, CustomArrow customArrow) {
        Arrays.stream(player.getInventory().getContents())
                .filter(itemStack -> itemStack.hasItemMeta() &&
                        itemStack.getItemMeta().hasDisplayName() &&
                        ColorTranslator.translateColorCodes(itemStack.getItemMeta().getDisplayName()).equalsIgnoreCase(ColorTranslator.translateColorCodes(customArrow.getArrowType().getDisplayName()))
                )
                .findFirst().get().setAmount(Arrays.stream(player.getInventory().getContents())
                        .filter(itemStack -> itemStack.hasItemMeta() &&
                                itemStack.getItemMeta().hasDisplayName() &&
                                ColorTranslator.translateColorCodes(itemStack.getItemMeta().getDisplayName()).equalsIgnoreCase(ColorTranslator.translateColorCodes(customArrow.getArrowType().getDisplayName()))
                        );
    }

Bruhhh..this is a total mess and i cant figure it out. Basically I need to search the player's inventory for the specific item, then reduce the amount by 1

#

trying to use streams instead of just a for loop

lost matrix
quaint mantle
#

NBT injection

carmine nacelle
#

the displaynames have colors tho u cant color things with anvils

lost matrix
#

But you can fk up already obtained items

carmine nacelle
#
                ItemStack multiArrow = ItemUtils.makeItem(Material.TIPPED_ARROW, ColorTranslator.translateColorCodes(ArrowType.MULTISHOT.getDisplayName()), ColorTranslator.translateColorCodes("&#63B558Upon firing, splits the single arrow into 3"));
                PotionMeta multiMeta = (PotionMeta) multiArrow.getItemMeta();
                multiMeta.setColor(archery.getCustomArrowManager().getCustomArrow(ArrowType.MULTISHOT).get().getColor());
                multiArrow.setAmount(amount);
                multiArrow.setItemMeta(multiMeta);

can't get PersistentData of itemstacks?

lost matrix
#

ItemMeta is instance of PersistentDataHolder

carmine nacelle
#

ah..alright

#

also is there a better way to do this..? I need to set the Color property of the arrow and you cant do it with itemmeta so I gotta use potionmeta for it

maiden patio
#

hi i'm disable-player-collision For The Server Help me

lost matrix
opal juniper
#

hey 7Smile - how to pronounce dijkstra - “dike struh” or “deek struh”

carmine nacelle
#

Does cancelling bow fire event still make it consume arrows..? it is for me

lost matrix
opal juniper
#

lol

eternal night
opal juniper
#

i had seen you talk about it before

#

thought you might know

prime leaf
#

anyone know how I can handle large amounts of tnt for my factions server

#

like does each world have its own thread ?

#

can i do that

eternal night
#

not without a lot of effort

buoyant viper
#

asking again bc cant test it rn, does a PlayerToggleSprintEvent get fired by calling Player#setSprinting

#

or only when player does it themselves

lost matrix
lost matrix
prime leaf
#

ye

#

pretty much

carmine nacelle
#

@lost matrix Would you have any idea how to make it so when I shoot a bow, it doesn't just consume the first arrow it finds in my hotbar..? cancelling bow fire still consumes and so does setConsumeItem(false)

lost matrix
prime leaf
#

is there a way too make it so all tnt actions except the damage to blocks async ?

lost matrix
carmine nacelle
#

correct

#

even if I cancel the event entirely it still consumes it.

lost matrix
carmine nacelle
#
    @EventHandler
    public void onBowShoot(EntityShootBowEvent event) {
        event.setCancelled(true);
        event.setConsumeItem(false);
    }
#

legit like

#

bruh tf

lost matrix
#

Same for me. Looks like a bug.

lavish hemlock
#

githuib isuseusi time

lost matrix
lavish hemlock
#

hmmm

#

sounds like a timing issue

lost matrix
maiden patio
#

@lost matrix how to disable player collision movement player help ?

maiden patio
#

i'm not speaking English i using Google Translator

#

@lost matrix use plugins ?

lost matrix
#

team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);

maiden patio
#

@lost matrix with use plugins work ?

lost matrix
#

This channel is for development related questions

maiden patio
#

its not work

opal sluice
#

Hi, does anyone knows how to change attributes through packets ?

#

Like the max health etc.

misty current
#

what do you need it for

#

cant you change attributes with spigot's api

opal sluice
misty current
#

iirc you need to provide an int as the entityId and a List

#

never used it tho, cant help much

opal sluice
#

No problem, thanks anyway ^^

ornate patio
#

I've made plugins before, no idea why spigot won't recognize this one

#

when i start up my server, it just doesn't load my plugin at all

#

theres my file structure

carmine nacelle
#

errors?

ornate patio
#

nope

#
[16:25:30] [Server thread/INFO]: Time elapsed: 6247 ms
[16:25:30] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end
[16:25:30] [Worker-Main-6/INFO]: Preparing spawn area: 0%
[16:25:30] [Worker-Main-10/INFO]: Preparing spawn area: 0%
[16:25:31] [Worker-Main-10/INFO]: Preparing spawn area: 43%
[16:25:31] [Server thread/INFO]: Time elapsed: 1381 ms
[16:25:31] [Server thread/INFO]: [PlugMan] Enabling PlugMan v2.2.2
[16:25:31] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[16:25:31] [Server thread/INFO]: Done (23.762s)! For help, type "help"
carmine nacelle
#

is it red?

ornate patio
#

it enables plugman but not mine

carmine nacelle
#

in /pl

opal sluice
ornate patio
misty current
#

if that was the case, it would throw an exception

ornate patio
#

not even listed in pl

carmine nacelle
#

do u have the plugin.yml included in the artifact output:

ornate patio
#

i think so

opal sluice
#

Look in your jar (use an unzipper) to see if there is the plugin.yml

ornate patio
#

k gimme a sec

misty current
#

unrelated to your issues, but don't call your main class main

#

call it the name of the plugin

ornate patio
misty current
#

yep

ornate patio
#

oh k

opal sluice
#

Have you started the right server ? I mean, it's in the good folder and you're opening this server ?

misty current
#

stupid question probably but is the plugin in the right folder

misty current
#

and also did you restart

ornate patio
#

yeah i did

#

would all the extra folders matter

misty current
#

nope

ornate patio
#

when i try to delete the plugin while the server is running it doesnt let me

#

because its in use

#

so the server is doing something with it idk

misty current
#

are you sure there is nothing in the console

ornate patio
#

i dont see anything

ivory sleet
#

PlugMan suspiciouseyes

misty current
#

i mean as long as it's a small plugin

ornate patio
#

wait bruh i scrolled all the way up and found something

misty current
#

but when u have dependencies always restart

ornate patio
#

ye ye

misty current
ornate patio
#

hopefully yes

carmine nacelle
#

uhhh

misty current
#

you need to register the manhunt command in plugin.yml

carmine nacelle
#

main.getCommand("manhunt").setExecutor(this);

#

move that to the main class

misty current
#

also fyi TabExecutor exists

carmine nacelle
#

that needs to be in onEnable

ornate patio
ivory sleet
#

No need to use setExecutor if it’s just going to be the plugin instance itself

ornate patio
#

wait god damn im an idea i put the wrong command

#

i meant to put deathswap

#

but i doubt thats the issue

misty current
#

that is indeed

ornate patio
#

oh wait

#

yeah plugin.yml thing

#

i copy pasted some of the code from my other plugin so

misty current
#

you have deathswap in your plugin.yml and manhunt as a getCommand parameter

ornate patio
#

yeah i figured

carmine nacelle
#

u should be initializing ur command class in onEnable not at the top of the class

ornate patio
#

why

formal dome
#

so i want a UDP socket in my plugin

ornate patio
#

i kinda just like it this way its neater

formal dome
#

how do you construct a datagram socket?

#

i have this so far

#
  try {
            this.inet4Address = (Inet4Address) Inet4Address.getByName("ipstring");
            this.datagramSocket = new DatagramSocket(8080, inet4Address);
            datagramSocket.connect
        }```
#

idk what to do exactly. i need to read info from a config file for sure

misty current
# ornate patio why

it's personal preference but vivian's way is more explicative to who reads ur code

ornate patio
#

oh

#

ig

misty current
#

so anyone can tell immediately that is a command

opal sluice
#

Set EntityPlayer max health through packets

ornate patio
#

why am i still getting errors hold up

#
[16:47:30] [Server thread/ERROR]: Could not load 'plugins\DeathSwap.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.okay.DeathSwap.DeathSwap.getCommand(String)" is null
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149) ~[spigot-1.17.1.jar:3187-Spigot-d03d7f1-b8c522d]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-1.17.1.jar:3187-Spigot-d03d7f1-b8c522d]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-1.17.1.jar:3187-Spigot-d03d7f1-b8c522d]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:384) ~[spigot-1.17.1.jar:3187-Spigot-d03d7f1-b8c522d]
        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:233) ~[spigot-1.17.1.jar:3187-Spigot-d03d7f1-b8c522d]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:995) ~[spigot-1.17.1.jar:3187-Spigot-d03d7f1-b8c522d]
#
public class CommandListener implements CommandExecutor, TabCompleter {
    private DeathSwap deathSwap;
    private String helpMessage;

    public CommandListener(DeathSwap deathSwapClass) {
        deathSwap = deathSwapClass;
        deathSwap.getCommand("deathswap").setExecutor(this);
// ...
fallow merlin
#

the command ur trying to get is null.

#

did you set it in ur plugin.yml?

ornate patio
#

yup

#
main: me.okay.DeathSwap.DeathSwap
name: DeathSwap
version: 1.0
author: okay
api-version: 1.17

commands:
  deathswap:
uneven dock
#

Hey everyone, just a question as I'm wondering if this is even possible... can you add items to MC with plugins in a way other than changing existing items or using OptiFine CLI to render custom models?

fallow merlin
#

that crashes the client

crude charm
fallow merlin
#

^^

#

thats why CustomModelData exists

uneven dock
#

I mean I know with a resource pack you can reskin ingame items and give them custom data. But I was wondering if I could say, add a new armor set without needing to reskin an existing item.

subtle kite
crude charm
#

With a texture pack

fallow merlin
uneven dock
crude charm
#

Wynncraft has thousands of custom textured sets

fallow merlin
lost matrix
#

You cant change an armor items model with a texturepack sadly

fallow merlin
#

its amazing

fallow merlin
subtle kite
#

then

#

how you do it

uneven dock
#

So if I understand correctly, you can add custom items with a resource pack to give it a texture?

fallow merlin
#

Armor Models cant be changed .-.

crude charm
subtle kite
#

Then how does cosmicpvp does it @ gardian

uneven dock
#

and you don't have to reskin existing in game items?

fallow merlin
#

provided its configured correctly

crude charm
uneven dock
#

So I can add my own custom armor sets with a plugin?

#

and not have to be rid of existing base MC ones?

fallow merlin
#

regular armor has no cmd

uneven dock
fallow merlin
#

not exactly

#

theres a thing called customModelData that texture packs can check

lost matrix
#

If you want to have custom armor then you need to generate player skins. But you will need quite a bit of clients for that as every combination of armor
items has to be generated. This means that 10 armor sets need at least 10.000 generated skins.

uneven dock
#

Yeah.. what?

lost matrix
#

Which requires about 8 - 10 player accounts

crude charm
fallow merlin
#

alternatively make the model urself in blockbench??

fallow merlin
uneven dock
crude charm
#

this is what I believe you want

#

having like 500 armour sets

#

with different models

lost matrix
fallow merlin
#

rate limit go brrrr

uneven dock
# crude charm no

So it changes the Armor texture applied to the items when a player is wearing it?

lost matrix
#

Armor items are not used at all. You need to change the skin of a player.

uneven dock
lost matrix
#

Right

uneven dock
#

Ohhhhhhhhhhhhhhhhh

#

I'm assuming they accomplish that with Packets?

crude charm
#
uneven dock
#

Thanks!

twilit wharf
#

Does anyone know a up to date api for getting input through a anvil or sign? I tried like 3 or 4 of them but all they did was just produce errors I couldnt make out.

drowsy helm
#

it shouldn't be hard to make one of them, just use a packet listener

#

both should have an event anyways

crude charm
#

what ver u using?

twilit wharf
#

1.17.1

crude charm
#

yeah they probs not on that

twilit wharf
#

well some of them were for craftbukkit

#

which I dont think is compatible

quaint mantle
#

can someone help me get eclipse setup with the buildtools library added

twilit wharf
crude charm
#

hmm not too sure

#

but yeah just make your own if they dont work

twilit wharf
#

alright, I dont even know where to begin lol

#

trial and error I guess

twilit wharf
#

intellij is way better in my opinion

quaint mantle
#

fineee

crude charm
#

how is eclipse better then intelliJ

#

intelliJ is better in EVERY way

quaint mantle
#

Nah I just like annoying people

#

:3

#

truth is I don't have much experience with either

crude charm
#

before spigot

#

spigot is a java api

ancient plank
#

I thought spigot was a c++ api

olive valve
#

hello! why does my plugin say Process Terminated when i build my plugin?

olive valve
#

pom.xml

crude charm
#

send the full error

olive valve
#

ye

crude charm
#

?paste

undone axleBOT
olive valve
#

the error is Process Terminated

crude charm
#

that's not enough

#

send the whole console

#

so you type

#

mvn package

ancient plank
#

are you clicking the big red square after you click build KEKWW

crude charm
#

and it just says that

#

NOTHING ELSE

unreal quartz
#

means ur not good enough

olive valve
#

yes just Process Terminated

unreal quartz
#

be nice to your ide next time

olive valve
#

WHAT DID I DO?

ancient plank
#

i tried tehe

crude charm
olive valve
#

pls help me i have been working on this plugin for almost 3 months i do not want to lose it! PLSSS

olive valve
#

ok

crude charm
#

it's not going to self destruct lmfao

olive valve
#

so should i give you some context and what i have been doing since the last time it actually worked?

crude charm
#

also you should have it on github

olive valve
#

this might sound dumb but i have never used github

crude charm
olive valve
#

ok

#

can we get back to the terminated process?

#

why isnt it working?

crude charm
#

have you tried deleting your .m2?

olive valve
#

.m2?

crude charm
#

yeah

#

your .m2 folder

olive valve
#

what will that do?

crude charm
olive valve
#

*sigh

#

i figured it out

#

and its so dumb

crude charm
#

also just look on stack overflow I can see alot of "processes terminated errors"

crude charm
olive valve
#

i was missing an > on one of my dependancies...

crude charm
#

that wouldn't return "processes terminated"??

olive valve
#

it did

crude charm
#

it would say there is a compiling issue

#

it defo shouldn't

olive valve
#

well i added that and it built just fine

crude charm
#

ok

olive valve
#

have a nice day

#

/night

crude charm
#

u2

hearty solar
#

help

#

how to check if player moved to another world?

quaint mantle
eternal oxide
#

PlayerChangedWorldEvent I think

quaint mantle
#

yeah that

hearty solar
#

wait ahh

hearty solar
# eternal oxide PlayerChangedWorldEvent I think

i have code below:

@EventHandler
    public void onWorldChange(PlayerChangedWorldEvent event) {
        System.out.println("onWorldChange executed.");
        currentWorld = event.getPlayer().getWorld();
        Player player;
        player = event.getPlayer();
        if(currentWorld.getName().equals("bwlobby"))
        {
            System.out.println("worldislobby executed.");
            PlayerInventory inv = player.getInventory();
            inv.clear();
            ItemStack compass = new ItemStack(Material.COMPASS, 1);

            ItemMeta im = compass.getItemMeta();

            im.setDisplayName("§6Game Navigation §7[Use]");

            compass.setItemMeta(im);

            inv.setItem(4, compass); //Slot 1 = 0
            System.out.println("item given executed.");
        }
    }
#

but it doesnt work as well

#

i wanna check if player moved to world bwlobby

#

and if player moved to world bwlobby, player will be clear inventory and given a compass

late sonnet
#

how can configure git for avoid making .patch with "line separator difference"?

hearty solar
#

but when i try the move player to another world, the System.out.println("onWorldChange executed."); dont even be executed

#

which mean the onWorldChange() function is not even called

eternal oxide
hearty solar
#

im new

#

in spigot development

eternal oxide
#

in your onEnable you should register your listeners

#

registerEvents(new ListenerClass, this)

hearty solar
#

what code should i write inside?

#

:/

hearty solar
eternal oxide
#

look up the correct code, thats just a snippet

hearty solar
hearty solar
#

lemme search real quick

eternal oxide
#

google "spigot registerEvents"

hearty solar
eternal oxide
#

You don;t have to.

#

is your changedworld listener in yoru main class?

eternal oxide
#

then do registerEvents(this, this)

#

to register your main class as a Listener

eternal oxide
#

yes

hearty solar
#

error

eternal oxide
#

Main extends JavaPlugin, implements Listener

hearty solar
#

public final class Main extends JavaPlugin implements Listener

hearty solar
#

lol

#

alright thats all right, lemme try

hearty solar
#

so i moved myself to world bwlobby

#

and these log is given

24.10 21:14:17 [Server] Server thread/INFO onWorldChange executed.
24.10 21:14:17 [Server] Server thread/INFO worldislobby executed.
24.10 21:14:17 [Server] Server thread/INFO item given executed.
#

BUT

#

i didt get my item

hearty solar
# eternal oxide yes

code inside the function:

System.out.println("onWorldChange executed.");
        currentWorld = event.getPlayer().getWorld();
        Player player;
        player = event.getPlayer();
        if(currentWorld.getName().equals("bwlobby"))
        {
            System.out.println("worldislobby executed.");
            PlayerInventory inv = player.getInventory();
            inv.clear();
            ItemStack compass = new ItemStack(Material.COMPASS, 1);

            ItemMeta im = compass.getItemMeta();

            im.setDisplayName("§6Game Navigation §7[Use]");

            compass.setItemMeta(im);

            inv.setItem(4, compass); //Slot 1 = 0
            System.out.println("item given executed.");
        }
eternal oxide
#

try at the end an inv.update();

hearty solar
#

u mean add

eternal oxide
#

I assume your inventory was cleared

hearty solar
#

maybe

#

my inventory was always empty in that world

hearty solar
#

uh

eternal oxide
#

in that world its always empty? do you have some other world inventory management plugin?

hearty solar
#

perworldinventory

#

but it doesnt block me doing this i guess..

eternal oxide
#

then it will be that which is causing your issues

#

You have discovered the wonderfull world of event priorities

hearty solar
#

but my other plugin work fine with that perworldinventory

eternal oxide
#

your plugin needs to run this event after yoru per world inventory plugin runs its own

hearty solar
hearty solar
#

lets add a sleep() function

#

lemme google search

eternal oxide
#

yeah, the code is actually player.updateInventory()

#

no sleep

#

never sleep

#

these events have a priority system already

#

you just have to set yours to run later

hearty solar
eternal oxide
#

after the @EventHandler (priority = high)

#

I think

hearty solar
eternal oxide
#

Its been a while since I played with priorities

young knoll
#

eventPriority iirc

restive wave
#

Does anyone know how to make an explosion particle at the players position? I cant find a good one.

#

(kotlin)

young knoll
#

Maybe it is just priority, idk

hearty solar
eternal oxide
#

you could run it delayed, yes

hearty solar
young knoll
#

The problem with priority is a lot of plugins like to use highest

hearty solar
#

it say plugin name in google

eternal oxide
#

coll is correct @EventHandler(priority = EventPriority.HIGH)

young knoll
#

And then you can't go after them

hearty solar
eternal oxide
#

you can use your task, just replace plugin with this as you seem to be using a god class

hearty solar
#

oh

#

ye

#

that make sense

crude charm
#

step 2) packets

eternal oxide
fallow merlin
#

oooh

crude charm
#

those pesky beginners

#

how dare they put it all their chickens in one box

hearty solar
#

the 20L mean what

#

ms?

#

or second?

eternal oxide
#

ticks

hearty solar
#

oh ticks

hearty solar
#

20 ticks is 1 second

#

right

eternal oxide
#

20 game ticks to a second

hearty solar
#

yes, my minecraft expirience is not that bad les goo

#

imma put 10L and see if its enough

eternal oxide
#

1-5 shoudl be enough

young knoll
#

Is there any good way to make sure your events go after other plugins that are using HIGEST

#

I guess you could softdepend on them

eternal oxide
#

this is an un cancellable event which means its already happed, so very minimal delay would be needed

crude charm
#

My sbs usually update every 2 ticks (assuming there is something to change) and there is no lag

eternal oxide
ancient plank
#

Thread.sleep(100000); then wonder why your server is "crashing"

young knoll
#

Not exactly helpful

fallow merlin
#

@ancient plank The server room is on 🔥!!!

young knoll
#

I really don't want to have to add specific support for protection plugins

#

Because they tend to use highest

eternal oxide
#

What are you attempting to do?

young knoll
#

Just for my general plugins

#

Don't want them to bypass protection

eternal oxide
#

The only other is Monitor, and so long as you are not wanting to change the event...

young knoll
#

Problem is I generally am

hearty solar
#

LES GO IT WORKED, thank you so much @eternal oxide

eternal oxide
#

np

quaint mantle
#

is everything we can make using datapacks we can make it in spigot too?

carmine nacelle
#

Error:(2, 13) Invalid main class trying to commit the project to github, getting this error

#

even though

#

Main-Class: com.squallz.archery.Archery is in fact my main class..

young knoll
#

Spigot plugins don't have a proper main class

#

With public static void main(String[] args)

carmine nacelle
#

sooo..ignore the error?

young knoll
#

Pretty much

carmine nacelle
#

bet

maiden thicket
carmine nacelle
#

when i was trying to commit it opened MANIFEST.MF and had that but i think its fine now

young knoll
#

Why do you even have a manifest

maiden thicket
#

u dont need a manifest

#

ur main class is defined in ur plugin.yml

carmine nacelle
#

Idk? ask intellij/maven

#

i didnt make it lmao

vital yacht
fallow merlin
raw coral
#

Anyone how hypixel does their inventory serialization

vital yacht
fallow merlin
#

??

young knoll
#

They don't want other plugins to be able to un-cancel it

vital yacht
#

Seems like a dumb way to do it

restive wave
#

how do i use player.location and bump it up one block?

eternal oxide
#

a good protection plugin would run on two priorities

restive wave
vital yacht
raw coral
#

hi Sus

raw coral
restive wave
#

thx

eternal oxide
#

Lowest is generally for permission plugins, so they setup perms first, then protection plugins on low, so they can cancel before anyone else.

#

The majority of other plugins would run on Normal

vital yacht
#

When would permissions plugins listen to events?

eternal oxide
#

Lowest

vital yacht
#

No like in what case

eternal oxide
#

PlayerJoin, change world etc

vital yacht
#

Isn’t that what other plugins would do? Shouldn’t permissions plugins just keep track of permissions, and other plugins use those permissions?

eternal oxide
#

Yes, which is why they listen on Lowest, so they can update the players permissions before any other plugin needs them

vital yacht
#

Oh I see

#

I thought you meant they were like blocking people from joining / changing worlds

young knoll
#

I need like

#

Something between Highest and Monitor

#

When you can't un-cancel an event, but you can do other stuff

eternal oxide
#

I don;t see why a protection plugin would run on Highest

#

it should (in theory) run on Low

young knoll
#

Huh I guess they don't

#

WG runs on normal

worldly ingot
#

I second that - any sort of protection plugin should always run on low

#

Events can then just ignoreCancelled on normal priority

young knoll
#

Towny uses high

worldly ingot
#

The towny dev is on crack

eternal oxide
#

🙂

young knoll
#

And EssentialsProtect uses highest

eternal oxide
#

Much of the odd priorities is down to the naming. Years ago when we wrote these plugins everyone was seriously confused as to what ran first

young knoll
#

Fair

#
if (!isAcceptingRegistrations()) {
  throw new IllegalStateException(
    "No longer accepting new enchantments (can only be done by the server implementation)");

👀

eternal oxide
#

thast why people do it using reflection

worldly ingot
#

Still really shouldn't be doing it anymore

#

Especially now that PDC exists

young knoll
#

It is much more convenient to do this way TBH

#

Also generally more compatible

worldly ingot
#

Compatible but not supported

young knoll
#

:D

raw coral
#

How should i serialize my players inventory to a string for storing in a database (1.8)

eternal oxide
#

google spigot serialize inventory

#

there is a gist

muted sand
#

wheres the code to entity AI?

#

or are they goals, or something....

fallow merlin
muted sand
#

both

#

lol

fallow merlin
#

ok lemme find the forum post about it

muted sand
#

for the latter, it's extending Entity something
pathgoal is just a method i believe-?
ah, thanks!

fallow merlin
#

(also targetselector is bP in 1.17)

fallow merlin
muted sand
#

bP?

#

but thank you!

fallow merlin
#

EntityLiving.targetSelector.a() turns into EntityLiving.bP.a()

muted sand
#

ohh

ornate patio
#

how do i check if a block is in an ocean biome?

#
while (teleportLocation.getBlock().getBiome().equals(Biome.OCEAN)) {
#

this is what i got, however it doesn't really work properly

ornate patio
#

because a cold ocean biome doesnt count as an ocean

ornate patio
quaint mantle
#

bruh

#

?learnjava

undone axleBOT
ornate patio
#

uh

#

I know java

#

or at least everything but this one part

quaint mantle
#

ok

#

so why are you asking how == works

#

if you know java

ornate patio
#

I know the difference between == and .equals

quaint mantle
#

so you should know that you use .equals with Strings

ornate patio
#

and how you should never use .equals with objects

quaint mantle
#

and == with objects

ornate patio
#

uh what

quaint mantle
#

so you should know that an Enum is an object

ornate patio
quaint mantle
#

ok

#

odnt use .equals

#

use ==

ornate patio
#

i mean like

#

I’m kinda interested why tho

quaint mantle
#

only use .equals, .equalsIgnoresCase with strings

quaint mantle
ornate patio
#

my java book lied to me then

#

lemme see if it works

limpid veldt
#

is there a way to apply creeper shading to a player's vision without having to manipulate packets? I.e. gain the green tint that a player gets from spectating a creeper. The forum posts boiled down to either use packets (https://wiki.vg/Protocol#Camera) or spawn a creeper, set it with no ai and then make the player spectate that somehow.

There has to be a better way to do this

quaint mantle
quaint mantle
limpid veldt
#

its literally from right clicking a creeper when in gmsp, so it doesnt really need to be changed with a pack

#

I would rather avoid having to use a resource pack as it forces players to load it when they join or download it

quaint mantle
#

yeah, there's no good way then tbh

limpid veldt
#

rip

quaint mantle
#

packets

last ledge
#

lmao i am trying to get if mob's health drops below 50% of health defined in confg, how do i do it

if(wither.getHealth() > plugin.getConfig().getInt("Boss.Wither.Max-Health") * (50/100)){

ornate patio
quaint mantle
#

._.

quaint mantle
ornate patio
#

still doesnt detect deep_ocean as an ocean

fallow merlin
ornate patio
#

i mean

#

there are a million oceans

#

is there a clean way to detect any ocean

fallow merlin
#

no idea

#

if biome<? extends ocean> idk

ornate patio
#

hm

#

what if i convert the biome to string

fallow merlin
ornate patio
#

and see if it contains the string "OCEAN"

fallow merlin
#

couldn't you do that with the enum?

ornate patio
#

wdym

#

no?

#

i mean like this:

#
teleportLocation.getBlock().getBiome().toString().contains("OCEAN")
fallow merlin
#

i guess that works??

#

idk you'd have to check with someone who knows if it works

ornate patio
#

it does, but i just wanna know if theres a better way

quaint mantle
#

it is kinda same but meh just try that

#

or just

#

divide by 2

ornate patio
#

how do i set a timeout in java? (similar to setTimeout in javascript)

#

i also want to be able to cancel this timeout

drowsy helm
#

a timeout for what exactly?

ornate patio
#

for example

#

if i just want to run a command

#

and 10 seconds later it says "hello"

#

and also have it possible to cancel the delay if another command is typed

quaint mantle
#

then it isn't a timeout LOL.

ornate patio
#

it is in javascript

quaint mantle
#

it is just a:

#

?scheduling

undone axleBOT
ornate patio
#

k thanks

drowsy helm
#

could run a repeating scheduler that runs every second or so

quaint mantle
#

about the cancle

drowsy helm
#

then that checks if the other command was typed

quaint mantle
#

you can check if the player run another command

#

then just cancle the scheduler

#

cancel i always forgot...

drowsy helm
#

cancelling it would just not run the code after

#

unless you want to run the code again in that command but thats just unnecessarily doubling identical code

noble lantern
#

So i was here a few days ago, and someone reccomended me a new JSON Library, by chance would anyone know the name of it? It was supposed to be better than GSON

eternal night
#

Jackson I guess ?

noble lantern
#

Nevermind found it, was named Moshi i think

eternal night
#

Oh o.o

noble lantern
young knoll
#

Moshi

noble lantern
#

So i have no idea how things like this are done, but is there any examples or tutorials online where im able to make something like this:

// Where "Inv" is my custom inventory class
final Inv inv = new Inv("inventoryName")
  .onInventoryClick(clickEvent -> { // <- i want to replicate this
    // on inventory click, code goes here
   });

Basically what I want to do is to be able to make a lambda where onInventoryClick represents the Inventory click event, however i have no idea what this is called to look it up, and there's not really a lot of plugin API's that do this

Is anyone able to point me to any tutorials, or tell me what this type of lambda method is called? Really sorry if this sounds confusing but i saw someones Inventory library do this and i found it rather neat, i know how ide register the InventoryClickEvent and whatnot, but i have no idea how to create the actual method?

Not looking for a spoon feed either i just have no idea what this is called or how its achieved

#

The most i could think of was making a method that takes an argument of InventoryClickEvent but that didnt really achieve what i wanted

quaint mantle
#

functional interface or "single method interface"

noble lantern
#

Took a little break but got it working, thanks for telling me what that was called Borlea, little messy right now but ill get it fixed up

summer scroll
#

Is placing spawn egg will call BlockPlaceEvent?

eternal night
#

No you are not placing a block

summer scroll
#

What event will be called?

#

When you placing spawn egg

alpine urchin
#

interact event

#

interact item event

summer scroll
#

alright, thanks

winged hinge
#

Hello I am writing a permissions system with paperspigot 1.12.2, i override the hasPermission Method, i need this block that i can use the hasPermission() with player.hasPermission(). Because when i now use player.has... the player variable is null and its not working. The Problem is that CraftHumanEntity not exist in 1.12.2 i think and i dont know how to do that

noble lantern
#

Why not use Vault or LuckPerms permissions?

winged hinge
#

hmm okey yes i think i will use LuckPerms

noble lantern
#

IIRC if you access that Async you will get an error

#

I think im slowly falling in love with functional interfaces now jesus

#

My intellij color theme is doodoo tho i need a new one

#

Can you explain?

#

Either way i wouldnt cache that cause its called anytime a chunks loaded and IIRC the server automatically caches chunks until they go inactive and then theyre unloaded again

#

It really depends

Because when a chunk becomes unloaded it also unloads all the entities within the chunk

But if your planning on having 1 mil entities your really better off making a Stacking plugin that stacks mobs

plain helm
# noble lantern My intellij color theme is doodoo tho i need a new one

In this short episode, I show you how to apply plugins and my custom color scheme to IntelliJ IDEA to make it look really good, since you guys have asked so many times. I hope you like it, this can be applied to any or most of the Jetbrains IDE's like CLion, PyCharm, etc.

⭐ Kite is a free AI-powered coding assistant that will help you code fast...

▶ Play video
noble lantern
plain helm
#

What do you mean? Like for each team a custom tnt or like a tnt linked to a certain team

noble lantern
#

So i kinda make my background a repeating image of my friend, currently awaiting to see how he likes it

plain helm
#

Ain’t that gonna give you headache

noble lantern
#

100%

#

Cant even see my class names anymore

plain helm
#

Lol

noble lantern
#

Was gonna add a dragon ball z background but...

#

yeeeeeah

#

looks like total shit

plain helm
#

Lmao

#

You can use custom textures

fallow merlin
#

or just straight up custom names if you don't wanna use textures lol

#

because primedTNT is an entity

plain helm
#

That too

noble lantern
#

Does intellij backgrounds not support transprent images?

fallow merlin
#

what?

#

They get fed instructions and follow those instructions based on whats happening iirc

noble lantern
#

Im just trying to get intellij to respect transparency on images

#

Its kinda doing it but its still not right

fallow merlin
#

I think that transparency is completely the images fault

noble lantern
#

Idk because ive used about 7 different images now

quaint mantle
#

Maybe try mine?

noble lantern
#

Nah i want it dragon ball z and only a small icon in bottom left to give me some motifvation

quaint mantle
#

lel

noble lantern
#

Something big like that would distract me 100%

quaint mantle
#

then try the 1st one

#

the 1st one actually is the same size as discord recommended for avatar icon

#

it's maybe not that big?

noble lantern
#

meh still want it dragon ball z

quaint mantle
noble lantern
#

i got the transparency to work a little but it has the little white ridges on it

#

finally i got an image that kinda works

torn shuttle
#

Am I using this wrong? if (!playerLocation.getWorld().getGameRuleValue(GameRule.DO_MOB_SPAWNING)) continue;

fallow merlin
#

what does continue; do?

torn shuttle
#

foregoes adding a location later in the code

#

I've never checked gamerules before so I'm not sure if my use of that check is correct

#

oh I see

#

I've been lied to by a user

#

never mind

fallow merlin
#

what part was the error?

maiden mountain
#

So, i'm making use of the "onWorldSave' event but it turns out, it gets called multiple times when the server saves. Is there an event hook that gets executed just once?

young knoll
#

I assume it gets called once per world

maiden mountain
#

You're probably right

#

But is there an event that gets executed when the total save event has been finished?

#

Otherwise i'll have to dig deeper and find a solution myself

opal juniper
#

wel it will be called once for each world

#

so find the length of bukkit.getWorlds

#

and then if there are 3 worlds, on the third call it’s the last one

maiden mountain
#

Yeah i already though about that, thanks though

fallow merlin
#

is there a list of events

#

i wanna read em all

quasi flint
#

somewhere in the src

#

prob event package of spigot

young knoll
#

You can look at the event package in the javadocs

mild forum
#

hello, when making custom crafting recipes, is it possible to check if an ingredients has an enchant

fallow merlin
quaint mantle
fallow merlin
young knoll
#

ExactChoice probably accounts for enchantments

eternal night
#

Yea its great

#

Keeping objects and memory close enough to keep in cache speeds up a threads performance

#

But this is an implementation detail the JVM worries about

plucky crow
#

How do I create a command with a 10 second cooldown?

#

Can you post a sample code

stone sinew
golden turret
golden turret
#

🤔

#

thanks

paper viper
#

Merchant: "Represents a merchant. A merchant is a special type of inventory which can facilitate custom trades between items."

#

MerchantRecipe: "Represents a merchant's trade. Trades can take one or two ingredients, and provide one result. The ingredients' Itemstack amounts are respected in the trade. A trade has a limited number of uses, after which the trade can no longer be used, unless the player uses a different trade, which will cause its maximum uses to increase. A trade may or may not reward experience for being completed."

lean gull
chrome beacon
#

joinsFile

stone sinew
lean gull
chrome beacon
#

Look at the error

#

It tells you

lean gull
#

it says it's null

#

but the file is set at the top?

#

i don't really get it

chrome beacon
#

It's not set at the top

lean gull
#

honestly i don't really understand what's going on in this code, i am big nub

chrome beacon
#

I recommend learning Java first

lean gull
#

i have some knowledge of java

#

but this is how i prefer to learn

chrome beacon
#

Then you should know that the variable you're creating is null

lean gull
#

ohh it's just defining it

#

it only sets it laterrr

chrome beacon
#

You're IDE should also warn you

lean gull
#

ohhh

chrome beacon
#

Yeah

lean gull
#

so this?
joins = YamlConfiguration.loadConfiguration(joinsFile);

chrome beacon
#

Yep

lean gull
#

i put it after the ConfigManager method, and now joins has a red line below it and stuff

chrome beacon
#

Show new code

chrome beacon
#

That's not even valid Java

lean gull
#

all i did was move it and now the world is falling apart

lost matrix
#

Why is joins in your class scope?

lean gull
#

what's a scope

chrome beacon
#

Yeah you moved it outside a method

buoyant viper
chrome beacon
#

Any programming language if you don't know it ^

lean gull
round elbow
#

how can i store a class in a yaml file?
and how can i load and parse it from that yaml file aswell?

quaint mantle
#

Hey, I would like to know how I can do to put a player's connection on hold, the time to load / modify their inventory from the database (since we will be inter-server).
Pls ping me when reply.

lean bone
#

I'm trying to teleport armorstands with falling blocks as passengers, but nothing happens. When I remove the passenger it works. Is this some kind of weird mechanic? I can provide code if needed

quaint mantle
#

3 question at the same time

#

Great

lean gull
#

4 actually, i still need help

lost matrix
lost matrix
lean bone
quaint mantle
quaint mantle
#

Then teleport them and finally add the passengers

lean bone
# quaint mantle Just don’t add them

I use this system with putting them as passengers because for some reason when I teleport falling blocks every tick they only update after like a second

lost matrix
stone sinew
worldly ingot
#

?ban @naive arrow

undone axleBOT
#

Done. That felt good.

worldly ingot
#

Oops. finger slipped

opal juniper
last ledge
#
    public void onClose(InventoryCloseEvent event) {
        Inventory gui = plugin.getInventories().getGui();
        Player player = (Player) event.getPlayer();
        if (event.getInventory() == plugin.getInventories().getGui()){
            if (team.contains(player.getUniqueId())) {
                team.remove(player.getUniqueId());
                return;
            }
            player.openInventory(gui);
            //player.kickPlayer(ChatColor.translateAlternateColorCodes('&', "§7Du wurdest rausgeworfen\n §7Grund | §7Wähle ein Reich aus!"));
        }```

When i try to open my inventory again when it closes, it bugs the inventory and console spams this error:
https://paste.gg/p/anonymous/a829585b8bf94778810525966038c31f
round elbow
worldly ingot
#

el n word

round elbow
#

bruh

lean bone
#

It goes smoothly when using armorstands with the falling blocks as passengers, but for some reason when I try to lower their Y coordinate by 1 (so that it lines up) it just doesnt work, but it does when using no armorstands (but then its unsmooth)

sharp bough
#

try removing the player.openInventory(gui) , i think its opening the inv, erroring, closing, calling the event, opening the inv, etc

last ledge
# sharp bough are you trying to not allow player to close this inv?

no i fixed it, i used this code:

        Inventory gui = plugin.getInventories().getGui();
        Player player = (Player) event.getPlayer();
        if (event.getInventory() == plugin.getInventories().getGui()){
            if (team.contains(player.getUniqueId())) {
                team.remove(player.getUniqueId());
                return;
            }
            new BukkitRunnable() {
                @Override
                public void run () {
                    event.getPlayer().openInventory(gui);
                }
            }.runTaskLater(plugin, 1);```
terse mason
#

whats a plugin where you can exchage exp for vault coins

last ledge
terse mason
#

sure man

#

make a command /xpmoney that exchanges ur xp for vault coins if u can

sharp bough
last ledge
sharp bough
#

this with stop the inv from closing

last ledge
#

there is no event.setCancelled(True) in Close Inventory event

hexed stirrup
#

can anyone help me in #general please

sharp bough
heavy perch
#

Ik its stupid to ask since everyone use MongoDB rn, but I need a good MySQL API that could handle on low RAM usage.

#

Does this thing exists?

terse mason
golden turret
#

hello, im getting all recipes of the server

#

but i would like to "sort" them

terse mason
#

who knows (or can code) a plugin where you can exchage exp for vault coins?

golden turret
#

how could i do that?

quaint mantle
little trail
#
try {
    File myObj = new File("Tooty/uuid.txt");
    myObj.createNewFile();
    FileWriter myWriter = new FileWriter("Tooty/uuid.txt");
    myWriter.write(uuid.toString());
    myWriter.close();
    logger.info("Your uuid is in Tooty/uuid.txt");
} catch (IOException e) {
    logger.warning("An error occurred.");
    e.printStackTrace();
}```
 is this the best way to write to a file, i get the no file or directory `IOException` for it (plugin is called tooty)
quaint mantle
little trail
#

ahh ty

terse mason
#

who can code a plugin where you can exchage exp for vault coins?

#

??

undone axleBOT
little trail
#
try {
    File myObj = new File(dataFolder.toString() + "/uuid.txt");
    myObj.createNewFile();
    FileWriter myWriter =
            new FileWriter(dataFolder.toString() + "/uuid.txt");
    myWriter.write(uuid.toString());
    myWriter.close();
    logger.info("Your uuid is in Tooty/uuid.txt");
} catch (IOException e) {
    logger.warning("An error occurred.");
    e.printStackTrace();
}```
 where dataFolder is my getDataFolder()
#

still raises the ioexception

quaint mantle
#

How do i install NMS for spigot 1.16.5?

little trail
proven whale
#

Is there someone could tell me if I can add a recipe to workbench, furnace, anvil or a forging table

quaint mantle
proven whale
#

Thank you!👍

little trail
#
try {
    System.out.println(dataFolder.toString());
    File myObj = new File(dataFolder, "uuid.txt");
    myObj.createNewFile();
    FileWriter myWriter =
            new FileWriter(dataFolder.getPath() + "/" + "uuid.txt");
    myWriter.write(uuid.toString());
    myWriter.close();
    logger.info("Your uuid is in Tooty/uuid.txt");
} catch (IOException e) {
    logger.warning("An error occurred.");
    e.printStackTrace();
}```
 still get the IOException `No such file or directory`
hasty prawn
#

What did the sout print

#

Actually nvm, is the Tooty folder there?

quaint mantle
#

you May want file.mkdir?

gleaming grove
#

Is there any API for Integration/Unit tests in spigot? md_5

last ledge
#

ah how do i add BossBar for my mobs/entities?

terse mason
#

guys im making a plugin where you can exchage exp for vault coins

this is my code:

/expmoney do
give money```

it doesnt work idk whats wrong with it
last ledge
#

has anyone ever made it

terse mason
last ledge
hasty prawn
terse mason
#

why my code not work??

hasty prawn
#

Because that's not code

terse mason
#

it is

hasty prawn
#

No one is going to code it for you for free, you need to go to services as stated earlier.

#

?services

undone axleBOT
gleaming grove
#

@terse mason This guy is trolling

hasty prawn
#

One can only hope they're trolling...

terse mason
#
prefix: "/"
execute local: "xp"
if xp = 1 run 
"give @p vault:money 1"```
#

this gud?

last ledge
hasty prawn
last ledge
#

in bossbar

hasty prawn
last ledge
#

i am confused here

#

so many parameters

#

what do i put in Style

#

flags

#

etc

terse mason
#

its working fine! there's only 536 errors!

hasty prawn
#

It tells you the types on the Java Docs @last ledge, they're enums, not Strings

#

Player#getWorld

last ledge
little trail
#

alalala sorry what

last ledge
#

you are really awesome

little trail
#

;0

#

hm how do i check if the directory exists

hasty prawn
#

.exists

little trail
#

oh i did not see that part of the docs

#

ty

hasty prawn
#

Are they within the spawn protection limits?

last ledge
#

change spawn-protection in config to 0

#

ok

#

wait

#
    @EventHandler
    public void onBlockBreak(BlockBreakEvent event){
        Player player = (Player) event.getPlayer();
        if(player.getWorld().getName().equalsIgnoreCase("world")){
            event.setCancelled(true);
        }
    }```
#

enjoy

terse mason
#

ppl rlly want me to pay for a plugin that takes 2mins to code

#

:/

last ledge
#

no one is here, to work for free for you

stone sinew
terse mason
stone sinew
terse mason
#

👺

noble spire
#

Wait quick question,

If x is an integer < 1
If y is an integer >= 1

float z = ((float) x) / ((float) y);

Will z be a fraction? If so is there a better way of preventing integer division?

ivory sleet
#

Are you after the mere outcome or what? Anyways you can store it as another data type.

noble spire
#

?paste

undone axleBOT
last ledge
#

k

#

I am trying to make Bossbar to track my mob's health

#

but i am so confused

hasty prawn
last ledge
hasty prawn
#

Listen to EntityDamageEvent and set the progress with the entities health

last ledge
#

i have the Event already

#

just need to know how to add progress

#

in bossbar

nova sparrow
#

How do you check when a block is being broken using event BlockBreakEVent

last ledge
#

change the code, to your need

nova sparrow
#

ok

misty current
#

how can I add a tabCompleter to a command I registered with ((CraftServer) Bukkit.getServer()).getCommandMap().register();?

elfin talon
#

Hey i have an error:

        at de.haikobra.tyko.kdcounter.Tyko.listener.JoinListener.onJoin(JoinListener.java:18) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)```

code:
```java
 if (!plugin.getConfig().contains(p.getName())){
            plugin.getConfig().set(p.getName() + "." + "kills", 0);
            plugin.saveConfig();
        }```
opal juniper
quaint mantle
ivory sleet
misty current
#

hm?

maiden thicket
misty current
#

im pretty sure there's no other way unless you register it in plugin.yml

quaint mantle
ivory sleet
#

CommandMap::getCommand
then check instanceof and cast to PluginCommand
then set its executor

maiden thicket
quaint mantle
#

The command can also be registered without plugin.yml

maiden thicket
#

you dont need nms to access the commandmap

#

its Server#getCommandMap

last ledge
#

i am trying

ivory sleet
#

It isn’t exposed in spigot tho taahanis

last ledge
#

but not sure

#

how to

ivory sleet
#

So what he does is somewhat justified

quaint mantle
#

Why don't you choose the .java file format ;-;

maiden thicket
#

or am i thinking of paprr

ivory sleet
#

Apparently it breaks/is improper api in md5 and Chocos opinion

maiden thicket
#

paper

ivory sleet
#

yeah paper

ivory sleet
#

But I’d say bad api > no api

maiden thicket
#

ye

maiden thicket
#

or just extend the regular Command class iirc

misty current
#

im extending BukkitCommand in the class where i have the command

#

and implementing TabExecutor

maiden thicket
#

not BukkitCommand

misty current
#

oke

quaint mantle
quaint mantle
maiden thicket
#

i mean you can also use BukkitCommand and the method is tabComplete()

quaint mantle
#

Server#createBossBar()

maiden thicket
#

no need to implement TabExecutor if ur extending Command or BukkitCommand

misty current
#

yea just noticed

#

so i can just do super.tabComplete() can't I

maiden thicket
#

override the method

misty current
#

oke

ivory sleet
misty current
#

yea that was smol brain moment

#

yey works

#

tyy

ivory sleet
#

Pog

misty current
#

probably with all the time i've spent making a command api i would've already made all the commands i needed :p

plucky crow
#

Can I add cooldown to sword in 1.8.8 like version 1.9?

crimson terrace
rancid pine
#

How do you cancel events?