#help-development

1 messages · Page 2134 of 1

tender shard
#

and in blockbreak, check if the broken block is either inside your chunk's list/set or if it's a bed

#

if not, cancel blockbreakevent

crude loom
#

Is this feature availble in 1.8?

tender shard
#

of course not

golden turret
#

yo

blissful pumice
#

hey

subtle folio
#

Should I be using PDC instead of Names?

crude loom
#

I'm making the plugin in 1.8 because of the PVP, so that wouldn't be possible then

tender shard
#

basically nothing is available in 1.8 api

eternal night
#

generally data should be in the PDC, display name and lore are for visuals only

hybrid spoke
crude loom
#

Ah

hybrid spoke
#

just move on to 1.18.x

golden turret
#

would be cool to create a object implements ConfigurationSerializable, create a custom pdc, make the primitive be byte[] and use the BukkitObjectOutputStream to get the byte[]?

hybrid spoke
subtle folio
crude loom
#

Is there a way to integrate 1.8's PVP to 1.18?

hybrid spoke
#

there are many plugins doing that

eternal night
subtle folio
fossil lintel
supple elk
#

if we could turn back time

#

to the good old daaays

tender shard
supple elk
#

lol

#

I meant 1.8 pvp but sure :p

hybrid spoke
#

so windows 98

tender shard
#

yeah

#

MC 1.8 is old enough to conclude contracts in germany

harsh totem
#

I don't understand what it says Cannot resolve method 'registerEvent(getCoinsEvent, Economy)' when I try to register my event
the line with the problem is getServer().getPluginManager().registerEvent(new getCoinsEvent(),this);

eternal night
#

registerEvents

harsh totem
#

?

eternal night
#

your method name is wrong

harsh totem
#

what

river oracle
#

Bruhs

eternal night
#

bruh this isn't rocket sicence

river oracle
#

registerEvents

#

Vs

#

registerEvent

#

You are using the wrong one

harsh totem
#

it auto completed mt to without the s

#

tf

river oracle
#

Your dumb

#

Ahaha

harsh totem
#

😥

river oracle
#

Thats funny tho

supple elk
river oracle
#

*That's

#

*though

#

*.

#

*hahahaha

left swift
#

When I'm using lettuce redis pub sub should I use connection pool for that?

harsh totem
eternal night
#

yes

river oracle
#

Lettuce

#

When is carrot coming out frfr

quaint mantle
#

Does the configuration api deserialize the classes when calling YamlConfiguration#loadConfiguration, or only when calling the get(path, class) method

eternal oxide
#

So long as you correctly registered the class before saving/loading

quaint mantle
#

how does it know that part of the file IS your class

eternal oxide
#

because you correctly implemented ConfigurationSerializable

quaint mantle
#

I mean

#

does the yaml section name need to be the name of your class

eternal oxide
#

The first line of the object identifies it

#

no

golden turret
#

not the first line btw

eternal oxide
#

the whole object is serialized

golden turret
#

any line with ==:

quaint mantle
#

!?

golden turret
#
test:
  ==: custom-object
  a: b```
quaint mantle
#

ah

quaint mantle
#

I am talking about DEserializing

quaint mantle
golden turret
left swift
# eternal night https://github.com/lettuce-io/lettuce-core/wiki/Connection-Pooling

Ok, so one question, what is wrong here:

    private GenericObjectPool<StatefulRedisPubSubConnection<String, String>> pool = ConnectionPoolSupport
            .createGenericObjectPool(() -> redisClient.connectPubSub(), new GenericObjectPoolConfig<>());

    private void foo() {
        try (StatefulRedisPubSubConnection<String, String> pubSubConnection = pool.borrowObject()) {
            pubSubConnection.addListener(new ExperimentalListener());
            pubSubConnection.async().subscribe("experimental");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private void bar(String message) {
        try (StatefulRedisPubSubConnection<String, String> pubSubConnection = pool.borrowObject()) {
            pubSubConnection.async().publish("experimental", message);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }```I can install a listener and subscribe a channel, but I can't publish a message
quaint mantle
#

this is probably not gonna do it for me, because I want to only load them not save, and I don't want the user to have to type ==:

golden turret
#

it is just a ==:

#

not thisIsAFuckingCustomObjectFromABukkitClassBecauseTheDeveloperCreatedAClassThatImplementsConfigurationSerializableDidYouUnderstand: custom-object

eternal oxide
#

if you are not going to save them you are going to have to manually deserialize them then

#

literally read data from config and create yoru object via its constructor or a Builder

golden turret
#

ConfigurationSerializable good

#

manual deserialization bad

eternal oxide
#

yep

#

Seems like thats not what he wants though

golden turret
#

only because of a ==:

tall dragon
golden turret
#

🤡

left swift
tall dragon
#

did he give any actual arguments?, i have never had issues with this

harsh totem
#

how do I put a stack of a custom item inside a custom inventory?
because the setAmount is void so it'll change the amount of the item

#

I want it to not be changed

crisp steeple
#

what?

midnight shore
#

Create another ItemStack using yourItemstack.clone();

crisp steeple
#

oh

midnight shore
#

Then set the amount of the new one

midnight shore
#

And there you have

harsh totem
#

thank you

crisp steeple
#

in general you shouldn’t be using just one instance of an itemstack though

midnight shore
#

😄

sage merlin
#

does anyone know what this means

hybrid spoke
#

reload your maven on the top right

sage merlin
#

nothing happened

golden turret
#

i guess

#

it is jsut a warning

#

safe to ignore

hybrid spoke
#

that means that it didnt download the dependency yet. it should do it once reloaded

#

otherwise force install

golden turret
#

bruh

#

there is

#

3 things

safe notch
#

Click on the maven bar on the right

#

and click install

golden turret
#

there is a maven error

#

update available

hybrid spoke
#

or terminal -> mvn install -U -> enter

safe notch
#

ohh

golden turret
#

and one for plugin update

sage merlin
#

do i click it

#

alright

safe notch
#

Click on banclass

#

And lifecycle

sage merlin
#

ok

#

install right?

safe notch
#

And I think the install might work but not sure

sage merlin
#

install do i right click and run maven build

safe notch
#

Just double click

sage merlin
safe notch
#

What

#

I have no idea then

#

Probably something is broken where it gets Java path mostly

#

But Mac OS I have no idea

delicate lynx
#

paste your entire pom

sage merlin
delicate lynx
#

?paste

undone axleBOT
sage merlin
delicate lynx
#

is your project set to use java 17

#

that shouldn't be needed

#

his pom is saying to use 17, but his project is building with a different java version

#

go to File > Project Structure and double check what the SDK is set to

sage merlin
#

16.0.2

delicate lynx
#

that is why

#

do you want to use java 17 or 16

sage merlin
delicate lynx
#

then you will need to download java 17, add it to Intellij, then switch your project over to 17

#

because your project is trying to use java 16 to build, but you told maven you want to use 17, so there is the conflict

#

hence the "invalid target release"

sage merlin
delicate lynx
#

go to your pom, change <java.version>17</java.version> to 16 instead of 17

harsh totem
#

this is the code of this slot if (event.getSlot() == 9){ player.getInventory().addItem(event.getCurrentItem()); player.sendMessage(ChatColor.GREEN + "You got 64 coins"); event.setCancelled(true); }

golden turret
#

always click to refresh maven

delicate lynx
#

your pom loads fine for me

harsh totem
#

it is still happening if (event.getSlot() == 9){ ItemStack clone = event.getCurrentItem(); player.getInventory().addItem(event.getCurrentItem()); event.getClickedInventory().setItem(event.getSlot(), clone); player.sendMessage(ChatColor.GREEN + "You got 64 coins"); event.setCancelled(true);

#

?????

river oracle
sage merlin
river oracle
#

You just named an item stack clone

hard lake
#

md_5 is owner
spigot ?

delicate lynx
#

did you change anything else besides the java version?

harsh totem
#

so just put .clone() like this? ItemStack clone = event.getCurrentItem().clone();

hard lake
#

thank

river oracle
#

Yea tlarFoxYesNod

hard lake
#

What is md_5's real name?

delicate lynx
#

what is your real name?

delicate lynx
river oracle
#

Why do you care khang yl

#

Are you tryna dig up dirt or something lmao

harsh totem
# river oracle ^

yeah yeah i saw and it worked. idk why i didn't put the .clone() in the first place. my brain is dead after my math exam

#

thx

river oracle
#

Sha

delicate lynx
sage merlin
sage merlin
delicate lynx
#

it's under File

safe notch
#

mines 1.8

sacred basin
#

Hello,
In command, how to express multiple arguments?

example

/cmd [<value1>] [<value2>] [<value3>] [<value4>] ... more available

sage merlin
#

there are some tutorials out there that can explain better than people can in a chat

golden turret
#

you mean like

#

/globalchat aa aaa aa ?

sage merlin
sacred basin
sacred basin
safe notch
#

you use string builder

#
String command = "";
for (int a = 0; a < args.length; a++) {
    command += args[a] + " ";
}
harsh totem
#

how do I get an itemStack variable of a used material in an OnCraft event?

safe notch
#

indentation is messed up

vocal tundra
#

Any built in method to run code at the very beginning of a tick before anything is processed or happens? wanna know before I patch

sacred basin
safe notch
coarse finch
steel swan
#

hey so i have this class (my main class) and idk why but when i try creating an other class and extending it to the first class it doesnt work :
Error:
cannot acces HunterHunterUhc

sacred basin
# safe notch I dont understand what you mean

I want to know how to express variable arguments to english command like /cmd <a1> <a2> <a3> ...

This command can be used like these

/cmd hi
/cmd hi hello
/cmd hi hello by goodbye yes

sacred basin
#

This is used for plugin command

safe notch
#

or do you mean like String...

safe notch
steel swan
#

using this material

harsh totem
#

how do I get the used material

steel swan
#

event.getItem.getType()

#

or

harsh totem
#

Cannot resolve method 'getItem' in 'CraftItemEvent'

steel swan
#

u if it doesnt work, take the item in the crafting inv at the crating slot

safe notch
river oracle
#

Don't do that use dependency injection

#

?di

undone axleBOT
safe notch
#

ahh constructor

harsh totem
river oracle
#

Dependency injection is the best practice makes your project more portable and easier to trouble shoot di is also an industry standard for Java

sacred basin
#

I know linux express like this for variable arguments

But how to express the plus?

steel swan
river oracle
#

Do you know what extends does

#

Your abusing a great aspect of java

#

May I suggest learning some more java

river oracle
#

?learnjava

undone axleBOT
sage merlin
visual tide
#

is it better to keep your sqlite Connection object in a field and reuse it or create and auto-close a new one every time

odd wedge
#

Wassup

odd wedge
visual tide
#

realistically max 1 per 10 secs

harsh totem
#

please

crisp steeple
visual tide
#

close in ondisable then?

crisp steeple
#

yea

#

don’t think it’ll cause issues if you don’t but should still probably do it

visual tide
#

aight ty

hybrid spoke
#

why not just close it

#

doesnt do much

crisp steeple
#

oh wait

#

he said sqllite not mysql

#

in that case it doesn’t matter as much as i thought

#

don’t really see the harm though of keeping it in a field

hybrid spoke
#

if you get the connection out of a pool it doesnt matter anyways

#

it will even be more save to just close it

#

since it sents it back to the pool for reuse

crisp steeple
#

maybe

steel swan
#

hey, ive always been coding in 1.16.5, but rn for a project i have to use 1.8.8 (before u ask, i cannot change version.
So i ve always used :

BukkitScheduler scheduler = Bukkit.getScheduler();
            scheduler.runTaskTimer(this, task -> {
}, 20L, 20L);

but rn i need to use

Runnable run = new Runnable() {
                @Override
                public void run() {
                    if(getRole(player) != null){
                        
                    }
                }
            };
            getServer().getScheduler().scheduleSyncRepeatingTask(this, run , 20L, 20L);

is there a better way for 1.8.8?
if not, how can i stop the task like i did with : task.cancel();?

tardy delta
#

is 1.8.8 using java 8?

blissful pumice
#

ye

steel swan
#

ye think so

tardy delta
#

runTaskTimer is returning a bukkittask

crisp steeple
tardy delta
#

java 8 supports lambdas?

crisp steeple
#

yeah

tardy delta
#

so why not using a lambda??

crisp steeple
#

i mean

#

i typically find that just making a bukkit runnable is easier than using the scheduler

tardy delta
#

i dont think that

steel swan
crisp steeple
#

they’re pretty much the same really

steel swan
crisp steeple
#

yea

#

if you’re assigning it to a variable it can be a lambda

steel swan
#

and how could i cancel the Runnable?

crisp steeple
#

from outside of it?

steel swan
steel swan
tardy delta
#

why not just

Bukkit.getScheduler().runTaskTimer(this, task -> {}, 20, 20)```?
tardy delta
#

ah lol its the api which doesnt support it or what

steel swan
#

deosnt recorgnize runTaskTimer

tardy delta
#

i thought you were talking about language specs

crisp steeple
#

scheduler does work in 1.8 but i still just prefer bukkitrunnables

#

let me check something where i used it

steel swan
#

k

#

oh wait maybe just this.cancel();

#

inside of it

crisp steeple
#

yeah

steel swan
#
new BukkitRunnable(){

                @Override
                public void run() {
                    if (getRole(player) == null) {
                        this.cancel();
                    }
                }
            }.runTaskTimer(this,20L, 20L);
crisp steeple
#

or just cancel

#

doesn’t matter

steel swan
#

k

#

and just to be sure, amplifier of 0 in 1.8 for an effect means like level 1 right (Like Weakness 1 for instance)

crisp steeple
#

yea i think so

kindred valley
#

how could we prevent the default join message

tardy delta
#

PlayerJoinEvent#setJoinMessage -> null

#

do people even use google

steel swan
eternal needle
tardy delta
#

dont compare inventory names

#

use inventoryholders instead

#

and use ?di instead of that ugly singleton

eternal needle
tardy delta
#

ye

mighty bane
#

Hey so we're trying to program a temporary wall in front of the player however if the wall hits a chest(or any of the blocks that can have items in them), the items stored inside that chest are completely erased upon the resetting of the spell.

Is there a simple fix for this?

tardy delta
#

you mean that the wall blocks are replacing the chest and after some time the blocks come back?

coarse finch
mighty bane
tardy delta
#

ofc

eternal needle
tardy delta
#

you are just setting the block to be a chest, youre not restoring its contents

mighty bane
#

I tried using blockdata, but that didn't work.

tardy delta
#

uh just store the contents and set them back

mighty bane
#

Yeah, that is what we are trying to do.

eternal needle
tardy delta
#

?

crisp steeple
#

depends on what you’re using the wall for

ancient plank
mighty bane
#

The wall is meant to protect the player from anything ranging from an arrow to a fireball nuke.

tardy delta
#

or just have a runnable to restore all blocks after you used the spell

eternal needle
# tardy delta ?

don't need inventoryholders i need the face of all online player to show up so it's not yust stive heads

mighty bane
crisp steeple
#

well in this scenario they probably won’t be useful after all

mighty bane
tardy delta
ancient plank
#

idk, chests are still blocks and the odds of something going through the tiny gaps between a block and a chest are like 1 of 1000

#

random numbers

tardy delta
#

best thing is to make a gui class which has an inventory as field and implements the InventoryHolder interface, then check in the event if the holder is instanceof your holder

mighty bane
ancient plank
#

not replacing the chest just removes the pain of having to deal with edgecases like "what happens if the server crashes? what type of storage do we have to set up for saving the data of the replaced chest's contents?"

mighty bane
#

We might just use the not replacing method as a temp fix, and later on when we've learned more about spigot and java. We'll go through and implement a more advanced method.

eternal needle
tardy delta
#

what type

ancient plank
#

I mean all you gotta do to get the contents is to check if the block is an instance of chest, then get the inventory of the chest, then store the contents of said inventory in a list then do whatever with that when resetting the blocks

static hollow
steel swan
crisp steeple
#

instance checking for inventories is usually the best checks

static hollow
tardy delta
#
if (set.contains(p)) return;
set.add(p);```
is the same thing as
```java
if (set.add(p)) {}```
eternal needle
#

huh`?

tardy delta
#

i hope its a set atleast

#

also Set#remove returns a boolean

ancient plank
#

brother if you can't read that, then nobody can help you. it's so simple
(responding to blobsky)

tardy delta
#

so checking contains before removing is redundant

ancient plank
#

nobody's gonna spoonfeed you some code

static hollow
#

is it to me?

tardy delta
#

and store a set of uuids not of player objects

static hollow
#

it is for a moment

tardy delta
#

?

static hollow
#

Why should I use uuid when the player won't change in a few seconds anyway?

crude barn
#

anybody help me weith the crate reloaded plugin?

tardy delta
#

no need to store players

static hollow
#

okay

mighty bane
crude barn
#

i need help putting more crate keys as a prize for a crate in cr

static hollow
#

uh, and i don't have waitingPlayers.remove/add where i could remove contains

brittle lily
#

Where is my error? Its Doesnt Set Item Diamondsword on GUI

steel swan
crisp steeple
tardy delta
#

dont people know that Arrays.asList exists

#

o<o

crisp steeple
#

and probably causing your problem

brittle lily
tardy delta
#

in what other class?

crisp steeple
#

you don’t just want one instance of an inventory

#

everyone will be using the same inventory in that case

#

also it doesn’t even look like you’re ever calling the method to set the item

brittle lily
#

oh..

steel swan
#

about what i asked earlier, in general, how to get the repistory of an api

quaint mantle
#

I have made a command, and I would like to know

#

do I need to do player.getInventory.getIteminmainhand();

#

or getItem or getItemInHand

tardy delta
#

why people shouldnt watch yt tutorials smh

tender shard
quaint mantle
#

anyone?

tender shard
quaint mantle
#

:bruh:

tender shard
quaint mantle
tender shard
tardy delta
#

stupid cats

#

my arm bleeding

quaint mantle
#

im trying to give the item to the player

tender shard
sonic cosmos
quaint mantle
tender shard
#

into the first free slot

quaint mantle
#

ItemStack item = player.getInventory().addItem();

#

hm

tender shard
#

?

quaint mantle
#

what do I put in the ()

tender shard
#

?learnjava

undone axleBOT
quaint mantle
#

in da addItem

#

pls

#

tell meh

tender shard
#

you must learn basic java, otherwise noone here can help you

quaint mantle
#

simple words please

tardy delta
#

lmao

#

learn java

#

is that simple

midnight glen
#

I need help optimizing this code, since right now it teleports me like 50 times and crashes the server.

public void onPlayerTeleportEvent(PlayerTeleportEvent event){
        Player player = event.getPlayer();
        World fromWorld = event.getFrom().getWorld();
        World toWorld = event.getTo().getWorld();

        if(!(fromWorld == toWorld)) {
            if(!(config.getLocation(player.getUniqueId()+"."+toWorld.getName()) == null)) {
                player.teleport(Objects.requireNonNull(config.getLocation(player.getUniqueId() + "." + toWorld.getName())));
            }

            config.addDefault(player.getUniqueId()+"."+fromWorld.getName(),event.getFrom());
            config.options().copyDefaults(true);
            saveConfig();
        }
    }
tender shard
#

so it keeps teleporting you

tardy delta
#

i hope you know what Objects.requireNonNull does

tender shard
#

it's like this:

  1. TeleportEvent ->
  2. Your code runs ->
  3. You teleport someone ->
  4. Teleport Event ->
  5. ...
quaint mantle
#

ae

midnight glen
#

How do I teleport only once? I made a check that if the world is different

midnight glen
ancient plank
tender shard
crisp steeple
#

and it just ends up breaking their plugin

midnight glen
crisp steeple
#

just add a null check instead

midnight glen
#

there is a null check

#

bruh im dumb

tender shard
#
private boolean ignoreTeleportEvent = false;
    
    @EventHandler
    public void onTeleport(PlayerTeleportEvent event) {
        if(ignoreTeleportEvent) return;
        // ...
        ignoreTeleportEvent = true;
        event.getPlayer().teleport(...);
        ignoreTeleportEvent = false;
        // ...
    }
quaint mantle
#

Incompatible types. Found: 'java.util.HashMap<java.lang.Integer,org.bukkit.inventory.ItemStack>', required: 'org.bukkit.inventory.ItemStack'

#

O

#

ok

tender shard
#

tip: enter ?learnjava, then read the bot's reply and click on one of those links

steel swan
#

guys i folowed what was on that website to add an API (and i also downloaded the Library) https://github.com/ConnorLinfoot/ActionBarAPI/wiki/Maven
here is what is in my pom.xml

<repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://shmezi.github.com</url>
        </repository>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>

    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.github.shmezi</groupId>
            <artifactId>ActionBarAPI</artifactId>
            <version>1.5.4</version>
        </dependency>

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <!--Bukkit API-->
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

But i get an error :
Could not find artifact com.github.shmezi:ActionBarAPI:pom:1.5.4 in jitpack.io (https://shmezi.github.com)

GitHub

Contribute to ConnorLinfoot/ActionBarAPI development by creating an account on GitHub.

burnt current
#

Hey short Question: i tried to make a command which places a chest with persistent data at the location from the Player.
I also made a Listener to check if a chest which is opened by the player has the persistent data:
https://www.toptal.com/developers/hastebin/jijosagehe.csharp

If yes the Chest opening event should be cancelled and an other inventory should open.
But it doesnt work and the console dont give an error.
Does somebody know what i did wrong?

crisp steeple
#

which part of it doesn’t work?

#

the command, event, or pdc

tardy delta
#

i dont think you have to update the state

#

i didnt iirc

burnt current
tender shard
tardy delta
#

wait why are you opening an inv in the interact event

burnt current
#

i want to cancel the chest opening and open an other inv instead

steel swan
burnt current
delicate lynx
steel swan
delicate lynx
#

if you used it, the url would be correct

#
<repository>
    <id>jitpack.io</id>
    <url>https://shmezi.github.com</url>
</repository>
#

use this URL <url>https://jitpack.io</url>

tender shard
#

jitpack is known to cause problems all the time

#

simply try to do mvn clean package -U

prime kraken
#

Hello ! I'm trying to do with my economy plugin a Bank System, I'm searching for how to get the number of a specific item in the player inventory, then save it and then remove from the inventory of the player ! How is that possible ? thanks for reading have a good day !

tender shard
prime kraken
steel swan
#
<repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <!--Bukkit API-->
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.github.shmezi</groupId>
            <artifactId>ActionBarAPI</artifactId>
            <version>1.5.4</version>
        </dependency>
    </dependencies>
delicate lynx
#

the version is not right

#

you have to use one from the list I linked

tender shard
#

I don't know why people keep using jitpack, it always causes problems lol

delicate lynx
#

me either

#

at this point just add it locally

steel swan
#

where can i download an other version

tender shard
tender shard
tender shard
#

clone the whole repository

#

then open it in your IDE and do "mvn install"

mighty pier
#

if (KitData.get().get(kitname) == null) { how do i make it so it doesnt check for caps?

steel swan
#

oh i see

tender shard
#

now you can use it

tender shard
#

we don't even know what KitData.get() returns, so noone can answer it

steel swan
tender shard
quaint mantle
#
new BukkitRunnable() {
            @Override
            public void run() {
                for (Player player : Bukkit.getOnlinePlayers()) {

                    ItemStack item = new ItemStack(Material.WOODEN_PICKAXE);
                    player.getInventory().addItem(new ItemStack(Material.WOODEN_PICKAXE));
#

@tender shard does this work?

tender shard
crisp steeple
quaint mantle
#

cause

#

it wont let me

crisp steeple
#

what?

quaint mantle
#

do it without that

#

or im forgeting something

#

dont u dare send dis command

tender shard
quaint mantle
#

?learnjava

undone axleBOT
crisp steeple
#

seems like you’re forgetting something

quaint mantle
#

hm

#

hint?

crisp steeple
#

i have no clue what your problem is in first place

#

you are making a itemstack variable for no apparent reason

quaint mantle
#

I want to add an item via a command, and I was told that I have do to this

steel swan
quaint mantle
#

.addItem

tender shard
quaint mantle
#

bro

crisp steeple
#

@quaint mantle you should really look at some of the links in ?learnjava

quaint mantle
#

there are like 50 links

crisp steeple
#

there are 5 actually

quaint mantle
#

idk

steel swan
delicate lynx
#

did you even follow any directions you were told

burnt current
steel swan
#

it is in my intelJ

tender shard
tender shard
snow compass
#

Hm it not allow me to post everything here, because of language (you should fix the bot).

tender shard
snow compass
#

I not use bad words even

tender shard
#

anyway, using a title to identify inventories is a very bad idea

#

simply keep track of the open inventories in a collection or map

snow compass
#

Is something some not work if you not make your own inventory holder. For example when player close inventory I need to know location (and the InventoryCloseEvent for example only will return player loc (if you use custom inventory))

crisp steeple
#

location of what?

snow compass
#

In this case a custom container player clicked on and open custom inventory (I solve it with set temporary metadata on player). But also to know if it right inventory player click on and is not normal chest or other custom inventory from other plugin.

crisp steeple
#

a custom inventory doesn’t just have a location

#

idk what you mean by that

snow compass
#

no but if you make your own inventory holder can you fix that

#

but some say you should not use that

kind hatch
#

You could use Inventory#getLocation() if the player is using something that returns an inventory. (Chest, Dropper, etc) Then compare if that location is your custom block.

tardy delta
#

would it make sense to do permissions like these?

crisp steeple
#

so it won’t have a location

snow compass
#

only if you implement inventoryholder and fix it self. but some say you should not use that.

#

like this post

kind hatch
#

You really shouldn’t be using it though.

crisp steeple
#

I usually find the best way of making custom inventories is to make an abstract class with methods for clicking, opening, closing, etc that extends CraftInventoryCustom

kind hatch
#

What’s the logic here? A player clicks a custom block/container and it opens a custom inventory?

#

The custom inventory just being Bukkit#createInventory()?

tardy delta
#

lol are my permissions making sense?

snow compass
kind hatch
#

But will it be tied to a block in the world? Meaning if the player broke the custom container, all of the items would drop? Or?

snow compass
kind hatch
snow compass
tardy delta
crisp steeple
#

why are you tying it to a block in the world if it’s not directly related to that block?

#

i’m so confused

kind hatch
#

Is this similar to shulker boxes?

crisp steeple
#

it seems like you’re using block locations and player metadata as a weird hack for checking the type of inventories

snow compass
grim ice
kind hatch
strong vigil
#

I added spigot to the project but for some reason it doesn't work

crisp steeple
#

it’s playerinteractevent

grim ice
#

oh

#

ok

crisp steeple
#

name is kind of confusing i guess

grim ice
hasty prawn
#

It depends on the inventory event does it not?

kind hatch
#

You can open another inventory in the inventory click event.

hasty prawn
#

Yes

#

But not open or close iirc

#

Maybe close idk, def not open

kind hatch
#

Correct

#

We were talking about the click event though right?

snow compass
slow thunder
#

You can if you close the inventory and then open another one I believe

coarse finch
#

ok so i have got unregistering commands working, but i would like to know how i can register this command again? (if player reloads config)

hasty prawn
snow compass
hasty prawn
#

Yeah, I'm not the one who asked the question though lol

eternal oxide
#

Don't open inventories IN the click event

#

delay it

crisp steeple
snow compass
crisp steeple
#

they aren’t just there as a way of checking the inventory

kind hatch
#

Delays aren’t even necessary in some cases though

crisp steeple
crisp steeple
eternal oxide
#

read the javadocs for the click event

#

it tells you

kind hatch
#

?jd

crisp steeple
#

ik that the click hasn’t actually happened

#

but i haven’t had any problems just opening inventories on click events

#

and delaying inventory opens can occasionally cause issues

kind hatch
#

That’s odd.

eternal oxide
#

I'm just telling you what Spigot says in its Javadoc.

#

It says it for a reason

kind hatch
#

I have opened inventories without delays and just updated the players inventory right after and haven’t ever had an issue.

snow compass
snow compass
snow compass
kind hatch
#

@eternal oxide could this be one of those javadoc comments that are actually meant for older versions and never got removed? I haven’t had issues with just opening one right after the other.

subtle folio
#

Close the inventory gui before you open a second one.

crisp steeple
kind hatch
#

Also if you close and then open an inventory, your mouse gets reset to the center of the screen.

subtle folio
eternal oxide
kind hatch
eternal oxide
snow compass
crisp steeple
eternal oxide
manic delta
#

Hi, I've been testing the EntityDamageByEntityEvent event for a while and I want to know if the player shot (damaged) the sheep with a bow

#

This is what i have for now

snow compass
manic delta
# grim ice yes thats how

I have a problem now, I want to kill the sheep directly or make it disappear without leaving drops

kind hatch
manic delta
#

I'm doing an event for a youtuber and I need that

manic delta
#

o

kind hatch
#

Or clear the drops

manic delta
#

let me try

manic delta
kind hatch
#

If you still want the death animation.

manic delta
#

nah i don't need it

manic delta
crisp steeple
#

yea

manic delta
#

Okay tysm

subtle folio
#

you check if the entity is a sheep right?

crisp steeple
#

won’t show the death animation though like shadow said

manic delta
#

ofc

snow compass
manic delta
#

I'll playsound the player to indicate that

#

Oh

#

lol

#

yes sure

#

i almost forgot it

#

tysm

#

like this then

kind hatch
manic delta
#

o

#

that works too

#
@EventHandler
    public void onDamage(EntityDamageByEntityEvent event){

        double damage = event.getDamage();

        if (!(event.getDamager() instanceof Arrow)) {
            return;
        }

        Arrow arrow = (Arrow) event.getDamager();

        if (!(arrow.getShooter() instanceof Player)) {
            return;
        }
        Player shooter = (Player) arrow.getShooter();

            if(event.getEntity().getType().equals(EntityType.SHEEP)){
                Sheep sheep = (Sheep) event.getEntity();
                EntityDamageEvent.DamageCause cause = sheep.getLastDamageCause().getCause();
                if(cause.equals(EntityDamageEvent.DamageCause.PROJECTILE)){
                    sheep.setInvulnerable(true);
                    sheep.remove();
                    shooter.playSound(shooter.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 10, 1);
                }
            }
    }
#

I got this

crisp steeple
#

looks solid

#

oh yeah

#

just check instanceof

manic delta
#
if(!(event.getEntity() instanceof Sheep)){
                return;
            }
#

yes i was doing that

#

sure

vestal dome
#

Guys do Streams in Java preserve order?

crimson terrace
#

no

#

unless you use the one that does

manic delta
#
@EventHandler
    public void onDamage(EntityDamageByEntityEvent event){

        double damage = event.getDamage();

        if (!(event.getDamager() instanceof Arrow)) {
            return;
        }

        Arrow arrow = (Arrow) event.getDamager();

        if (!(arrow.getShooter() instanceof Player)) {
            return;
        }

        Player shooter = (Player) arrow.getShooter();

        if(!(event.getEntity() instanceof Sheep)){
            return;
        }
        Sheep sheep = (Sheep) event.getEntity();
        
        sheep.setInvulnerable(true);
        sheep.remove();
        shooter.playSound(shooter.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 10, 1);
    }
#

done i think

snow compass
# kind hatch Well, there are workarounds. You cloud store the player and the inventory in and...

first one I only need player and location in the cache I think (can then get player on close event and see if it exist in the map). I not really need the inventory (I get that from location (is how my custom system work, location is key do access all data to inventorys)).

second one can you be unlucky and player not look on right block when close inventory (I think you can look on wrong block when open a inventory in some cases (yea you can if you get moved)).

last one sadly not work on custom inventory's if I not use inventory holder.

vestal dome
manic delta
#

why

crimson terrace
crisp steeple
#

i mean

#

if it’s like a mini game or something it would make sense to only play it to the shooter

manic delta
#

yes

#

it's one

crisp steeple
#

to indicate they hit it

manic delta
#

his followers will enter and shoot sheeps

#

It would be a chaos that play the sound for everyone

crimson terrace
manic delta
#

I'll make a message in the chat too i think

#

i made a team system then i can message all the team at the same time

#

like &a+1 or something like that

vestal dome
#

define them final.

#

🙂

manic delta
#

yes im just starting it

vestal dome
#

there's no point in not doing so.

vestal dome
#

it's for reflection mostly

#

because of my mappings and stuff, and I use the Index of a method for example, to decide which one I want to execute, which is a better way of doing it then specifying for example, methods with names such as a, b, c, d, e, f

crimson terrace
#

streams do have a sorted() method so you could use that

manic delta
#

I just can "disable pvp" from EntityDamageByEntityEvent right?

crimson terrace
vestal dome
#

I mean the order of the ArrayList

crimson terrace
#

could make your own Comparator maybe? not too sure what would be the best way to do it

vestal dome
#

no I can't

#

because there's no way to compare the methods

#

at that point I might as well just search for a method with name x, and parameters y, which defies the point of even using indexes

last ledge
#

System.out.print("Hello World");

crimson terrace
#

you could just not use streams

#

use foreach

#

that preserves order

glossy venture
#

i recommend using Arrays.asList(arr) instead of Arrays.stream(arr).collect(toList())

manic delta
#

I just can "disable pvp" from EntityDamageByEntityEvent right?

vestal dome
glossy venture
#

or do everything stream related in one go:

List<Method> methods = Arrays.stream(cls.getDeclaredMethods())
  .filter(method -> (method.getReturnType().equals(returnType) || method.getReturnType().getSimpleName().equalsIgnoreCase("void") && returnType == null) && Arrays.equals(method.getParameterTypes(), parameters))
  .collect(Collectors.toCollection(ArrayList::new));
vestal dome
#

eh Ig thank you.

glossy venture
vestal dome
#

well I don't think I want to use streams if they literally ruin the point of using indexes.

#

and do not keep the order of array lists.

grim ice
#

dont do Arrays.asList

#

add and remove are unsupported operations with it

vestal dome
grim ice
#

since it returns an Arrays.ArrayList, not an arraylist

glossy venture
#

theyre not modifying it

#

afterwards

#

so its possible

glossy venture
vague swallow
#

Hey guys, can someone please tell me how to change the attack damage of an ItemStack? With the ItemMeta?

coarse finch
#

might be a stupid question, but what does String... aliases do in a methods arguments?

glossy venture
#

its a varargs

#

it collect an array from "different" arguments

#

making it cleaner

vague swallow
glossy venture
#

uh

#

lemme see

coarse finch
glossy venture
#

yes

#

exactly

coarse finch
#

ok

delicate lynx
tardy delta
#
void someMethod(String... args);

someMethod("test");
someMethod();
someMethod(new String[]{"test", "hello"});
// all of these are valid```
glossy venture
# vague swallow I know but how?
itemMeta.addAttribute(Attribute.GENERIC_ATTACK_DAMAGE,
  new AttributeModifier("<name>", /* strength */ 1, 
    AttributeModifier.Operation.ADD_NUMBER /* operation */
  )
vague swallow
#

wow ty

delicate lynx
#

you might want Operation.ADD_NUMBER

glossy venture
#

oh yeah

#

might be more suited

#

forthis purpose

vague swallow
#

how much f is a half heart?

#

1f right?

kindred valley
#

how can i prevent a command to execute

#

like skinsretorer

glossy venture
#

i think so

vague swallow
#

ty!

kindred valley
glossy venture
#

also @vague swallow u might want to use Operation.ADD_NUMBER

kindred valley
#

with groupmanager

vague swallow
glossy venture
#

the operation specifies how the provided strength/amount influences the source number to get the result
so its kind of in the name
MULTIPLY_SCALAR_1 adds 1 to the strength and multiplies it by the original value
ADD_NUMBER just adds the strength to the original value

vague swallow
#

ty

#

you helped me alot

#

@glossy venture

glossy venture
#

np

#

glad i can help

steel swan
#

hey, so i have this very simple code :

@EventHandler
    public void onPlayerClick(PlayerInteractEvent event) {
        Player player = event.getPlayer();

        Bukkit.broadcastMessage("click");

    }

that i made just to test things, but when a player clicks on the right, right clicks or anything, i dont get any message in chat. any idea why?

tardy delta
#

register it

crisp steeple
#

did you register the listener

vague swallow
#

in your main class

tardy delta
#

competition be like

glossy venture
#

yeah did u register it

#

or did u use wrong @EventHandler annotation or smth

tardy delta
#

java.awt kekw

steel swan
#

wait what lmao where did my onEnable go

#

like it just disapeared

crisp steeple
#

how strange

tardy delta
#

it was scared of u and fucking died

#

1-0

coarse finch
#

i can unregister a command in the start of the server, but not during runtime? and i also cant register a command at runtime.

vague swallow
steel swan
#

BRO LMAO I USED A LOT of other events and they worked but rn my onEnable just disapeared

steel swan
coarse finch
vague swallow
steel swan
#

frick i had code in my onenable

coarse finch
#

dont need an on enable

coarse finch
vague swallow
#

I mean yes but the plugin couldn'T do anything

tardy delta
#

you can register a command at runtime with reflections and the commandmap

coarse finch
#

let me try if i can register in start

tardy delta
#

ur tryin what?

crisp steeple
coarse finch
#

ok yeah i can register and unregister in the on enable but not anywhere else?

#

think u gotta update the entire thing

tardy delta
#

cuz onEnable is the only thing thats called at startup

#

i guess if your command is present in the plugin.yml in the jar, you can still register it at runtime

#

PluginCommand#setExecutor

coarse finch
#

yes but i have in my reload command, if the config says enable this command enable it. otherwise disable it

tardy delta
#

read the config and depending on if its true or false, register the command

coarse finch
#

yeah

#

except it does neither

#

and the config path is correct

tardy delta
#

show code

coarse finch
orchid pollen
#

hey im not very smart can i get some help please

tardy delta
#

?ask

undone axleBOT
#

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

coarse finch
tardy delta
coarse finch
#

no

tardy delta
#

why asking it to the pluginmanager then

coarse finch
#

gtg to next period be back in a bit

tardy delta
#

just grab your plugin's instance

orchid pollen
#

so im just starting making plugins but for some reason whatever im doing isnt working. Im making a 1.18.2 plugin and imported everything, but i cant import org.bukket.plugin etc. Its saying 'The package org.bukket is not accessible'. I have imported the module though.

#

shhhhh

tardy delta
#

?bootstrap is maybe something

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

coarse finch
#

if it aint broke dont fix i

tardy delta
#

?di

undone axleBOT
tardy delta
#

use that instead of that crappy shit

coarse finch
#

oh i already have that

#

Gosh dang can't get a break around here

#

They are searching our classroom with a drug dog

orchid pollen
#

Hey. So i swapped to 1.18.1 and added the jar file but its still not importing?

coarse finch
#

@tardy delta soooooo this happened

#

when i enable it

#

i assume i need to set an executor

tardy delta
#

uhm yes?

steel swan
#

hey little question, i have a text that is written with like "&6text" but when i try to for instance player.sendmessage it, it doesnt work. How do i do it? (ps : i need it this way, cuz normally i use ChatColor but this time text is already prepared)

coarse finch
#

but also how would i set the executor

crimson terrace
steel swan
crimson terrace
#

no sorry

coarse finch
steel swan
#

i usually use ChatColor but i am making a plugin for a server and they already have text prepared

tardy delta
#

bruh

steel swan
#

thx

crimson scarab
#

how do i get 5 blocks in front of the player

#

as a location

coarse finch
#

@tardy delta do i set the executor before or after registering, or does it matter?

tardy delta
#

wdym registering?

crimson terrace
coarse finch
tardy delta
#

after

#

cuz JavaPlugin#getCommand consults that map and youll get a npe otherwise

coarse finch
#

ok

crimson scarab
#

is it possible to apply velocity while still having gravity disabled

tardy delta
#

floating thro space uwu uwu

coarse finch
burnt current
#

Hey short Question: i tried to make a command which places a chest with persistent data at the location from the Player:
https://www.toptal.com/developers/hastebin/hoyarucabe.php
I also made a Listener to check if a chest which is opened by the player has the persistent data:
https://www.toptal.com/developers/hastebin/aqaxixafec.csharp
If the clicked Chest has unique persistent Data it should cancel to open the chest and open an other inventory instead
i added a message which will send to me when i use the command. But if i use the command the chest is set but i dont get the message from the server. Also if i click on the chest it opens normally and not the inventory i created though i cancelled the event to open the chest normally.
Probably something with setting the persistent data in the command went wrong.
Can maybe somebody help me with that?

coarse finch
tardy delta
#

no need to update the state btw

coarse finch
#

?

harsh totem
#

when I use event.getInventory() in OnCraftEvent do I get the 9x9 inventory of the crafting recipe?

midnight shore
#

How can I create a pastebin link with a specified text from my minecraft plugin? I want to give player a sort of item sharing by using some commands that will be listed there in the pastebin

coarse finch
# tardy delta idk

it has something to do with the set executor, it unregistered fine before

tardy delta
#

using the pastebin api prolly

rocky bolt
#

guys what java version require 1.8.9 spigot?

tardy delta
#

java 8 i guess

#

?goohle

steel swan
#

can i modify the name of the name of the item in the hand of a player directly like that :

player.getItemInHand().getItemMeta().setDisplayName(ChatColor.GOLD + "Paume de Zéro");
#

?

#

or do i need to give it again

tardy delta
#

give it again

steel swan
#

k

#

and is it possible to putit in the slot of the main hand?

tardy delta
#

ye

steel swan
#

how

tardy delta
#

Inventory#setItem(int, ItemStack)?

steel swan
#

k

tardy delta
#

get the main hand slot first i guess

steel swan
#

okey lemme try

crimson scarab
#

is there a way to disable entity ai while keeping gravity

steel swan
tardy delta
#

idk lol check the docs

#

and google it

steel swan
#

Ok lemme check

tardy delta
#

PlayerInv#getHeldItemSlot iirc

steel swan
#

...yeah i m stupid lmao didnt see it

tardy delta
#

just 2 sec google

mortal hare
#

i especially like the stackable "big chest" container

kindred valley
#

?paste

undone axleBOT
rocky bolt
#

anyone have java 8 download link?

snow compass
# mortal hare that's a really cool idea ngl

yeah and is working with hoppers to (both take and pull in items). You can limit amount you can have in the container (if you left it to unlimited you can store billions of items (only your jdk (java) implementation and ram can stop you)).

subtle pewter
#

how do I use input stream and put it into a file?

glossy venture
#

you open an output stream to a file, transfer the bytes using inputStream.transferTo(outputStream) and then close both of them

subtle pewter
#

i think i got another way

tender shard
rocky bolt
tender shard
snow compass
#

do not java 11 also work to start 1.8.8?

subtle pewter
#
        Reader targetReader = new InputStreamReader(in);
        FileConfiguration fc = YamlConfiguration.loadConfiguration(targetReader);```
rocky bolt
tender shard
tender shard
glossy venture
subtle pewter
#

either

snow compass
coarse finch
kindred valley
#

hey i have a question

tardy delta
#

i have one too

kindred valley
#

ask me

tardy delta
#

smh

#

?ask

undone axleBOT
#

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

kindred valley
#

but i dont think its the right place

harsh totem
#

I'm comparing an array of 9 ItemStack variables like this and it returns false when it should be true.

        for (int i = 0; i < items.length; i++){
            if (items[i].isSimilar(Coins.one) && items[i].isSimilar(Coins.ten) && items[i].isSimilar(Coins.hundred) && items[i].isSimilar(Coins.twoHundred) && items[i].isSimilar(Coins.fiveHundred) && items[i].isSimilar(Coins.thousand) && items[i].isSimilar(Coins.twoThousand) && items[i].isSimilar(Coins.fiveThousand) && items[i].isSimilar(Coins.tenThousand)){
                return true;
            }
        }
        return false;
    }```
```    public boolean isSimilar(ItemStack first,ItemStack second){

        boolean similar = false;

        if(first == null || second == null){
            return similar;
        }

        boolean sameTypeId = (first.getType() == second.getType());
        boolean sameDurability = (first.getDurability() == second.getDurability());
        boolean sameAmount = (first.getAmount() == second.getAmount());
        boolean sameHasItemMeta = (first.hasItemMeta() == second.hasItemMeta());
        boolean sameEnchantments = (first.getEnchantments().equals(second.getEnchantments()));
        boolean sameItemMeta = true;

        if(sameHasItemMeta) {
            sameItemMeta = Bukkit.getItemFactory().equals(first.getItemMeta(), second.getItemMeta());
        }

        if(sameTypeId && sameDurability && sameAmount && sameHasItemMeta && sameEnchantments && sameItemMeta){
            similar = true;
        }

        return similar;

    }```
tardy delta
#

lmao

harsh totem
#

I compared an array of ItemStack whick are all Coin.one

#

and it returned false

crisp steeple
#

how is it going to be equal to all of the ones then

harsh totem
#

oh wait

#

it should be ||

#

bruh im dumb

#

im sorry

steel swan
#

hey i am making a plugin and want to check if the player doesnt have an armor.
I did this :

if(getRole(player) == Role.Geru){
                        if (player.getInventory().getHelmet().getType() == null && player.getInventory().getLeggings().getType() == null && player.getInventory().getBoots().getType() == null && player.getInventory().getHelmet().getType() == null){
                            player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 20000000, 0));
                        }
                    }

But it doesnt work (it checks it every second if u want to know)

crisp steeple
#

that’s just gonna throw a ton of npes

crisp steeple
#

check if the item is null

#

not the type

steel swan
#

== null?

crisp steeple
#

yes

harsh totem
tardy delta
#

loop the armorcontents

fervent gate
#
if (container.get(type, PersistentDataType.STRING).equalsIgnoreCase("common_cow")) {
  SpawnCommonCow scc = new SpawnCommonCow(this.plugin);
  scc.spawnPet(player, 2);
} else if (container.get(type, PersistentDataType.STRING).equalsIgnoreCase("common_cat")) {
  SpawnCommonCat scc = new SpawnCommonCat(this.plugin);
  scc.spawnPet(player, 2);
} else if (container.get(type, PersistentDataType.STRING).equalsIgnoreCase("common_dog")) {
  SpawnCommonDog scd = new SpawnCommonDog(this.plugin);
  scd.spawnPet(player, 2);
}

My code is filled with these, is there a way to better put this? I need to implement more of this.

tardy delta
#

generic eenums in java when

#

🥺

#

im doin too much rust

ionic hound
#

how can i check when it becomes day?

crisp steeple
#

stream all pet values, check if the string is equal to one of the name values

fervent gate
#

I'd have to look up how that works

grim ice
#

do you need event.isAsync() for player async chat event???????

#

to know if its async

mortal hare
#
public interface HandleableUIContainerView<T extends UIContainer<? extends UIContainerView<T>>> extends HandleableUIView<T>, UIContainerView<T> {
}

now this is what i call generic lol

tardy delta
#

thats a lot of extends

mortal hare
#

but it works

ionic hound
mortal hare
#

that's legal

mortal hare
ionic hound
mortal hare
#

its in ticks

hasty prawn
mortal hare
#

20 ticks = 1 sec.

ionic hound
#

alright

mortal hare
#

im not sure if its in ticks though

#

it returns long

kindred valley
#

im setting group managers default permission but players still can execute the commands i didnt put

mortal hare
#

its basically the same value you use in /time set vanilla command

#

24000 is the highest

#

24 hour * 1000 = 24000

#

why does it return long though if the maximum value of the time in minecraft is 24000

harsh totem
#

When I use an inventory of an anvil slot[2] should be the right slot of the anvil, right?

hasty prawn
#

because yes

harsh totem
#

ok

hasty prawn
#

Should be the result slot

harsh totem
#

yeah

orchid pollen
#

hey

#

Im having a problem with my plugin and am not sure why...

#

[19:46:04] [Server thread/ERROR]: Error occurred while enabling Testing v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.doctorleaf.testing.Testing.getCommand(String)" is null
at com.doctorleaf.testing.commands.helloCommand.<init>(helloCommand.java:15) ~[?:?]

hasty prawn
#

?paste the hellcommand class

undone axleBOT
tardy delta
#

command not registered

#

youre working with da commandmap right

subtle pewter
#

Class<?> main = Class.forName(ebr.hasBlockYml().mainclass);

How do I check if the class extends ExtensionBlock?

#

And if it does, how do I get the ExtensionBlock form of it

tardy delta
#

main.isassignablefrom(extendsionblock.class)N?

#

or the other way aroud?

#

type aids

subtle pewter
#

ExtensionBlock eb = (ExtensionBlock) main.cast(ExtensionBlock.class);

#

do this?

mortal hare
#

if you're registering command with command map, in order for getPluginCommand() to find your command object instance it needs to be instanciated via PluginCommand concrete class, which is final and cannot be extended afaik, so you'll need reflections probs

quasi stratus
#

I'm attempting to iterate through an item's lore and insert a line at a certain point.

        int insertIndex = 0;
        for (int i = 0; i < lore.size(); i++) {

            if (!(lore.get(i) instanceof TextComponent component)) {
                continue;
            }

            String text = component.content();
            System.out.println(text);

            if (text.startsWith(" ")) {
                insertIndex = i;
            } else {
                lore.add(insertIndex, Component.translatable(ChatColor.DARK_GREEN + " Nightmare Infused"));
            }
        }

This creates an infinite loop for some reason, and I have absolutely no idea why; am I missing something?

#

Feel free to tell me I'm stupid (I probably am).

quaint mantle
#

nqkoi moje li za plugini?

tender shard
mortal hare
#

either your lore.size() method returns garbage value or something's wrong but not here

#

from my perspective

hasty prawn
#

Shouldn't that throw a CME?

tender shard
#

lore.size() increases everytime

mortal hare
#

oh wait

#

yea

#

but that would throw

#

ConcurrentModificationException

#

right?