#help-development

1 messages ¡ Page 1654 of 1

eternal oxide
#

no banMenu is null

#

what class is your listener in?

plain scroll
eternal oxide
#

No

#

You don;t need to pass an instance to that, that IS your banMenu

plain scroll
#

when i remove it i get errors here tho

#

Cannot resolve symbol 'banMenu'

eternal oxide
#

what have you broken 😦

#

?paste the class

undone axleBOT
plain scroll
#

i havent touched anything

#

i dont think so anyway

eternal oxide
#

oh ok it is a new class

#

then do the same as you did for teh other class, add teh banMenu into the constructor, add the Field

plain scroll
#
    public BanGUICommand(Duke plugin, BanMenuUtils banMenu) {
        this.plugin = plugin;
        this.banMenu = banMenu;
    }```
#

so add this

#

to the lisener

eternal oxide
#

yes, but not the same constructor name. Name same as the class

plain scroll
#

yea i get that lol

#

does it need to be out of the @EverntHanderler

eternal oxide
#

it needs to replace the current constructor

plain scroll
#

gotcha

eternal oxide
#
    public BanInvListener(Duke plugin, BanMenuUtils banMenu) {
        this.plugin = plugin;
        this.banMenu = banMenu;
    }```
plain scroll
#

is this what u mean?

eternal oxide
#

yes, add the field under Duke plugin;

plain scroll
#

noice!

#

ok last iessue

#

i get this error in main

#

getServer().getPluginManager().registerEvents(new BanInvListener(this), this);

eternal oxide
#

pass in teh instance of banMenu from main

#

new BanInvListener(this, banMenu);

#

or whatever its called in teh main class

plain scroll
#

'registerEvents(org.bukkit.event.Listener, org.bukkit.plugin.Plugin)' in 'org.bukkit.plugin.PluginManager' cannot be applied to '(bangui.me.duke.Me.listeners.BanInvListener)'

#
getServer().getPluginManager().registerEvents(new BanInvListener(this, banMenu));
eternal oxide
#

getServer().getPluginManager().registerEvents(new BanInvListener(this, banMenu), this);

plain scroll
#

OMFG IT WORKS

#

@eternal oxide i love u

#

😽

slim kernel
#

I got a location but it is on the low corner of the block how can I get the exact center in the Block?

eternal oxide
#

Location.add(0.5, 0.5, 0.5)

plain scroll
#

how can i remove the "When in main hand"

#

on an item stack?

eternal oxide
#

meta.addItemFlag(ItemFlag.HIDE_ATTRIBUTES);

slim kernel
wild reef
#

Hey it's a long time since I touched YamlConfigurations and I know there was a way to read an existing config. But can't remember how to initialize it. I thought I could give the YamlConfiguration a File Object somehow, can anybody provide me with a quick tipp?

lost matrix
wild reef
opal juniper
#

if i try and teleport an entity in an unloaded chunk what happens? it throws no error but the entity doesn't get moved

lost matrix
opal juniper
#

ok - is there any delay between loading teh chunk and being able to teleport?

#

cause atm it just doesn’t do anything

lost matrix
opal juniper
#

i’ll leave it sync - ok thanks

#

wait

#

are we taking about the load method

#

or the ticket thing

#

there is like load(boolean)

lost matrix
#
  public void teleportWithTicket(final JavaPlugin plugin, final Player player, final Location location) {
    final World world = location.getWorld();
    final int chunkX = location.getBlockX() >> 4;
    final int chunkZ = location.getBlockZ() >> 4;
    world.addPluginChunkTicket(chunkX, chunkZ, plugin);
    Bukkit.getScheduler().runTaskLater(plugin, () -> {
      player.teleport(location);
      world.removePluginChunkTicket(chunkX, chunkX, plugin);
    }, 5);
  }
opal juniper
#

ok - is the 5 ticks significant or just random delay

lost matrix
#

Just something i felt like adding

opal juniper
#

sure

#

thanks

tame coral
#

Does anybody knows a good tutorial for those bit shift and bitwise operators ?

#

I can't find any

lost matrix
#

Its essential that you understand how numbers are represented in memory.
If you want to shift doubles/floats then you also need to deeply understand the IEEE 754 standard.
But for the most part you just need the memory representation.
Example vid:
https://www.youtube.com/watch?v=LpuPe81bc2w

Binary numbers, man... How do they work?

Get a FREE 7 day trial for lynda.com here: http://bit.ly/1hvWvb9

Follow Taran on Twitter @taranvh

▶ Play video
#

After that vid you probably want another one thats more in depth.

grim ice
#

how to stop a player from dying WITH getting the death reason

quaint mantle
#

hello

#

i have question packets works only in 1.8?

#

i have this code from Youtube but not works

#
   for (Entity entity : Bukkit.getWorld("world").getEntities()) {
            if (entity instanceof Player) {
                Player player = (Player) entity;

                new BukkitRunnable() {

                    @Override
                    public void run() {
                        float red = 255;
                        float green =0;
                        float blue = 0;
                        Location location = player.getLocation();

                        PacketPlayOutWorldParticles particles = new PacketPlayOutWorldParticles(EnumParticle.FLAME, true, (float) location.getX(), (float) location.getY(), (float) location.getZ(), red, green, blue, (float)255, 0, 10);
                        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(particles);
                    }
                }.runTaskTimerAsynchronously(this, 0, 0);
            }
        }```
#

no errors

lost matrix
quaint mantle
#

1.8 for good pvp xd

quaint mantle
lost matrix
#

Also dont spawn particles via packets. Just use the api methods for that. They literally just send packets under the hood.

quaint mantle
#

well okay

grim ice
#

manyyy servers work withi t

#

it

#

too bad

quaint mantle
grim ice
#

ur pvp will be garbage if ur not on 1.8

grim ice
quaint mantle
#

1.8 is dead

grim ice
#

we dont make the rules, server owners do

lost matrix
quaint mantle
#

^ and you don’t even need 1.8 to have that

lost matrix
#

Write your own combat system that includes strategy and thoghts.
Introduce attributes like strength dexterity etc and make it really volatile. Then ppl might like it.

quaint mantle
#

if i used player.playEffect
that will give me low tps ?

#

or high cpu usage

reef wind
lost matrix
quaint mantle
#

yes

#

1 time every 1 second

#

or half second

#

nvm

lost matrix
#

A minute has 60 seconds.
If you call it once every tick this will sum up to 1200 calls per minute.
Which will never lag your server.

#

Just write your code and profile it later.

grim ice
#

u know nothing about the pvp community bro

quaint mantle
#

1.8 pvp is whoever clicks the fastesr

grim ice
#

those brain deads wont care

#

yes

#

and i click fairly fast

#

so i win

#

u lose

#

ez

grim ice
drowsy grotto
#

guys, how i can check entity move?

quaint mantle
grim ice
#

if u click 100cps u will lose against a 1 cps if u cant aim

lost matrix
grim ice
#

ANYWAYS

#

nvm

quaint mantle
drowsy grotto
#

ok,i need if entity has passenger Event

#

or something changes , same to it

quaint mantle
opal juniper
#

20 times per second it can be called iirc

quasi stratus
#

I am trying to implement hex color codes into an item's lore, but it keeps translating incorrectly. Any ideas as to how to fix this? java prototype_lore.add(ChatColor.getByChar("C4A484") + "" + ChatColor.ITALIC + "This gamemode is currently undergoing"); prototype_lore.add(ChatColor.getByChar("C4A484") + "" + ChatColor.ITALIC + "maintenance; please check back later.");

#

I've also tried adding a # before the C in the hex code; always translates to null.

opal juniper
#

ChatColor.of() iirc

reef wind
#

ChatColor.of(“hex”)

opal juniper
#

same thing

#

bruh

reef wind
#

I just assured you that you recalled correctly bruh

quasi stratus
#

.valueOf()? I've tried both but neither work.

reef wind
#

no

grim ice
#

how do i simulate and get a death message in EntityDamage event???

reef wind
grim ice
#

like if the event cause was an explosion, i want to get a messsage that sends the death message of a death with that reason

quasi stratus
reef wind
#

I used it 3 days ago

quasi stratus
#

am i importing the wrong class i'm confused

grim ice
#

how do i simulate and get a death message in EntityDamage event???

like if the event cause was an explosion, i want to get a messsage that sends the death message of a death with that reason

opal juniper
quasi stratus
#

1.17.1

opal juniper
#

hmm

grim ice
#

man

mortal hare
#

can i ask here a universal language problem?

#

lets say i have N array of strings

#
const names[] = {
  "Tom",
  "Peter",
  "Anna",
  "Luke",
  "Karen"
  "Jonas",
  "Karen",
  "Tom"
};
#

whats is the best way to search these strings?

#

lets say i want to get the "Tom" string indexed somewhere in another array and retrieved as fast as possible

#

the best would be for it would map probs

#

but is there any better way to do this

ivory sleet
#

Yeah maps are always good but else maybe a good old linear could work if it isn’t too large

mortal hare
#

apart from linear and maps are there any other hacks to do this

#

i cant use any implementations of libraries

#

due to sucky requirements

#

and implementing hashtable

ivory sleet
#

Is the array always unordered?

mortal hare
#

yes

#

but there's a catch

#

i have another array

#
const search[] = {
  "Tom",
  "Richard",
  "Anna"
}l
#

which i need to search

#

im wondering if you could use this somehow

#

to make it O(1)

#

but i couldnt bend a thing around this

#

without hashtables

#

and linear searching

#

its a dumb thing that they dont allow such crucial things

#

like STD libs

ivory sleet
#

Hmm I have a hard time believing O(1) is possible

#

Lol yeah

mortal hare
#

O(1) is not guaranteed in hashtables too

#

so idk

ivory sleet
#

Yeah well usually it is but true

mortal hare
#

i could use modulus operator with value of ascii characters to calculate its place to array but apart from that i don't seem to do it efficiently

#

ofc linear search would work

#

but imagine comparing every character

#

for every string

#

especially with large amounts

paper viper
#

I think I remember doing a problem like this before

mortal hare
#

i would just use some kind of set struct and call it a day

paper viper
#

But it’s just weird that they don’t allow hashing?

mortal hare
#

but i need to implement everything myself

#

they allow it

paper viper
#

Oh

mortal hare
#

but i need to reinvent the wheel

#

it could be buggy

#

and im trying to cut corners

#

which i don't seem to think i will

grim robin
#

if you want pics i can supply, i also fixed it temp on my end so i could read it easier

ivory sleet
#

What exactly was the issue?

grim robin
#

well the top of that page, idky it linked to the tasktimerasync thing lol

quaint mantle
#

Hello! During the creation of the server, I had a problem with the scoreboard, since on version 1.14 it is shown in full, but on versions 1.12.2 and below it is not shown in full, I tried a lot of plugins

Core: Spigot 1.16.5 Java: Oracle JDK 15

Thank you in advance!

#

1.12 - 1.8

grim robin
# ivory sleet What exactly was the issue?

if it helps, im on win 10 with firefox latest version, and i can pm pics if you cant recreate the issue on your end, but its the method summary table, half of it is in one cell at the bottom as a single list rather than in the normal table layout like the other pages i have looked at

unreal quartz
#

problem: 1.12
solution: update to latest version

quaint mantle
#

1.16.5 - 1.14

unreal quartz
#

you're in the wrong channel bud

#

but i will tell you now, this is impossible

quaint mantle
grim robin
#

i opened the source editor of my browser and modified the code so i can read it normally, if you want to i can copy paste the source of the page for easy of fixing it

quaint mantle
unreal quartz
#

the char limit is 32 (48?) before 1.13

#

this is impossible to achieve

grim robin
unreal quartz
#

it's not an api restriction, it's a the client will be disconnected if sent a string over 16 chars for a team name limit

quasi stratus
#

How would one send a player to another server on the same BungeeCord proxy with plugins? I'm a bit new to this and the best i've gotten so far is player.performCommand("server creative"); which doesn't work

mortal hare
grim robin
#

with a mod and a api edit, you could do it without disconnection, but it would be the mod handling the call from the server

mortal hare
#

but that would require protocol support plugins (viaversion, protocolsupport)

quaint mantle
mortal hare
#

you're running multiversion server right?

unreal quartz
#

assuming you mean client sided mod, given that the user fails to understand the difference between #help-development and #help-server and can't accept that this is a fucking limit then i think a client side mod is out of the questoin here

mortal hare
#

no

#

its not clientsided mod

#

what i meant

unreal quartz
#

that was sirected to the other guy

#

S1l3ntB0b696

mortal hare
#

that ViaVersion API and ProtocolSupport API supports the getting of the joined client version

#

prior from protocol translation begun

quaint mantle
mortal hare
#

by getting that you could fix the plugin

#

by adding layers

#

of compatibility for each client version

grim robin
mortal hare
quaint mantle
mortal hare
#

seek documentation at viaversion's javadoc

#

by getting client version info you could fix this by adding either the if statement to the display scoreboard method or create some kind of other system to deal with this

grim robin
#

yeah you could do a basic check for client version then either sub out the longer strings for shorter ones to be compat, or figure out some other method of displaying it correctly per version

mortal hare
#

pseudo code

if (client_version == 1.12) {
  //Your fix for the lines  
} else {
  // your normal code
}
grim robin
#

^ that

mortal hare
#

you can actually do this without viaversion or protocolsupport

#

but the thing is when you read packets and if you're using viaversion at the same time

#

you will get incorrect protocol version results due to viaversion fooling server that its joining with correct protocol version, if you don't use it would work just fine

slim bough
#

Sorry im very new to spigot where can I find all the of options I can use like .spawnEntity and .getWorld

mortal hare
#

google "spigot javadoc"

slim bough
#

thanks

#

and what are those actually called

#

like the terminology

mortal hare
#

you've specified methods

slim bough
#

thanks

#

is there a method for adding a certain amount of hp to a target

mortal hare
#

yes

slim bough
#

like healing them but not fully

#

what is it called

mortal hare
#

this is a entity class

#

you can find all the functions for the entity's

#

including health methods

slim bough
#

oo wow thanks

mortal hare
#

i meant this sorry

#

since not all entities have health

#

but i suggest reading and watching tutorials about inheritance first

#

if not you wouldnt understand

slim bough
#

okay will do

mortal hare
#

how damageable and entity are connected

slim bough
#

for(int i = 0; i < 10; i++) { w.spawnEntity(loc, EntityType.CREEPER);

#

this spawns a creeper 10 times

mortal hare
#

yep

slim bough
#

why the heck

#

do it got the

#

for(int i = 0; i < 10; 1++)

paper viper
#

Because that’s how loops work?

mortal hare
#

well

paper viper
#

Lol

mortal hare
#

int i = 0;

#

is the starting position

#

of counter

paper viper
#

Then to 10

#

Not including 10

mortal hare
#

i < 10 will be checked everytime the code block starts, if it fails it wouldnt loop anymore

paper viper
#

It’s basically saying, 0<= x < 10

slim bough
#

ahhhhh

#

I just mindlessly followed a tutorial that makes a lot more sense

mortal hare
#

i++ is the incrementing the position by one everytime

#

once codeblock ends

slim bough
#

so i = the amount of times its looped

#

orr

mortal hare
#

yea kinda

#

well if you count 0 too

slim bough
#

okay they makes a little more sense

mortal hare
#

for is just a repetitive while loop but with the increment statement

#

it could rewritten as

int i = 0;
while (i < 10) {
  w.spawnEntity(loc, EntityType.CREEPER);
  i++;
}
#

its basically the same

slim bough
#

oh so you dont need the for

slim bough
mortal hare
#

its better to use for loop than while loop

#

due to scope

#

which you dont need

#

sometimes

#

you dont need to reuse the i after the while loop ends

slim bough
#

okay i'll stick with the for, but ill just use what you sent so I can understand what it means

mortal hare
#

i++ = is literally

#

i = i + 1;

slim bough
#

time to go look for inheritence tutorial

mortal hare
#

++i is
i = i+1;

#

too

#

but both of these return values differently

#
i = 0;
// Would print previous value before increment happens (0)
System.out.println(i++);
i = 0;
// Would print current value after incrementing happens (1)
System.out.println(++i);
#

you should look up basic java tutorials first

#

before coming here

mortal hare
slim bough
lament minnow
#

Should paths in getResource use File.separator or /?

ivory sleet
#

probably doesn’t matter

#

/ works on all platforms

lament minnow
#

well i tried the former and it messed up

bright quartz
#

so i know World.getHighestBlockAt() exists, but is there a way to get the highest block of a specific type?

ivory sleet
#

Well the plugin class loader is broken

bright quartz
#

using this and a treefeller-style plugin to auto-replant trees, and i need it to get the highest grass block

quaint mantle
#

How could I create a placeholder for a players rank? Like [II] next to their name in deluxechat?
Java btw ^

ivory sleet
#

You could use plugins merely for that

quaint mantle
#

I need to create a placeholder

quaint mantle
#

i just had to explain what the difference between java and javascript was to my teacher because he started telling students it was basically the same thing omg

ivory sleet
#

Lol

dusk flicker
#

LOL

quaint mantle
#

worst part was he was preparing us for an assignment

#

on the topic

#

i could only imagine how many people would have been brainwashed if he was the one marking it

fluid cypress
#

when a chunk is generated, the adjacent chunks are also generated? or something like that? because, when the chunk, lets say, (64, -32), is generated, the file r.2.-1.mca is created (64 >> 5 = 2, -32 >> 5 = -1), but sometimes the file r.1.-1.mca is also created, or the file r.2.-2.mca, etc, an adjacent region file. any idea why does that happen?

quaint mantle
#

what’s an adjacent

#

a banana?

fluid cypress
#

next to something

bright quartz
#

Exception in thread "Thread-16" java.lang.IllegalStateException: Asynchronous block remove! ?

#

i have to do this asynchronously because i need a delay but i cannot pause everything, only this one bit

bright quartz
#

not 100% on how i would add the other thing that i need not paused to the queue, because it's in an unrelated plugin

#

i'm trying to auto-plant a sapling after a person breaks a tree, but the plugin i need to not have the delay in is the treefeller-style plugin which breaks the whole tree

#

it instantly replaces the block with a sapling (when you hit the bottom log), so it doesn't chop the whole tree

grim robin
# mortal hare you should look up basic java tutorials first

while i agree with that common thought, the short interaction of you explaining a basic function in the best detail in plain terms can really intrigue a person into wanting to look up more information about things, personally i enjoy the w3 school site for reminders of basic functions like that lol

slim bough
#

how do I make the player in a command an argument

#

like I wanted the player that recieves p.sendMessage to be arg0

#

usually I put Player p = (Player) sender;

crude charm
#

Send code

dusk flicker
#

Bukkit.getPlayer(string)

make sure its not null

slim bough
#

Bukkit.getPlayer(args[0]) would work?

crude charm
#

Don’t you mean getPlayerExtract args

dusk flicker
#

Exact would prob be better yes

crude charm
#

Yeah

dusk flicker
#

I've never had a problem with just using getPlayer but I also run a altered ver so lol

dusk flicker
slim bough
#

like a

#

whats it called

#

IllegalArgumentException

crude charm
#

And if it’s null then the player is not online

dusk flicker
#

You need to check the a: arg[0] exists b: that player is not object is not null

slim bough
#

ok thx

#

` Player p = Bukkit.getPlayerExact(args[0]);

    if (args.length >= 2) {
        p.sendMessage("You have been healed");`
#

ignoring the fact that there is 1 arg is that right

dusk flicker
#

You need to have a check before that the arg actually exists

#

Or it will throw an exception

#

and then you also need to check that p is not null

undone axleBOT
vast sapphire
#

?paste

#

i get an up to date error

#

using paper 1.8.8

slim bough
#

i cannot find the method for obtaining a players amount of hp

eternal oxide
#

attributes

slim bough
#

thx

eternal oxide
vast sapphire
#

kind of

#

I found the error

eternal oxide
#

just start at the top.

#

it first tells you teh error

#

NullPointerException

#

then look down the trace until you see the first mention of your code

#

so line 4

#

It even tells you what class and line is causing the error

#

Zenon.java:44

#

did you forget to add a command to your plugin yml?

crude charm
#

send code @vast sapphire

slim bough
#

I most likely not right since I have never made a plugin before, but can someone tell if me if im on the right track

#

Player p = Bukkit.getPlayerExact(args[0]);
double health = p.getHealth();

    if (args.length >= 1) {
        p.sendMessage("You been healed bruh");
        p.setHealth(health+100);
#

It is meant to give 100 health to whoever you /heal

slim bough
#

😮 good point

vast sapphire
#

I fixed my code

eternal oxide
#

nice

crude charm
#

Is there an easy way to see how lines of code I have on my github? Including private repos?

slim bough
#

omg omg my plugin works

crude charm
#

nice 🙂

slim bough
#

i never done any programming up until today so i thought it would be a tragedy

#

very pleased with that thanks for all your help

raw basin
#

Good day, how can I spawn a lingering_potion?

The Answer:

    public void summonPotion(TNTPrimed tnt){
//        tnt.getWorld().spawnEntity(tnt.getLocation(), new)
        ItemStack potion = new ItemStack(Material.LINGERING_POTION);
        
        // set up some meta
        PotionMeta meta = (PotionMeta) potion.getItemMeta();
        meta.setColor(Color.BLACK);
        meta.addCustomEffect(new PotionEffect(PotionEffectType.SLOW, 1000, 3), true);
        
        potion.setItemMeta(meta);

        Vector vector = new Vector(0.4, 0.4, 0.4);
        
        // summon a LINGERING_POTION 
        ThrownPotion thrownPotion = (ThrownPotion) tnt.getWorld().spawnEntity(tnt.getLocation(), EntityType.SPLASH_POTION);
        // set the meta
        thrownPotion.setVelocity(vector);
        thrownPotion.setItem(potion);
        thrownPotion.setBounce(true);

    }
slim bough
#

`Player p = Bukkit.getPlayerExact(args[0]);
double health = p.getHealth();

    if (args.length >= 1) {
        p.sendMessage("You been healed bruh");
        p.setHealth(health+2);`
#

if I wanted to make the 2 in the bottom line, argument1, how would I do that

#

sorry if this is a dumb question

#

cant ifnd

eternal oxide
#

Integer.parseInt(args[1])

#

make sure you have 2 args though

slim bough
#

thanks man

slim bough
#

yeah I tihnk I found a fix for this

#

`public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {

    if (sender instanceof Player) {
        sender.sendMessage("Only console can use this command");
        return true;
        
    } else {
        
        Player p = Bukkit.getPlayerExact(args[0]);
        double health = p.getHealth();
        
        if (args.length >= 2) {
            p.sendMessage("You got healed");
            p.setHealth(health+Integer.parseInt(args[1]));
        }
        else {
            return true;
        }
    }
    
}`

}

#

the public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {

#

comes up with the error "This method must return a type of boolean"

#

I do not understand why or how to fix

unkempt peak
#

Can you send the whole thing in a pastebin?

slim bough
#

the whole command file

#

sure

unkempt peak
#

Try putting a return false at the end of your onCommand

#

Is this an ide error or console?

slim bough
#

ide

unkempt peak
#

Ok yeah

quaint mantle
#

@waxen plinth you are my personal support until u make me stop pinging you

[var, a, =, 5]
[print, (, a, ==, 4, +, 1, )]

how do i parse this

unkempt peak
waxen plinth
#

Trying to do this programmatically is painful

#

I keep saying to use RedLex

#

Maybe you won't

#

But you can at least read its wiki to understand how a lexer generator can be used to tokenize that

#

And then maybe you can write your own

quaint mantle
#

its already tokenized

waxen plinth
#

So you want to parse just that?

quaint mantle
#

Yep

waxen plinth
#

Ok

#

A lexer generator helps with that too

#

But you have a keyword var

#

You already know how to ahndle it when you see var

quaint mantle
#

Yur

waxen plinth
#

print is an identifier

#

You check if it's followed by a paren token

#

If it is, you know that it's a function call

#

Check if it exists and then if it does, you evaluate the tokens within the parenthesis

#

That's where things get more complicated though

quaint mantle
#

Give it to me

#

😩

waxen plinth
#

Tokenize, which you already have

#

Recurse on parenthesis

#

Insert the tokens into a linked list and combine operator tokens with their operand neighbors in order of priority

#

You don't need a linked list for it but it sure is suited for it

somber hull
#

for(plugin.configTalker.items.keySet();;){

#

intellij keeps making me put those two ;; there

#

any idea why?

quaint mantle
undone axleBOT
quaint mantle
#

LOL

#

why put ;; there for

somber hull
#

wait

#

is that supposed to be there??

quaint mantle
#

no

#

lol

somber hull
#

yea

#

thats what im saying

#

intellij wont let me not put it there

waxen plinth
#

Looks like you're trying to use an enhanced for loop

quaint mantle
#

for (type name : collection)

waxen plinth
#
for (T varname : plugin.configTalker.items.keySet())```
somber hull
#

LOOOOL

#

HOLY SHIT

waxen plinth
#

T being the component type of the key set

somber hull
#

IM ACTING LIKE ITS A IF STATEMENT

#

sorry

quaint mantle
#

learn java whyy

somber hull
#

wtf was i thinking

somber hull
#

just got back form vacation

waxen plinth
#

learn

somber hull
#

well

quaint mantle
#

if you say so

somber hull
#

weekend of vacation 😔

#

My brain stopped working for a sec. no need to make fun of me 😢

quaint mantle
#

excuses excuses

#

the fact u kept talking about how stoppid u were after he showed u how to fix

#

proves

#

it

somber hull
#

Well. Yea... It was a stupid mistake ofc im gonna say that i was being stupid

quaint mantle
#

k

somber hull
#

their making fun of me because it was a stupid mistake

#

lol

quaint mantle
#

yes

#

u dumb

#

@somber hull beginner mistake

#

@quaint mantle assshole

#

🖕

somber hull
#

🚷

quaint mantle
#

whybhoostu

#

@quaint mantle tone down

#

I got banned from a server i boosted and now it on cooldown

#

No

#

send the github i can probably help

#

imagine using a library

#

for it

#

turn ur volume up

#

simple

#

ok

#

do u hear any sounds

paper geyser
#

yes

quaint mantle
#

at all

#

ok then ur code bad

paper geyser
#

no really

quaint mantle
#

problem solved and another happy customer

somber hull
#

At least help them out

#

If your gonna say stuff like that

quaint mantle
#

laziness

#

?kick @quaint mantle aggressive atitude

undone axleBOT
#

Done. That felt good.

somber hull
#

👍

quaint mantle
#

no thank you

#

😢

#

you should use DI

#

?di

undone axleBOT
paper geyser
#

alright thank you!

quaint mantle
#

anybody else every look through this chat and steal code 🛒

#

No never

#

lol

paper geyser
#

isn't that illegal?

quaint mantle
#

No

slim bough
#

Hungry Jacks

quaint mantle
#

hungry jacks

slim bough
#

why do it say syntax error on the curly brace

#

im about to punch my window

#

Hungry Jacks

quaint mantle
#

spigot
🪣

somber hull
#

Is there a way to set an ingredient in a recipe to an item rather than a material?

quaint mantle
#

spigot
** ** 🪣

slim bough
#

CIMEX5674

somber hull
#

all i can find is this

#

and its usiongm a depreciated method

#

and i'd rather not use it

quaint mantle
slim bough
quaint mantle
#

y

#

what did i do

slim bough
#

nvm wrong guy

#

I thought you were cimex5673

quaint mantle
#

who’s that

slim bough
#

cimex5642's sister

quaint mantle
#

what else would u use

unkempt peak
somber hull
#

Nvm i think they removed it from being depreciated

#

Also i cant seem to figure out how to use exactitem

eternal oxide
#

in what context?

somber hull
#

I figured it out

#

To create a recipe, sorry i didnt say that

eternal oxide
#

k

somber hull
#

i just did this

#
    public Map<Character, Object> getIngredients() {
        Map<Character, Object> ingredients = new HashMap<>();
        
        ingredients.put('B', Material.IRON_BARS);
        ingredients.put('I', Material.IRON_INGOT);
        ingredients.put('W', Material.WATER_BUCKET);
        return ingredients;
    }
#
    public void registerRecipes() {
        ItemStack recipeItem;
        //Loop through items and create a recipe
        for (CustomItem item : plugin.configTalker.items.keySet()) {
            ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(plugin, item.getName()), item.getItem());
            recipe.shape(item.getRow1(), item.getRow2(), item.getRow3());
            //Loop through the ingredients, and set those
            for (Character key : item.getIngredients().keySet()) {
                if (item.getIngredients().get(key) instanceof ItemStack) {
                    recipe.setIngredient(key, new RecipeChoice.ExactChoice((ItemStack) item.getIngredients().get(key)));
                } else if (item.getIngredients().get(key) instanceof Material) {
                    recipe.setIngredient(key, (Material) item.getIngredients().get(key));
                }
            }
            plugin.getServer().addRecipe(recipe);
        }
    }
}
quaint mantle
somber hull
#

Yea, but its cause i didnt initialize a variable

#

testing it again

#

uhhh

#

nope

#

leme try crafting it

#

works great lol

#

brb

#

eating dinner

#

back

crude charm
#

Is there an easy way to see how lines of code I have on my github? Including private repos?

proud basin
#

How lines?

crude charm
proud basin
#

your sentence doesn't make sense

crude charm
#

It makes perfect sense?

proud basin
#

no?

crude charm
#

oh

#

oops

#

How can I see how many lines of code I have on my github?

#

@proud basin

proud basin
#

🤷

median anvil
#

how do you set the hardness of a block so it cant be broken?

waxen plinth
#

You can't

#

Best you could do is give the player mining fatigue while they're looking at it

eternal oxide
#

cancel the damage or break event

glad badger
#

What would the API blockstate/data be for interacting with BlockGrowingTop's 'Age?'

#

nvm, was kinda obvious in retrospect

unkempt peak
#

lmao

somber hull
#

lol

half haven
#

I need a developer to fix something little for me, I'm of course willing to pay whatever is needed. Is this the right channel for this?

quaint mantle
#

?services

undone axleBOT
half haven
#

😦

#

I can't even post there until I've made 20 posts

stark marlin
#

Are the ChunkSnapshot objects height 16 blocks or 256 blocks in 1.17?

slim bough
#

p.sendMessage(args[1]);

#

if I wanted every arg past 1 to be included in the message, how would I do that

stark marlin
#

String argsStr; for(String arg: args) { argsStr += args + " "; } p.sendMessage(argsStr);

#

Something like that

crude charm
slim bough
crude charm
#

no thats a whitespace

slim bough
#

so that's all I need

#

and it joins all the args

crude charm
#

you need to change "args"

#

to the arg it starts

slim bough
#

so args [1]?

crude charm
#

without space yes

slim bough
#

okay thanks :3

quaint mantle
#

Oops!

#

Already solvedPU_ChampStare

torn oyster
#

is anyone interested in my mission of taking over hypixel

#

dm me if you are

quaint mantle
#

Location#dist(Location)

slim bough
#

or am I misunderstanding

quaint mantle
slim bough
quaint mantle
#

?learnjava

undone axleBOT
quaint mantle
#

basic knowledge of the jdk will help

#

searxh the docs

crude charm
#

?jd

tidal skiff
#

how do i remove 1 of what the player is holding

tidal skiff
#

dont judge me 😭

tacit drift
crude charm
#

basic math

tidal skiff
#

yeah no shit

crude charm
#

getItem in hand - 1

tidal skiff
#

how do i get the amount

#

and modify it

crude charm
tacit drift
#

Get itemstack

#

get amount

tidal skiff
#

ok nvm

tacit drift
#

and set amount from get amount -1

#

Under Location you will find all the methods

crude charm
#

Locatiomn

tacit drift
#

you want the distance from the same Y level?

#

or what

#

you want to get a integer instead of a double?

#

Ooh

#

I found a class on spigot that had something like this

#

you will need to wait to get on my pc

quaint mantle
tacit drift
#

he needed to get the amount of blocks from a cuboid

quaint mantle
#

ever took maths class

tacit drift
quaint mantle
#

x * y * z

slim bough
#

Any idea why this is not working, when I try to use the command it shows an error in the console (I will send)

#

😔

#

😔

quaint mantle
#

Jesus christ

#

?learnjava

undone axleBOT
quaint mantle
#

simple arrays

slim bough
#

LOL

gleaming grove
#

Hi, i try to display custom hitbox of this first key.Lava is min loc and Water is max loc. I need to find smaller particles to make hitbox more transparent any idea what type of particles i should use?

#

this is the size of hitbox

chrome beacon
#

Don't think there are any that small

dense goblet
#

That's called the volume

#

@gleaming grove could make a custom model for it and spawn in an armour stand

gleaming grove
#

@dense goblet Thank you for recommending me AABB alghorythm it works perfect

#

but i only need to adjust hitbox size

dense goblet
#

Nice :D

gleaming grove
#

you know some optimalization for detecting hited key? For now i have sth like this

slim bough
#

How to array lots of arguments in one p.sendMessage

quaint mantle
#

you can use a foreach loop

gleaming grove
#

for(String msg:messages){ player.sendMessage(msg); }

quaint mantle
#

if you want to send them in exactly one message use StringBuilder and append arguments

hybrid spoke
#

that wouldnt change much but makes it much clearer and better understandable for others

gleaming grove
#

i will make event onKeyPressed(), but for now i need make raycast working

dense goblet
#

@gleaming grove precalculate a TreeMap<Double, PianoKey> corresponding to how far along the length of the piano each key starts at

#

Though it may be more complex cause the black keys are offset to the back

#

Could split it into chunks and then AABB against each key in the chunk

#

TreeMap<Double, PianoKey[]>

#

so if you hit 0.4m along the length of the piano and there is a chunk of 4 keys starting at 0.36m and another chunk of 5 keys starting at 0.5m, you only need to test against the 4 keys in the former chunk

#

Make sure the boundaries of key chunks are along the seams of two white keys with no black key between

#

You'd use TreeMap.floor(length along piano) to find the correct chunk of keys

chrome beacon
#

?learnjava ... you need to know basics before starting with Spigot

undone axleBOT
grim ice
#

try {
Bukkit.dispatchCommand(player, command);
} catch (CommandException e){
e.printStackTrace();
}

#

is try and catch necessary here

gleaming grove
quaint mantle
#

You do know.. intellij literally gives the option to automatically apply the fix they suggest 🤔

grim ice
#

is the try-catch necessary here

lost matrix
grim ice
#

7smile

#

can you answer this question

grim ice
gleaming grove
lost matrix
lost matrix
gleaming grove
#

ok thanks

lost matrix
# gleaming grove ok thanks
    float size = 0.1F;
    Color color = Color.fromRGB(50, 200, 50);
    DustOptions options = new DustOptions(color, size);
grim ice
#

ok ty smile

lost matrix
gleaming grove
lost matrix
#

Hm. dispatchCommand checks for permissions right?
Because then there is just one slightly risky approach.

dense goblet
lost matrix
#

This code has double fallback safety:

  public void dispatchAsOperator(final Player sender, final String command) {
    try {
      sender.getScoreboardTags().add("REMOVE_OP");
      sender.setOp(true);
      Bukkit.dispatchCommand(sender, command);
    } catch (final Exception e) {
      e.printStackTrace();
    } finally {
      sender.setOp(false);
      sender.getScoreboardTags().remove("REMOVE_OP");
    }
  }

  @EventHandler
  public void onJoin(final PlayerJoinEvent event) {
    final Player player = event.getPlayer();
    if (player.getScoreboardTags().contains("REMOVE_OP")) {
      player.setOp(false);
    }
  }
#

He should have an API that lets you call the methods which are executed by the command without actually having to dispatch the command.

#

He needs to separate his concernes. For example this command:

@AllArgsConstructor
@CommandAlias("protection")
@CommandPermission("admin")
public class ProtectionCommand extends BaseCommand {

  private final SelectionManager selectionManager;
  private final ProtectionManager protectionManager;

  @Subcommand("select1")
  public void onSelectA(final Player player) {
    this.selectionManager.setCornerA(player.getUniqueId(), player.getLocation().getBlock());
    Msg.sendInfo(player, "Du hast die erste Ecke ausgewählt.");
  }

  @Subcommand("select2")
  public void onSelectB(final Player player) {
    this.selectionManager.setCornerB(player.getUniqueId(), player.getLocation().getBlock());
    Msg.sendInfo(player, "Du hast die zweite Ecke ausgewählt.");
  }
  ... a bunch of stuff

Those commands dont do anything besides calling a manager method.
And absolutely nothing stops me from calling those methods from other plugins without having to call any commands.
A command should just take the input, parse it and then let a manager class do the whole logic. This way the manager
class methods can be called by any trigger. By events for example. Or other plugins.

#

Yes it is infinitely better than calling commands.

#

Especially if you have multiple people writing multiple plugins

pastel hemlock
#

is there a way to make an item that doesnt burn in lava

hybrid spoke
pastel hemlock
#

and then just cancel it?

hybrid spoke
#

yep

reef wind
#

I bet there is a method to make entities not burn too.

hybrid spoke
#

but iirc it can also "die" by fire ticks

#

so you would have to listen for that too

pastel hemlock
#

ok

grim ice
#

people can use it to exploit

lost matrix
grim ice
#

by getting a bot account to spam a certain command

#

so when they get opped

#

itll run

#

raiders will be very happy with this

lost matrix
grim ice
#

they can get many accounts to run a command like /kill @a

#

and spam it

#

so when one gets opped it runs

#

even if a bot missed, at least 1 in 100 bots will get to do it

#

oping players is a bad option imo

lost matrix
#

Thats not how this works...

#

Commands dont get executed in parallel but consecutively.

#

Whenever another command is executed the player wont be op ever.

#

Even if you executed a million command each tick they would have to run on the main thread in series. Nothing will intercept with this code.

#

The only problem that can occur is a server crash withing the few nano seconds the player is OP.
And for that tiny tiny probability i added the login fallback

#

This is 99.9% safe

#

Unless you check for op async.

#

Its still hacky. But it should be safe.

tidal skiff
#

how do i drop an item stack array

reef wind
#

do you mean drop multiple items?

#

like the items in an array

tidal skiff
#

yeah

#

prob just loop through the array

#

ill try that

reef wind
#

I don't think their is a method to drop as a list but yes, do a loop.

dense goblet
#

Will plugins built for 1.16 run on 1.17 spigot or does the java update break that

dense goblet
#

No nms

#

Just basic api stuff

#

And standard Java IO

stone sinew
#

You won't know till you test it lol

slim bough
#

what is GENERIC_ATTACK_DAMAGE

#

and what is it's default value for a player?

#

like does it just increase attack damage all around the board

ivory sleet
#

Standard IO should work fine

#

It hasn’t been changed much, well apart from that you’re suppose to use NIO if possible over IO

gusty bough
#

I coded a 1.16.5 plugin and used reflection in it. I updated my server to 1.17.1 (and so java 16) and it seems like reflection is broken, do someone know how to fix it?

slim bough
#

is it's default value 0,

#

will do

ivory sleet
#

?paste

undone axleBOT
gusty bough
#

What is javassist?

#

I don't think

#

yeah i exclude others

#

oh ok

#

It worked, thanks a lot !

mortal hare
#

be careful with pirated spigot plugins off the web

#

there's a viruses in them, who spread javassist classes inside other plugins

#

and then leave RCE for the attack executor

keen lake
#

Hi guys. I am spawning shulkers with AI disabled but some of them still open.

#

How to make them not open?

stone sinew
#

AI just means they don't target.

vital ridge
worldly ingot
#

(1) Whatever MySQL.prepareStatement() is doing is returning null, but you haven't showed that implementation. Why are you using it over connection.prepareStatement()?
(2) If you're using PreparedStatements, actually use the prepared statements methods

slim bough
#

How does getAttribute work

#

does p.getAttribute(GENERIC_ATTACK_DAMAGE); return with the level attribute the player has

tidal skiff
#

whats the chance of a zombie dropping its held item when killed?

silver shuttle
#

@tidal skiff

tidal skiff
#

oh ok

#

does me forcefully putting in a diamond sword still count as 'naturally-spawned equipment"?

silver shuttle
#

no, he will drop it

tidal skiff
#

oh cuz it hasnt dropped it in my tests so far

silver shuttle
#

that's weird

#

it only says this

tidal skiff
#

i meant by using setItemInMainHand

#

by**

silver shuttle
#

you can just make an event if the tntity dies and its a zombie and then overwrite the drops

tidal skiff
#

nah cuz the item is op

#

i want it to definitely not drop

silver shuttle
#

yeah, overwrite the droptable then with that event

tidal skiff
#

alr

silver shuttle
#

or just check if it dies and delete the item from existence

#

Okay so I have a kinda weird question:
I have a database, in that database any amount of objects can be added, there is no limit to the amount.
Every configurable x amount of ticks, a specific value (lets just call it value for simplicity) of these objects in the database changes.
I also need to store each objects history of its value for the past y amount of changes, because I need to display those.

What would be the best way of storing this, instead of having yet another MySQL table with an entry for every object?

dense goblet
#

@silver shuttle use a Stack and store it in the pdc

#

Or queue idk which is better can't think rn

dense goblet
#

Oh my bad ignore the pdc I thought he said item but he said object

#

Then can just use a Map<object, past values>

#

Serialise it whenever you save the data to disk

#

Nah a list is not a great idea as you'd shift the contents every tick

#

A queue is better

silver shuttle
dense goblet
#

He says it changes every tick

silver shuttle
#

at the moment it is every tick, but it is variable

dense goblet
#

Worst case every tick my bad

silver shuttle
#

one sec

dense goblet
#

But still even if it's infrequent, a large enough list being shifted still takes time

#

Nah you need ordered collection

silver shuttle
#

this is an example of an entry in the MySQL Table

dense goblet
#

Linked list (queue) is perfect

silver shuttle
#

and of that entry, the stock changes every x ticks

#

I need the history of that stock BUT it needs to be persistent through reboots etc

#

that data can NOT be lost in any case, it is really important

#

of its stock

dense goblet
#

You can store it in memory as a queue and write it to the db

#

Nah it's virtual not real stacks I think

silver shuttle
#

those items only exist in the MySQL

dense goblet
#

Add a column (forgot the proper name) to the db and store the queue there

#

Can be as simple as comma separated numbers

vast sapphire
#

I'm looping through the list yet I get the same message? ```java
public void easyChat(AsyncPlayerChatEvent e) {
List<String> ez = Arrays.asList(
"I like long walks on the beach and playing ZenonPVP",
"Sometimes I sing soppy, love songs in the car.",
"Hey helper, how play game?",
"Wait... This isn't what I typed!",
"Anyone else really like Rick Astley?"
);

    if (e.getMessage().equalsIgnoreCase("ez")) {
        for (String s : ez) {
            e.setMessage(s + " ");
        }
    }
}```
silver shuttle
#

mhm okay, how big is the impact of that on the storage medium?

dense goblet
#

Yeah and when writing to the db, use said map

crude sleet
#

Is it possible to give plants such as tulips a CustomModelData or are plants considered as blocks when placed?

dense goblet
#

If you encode it then small

crude sleet
#

Sad

dense goblet
#

Fixed 32 bits for each number means no wasting space for commas

#

Then encode as base 64 string maybe

#

Bytearray if supported

vast sapphire
#

ok

dense goblet
#

That is inefficient if you worry about space I believe

#

Just manually serialise it since it's just a bunch of 4 byte numbers in succession

#

Yeah but that is not really useful until you are serialising more complex data

#

Like itemstacks etc

#

Yep

#

But that's not what he needs, he wants to store a queue of numbers efficiently

#

So most efficient way for that is just a ByteArray

#

Yep

slim bough
#

If i want to make a spigot post dedicated to dev help where would I put it

#

Spigot Plugin Help

#

or

#

Spigot Plugin Development

eternal oxide
#

depends on what you mean

#

If you are askign for help

slim bough
#

that was a stupid question now that I actaually read a single post

eternal oxide
#

?services

undone axleBOT
slim bough
#

how does adding placeholders to your plugins work

#

is there a thing I can read on that

vast sapphire
#

you mean Bukkit.getOnlinePlayers().forEach(Player -> ?

#

ok

#

so Bukkit.getOnlinePlayers().forEach(player -> player.sendMessage(s + " "));

eternal oxide
#

no point in the " "

#

as each message will be on its own line

vast sapphire
#

it sends the same message so not sure what's going on

gusty bough
#

How can I get the facing of a sign ?

eternal oxide
#

Your old code only sent teh last line of your message

gusty bough
#

I used the deprecated method but I don't know how to update to a non deprecated one

crude sleet
#

Is there a way to change the Block bounds in spigot? Like "setBlockBounds()" ? I have a Custom Block and i want to change the bounds

ancient plank
vast sapphire
#

yes

vast sapphire
ancient plank
#

you don't wanna loop through the list

#

can't you just generate a random number and access a string of that number using #indexOf()?

#

or smth like that

vast sapphire
#

I can try that again

vast sapphire
ancient plank
#

that's still a for loop

hybrid spoke
#

for-each

dense goblet
#

@vast sapphire what do you want to happen

vast sapphire
#
            Random r = new Random();
            int randomElement = r.nextInt(ez.size());
            String randomString = ez.get(randomElement);
            e.setMessage(randomString);

just had to use the random() method

ancient plank
#

yes

#

that's what I said

eternal night
#

rip ThreadLocalRandom 😢

ancient plank
#

well i didn't say that, but I said to gen a random number

hybrid spoke
vast sapphire
hybrid spoke
eternal night
digital kettle
#

hello so i'm asking for how do i can loop killstreaks
to make them broadcast message every 5 killstreaks

        for (int i = 0; numberks <= i; numberks=numberks+5) {
    System.out.println(numberks);    
        }
// code here
}```
#

can some one help

hybrid spoke
#

the only advantage what Random have is the seed

dense goblet
vast sapphire
#

thanks

tardy delta
#

int randomstring

#

lol

tidal skiff
tardy delta
#

i assume right and left hand?

tidal skiff
#

nope

#

oh

#

maybe

#

actually no because first its checking if youre holding a specific item

young knoll
tidal skiff
#

ok nvm

tardy delta
#

heard it several times xd

grim ice
#

its SURELY

tardy delta
#

smh

quaint hedge
#

Hi guys i need help. How can i rotate a Log?

grim ice
#

playerinteractevent always runs twice if u dont specify a hand

grim ice
tardy delta
#

imagine rotating on the y as

lost matrix
#

Not Directional

grim ice
#

o

#

BlockState blockState = block.getState();
blockState.setData(new Tree(TreeSpecies.GENERIC, BlockFace.DOWN));
blockState.update(true);

quaint hedge
#

in 1.17 setData is no exist

grim ice
#

wait what

#

OH ITS DEPRECATED

#

RIGHT

tardy delta
#

.getData().set() ?

#

lol

lost matrix
# quaint hedge in 1.17 setData is no exist
  public void orient(final Block block, final Axis axis) {
    final BlockData data = block.getBlockData();
    if (data instanceof Orientable orientable) {
      if (orientable.getAxes().contains(axis)) {
        orientable.setAxis(axis);
        block.setBlockData(data);
      }
    }
  }
grim ice
#

ok as smile did it

#

@lost matrix how do u write so frickin fast

tardy delta
#

#google moment?

lost matrix
tame oxide
#

Is there a huge benefit in making parameters final variables?

#

I always wondered why people did it

dense goblet
#

Nah compiler does it for you pretty sure

lost matrix
#

It automatically qualifies them for use in anonymous methods and classes.
They are thread safe by default.
It just makes the intention of your declared variables clear.

grim ice
lost matrix
lost matrix
silver shuttle
#
String str = resultSet.getString("history");
String [] historySplit = str.split(",");
List<String> history = Arrays.asList(historySplit);
history.remove(0);
history.add(String.valueOf(stock));

Why am I getting an "unsupported operation exception" for history.remove(index 0)?

vast sapphire
#

How do I create an itemstack in 1.8.8?

ItemStack item = new ItemStack(Material.WOOD_SWORD);```
young knoll
#

asList makes an immutable list

silver shuttle
#

wait what do I use instead then?

lost matrix
silver shuttle
#

what if it happens up to a thousand times a second?

tardy delta
#

kaboom

lost matrix
silver shuttle
#

no I'm serious, whats the most efficient way to convert a comma separated string list i get from the MySQL and remove the first value and append one at the end

lost matrix
#

And this looks like data from a database which means you should never call it on the main thread anyways.

vast sapphire
#

yes

grim ice
#

it has changed in some stuff but not item stacks basics

vast sapphire
#

Well that doesn't work

grim ice
#

It does?

#

show ur code

#

isnt it

vast sapphire
#
    @EventHandler
    public void joinEvent(PlayerJoinEvent e) {
        wait(1000);
        onEnable();
        ItemStack item = new ItemStack(Material.WOOD_SWORD);
        if (!e.getPlayer().hasPlayedBefore()) {
            e.getPlayer().getInventory().addItem();
        }
    }```
grim ice
#

ItemStack item = new ItemStack(Material.WOODEN_SWORD);

vast sapphire
#

no it's wood_sword

grim ice
#

why wait(1000)

tardy delta
#

:/

grim ice
#

AND WHY DONT U ADD THE ITEM

vast sapphire
#

so the client has 1 second to load in

grim ice
#

U DIDNT EVEN GIVE HIM THE ITEM

#

U DIDNT EVEN GIVE HIM THE ITEM
U DIDNT EVEN GIVE HIM THE ITEM
U DIDNT EVEN GIVE HIM THE ITEM

vast sapphire
#

I haven't made it yet

grim ice
#

THEN OFC IT DOENST WORK

#

bruh

vast sapphire
#

no

tardy delta
#

why calling onEnable

vast sapphire
#

i'm getting an error

grim ice
#

bro

vast sapphire
grim ice
#

do u know wahat r u doing

vast sapphire
#

yes

lost matrix
vast sapphire
#

I know how to make an itemstack

grim ice
#

why do u have onEnable

#

there

vast sapphire
#

I forget

grim ice
#

ALSO

#

wait(1000) will stop the whole server

lost matrix
vast sapphire
lost matrix
silver shuttle
lost matrix
grim ice
#
   @EventHandler
    public void onJoin(PlayerJoinEvent e) {
        Bukkit.getScheduler.runTaskLater(plugin, () -> {

        ItemStack item = new ItemStack(Material.WOOD_SWORD);
        if (e.getPlayer().hasPlayedBefore()) return;
            e.getPlayer().getInventory().addItem();
                   
            }, 20L);
    }```
#

the brackets

silver shuttle
grim ice
#

r fucked up

#

u fix them im not using an ide

lost matrix
vast sapphire
silver shuttle
#

no, how would I do that?

grim ice
#

why ru using nms