#help-development

1 messages · Page 1375 of 1

solemn shoal
#

who tf uses ::

quaint mantle
#

me?

hybrid spoke
quaint mantle
#

proper

solemn shoal
#

ugly C style namespacing

quaint mantle
#

formatting

dusty herald
#

C isn't ugly sadge quit being a bully 😭

quaint mantle
#
void a(ReturnType myVar) {
    MyObj obj = myVar.getMyObj();
    obj.doSomething("With an argument");
}
solemn shoal
#

intellij autoformatting ^

quaint mantle
#

you have to realize

#

it only formats

#

not fixes your code

solemn shoal
#

then again im a C# dev so uh

#

yeah

dusty herald
#

I should find a way to get intellij to auto format each save

young knoll
#

Are you telling me it won’t automatically add early returns

quaint mantle
#

i wish

young knoll
#

Worst program 0/10

quaint mantle
#

@stoic elk still confused?

young knoll
#

Visual Studio does offer a lot of reformatting options actually

dusty herald
young knoll
#

Net beans did too from what I remember

stoic elk
#

what is the thing to send message to player again

#

i think i got something

dusty herald
#

I enjoyed using NetBeans

young knoll
#

sendMessage

quaint mantle
#

player.sendMessage("msg");

stoic elk
quaint mantle
#

sigh

drowsy helm
#

p

stoic elk
#

bruh im trying my best here

dusty herald
#

You can't pull an event variable out of your ass either

solemn shoal
#

p.sendMessage()

drowsy helm
#

you are reference the variable typ

#

e

#

not the variable

young knoll
#

Also one letter variables

#

No

solemn shoal
#

one letter variables

#

im king at that

quaint mantle
stoic elk
quaint mantle
#

dont say that

#

hes trying

drowsy helm
#

yeah that really isnt necessary man

#

everyone starts somewhere

dusty herald
#

bully !!!!!

stoic elk
#

ive been working on this for like 1 hour my guy

dusty herald
patent ice
#

kidding

solemn shoal
#

one letter variables you said?

young knoll
#

One letter variables are great for saving precious bytes in networking data

quaint mantle
#

jeez

drowsy helm
stoic elk
#

what does this mean

#

illegal start of expression

dusty herald
patent ice
#

Caps sensitive?

dusty herald
#

There cannot be a space between MyMethod and ()

young knoll
#

Also there is this magical exception

#

Called ReflectiveOperationException

solemn shoal
#

intellij doesnt care so

#

eh

solemn shoal
quaint mantle
dusty herald
#

intellij usually warns you about the Catch when they can be compressed into one

quaint mantle
#

@stoic elk

stoic elk
#

uhhh

#

bruh ima be dead serious i got no idea

solemn shoal
quaint mantle
#

naming conv

solemn shoal
#

more short variables

stoic elk
#

arg would be the variable right

quaint mantle
#

right

#

but we want an event

#

so put an event as the argument

#

remember, (ReturnType variable)

drowsy helm
#

arg is a parameter, so yes a variable

young knoll
#

The internet is an amazing place

stoic elk
#

uhhh

quaint mantle
stoic elk
#

how

#

bruh i cant do this lmfao

quaint mantle
#

i gave plenty examples

young knoll
quaint mantle
#

Should the MySQL connection be run in an new thread ? I'm not sure if I keep it this way that it will cause server freezes.

drowsy helm
quaint mantle
#

Okay thanks 🙂

young knoll
#

You should use bukkit runnables over a thread

stoic elk
#

dude i dont know where to put what

quaint mantle
#

^ I actually never used those. Mostly used java schedulers etc

drowsy helm
#

bukkit runnables and java runnables are pretty much indentical, just has more bukkit related methods in it lol

quaint mantle
#

Ah then I keep it just the way I do things :p

quaint mantle
#

then you can get the player or whatever

stoic elk
#

the parameter would be?

#

like

#

void b

#

?

quaint mantle
#

no

#

like PlayerInteractEvent

#

would be the type

#

then event as the name

#

void myFunc(PlayerInteractEvent event) {

}

#

then you need to set up this class for listening to events

stoic elk
quaint mantle
stoic elk
young knoll
#

I have several questions

quaint mantle
#

Is PlayerNameEvent even an event ?

young knoll
#

No

stoic elk
#

idk

quaint mantle
#

i want to teach you

stoic elk
#

bruh im trying

quaint mantle
#

but i want you to learn

#

lets make a deal

#

righr

stoic elk
#

sure

quaint mantle
#

i will give you the code

#

BUT

#

you will watch that entire java course

final fog
#

You are missing @brave glenHandler btw @stoic elk

stoic elk
#

when I have some free time I will

#

after i get this working im going to bed

#

its 12:30

quaint mantle
#

And did you implement listener?

quaint mantle
quaint mantle
stoic elk
#

ohh wait

#

i had that before

final fog
#

It’s just something he has to add

quaint mantle
#

its not your vurrent issue

final fog
#

Above the method

stoic elk
#

idk what the fuck it does but i had it

final fog
#

(The public void)

stoic elk
#

o

quaint mantle
#

stop adding me lol

stoic elk
#

aw

#

let me save that video

final fog
#

I kind of wish I had an actual person teach me java tbh

#

Would’ve gone a lot faster

stoic elk
#

ok i saved it

young knoll
#

I mean the internet has tutorial videos

#

By actual people

quaint mantle
#

and they dont really teach

final fog
#

I’m talking about personally

stoic elk
#

is a class worth taking on it

final fog
#

People who actually talk to me

final fog
stoic elk
#

bruh im not learning jack tbh

final fog
#

Don’t bother spending money or anything like that

stoic elk
#

i learn more by reading over existing code and by hearing other people talk about it

quaint mantle
#
public class BlockBreakListener implements Listener {
    @EventHandler
    public void onBlockBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        player.sendMessage("Hello");
    }
}

@Oute#5707 promise me you will learn java before coming back asking a syntax question

#

@stoic elk

stoic elk
#

i will try

#

ill watch that video but

drowsy helm
#

watch some basic youtube tutorials

#

they are great

stoic elk
#

i have rly bad adhd and cant pay attention to that shit

young knoll
stoic elk
#

ill try lmfao

#

either im fucking stupid or

final fog
quaint mantle
stoic elk
#

im probably fucking stupid

quaint mantle
#

wtf

final fog
#

Lol

quaint mantle
#

where did you get that code

final fog
#

That’s funny

stoic elk
#

?

quaint mantle
#

you just pulled code out of your ass

stoic elk
#

wdym

quaint mantle
#

he really did it

#

i didnt believe in him

stoic elk
#

what did i do

quaint mantle
#

you made the code work without my code

#

where did you get that lol

stoic elk
#

im so confused

quaint mantle
#

Why is that class on the If 🙃

final fog
#

Where did you get the top part

stoic elk
#

thats the diamond ore thing from before

quaint mantle
#

DUDE

#

WHY ARE YOU ASKING. for help

#

that code works perfectly

#

wtf dude

stoic elk
#

because i dont know how to send a fucking message

#

this is all i ask -_-

quaint mantle
#

event.getPlayer().sendMessage("arg");

#

jeez luis.

haughty haven
#

i'm losing my mind ffuuuuc haha

stoic elk
quaint mantle
#

enough discord for today

quaint mantle
stoic elk
#

im braindead im sorry

haughty haven
#

I have an event where if a player drinks a potion, they get "potion effects" which works all fine and dandy. But I also want to implement another feature where the player will get knockback resistance 100 when they drink it, then have a scheduler which sets the player's knockback resistance back to 0 when it the timer ends

#

i don't understand

stoic elk
#

finally

#

holy shit

final fog
#

Good job

patent ice
#

Noice

dusty herald
#

Congratulations @stoic elk :D

young knoll
#

Aka dependency injection

olive lance
dusty herald
#

Might want to reformat the code with intellij though oute

stoic elk
#

i honestly dont know

#

its been a rough night

quaint mantle
minor vapor
#

my head

#

hurts

quaint mantle
#

he was making another method inside his if statement

olive lance
#

Oh so he just had an extra brace and tried fixing it by pasting a listener class inside his method inside his listener class

stoic elk
#

i have succeeded

minor vapor
# stoic elk

if you were able to do this, how couldn't you send a message...?

haughty haven
quaint mantle
#

UHCum

haughty haven
#

yes

olive lance
#

Nice plugin

stoic elk
#

i followed a tutorial for most of the first part to try to learn basic stuff

olive lance
#

Does it spawn particles

haughty haven
#

thanks, I still don't know why it works

quaint mantle
#

import it

stoic elk
#

i did do some stuff on my own tho not alot but

minor vapor
stoic elk
#

probably a good idea

#

im going to bed

#

im sorry for being a dumbass

haughty haven
#

like it's greyed out, the rest of the imports have colours

stoic elk
#

@quaint mantle thank you lol

young knoll
#

I assume it’s because you haven’t used it

#

new ClassName(this);

#

Assuming you have the constructor setup to take an argument

olive lance
#

Public UhCumEvents(Plugin plugin){}

dusty herald
#

public*

young knoll
#

You’ll want some code in that constructor to set an instance variable

#

But yes

olive lance
#

Yes I’m on iOS mobile

#

Auto capitalization on everything

summer scroll
olive lance
#

Just mark over it in blue

#

Then they all have colors

young knoll
#

Most LCD screens don’t support ink based input

haughty haven
dusty herald
#

I dislike how Intellij markes events as being unused

summer scroll
olive lance
dusty herald
#

what kind of class name is that btw

haughty haven
#

lol shit what's that?

summer scroll
#

Lmao, the message haha.

#

"Get ready to CUM"

haughty haven
#

lol that was temporary

#

not supposed to be there was just testing messages

dusty herald
#

although if you're not dependency injecting you don't need a constructor to call the class, just (new ClassName(), this)

olive lance
#

If you don’t know what a constructor is u should learn that

summer scroll
#

he needs DI for creating a runnable.

olive lance
#

Not that I’m one to speak I did the same thing lol

dusty herald
dusty herald
#

they named their main class Main KEKW

summer scroll
#

first reply is a staff tells to avoid naming main class as Main xd

dusty herald
#

pff

olive lance
#

Anybody ever made a roblox game that made money

#

Bet some of them take in serious cash

#

At no cost other than development

drowsy helm
#

I used to make em ages ago but never made anything lol

young knoll
#

Screams in 1-indexed arrays

drowsy helm
#

man lua hold your hands so much lmao

young knoll
#

Hmm?

#

I don’t recall any handholding

drowsy helm
#

using bungee api?

woven coral
#

in the called class

dusty herald
#

and yes they are being registered

fickle helm
#

I'm trying to figure out if there's any event thrown when a baby hoglin ages into an adult hoglin. From what I can tell there is no event.

sullen marlin
#

Marking public methods as unused is a stupid default

summer scroll
#

Looking at that gray colored method

dusty herald
#

There is probably some way to disable it in intellij's configuration, I'll have a look later c:

silent vigil
#

How would I make a cooldown for lets say interacting with something?

fickle helm
# silent vigil How would I make a cooldown for lets say interacting with something?

Here you can see how we did that with this listener. When you attack a mob it shows you debug info. When the event fires it adds the player's UUID to an array, then starts a BukkitRunnable with a 40 tick delay which will then remove that UUID from the array. If the event fires and the UUID is present in the array, the function is exited
https://github.com/lokka30/LevelledMobs/blob/master/src/main/java/me/lokka30/levelledmobs/listeners/EntityDamageDebugListener.java

silent vigil
#

ty

#

@fickle helm delay.add(player.getUniqueId()); new BukkitRunnable() { public void run() { delay.remove(player.getUniqueId()); } }.runTaskLater(plugin, 80);
would that work?

#

(I have nothing in my main method idk if that has anything to do with it)

fickle helm
#

I think so. Looks like how we have it setup

silent vigil
#

ok copy

#

ill try

torn oyster
#

hey guys

#

does inventories

#

or playerinventories

#

have the items in them?

#

cuz im making a staffmode plugin

#

where they can switch between their staffmode inventory and their in-game inventory

gleaming grove
#

hello

#

can someone exmplain me how to include external library to my plugin ?

#

java.lang.NoClassDefFoundError: org/java_websocket/server/WebSocketServer at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] at java.lang.ClassLoader.defineClass(ClassLoader.java:1016) ~[?:?] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) ~[?:?] at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:163)

chrome beacon
#

Are you using maven or gradle?

gleaming grove
#

maven

#

i should rather ask how to compile my plugin with external library

eternal oxide
#

set the dependency to compile rather than provided in your pom

gleaming grove
#

it is set to compile

eternal oxide
#

then it shoudl be auto shaded. no shade plugin needed. its auto

chrome beacon
#

Read through that guide and setuo the maven shade plugin

gleaming grove
#

@chrome beacon ok thx

eternal oxide
#

InteliJ or Eclipse?

gleaming grove
#

InteliJ

chrome beacon
#

I've always needed the shade plugin

eternal oxide
#

I can;t say on Intelij. in Eclipse you don;t need the shade plugin defined in your pom, its auto included with defaults

chrome beacon
#

It's smart to relocate shaded things anyway so might as well use the plugin

eternal oxide
#

relocation is really complex though as the references are not updated in yrou source when teh lib is shaded/relocated

#

@gleaming grove what lib are you wantign to shade?

gleaming grove
#

<dependency> <groupId>org.java-websocket</groupId> <artifactId>Java-WebSocket</artifactId> <version>1.5.1</version> <scope>compile</scope> </dependency>

torn oyster
#

hey guys
does inventories
or playerinventories
have the items in them?
cuz im making a staffmode plugin
where they can switch between their staffmode inventory and their in-game inventory

chrome beacon
#

Yes they have items they are inventories?

torn oyster
#

okay

#

i thought it was just the inventory object

#

like size

#

not contents

#

but ty :P

gleaming grove
#

@torn oyster for(int i=0;i<player.getInventory().getSize();i++) { ItemStack itemStack = player.getInventory().getItem(i); }

torn oyster
#

what

gleaming grove
#
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <relocations>
                                <relocation>
                                    <pattern>org.java-websocket</pattern>
                                    <shadedPattern>org.shade.java-websocket</shadedPattern>
                                </relocation>
                            </relocations>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>````
#

still dont work, what I'm doing wrong ?

quaint mantle
#

hi i have a problem i wanna create a tablist but there's no method like IChatBaseComponent or CraftPlayer or anything on 1.12.2 spigot.

gleaming grove
#

import your spigot.jar file to your project

dusty herald
queen dragonBOT
dusty herald
#

?bt

silent vigil
#
    public static void onBlockBreak(BlockBreakEvent event){
            Player player = event.getPlayer();
            if(player.getItemInHand().getItemMeta() == null){
                return;
            }else{
                String mainhand = player.getItemInHand().getItemMeta().getDisplayName();
                if(mainhand.equals(ChatColor.GOLD + "Excavator")){

                    Location loc = event.getPlayer().getLocation();
                    World w = player.getWorld();
                    w.createExplosion(loc, 2, false);
                }else{
                    return;
                }
            }
    }``` anyone have any idea why it doesnt explode?
eternal oxide
#

debug - sysout

#

see where it stops

silent vigil
#

copy

eternal oxide
#

I'm betting it fails on yoru mainhand.equals test

gleaming grove
#

have you include @EventHandler above method?

quaint mantle
#

i just use maven jar spigot and idk fixed it

#

how do i add placeholderapi to maven?

#

it says it didnt found

drowsy helm
quaint mantle
#

it doesnt work for me

drowsy helm
#

are you using the right version

quaint mantle
#

yes i am

drowsy helm
#

interesting

#

your spigot dependency is working correctly, right?

quaint mantle
#

yes too

#

used by this

eternal oxide
#

inteliJ or Eclipse?

quaint mantle
#

intelij

eternal oxide
#

are you just nto seeing PlaceholderAPI in your IDE or not workgin when exporting?

quaint mantle
#

in ide

#

it just says this

eternal oxide
#

when you export are you using Artifacts or lifecycle?

quaint mantle
#

artifacts

eternal oxide
#

thats wrong. You probably also manually imported spigot

quaint mantle
#

no i did it with maven

quaint mantle
eternal oxide
#

you are not using Maven in yrou enviroment so your pom is doing nothing

quaint mantle
#

i do use it

eternal oxide
#

If you are using artifacts you are not

#

show me a SS of your projects dependency libraries

quaint mantle
#

but like then spigot wouldnt export?

eternal oxide
#

expand external libraries

quaint mantle
drowsy helm
#

how do you code with lightmode lmao

quaint mantle
#

its cool xd

#

i use it on discord too

eternal oxide
#

You have two issues...

#
  1. your are exportign incorrectly, Right hand side expand the Maven tab and use package in the lifecycles section.
#
  1. You need to clean/refresh yrou project to include yoru maven pom changes
quaint mantle
#

wait where is right hand sid emaven?

#

where do i do that?

#

im new to intellij

eternal oxide
#

main screen, very right hand side is a bar with a Maven symbol

quaint mantle
#

this?

eternal oxide
#

yes

quaint mantle
#

okay

eternal oxide
#

open that, expand the lifecycle section and run a clean

quaint mantle
#

omg it works?

eternal oxide
#

to export yoru jar properly you run package adn yoru new jar will be in a target folder

quaint mantle
#

okay

#

ty sooo much

graceful turret
#

guys any ideas how to make /reply command?

quaint mantle
#

do you do /msg?

drowsy helm
#

cache the last player that sent the player a message

#

then reply

quaint mantle
#

yeah same idea

#

ig u could use hashmap<string, string> first string is the playername and the other is the other players name

eternal oxide
#

use UUID not names

drowsy helm
#

dont use names

#

ew

#

just use two uuids

graceful turret
#

where

quaint mantle
#

in hashmap

graceful turret
#

hashMap

#

really

quaint mantle
#

yes

graceful turret
#

public static hashmap will blow my plugin

#

so lmao

quaint mantle
#

dont do static

#

and how it would blow

#

i mean you can use hashmap because its the most easiest way, but if you want you can use something else

drowsy helm
#

actually in this usecase static wouldnt be bad

graceful turret
#

because of using public static maps

#

etc

drowsy helm
#

just have a messagemangaer class which has a hashmap which is a cache of last message sender

graceful turret
#

it's a

#

emmm

drowsy helm
#

one map wont do anything

graceful turret
#

i doon't know how can i say that in english xD

drowsy helm
#

plus its pretty much your only opton

#

unless you want to write to config or smth

graceful turret
drowsy helm
#

a hash map with uuids wont cause mem leaks

#

using players in the hashmap may though

graceful turret
#

uuids?

#

in hash map

#

wtf

drowsy helm
#

yeah

#

using Player in hashmap[ causes mem leaks

graceful turret
#

and geetting it with Bukkit.getPlayer?

drowsy helm
#

yep

eternal oxide
#

Player#getUniqueId()

#

Never store players. the objects are not persistent.

gleaming grove
#

@graceful turret Moge ci pomóc na priv

drowsy helm
#
private static HashMap<UUID, UUID> playerMessageCache = new HashMap<>();

public void sendMessage(Player sender, Player recipient){
  playerMessageCache.put(recipient.getUniqueId(), sender.getUniqueId());
}

public Player getReplyRecipient(Player sender){
  return Bukkit.getPlayer(playerMessageCache.get(sender.getUniqueId()));
}

#

done done

graceful turret
#

is that 'java.util.uuid'?

eternal oxide
#

yes

drowsy helm
#

have you never used uuids before?

rotund ravine
#

Liskovs substitution principle tho

graceful turret
#

but

#

i had small mide fuck

drowsy helm
#

lmao

graceful turret
#

with java util

#

not bukkit etc

#

xDD

#

?paste

queen dragonBOT
graceful turret
eternal oxide
#

are you registerign msg and reply to teh same command executor?

unreal kayak
#

what is the async event where I can get the session and do http request to Mojang with it (for cracked servers)?

drowsy helm
#

looks good to me

#

why you have to iterate over each player

#

Bukkit.getPlayer(args[0])

#

then check if not nul

unreal kayak
eternal oxide
#

then you are on an old version

unreal kayak
#

Old version of what?

#

Docs?

eternal oxide
#

spigot

unreal kayak
#

Since when the methods were added?

#

1.8?

eternal oxide
#

much newer

unreal kayak
#

1.9?

#

Just what version?

#

I want them to work on 1.8 or i wont code the plugin

eternal oxide
#

That method is not in 1.8

quiet ice
#

You might be able to do it with some reflection magic

eternal oxide
unreal kayak
#

I just gonna tell what i wanna code

#

A plugin that sort premium and cracked players

#

Every cracked player given random uuid

#

Premium gets his actual uuid on mojang

#

And cracked has to login and register

#

To know if user is premium

#

I need to make a request to mojang session servers

eternal oxide
#

There is almost guaranteed to be a plugin that already does that

unreal kayak
#

Whatever gonna make my own for my server

zinc kayak
#
@client.command(aliases=['c'])
@commands.has_permissions(manage_messages = True)
async def clear(ctx, amount=100):
    await ctx.channel.purge(limit=amount)
    await ctx.send(f'Deleted {amount} Message(s)!')

You guys know wich code i've to add so the bot waits 3 sec and then delete his own message ?

zinc kayak
#

yess

fathom timber
#

You'd probably have to make a string or something then call a wait value then remove that string

#

Idk how python works so I can't help you there

#

You should look at open source code by other devs or just Google it

zinc kayak
#

alright thx

fathom timber
#

Np

green prism
#

Guys, i've a question, how can i make the item named "&dHello" with the texture hello.png (For example)?

fathom timber
#

You'd need a resource pack @green prism

#

You're just making an item by either an event or command so if an event OnPlayerJoin or something you'd need to use the Item class and generate it, set it to the position and item.Meta("&dHello");
item.Enchanted(true);

#

Search up some documentation

green prism
fathom timber
#

How tf do I delete embeds on phone

#

Send help

#

@green prism ^

green prism
#

not for custom resourcepack

quiet ice
#

TechnoVision should be avoided in my honest opinion

green prism
quiet ice
#

Also one way to avoid embeds is to make them code; like this: https://www.youtube.com/watch?v=dQw4w9WgXcQ

green prism
quiet ice
#

what else would I have used?

#

I cannot promote shitty YTers

green prism
#

Come on gentlemen, a little help please, I need a custom texture attributed to something, not custom enchantment (Stick texture = "stick.png" Stick named hello = "hello.png")

quiet ice
#

You'd need to sacrifice a block state iirc

#

Though idk how that works for items

fathom timber
#

Thats what I was stating :/

#

Youd need to set it through the server

#

And then the item should be it

quiet ice
#

I never worked with custom textures though, so I cannot say how exactly that works, except that you need to use resource packs

fathom timber
#

So like a barrier block could be replaced as Hello.png

cold tusk
#

Hello, if I use Bukkit.spigot().restart();, the server only stops.

quiet ice
#

Or you could use the 2000 blockstates mushrooms introduce

green prism
#

Okay, now thanks to the dearest gentleman whose name I can't remember, how do I set it up via server?

quiet ice
#

Send a resource pack?

green prism
quiet ice
thorn beacon
#

How would I get around the "Unsupported API version 1.16" to allow the plugin to support multiple older versions?

sullen marlin
#

You have to write for the oldest version

thorn beacon
#

ah.. Great

green prism
quiet ice
#

You cannot do that without a resource pack

#

If you think that you can do that then you should not ask me about how to do that since I will say "no, you cannot do that that way"

green prism
haughty haven
#

how do i inject this into the main plugin? I'm quite a big newbie

quiet ice
#

I HAVE NEVER DONE IT. I cannot really help you on this since I have never messed with resourcepacks nor with custom model data

green prism
quiet ice
#

You can pass the plugin instance across classes by using the constructor; so instead of doing new MyClass() you'd do new MyClass(this) in you onEnable

green prism
quiet ice
#

I know that, I have worked with java long enough to know how it works

ivory sleet
haughty haven
#

this is my main java file if it helps

green prism
haughty haven
#

like at this point I'm willing to just send the whole file over if I need to

green prism
ivory sleet
#

you're not even doing any dependency injection at the moment

#

ideally you'd pass your main instance through the other class constructors

green prism
#

Yes, u need a constructor

ivory sleet
green prism
#

like

private final Main plugin;

public Class(final Main plugin) { this.plugin = plugin; }

haughty haven
#

I've done that now, but now I have another problem and it didn't fix it D:

ivory sleet
#

click the problem

#

and see where it takes you

haughty haven
ivory sleet
#

pass this

haughty haven
#

this problem right here ^^ is in my main java

#

thing

ivory sleet
#

Okay

#

firstly

ivory sleet
#

but rather UHCum

#

since that's your main class

#

(the one that extends JavaPlugin for you)

haughty haven
hardy valley
ivory sleet
#

so

private final UHCum plugin;

public UHCumEvents(UHCum plugin) {
  this.plugin = plugin;
}

//then in main

...registerEvents(new UHCumEvents(this), this);
ivory sleet
#

ofc there isnt or am I missing smtng?

quiet ice
#

The EventHandler annotation is irrelevant here

olive badger
#

Hello,
I currently rework my project with maven in multi project (one for each platform).

But i have some issue i want to fix :

  • i want disable common and parent build
  • find an way to have common shade but the specific relocation for bungee (adventure implementation)
  • bonus: centralize final jar inside same folder at root

This is my repo : https://github.com/orblazer/maven-bug
Thanks by advance for your help

ivory sleet
#

uh I mean gradle :>>>

quiet ice
#

In this case, the bonus would be something like


    <build>
        <defaultGoal>clean package</defaultGoal>
        <directory>../target</directory> <!-- Build it one level up, because it is the one we care about -->
        <finalName>Zenchantments</finalName>
        <!-- etc ... -->
    </build>
olive badger
quiet ice
#

You can also re-declare dependencies with the compile scope to shade them

ivory sleet
#

Oh well I could make a pr for u or smtng in gradle if you’re interested

quiet ice
#

I. e. in the non-final artifacts the dependencies are all provided and only outside of that they are compile or other scopes

bold parcel
quiet ice
olive badger
ivory sleet
#

🍉

haughty haven
#

I'll definitely look at more tutorials and javascript introduction videos to expand my knowledge further more before diving deeper, but it is a lot more reassuring to know that the code is finally fixed

#

thank you savior

fading lake
#

UHCum, interesting class name

haughty haven
#

yea

#

it was a massive meme at first

#

but now I just stuck with it

fading lake
#

Just refactor it if you wanna change it lol

haughty haven
#

nah I'm good, I have a ton of other plugins on my server and they all use uhcum so

#

too late

elfin minnow
#

Is there a way that you can change durability of any item?

#

Like a player head for example

fading lake
#

Depends your spigot vers

elfin minnow
#

1.16.5

fading lake
#

If its Danageable yes, otherwise ni

#

damageable*

elfin minnow
#

oh well it was worth a go

fading lake
#

are you trying to set a player head to a skull?

#

if so cast the skulls itemmeta to SkullMeta and use setOwner

haughty haven
#

also is there still a way to have custom colors onto potions?

fading lake
#

@elfin minnow

haughty haven
#

sorry for bulging in

elfin minnow
fading lake
#

@haughty haven not without throwing a resource pack at the player

haughty haven
#

yeah I thought so

fading lake
#

shut up automoderator

#

@elfin minnow wym

haughty haven
#

I already have a resource pack which works with optifine to change the texture of drinkable potions (can't get it to work on splash potions tho :()

elfin minnow
#

I am using this to get the player head

fading lake
#

since when is it deprecated?

eternal oxide
#

Skull

elfin minnow
#

then i give it attributes, dont look at the numbering

fading lake
#

wait it has its own class now?

elfin minnow
#

I'm not sure I've only ever done this in 1.16.5

fading lake
#

was directed at elgar lol

elfin minnow
#

oh

urban trout
#

hey, my registerNewObjective line is underlined in red? what did i do wrong?

eternal oxide
#

it means stop copy pasting code and use your IDE and javadocs to show you teh valid options

quiet ice
#

You are using + instead of ,

urban trout
quiet ice
#

And?

urban trout
#

it works

#

ty

timid sun
#

How can I do a block that replant seeds above him when the wheat is broken?

ornate hollow
#

I am speechless

#

When a baby zombie zombiefies a villager and then you cure it they lose the trades

#

i cant get it

eternal oxide
timid sun
#

A lot of plugins replant any broken wheat but I want that it replants only a block that the player can buy in shop

eternal oxide
#

You can;t do a specifc block to do that without trackgin those blocks in a db or PDC

quiet ice
#

PDC is not really recommended, especially with bigger volumes

timid sun
#

How do I track a block?

eternal oxide
#

a database or the chunk PDC

quiet ice
#

Basically store it's location somewhere

ornate hollow
timid sun
#

Do you have a tutorial?

#

I'm not the best with plugins

quiet ice
#

SQLite is also a good compromise between setting up for user and speed

ornate hollow
#

Well you dont have to be good at plugins you need to be good with java tbh

eternal oxide
#

just use the Chunk PDC. no database to deal with

earnest junco
urban trout
timid sun
#

I think I need a tutorial

earnest junco
urban trout
quiet ice
#

it does not have the API-version set

urban trout
#

apparently it doesnt contain my plugin yml

eternal oxide
#

Your JAR doesn;t contain your yml

ornate hollow
# timid sun I think I need a tutorial

Find your connector on maven and add it to your project

try{  
Connection con=DriverManager.getConnection(  
"jdbc:mysql://localhost:3306/sonoo","root","root");  
//here sonoo is database name, root is username and password  
Statement stmt=con.createStatement();  
ResultSet rs=stmt.executeQuery("select * from emp");  
while(rs.next())  
System.out.println(rs.getInt(1)+"  "+rs.getString(2)+"  "+rs.getString(3));
rs.close();  
con.close();  
}catch(Exception e){ System.out.println(e);}  
}  

this is just an example select statemnet
This is just an example on how

quiet ice
#

That is an issue with your build system, not exactly your plugin.yml

ornate hollow
#

This example doesnt represent a good way to store passwords ether

urban trout
#

nvm i got it

#

ty

ornate hollow
#

use hash for that

timid sun
#

uuuuuuuuuuuuuuuuuuh...

#

Is there an easier way?

earnest junco
timid sun
#

With armorstands maybe?

eternal oxide
#

There is an easier way, as I said, Use the Chunk PDC

ornate hollow
#

Well i dont recommend anything else then a good old database

quiet ice
earnest junco
eternal oxide
timid sun
#

Idk how to do that

eternal oxide
#

It saves and loads with the chunk

#

search Persistent Data Container.

#

all entites and every chunk has one

timid sun
#

Look I'm a begginer with plugins...

quiet ice
#

Question is whether it can store that much data

timid sun
#

...so can someone do it for me ?

eternal oxide
#

Of course it can, you are only storing block locations

timid sun
#

auto replant wheat above a certain block

#

just that

quiet ice
#

Just use a god damn hashmap that you serialise on shutdown and deserialise on startup

eternal oxide
#

Yes, but you need to know what you "special" block is

timid sun
#

(If someone know how to do it send me the code)

eternal oxide
#

We don;t write code for you

timid sun
#

Ok

earnest junco
timid sun
#

No a special block like with a special name

quiet ice
#
private static final HashSet<Location> SPECIAL_BLOCKS = new HashSet<>();

here, this is your database

eternal oxide
#

If you want a "special" block with its own name then you have to use datapacks

timid sun
#

okkkkkkkkkkk

eternal oxide
quiet ice
#

That is pretty easy

#

Of course a bit hard to do it safely, but still doable

timid sun
#

(How do I do a datapack heeeeeeeeeeeeeeeelp)

eternal oxide
#

throwing it on the PDC its all done for him

timid sun
#

How do I use** PDC**?

quiet ice
#

?jd

earnest junco
#

At this point we're gonna end up with the question "how to install eclipse"

timid sun
#

no

#

😄

quiet ice
timid sun
#

I've made some plugins already but never with special blocks

#

Soooo I'm kinda lost 🙂

gleaming grove
#

Is there some JavaScript programmer that can exmplain why when i send ByteArray from WebSocket client i got empty array on WebSocket server ?

olive badger
ivory sleet
#

Why annotationProcessor

#

Pls don’t tell me ur Lomboky

#

Anyways add as compileOnly as well

rapid roost
#

btw how do you imbed lines of code here?

ivory sleet
#

```java
//todo

#

Or upload a file with the file extension java

#

? Or this

ornate heart
ivory sleet
#

?paste

queen dragonBOT
ivory sleet
#

It’s useless arguably

ornate heart
#

I like the getters and setters only. It’s just less work to type

ivory sleet
#

To put it clearly Lombok doesn’t in fact provide any meaningful value

#

Well IDEs exist for a reason nevertheless

rapid roost
#

java //something

quiet ice
#

Yeah, IDEs can automatically generate those methods

#

Hell, even eclipse does that

ivory sleet
#

And they can also hide it such that it doesn’t get too verbose

ornate heart
#

Yea I realized that IntelliJ could do that after I started using Lombok

rapid roost
#

,, //something ,,

#

wait how do you imbed code?

quiet ice
#

```java
<code>
```

rapid roost
#
//something
quaint mantle
#

hello, i'm setting entityzombie(NMS)'s equip. but i have problem with Imaterial. how to use it?

rapid roost
#

oooohhhhh

quaint mantle
#

zombieAI.setEquipment(EnumItemSlot.LEGS, new ItemStack((IMaterial) Material.AIR);

#

it doesn't work

rapid roost
#
//code
#

ok

quaint mantle
#

so my question is, how to use Imaterial?

#

ok

ivory sleet
#

IMaterial is an nms interface?

rapid roost
#

i understand now

fading lake
#

IMaterial and Material are not the same thing

#

afaik

ivory sleet
#

Yup

quaint mantle
#

zombieAI.setEquipment(EnumItemSlot.LEGS, new ItemStack(Imaterial...) //How to use it;

ivory sleet
#

iirc you’d have to use the material registry if you wanna create an nms stack or maybe I’m wrong here but coming from the modding side you’d have to at least. Have you googled?

rapid roost
#

btw how do you reference this line of code

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

}
ivory sleet
#

Reference?

quaint mantle
rapid roost
#

like this ``` public static void init() {
createTnt();
}

private static void createTnt() {
    // something
    }
    ```
ivory sleet
#

I mean it’s referenced now? Or you’re invoking that createTnt method in init

rapid roost
#

and so to reference this we can do this

item = Createtnt.createtnt;
quaint mantle
#

uh what does mean? referenced

#

ZombieAI zombieAI = new ZombieAI(event.getEntity().getLocation()); if I understood correct

quaint mantle
#
        super(EntityTypes.ZOMBIE, ((CraftWorld) location.getWorld()).getHandle());
        this.setPosition(location.getX(), location.getY(), location.getZ());
    }```
ivory sleet
#

That would create and put ur zombie into the world

quaint mantle
#

yupp

#

so how can I make equip?

ivory sleet
#

Btw why not use the api?

#

this.getBukkitEntity().getEquipment() and so on

quaint mantle
#

uh getBukkitEntity()#getEquipment() isn't exists

ivory sleet
#

What nms version

quaint mantle
#

v1_15_R1

ivory sleet
#

Then it should work

#

Entity#getBukkitEntity presumably?

quaint mantle
#

ZombieAI zombieAI = new ZombieAI(event.getEntity().getLocation()); // (NMS EntityZombie)

#

😦

gleaming grove
#
        super(EntityTypes.ZOMBIE, ((CraftWorld) location.getWorld()).getHandle());
        this.setPosition(location.getX(), location.getY(), location.getZ());
        this.getEquipment().setHelmet(new ItemStack(Material.DIAMOND_HELMET,1));
    } ```
#

try like this

#

or zombieAI.getEquipment().setHelmet(new ItemStack(Material.DIAMOND_HELMET,1));

ivory sleet
#

Oh yeah you might have to cast to living entity

rapid roost
#

so this is a way to reference code

public class CreateTntWand {

    public static ItemStack wand;

    public static void init() {
        createTnt();
    }

    private static void createTnt() {
        ItemStack item = new ItemStack(Material.STICK, 1);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName("§6Tnt Stick");
        List<String> lore = new ArrayList<>();
        lore.add("§7The Staff of Gods");
        meta.setLore(lore);
        meta.addEnchant(Enchantment.KNOCKBACK, 5, false);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        item.setItemMeta(meta);
        wand = item;
    }
    
}

and to reference it in another class is this

if (cmd.getName().equalsIgnoreCase("givetntwand")) {
            player.getInventory().addItem(CreateTntWand.wand);
        }
ivory sleet
#

Ye I guess?

quaint mantle
rapid roost
#

so is there a way to reference this

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

}
ivory sleet
#

Toto

quaint mantle
ivory sleet
#

Cast to LivingEntoty

quaint mantle
#

okay

rapid roost
ivory sleet
#

LivingEntity bukkitEnt = (LivingEntity) getBukkitEntity();
bukkitEnt.getEquipment()

#

Etc

quaint mantle
lunar folio
quaint mantle
#

oh ok

ivory sleet
#

Yeah use the Bukkit representation

quaint mantle
#
            e.getEquipment().setHelmet(new ItemStack(Material.AIR));```
#

thanks but still error on Material.AIR

rapid roost
gleaming grove
#

you cant put air

lunar folio
gleaming grove
#

set setHelmet(null)

quaint mantle
#

I won't put air 😉

ivory sleet
quaint mantle
#

OHHH Thanks

#

it works

#

e.getEquipment().setHelmet(new org.bukkit.inventory.ItemStack(org.bukkit.Material.BAMBOO_SAPLING));

ivory sleet
#

Nice

#

Lol little verbose tho

quaint mantle
#

thanks @ivory sleet and @gleaming grove and who that helped me

gleaming grove
#

np

rapid roost
# lunar folio Why?

my code is under that so i thought if i can reference it i can run that code without making a whole other class

lunar folio
rapid roost
#

yeah

#

kind of

lunar folio
#
public class CreateTntWand {

    public static ItemStack wand;

    public static void init() {
        createTnt();
    }

    private static void createTnt() {
        ItemStack item = new ItemStack(Material.STICK, 1);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName("§6Tnt Stick");
        List<String> lore = new ArrayList<>();
        lore.add("§7The Staff of Gods");
        meta.setLore(lore);
        meta.addEnchant(Enchantment.KNOCKBACK, 5, false);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        item.setItemMeta(meta);
        wand = item;
    }
    
}
#

This should be in an item manager class.

#
if (cmd.getName().equalsIgnoreCase("givetntwand")) {
            player.getInventory().addItem(CreateTntWand.wand);
        }
#

This should be inside of the command manager.

rapid roost
#

what is a manager class?

lunar folio
#

Your CreateTntWand class is inside a separate file than your command manager yes?

rapid roost
ivory sleet
rapid roost
lunar folio
#

Why are you trying to put it all in one file?

#

That will just lead to a bunch of confusion if you try to add more items.

rapid roost
#

im not putting it all in one file

lunar folio
#
if (cmd.getName().equalsIgnoreCase("givetntwand")) {
            player.getInventory().addItem(CreateTntWand.wand);
}

This should be inside of the onCommand method.

rapid roost
#

im just trying to reference
*example

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

*in another class

if (SomeClass.onCommand(//i know it doesnt work like that but this is a example)) {
  //code
}
#

that is what im trying to do

gleaming grove
#

@rapid roost you can trigger your command like this

#

Bool result = Bukkit.getServer().dispatchCommand(player, command);

eternal oxide
#

Always use an API over dispatchCommand if you can

arctic summit
#

?paste

queen dragonBOT
arctic summit
#

when my players are teleported to l, the chunk for some reason doesnt load and they fall forever in the void. heres my code, i make a chunk ticket before teleporting and stuff too so idk what the issue is

eternal oxide
#

add teh ticket before you run your task to teleport

arctic summit
#

i did

eternal oxide
#

not in that code you didn;t

arctic summit
#

really?

eternal oxide
#

you are adding the ticket in the task

arctic summit
#
                  
            for (UUID playerID : players1v1) {
                  Player player = Bukkit.getPlayer(playerID);
                  if (player == null) {
                    // player is not online so just skip to next uuid
                    continue;
                  }
                        
                      player.setGameMode(GameMode.SURVIVAL);
                      player.teleport(l);```
#

i add it before the for loop

eternal oxide
#

yes, Inside teh task

arctic summit
#

i add it before the scheduler?

eternal oxide
#

Are you having problems reading your own code?

arctic summit
#

no, im just confused abt what task ur talking abt

eternal oxide
#

you only have one task in that code

#

Bukkit.getScheduler().runTaskLater(this, () -> {

arctic summit
#

yeah thats what im asking

#

so i put it before the scheduler

eternal oxide
#

yes, add the ticket BEFORE you run your task.

arctic summit
#

thank you

gleaming grove
#

guys there is some option to get currert server tick

#

int startTick = Bukkit.getTick();

// code here

int lastTick = Bukkit.getTick();

int deltaTime = lastTick - startTick; ```
#

i would like to get sth like this

sand vector
#
Caused by: org.yaml.snakeyaml.scanner.ScannerException: mapping values are not allowed here
 in 'reader', line 18, column 21:
             description: allows players to set warps
                        ^
#

i got this error but have no clue what it means, can someone help me? TIA

eternal oxide
#

bad yaml formatting

sand vector
#

it says that it is valid

#

odd

eternal oxide
#

?paste your file

queen dragonBOT
earnest junco
sand vector
quaint mantle
#

Hello, spigot i have problem in get custom name in creature spawn event

:

    public void onEntitySpawn(CreatureSpawnEvent event) {
Bukkit.broadcastMessage(event.getEntity().getCustomName)``` it returns null

(I set mob's custom name in another plugin)


Btw, I made custom name and summon in another plugin.
eternal oxide
sand vector
#

I deleted the 'description: allows players to set warps' and retyped it. then reloaded it and it worked fine. Thanks for the help anyway

#

Might have used a tab space in it maybe

eternal oxide
#

nope, it would have said tab

sand vector
#

oh, idk what did it then. Works now though

rapid vigil
#

Hey, does anyone know the cause of the error:

#This is the code
#And the error is ```Cannot resolve method 'setPlayerListHeaderFooter(java.lang.String, java.lang.String)'```
eternal oxide
#

You are not using 1.16 or any version that has that method

rapid vigil
#

Ohh

earnest junco
#

It was introduced in 1.13, so your server is below that while the API you're trying to use is above that

rapid vigil
#

Nvm, I knew the cause

eternal oxide
#

what version spigot are you building against?

rapid vigil
#

1.12.2

leaden falcon
#

What happens when I use bukkitRunnable.runTaskLater(plugin, 0)?

#

Does that just queue the task onto the next tick or what?

quiet ice
leaden falcon
#

Ah

#

Alr thanks

eternal oxide
rapid vigil
#

Alright thanks.

rapid vigil
#

Is there anyway to make a Tablist plugin on 1.12.2?

hardy valley
#

yes there is

rapid vigil
#

Send me link or something

hardy valley
rapid vigil
#

That didn't work

patent ice
hardy valley
rapid vigil
#

How do I change the API?

hardy valley
#

what IDE are you using?

rapid vigil
#

Intellij

hardy valley
#

alright go in pom.xml

#

scroll down until you find something called 1.8.8-RO something

#

change it to 1.12.2

#

anyway I meant the code

rapid vigil
#

<version>1.12.1-R0.1-SNAPSHOT</version>?

hardy valley
#

put 1.12.2

rapid vigil
#

I'm using 1.12.1

hardy valley
#

oh

rapid vigil
#

They

#

They're the same

#

But I'm not coding on 1.8

#

PacketPlayOutPlayerListHeaderFooter Doesn't work for me

hardy valley
#

don't use packets for tablists

#

unless you want to make it animated

#

anyway

rapid vigil
#

What should I use then?

hardy valley
#

Tablists xd

rapid vigil
#

I mean how do I make a tablist without packets

cinder thistle
cinder thistle
#

afaik

#

teeeechnically you can't do anything without packets

#

considering that bukkit is just a wrapper for them

hardy valley
#

technically

cinder thistle
#

teeechnically

#

:D

young knoll
#

I assume the setPlayerListHeader/Footer are not around in 1.12?

rapid vigil
#

I really wanna know why I can't import the IChatBaseComponent and ChatSerializer

rapid vigil
#

Is there anyway to do something like add build path on Intellij?

earnest junco
crisp iron
#

Anyone had any luck with getting inventory name? Using inventory click event and need to check the name

young knoll
#

event.getView.getTitle

crisp iron
#

okay

#

i was just making sure that was right

#

bc i wasn

carmine ivy
#

Hey I have an error,

Could not pass event InventoryClickEvent to WolfPVPMain v1.0
org.bukkit.event.EventException: null

i have no idea how to fix this, even went through an entire tutorial again to watch how he fixed the error but that fix didn't work. Anyway here is the code

public class gameSelectorListener implements Listener {

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        Player player = (Player) event.getWhoClicked();

        if (event.getView().getTitle().equals(ChatColor.DARK_GREEN + "Select a game!")) {
            event.setCancelled(true);
            if (event.getCurrentItem() == null) {
                return;
            }else if (event.getCurrentItem().getType().equals(Material.STICK)) {
                    player.teleport(Bukkit.getWorld("knockbackArena").getSpawnLocation());
                    player.closeInventory();
            }
        }
    }
}
#

If anyone knows how to fix this please tell me

earnest junco
#

Bukkit.getWorld("knockbackArena")
is probably null?

#

your error w ill tell you class & line

digital kettle
#

if (e.getCurrentItem() != null && e.getCurrentItem().getItemMeta() != null && !e.getCurrentItem().getItemMeta().hasDisplayName()) {
return;
}

carmine ivy
carmine ivy
#

It doesn't work, still throws the same error

eternal oxide
carmine ivy
#

Hm ok

#

I added this

#

knockbackArena

#

whoops

#

wait there

#
                new WorldCreator("knockbackArena").environment(World.Environment.NORMAL).createWorld();
#

throws more errors lmao

#
The process cannot access the file because another process has locked a portion of the file
eternal oxide
#
if (e.getCurrentItem() == null) return;
if (e.getCurrentItem().getItemMeta() == null) return;
if (!e.getCurrentItem().getItemMeta().hasDisplayName()) return;```
carmine ivy
#

Ok i'll try this

eternal oxide
#

you can make that one if statement using || but separate is cleaner to learn.

carmine ivy
#

Now its throwing no errors, but its not working lamo

#

lmao*

#

This is the code atm

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        Player player = (Player) event.getWhoClicked();

        if (event.getView().getTitle().equals(ChatColor.DARK_GREEN + "Select a game!")) {
            event.setCancelled(true);
            if (event.getCurrentItem() == null) return;
            if (event.getCurrentItem().getItemMeta() == null) return;
            if (!event.getCurrentItem().getItemMeta().hasDisplayName()) return;
        } else if (event.getCurrentItem().getType().equals(Material.STICK)) {
            new WorldCreator("knockbackArena").environment(World.Environment.NORMAL).createWorld();
            player.teleport(Bukkit.getWorld("knockbackArena").getSpawnLocation());
            player.closeInventory();
        }
    }
}
rain flint
#

Hello !

carmine ivy
#

Hello

#

Do you know whats wrong with my code

rain flint
#

What do you want to achieve ?

carmine ivy
#

I want it so when the user clicks on a stick inside my UI, it teleports the player to a different world

rain flint
#

You are trying to click your "Select a game" inventory, and it's not working right ?

carmine ivy
#

Yeah

rain flint
#

Yeah that's what your code is saying if i'm right

eternal oxide
rain flint
#

Because you check if it's the right inventory, if it is, the "else if" does not run

#

You should remove your else if, and instead just put an if, but inside your first condition

carmine ivy
#

Ohhh

#

Ok

rain flint
#

I think

eternal oxide
#

^ correct

carmine ivy
#

Ok that makes sense

rain flint
#
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();
        if (event.getView().getTitle().equals(ChatColor.DARK_GREEN + "Select a game!")) {
            event.setCancelled(true);
            if (event.getCurrentItem() == null) return;
            if (event.getCurrentItem().getItemMeta() == null) return;
            if (!event.getCurrentItem().getItemMeta().hasDisplayName()) return;
            
            if (event.getCurrentItem().getType().equals(Material.STICK)) {
              new WorldCreator("knockbackArena").environment(World.Environment.NORMAL).createWorld();
              player.teleport(Bukkit.getWorld("knockbackArena").getSpawnLocation());
              player.closeInventory();
            }
        }
    }
}```
#

Like so

carmine ivy
#

Ok imma try it

#

Its giving me two erros

#

lemme send

#
Could not pass event InventoryClickEvent to WolfPVPMain v1.0
org.bukkit.event.EventException: null

The process cannot access the file because another process has locked a portion of the file
rain flint
#

I had a question too, I might just don't know something about boolean expressions, but this condition is never checked right ? Because of the false && (so that it's never true, so not checked)

if (false && applyPhysics && getData() instanceof Attachable)```
eternal oxide
#

no, thats an and conditional. It depends on BOTH

#

use || if you want it to fail progressively

rain flint
#

Both need to be true right (to execute the code inside the statement) ?

eternal oxide
#

yes

rain flint
#

It's extracted from craftbukkit source code

#

So since there is a false sitting here, it's never true, and never checked right ?

eternal oxide
#

so yes, your statement is correct, that code would never pass

rain flint
#

That's what I thought

#

I have a problem for one of my plugin, glad I found the source of it x)

#

What is the point of this ?? xD

eternal oxide
carmine ivy
#

Ok

#

I've removed the world creator part

eternal oxide
carmine ivy
#

Doesn't throw that error anymore

rain flint
#

oh sorry