#help-archived

1 messages · Page 62 of 1

hallow surge
#

Idk why it isnt running though

#

it should work fine it detects if the sugar cane is present cancells the break event, than does the task sets to air etc

radiant pollen
#

Wait, shouldn't the material be SUGAR_CANE_BLOCK?

sleek ivy
#

does spigot have a built-in way to serialize an itemstack for writing to file/db?

wraith grail
#

Thankfully the worlds will have everything "random" ish disabled. The only entities that spawn will be off my own design etc.

hallow surge
#

omg

#

xD

#

simple mistake

#

my brain

tiny dagger
#

don't

#

use

#

legacy

radiant pollen
#

@turbid latch very wrong

wraith grail
#

If a World also has a UUID, why don't I just throw it into a hashmap or something like that?
Then I could grab the UUID of the world in the event or something, compare it to the hashmap and IF the boolean in the hashmap for that UUID key is true, it will play the sound.

radiant pollen
#

You should use the item consume event.

turbid latch
#

how to check for consume item then?

radiant pollen
#

We told you already...

turbid latch
#

i never use consumeevent

radiant pollen
#

Read the docs.

turbid latch
#

but the item

#

k

left plover
#

Is there any reason there would be no colour to an actionbar created by an NMS json string which does include colour

hallow surge
#

something else is preventing the code from runninng i fixed that simple issue still not working

wraith grail
#

Ha, it was so:
event.getBlock().getWorld().getUID();
Big thanks @radiant pollen , now I only need an if to check a hashmap for the UID and if it's stored in there, it plays the sound.

hallow surge
#

think you frogot a U

#

maybe not but just pointing it out

wraith grail
#

Nope, it's a typo itself in the api apperently.

turbid latch
#

@radiant pollen sorry for the confusion and thanks for info👍

prisma wolf
#

Hey guys, any another way to detect Mouse middle clicks (if its possible) on InventoryClickEvent instead of if (event.getAction() == InventoryAction.CLONE_STACK) because you need to be in creative to perform that.

frigid ember
#

I don't think, but you could try sending a specific packet to the player that makes client think they're creative while they aren't (like hypixel limbo does, you can middle click blocks to get them, not sure if same applies to inventory click)

tawny crescent
#

who have a rank plugin ? (i don't wan't <RANK USERNAME> MESSAGE (like luckperm) i wan't a full customizable)

light geyser
#

Hey, little question, in the /msg <target> <message>, how do I get the <target>, without using getRecipients​(), since its depricated. on a PlayerCommandPreprocessEvent

hallow surge
#

the fact that its depricated isnt a big deal

#

if it works it works

light geyser
#

true, but it might be removed in a future version though

hallow surge
#

what version are you using

light geyser
#

1.15

hallow surge
#

1.15.2?

light geyser
#

yes

hallow surge
#

I use getRecipients so I'm not sure how else you would do it

light geyser
#

okay, will just use it then 😄 seems there's no real alternative

hallow surge
#

I'm relatively new to spigot and java but I was just look around and came across PlayerChatEvent didnt really look into it so idk how useful it is

light geyser
#

I dont think PlayerChatEvent fires on commands

radiant pollen
#

@hallow surge Add debug messages before every conditional statement you have and see where it stops.

hallow surge
#

okay new to java how do i use the debug message

radiant pollen
#

Just print a message to the player or in the console.

hallow surge
#

what am i exactly printing

radiant pollen
#

Just a message. "Test1" and then print "Test2" somewhere else

#

Before each if statement basically

hallow surge
#

oh okay

radiant pollen
#

Do one at the top of the event before you do anything to make sure the event is firing at all, etc etc.

hoary parcel
#

mfw you outsmart the java compiler

#

and it just gives up

#

and throws a NPE

radiant pollen
#

lmaooo

#

You've transcended the limitations of the compiler.

hoary parcel
#

its so dum

radiant pollen
#

lmao wtf are you doing

hoary parcel
#

I know exactly which code causes it

tiny dagger
#

is this a loop ?

#

a recursive one

hallow surge
#

@radiant pollen my mind is broken

#

it runs every single test i put into myc ode

#
    @EventHandler
        public void onSugarCane(BlockBreakEvent e) {
            Player p = e.getPlayer();
            p.sendMessage("test");
            Block block = e.getBlock();
            if (block.getType() == Material.SUGAR_CANE_BLOCK) {
                p.sendMessage("test1");
                e.setCancelled(true);
                Bukkit.getScheduler().runTaskLater(plugin, () -> {
                    p.sendMessage("test2");
                    int canes = 0;
                    Block b = e.getBlock();
                    do {
                        p.sendMessage("test3");
                        b.setType(Material.AIR);
                        b = b.getRelative(BlockFace.UP, 1);
                        canes++;
                        }  while (b.getType() == Material.SUGAR_CANE_BLOCK);
                            p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
                            p.sendMessage("test4");

                    }, 1L);    
                }
        }
    }```
#

all 5 of them it runs

radiant pollen
#

But the items aren't given to the player?

hallow surge
#

no

radiant pollen
#

and the items still drop?

hallow surge
#

they just drop on the floor

#

the only other code to deal with scane is this

#
    @EventHandler
        public void blockPlaced(BlockPlaceEvent event) {
        Block b = event.getBlock();
        Player p = event.getPlayer();
        Material m = b.getType();
        b.setMetadata("placedbyplayer", new FixedMetadataValue(this.plugin, "something"));
        if(m == Material.SUGAR_CANE_BLOCK) {
            if(b.getRelative(BlockFace.DOWN).getType() == Material.SUGAR_CANE_BLOCK) {
                event.setCancelled(true);
                p.sendMessage(ChatColor.RED + "You can't place that their wait for it to grow");
                b.removeMetadata("placedbyplayer", plugin);
                
            }else {
                event.setCancelled(false);
            }
        }``` and its a place event not break
#

oh wait @radiant pollen it gives sugarcane to the inv now

#

just the block you break though not the blocks above it

radiant pollen
#

Move p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes)); to inside the do-while loop.

hallow surge
#

still having the issue i quoted above

oh wait it gives sugarcane to the inv now

radiant pollen
#

You could try, inside the do-while loop, b.getDrops().clear()

#

Before you set it to air.

#

Did you move the addItem() to inside the do-while loop?

hallow surge
#

yes

radiant pollen
#

Right now, it's after the loop so it only gives one.

hallow surge
#
do {
                        p.sendMessage("test3");
                        b.setType(Material.AIR);
                        b = b.getRelative(BlockFace.UP, 1);
                        canes++;
                        p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
                        }  while (b.getType() == Material.SUGAR_CANE_BLOCK);
                            p.sendMessage("test4");```
radiant pollen
#

Oh wait... hmmm.

#

Nevermind, you were changing the amount.

#

It's weird that it only drops one.

#

It's probably because the top blocks are getting broken automatically

tiny dagger
#

get drops is returing a new list everytime

hallow surge
#

drops one and doesnt even delete the scane on top breaks and drops a sugarcane piece

radiant pollen
#

So the blocks above the bottom sugarcane are already air.

#

You might have to break them from top to bottom or cancel the Physics event that's making them break.

hallow surge
#

I tried cancelling the physics event but it always ended up in just weird situations

#

and didnt fix hte problem

pastel condor
#

for some reason my plugin jar file is now 4 MB when the previous release 30KB and I haven't added much code to it

radiant pollen
#

Then break the blocks from top to bottom.

#

@pastel condor You're probably shading something.

hallow surge
#

isnt that what its doing already

pastel condor
#

like what?

radiant pollen
#

No, you're breaking the bottom block first and then getting the block above it and checking if it's sugarcane and breaking it again.

tiny dagger
#

like the whole minecraft api?

radiant pollen
#

You should loop and go up and check if it's sugarcane and then break all the blocks once you're done checking how tall the sugarcane is.

#

@pastel condor You're shading a dependency or something.

pastel condor
#

oh

#

I already posted my jar on spigot though

#

what do I do?

hoary parcel
#

@tiny dagger no its not a loop

@Override
    public ServerChunkCache getChunkSource() {
        return (ServerChunkCache) super.getChunkSource();
    }
#

thats the method that causes it

tiny dagger
#

this looks weird, any idea how it worked?

hoary parcel
#

the code is fine

#

it should compile

hallow surge
#

@radiant pollen shouldnt this code work?

@EventHandler
public void onSugarCane(BlockBreakEvent e) {
    Block block = e.getBlock();
    if (block.getType() == Material.SUGAR_CANE) {
        int canes = 0;
        e.setCancelled(true);
        do {
            block.setType(Material.AIR);
            block = block.getRelative(BlockFace.UP, 1);
            canes++;
        } while (block.getType() == Material.SUGAR_CANE);
        e.getPlayer().getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));

    }
}```
hoary parcel
#

even if I rename the method and remove override it NPEs

radiant pollen
#

@hallow surge Try adding the blocks to a list and then set all the blocks in the list to air after the first do-while loop.

tiny dagger
#

eclipse has a bug where if i try to put an enum inside an enum sometimes it would freeze

hoary parcel
#

am literally debugging inside of javac right now 😂

#

fuck this shit

vivid herald
#

Any preferred method for Custom Items that have "passive" abilities in a player's inventory being used?

Should these abilities be checked using a Task, or would it be far more optimized in an event?

radiant pollen
#

What event are you thinking about using? @vivid herald ?

vivid herald
#

Events related to the ability use, such as if the item has Regeneration +25%, the EntityRegainHealthEvent is used.

hallow surge
#

look into itemStacks like when in hand
p.setFoodLevel(20);
^ just as an example for my /feed command

radiant pollen
#

@vivid herald If you can use an event, use an event.

vivid herald
#

Oh, I'm not checking if it's in the player's hand. Just if the item exists in the inventory, get the ability from the item, and run the ability.

hallow surge
#

same goes for inventory iirc

radiant pollen
#

I imagine you'll have some passive abilities that are not necessarily associated with an event. I don't think a task would be too taxing on the server.

vivid herald
#

Then would it be better to just run a general task that checks the inventory, and runs the ability?

radiant pollen
#

Well I would still prioritize events if you can.

hallow surge
#

I just do it the way I do because its in an inventory prolly better ways to do for passive abilities

#

@radiant pollen any idea why if statements dont like to run after
b.setType(Material.AIR);

radiant pollen
#

Can you show the code?

hallow surge
#

just looking back at another itteration of the same type of idea i had

#
        @EventHandler
        public void onSugarCane(BlockBreakEvent e) {
            Player p = e.getPlayer();
            p.sendMessage("test");
            Block b = e.getBlock();
            b.getRelative(BlockFace.UP, 1);
            b.setType(Material.AIR);
            b.getRelative(BlockFace.SELF);
            b.setType(Material.AIR);
            p.sendMessage("test");

            if (b.getType() == Material.SUGAR_CANE_BLOCK) {
                p.sendMessage("test1");
            if(b.getRelative(BlockFace.UP, 1).getType() == Material.SUGAR_CANE_BLOCK) {
                e.getPlayer().getInventory().addItem(new ItemStack(Material.SUGAR_CANE));
                p.sendMessage(ChatColor.DARK_GREEN + "+1");
            if(b.getRelative(BlockFace.SELF).getType() == Material.SUGAR_CANE_BLOCK) {
                e.getPlayer().getInventory().addItem(new ItemStack(Material.SUGAR_CANE));
                p.sendMessage("+1");

            }
            }

                }
        }
    }```
vivid herald
#

Wouldn't b now be set to air? So the if statement is now checking for something that can't even be?

hallow surge
#

true

#

also why does it still drop scane I am removing blocks from the top down

vivid herald
#

Are you disabling the item drops?

hallow surge
#

can't do that in 1.8.8

#

you have to set to air

#

and before you scream at me to update I'm doing it in 1.8.8 for a reason

frigid ember
#

Hey, can I get some help? I want to change my spigot Profile Name

tiny dagger
#

don't do this please that's not how this work

sullen crane
#

oh.. sorry didn't know

tiny dagger
#

ask here directly your question or there

sullen crane
#

ok,

tiny dagger
#

or both but make sure you update the forum side

sullen crane
#

i'm having a problem with FactionUUID
i'm trying to remove the "***[faction]" thing from the chat and i don't understand how to do it
for chat i'm using EssentialsX
and for the faction FactionUUID
and i yet figured out how to remove it

tiny dagger
#

this seems like a format thing, maybe check config for both plugins?

sullen crane
#

i checked the config in essentials and i remove the {group} from the format
and still seeing the "***[faction] on chat

tiny dagger
#

maybe check faction config?

sullen crane
#

there is no "config.yml" in factionUUID and i check every yml that is there and didn't see a line that talk about removing it

tiny dagger
#

try contacting the plugin dev usually they know more about the workings of it all

sullen crane
#

ok, thank you for your time

mossy crane
frigid ember
#

I need help before i kill myself

tiny dagger
#

okayyyy..

frigid ember
#

two minutes

#

it is a custom enchants plugin i am making, i got the enchant to apply

#

and for it to reduce the amount of items of books if it is a stack

#

and for it to make a new item with the enchantment

#

but a item appear in the cursor

#

but if i set an item into the cursor, the item doesn't change but if i exit my inventory the item that i set to the cursor appear on the ground and i also have the item from the cursor.

#

@tiny dagger

tiny dagger
#

oh hmm

frigid ember
#

this item is not in the cursor but in the cursor

tiny dagger
#

cancell the event to you can't get the item on the cursor?

frigid ember
#

it is cancelled

smoky tundra
#

maybe try calling updateInventory on the player? that usually fixes weird glitches i get

frigid ember
#

nmope

#

@smoky tundra @tiny dagger

#

is there a better way of registering commands, rather than just line after line of this:

registerCommand(new KitsCommand());
registerCommand(new CreateKitCommand());
registerCommand(new KitCommand());
registerCommand(new EditKitsCommand());
...
upper hearth
#

@frigid ember Player#setItemOnCursor() ?

tiny dagger
#

how would there be a better way?

frigid ember
#

like directly putting the commands in to the bukkit command map

#

without having to register them in the main class or whatever

tiny dagger
#

this does that

#

well

#

you would still need to get to the command map

#

and register them

frigid ember
#

but is there some method that automatically could do that

tiny dagger
#

extending a super class ?

frigid ember
#

because having 30 commands and having 30 separate lines i would think is not convenient

tiny dagger
#

that has the command stuff already in there

#

this is at least how i do it for my minigame arcade

#

i'm not really touching commands

frigid ember
#

i already extend a super class, but that doesn't really help

#

since i still need to call the method

tiny dagger
#

well

#

i do have an enum

#

that passes command stuff

#

main and aliases

frigid ember
#

i guess that is somewhat better?

#

not exactly what i was looking for but i'll try it

tiny dagger
#

think so

#

that or go with reflections

#

automatically load the classes from a package

frigid ember
#

tried reflections before but it was starting to get way beyond my level of understanding

tiny dagger
#

well

#

you would hate yourself in the future too if something shifts too much

vivid herald
#

You can try the CommandAPI library.

hoary parcel
#

ACF for commands

#

❤️

frigid ember
#

used acf before but imo it doesn't offer that much flexibility with subcommands and aliases

#

Yo

hoary parcel
#

then you used it work, lol

frigid ember
#

Can I get some help

#

Look at the blue marked error message at the bottom

hoary parcel
#

install java 14 or set your compiler to java 8

frigid ember
#

YES

#

I already done this to 1.8

mossy crane
#

how would I send a POST request from a plugin?

frigid ember
#

a right answer

#

I used 1.14

#

But now im using 1.8

hoary parcel
#

go into your module settings in IJ and change it

frigid ember
#

Where are those settings

hoary parcel
frigid ember
#

Wait.. How do u have a few projects in the same window

hoary parcel
#

you just create modules?

#

this is all one project tho, those are submodules

#

but you can have many modules in one project

summer flax
#

Maven --

hoary parcel
#

those arent submodules

gritty mulch
frigid ember
#

Hi, are there any people who own non-premium servers? I need help too

hoary parcel
#

no support for cracked servers

gritty mulch
#

How dose one fix my error 😐

mossy crane
#

how would I send a POST request from a plugin?
@mossy crane

#

pls

#

I need halp

digital sphinx
#

How can i make extra Slots only for people with ranks?

kind cove
#

Where would I get help with BungeeCord?

raven shell
#

read the channels description

#

._.

kind cove
#

Ah shit

#

Oops lmao

#

Alright, I'm just rushing a bit nevermind that sorry

#

Apparently for BungeeCord, the installation warns of an exploit. I've searched for the exploit and it makes it as easy as having a bungeecord server on your localhost and zenmap doing very little to join any offline server as anyone.

Warned on installation:
https://www.spigotmc.org/wiki/bungeecord-installation/

Post I found it at:
https://www.reddit.com/r/admincraft/comments/6xlk01/warning_massive_bungeecord_exploit_allows_a_user/

Easy tutorial (cringy, loud, and maybe outdated) for preforming:
https://www.youtube.com/watch?v=RAfsWMmZLn0

Plug-in I don't know how to use but am trying to (PreventPortBypass):
https://www.spigotmc.org/resources/preventportbypass-the-onlyproxyjoin-alternative.54934/

Plug-in I compiled the master of and am unsure how to use also (BungeeGuard):
https://github.com/lucko/BungeeGuard

As the "unsure how to use" implies, I don't know what I'm doing in this regard despite looking into it. What do I do to prevent ipscanning allowing players to join without using the Proxy?

inland depot
#

What/who is zenmap?

kind cove
#

I don't know much about it but it was used to manipulate something to do with the ip when moving a player between ips or something like that

#

It's a program.

raven shell
#

you should block/close the ports from the spigot server and only allow bungees port

kind cove
#

Where do I do that? (I mostly have no idea where to go, I know what to do.)

raven shell
#

are you using a vps?

kind cove
#

Well, I mustn'y I guess

#

I am not using vps

#

a vps*

raven shell
#

local network?

kind cove
#

I'm using a gsp

wanton delta
#

so ive got an interface that extends Comparable

#

which apparently is not ok

#

when it comes to the classes that implement said interface

#

any of you know a solution

#

java.lang.Comparable cannot be inherited with different arguments is the IDE error

raven shell
#

@kind cove wots dat? 🤔

kind cove
#

Below "IMPORTANT SECURITY NOTICE:"

raven shell
#

@wanton delta apparently you cant do Comparable<Class1> then Comparable<Class2> within the same class or whatever

#

so you're using a minecraft host? @kind cove

wanton delta
#

no thats not my issue

#

i have an interface

#

that implements comparable

#

and 2 enums

#

that implement the interface

#

but java doesnt like that

raven shell
#

hmm

wanton delta
#

oh

#

i figured it out

#

enums automatically implement comparable

#

so i had to use generics

#

if anyone is remotely interested

hoary parcel
#

ah yes

#

self referencing generics

#

gotta love that shit

wanton delta
#

i hate them

#

no

#

stop

hoary parcel
#

I have to do that too

wanton delta
#

ive already had to do it once

#

and doing it TWICE

hoary parcel
#

Entity<E extends Entity<E>> extends EntityInternal<E>

#

😄

kind cove
#

I am By_Jack

wanton delta
#

PLEASE

kind cove
#

@raven shell

wanton delta
#

NO

raven shell
#

oh

wanton delta
#

well

#

by twice i mean

kind cove
#

what

wanton delta
#

in diferent classes

#

but that is

#

aweful i hate that

raven shell
#

just use BungeeGuard i guess, you can't do much using a GSP
but you'll probably be more secure on a vps

wanton delta
#

what the heck

#

is not abstract and does not override abstract method compareTo

#

im so done why

#

its labelled as default in the interface

#

dumb

kind cove
wanton delta
#

this is stupid i hate java im quitting

kind cove
#

System.out.println("Don't Quit");

#

< 3

raven shell
#

come to javascript

#

join me

solar magnet
#

bruh just use kotlin

wanton delta
#

i hate all of you

frigid ember
#

someone sent me a recommendation to do this.

One suggestion, is to add a little item in the players inventory that they can right-click to restart the spawn parkour but has a cooldown for 5 seconds to avoid spam

does anyone know a plugin that can do this?

raven shell
#

a plugin that does what exactly?

wanton delta
#

click item in inv and teleport i think

raven shell
#

have a reset parkour plugin or a parkour plugin that has a restart feature?

frigid ember
#

right click on a item that teleports you to a set location

#

my server is extremely lightweight, designed for no lag. i dont want a parkour plugin lmao

kind cove
#

define a new location and
event.getPlayer().teleport(LOCATION);

#

but that's not with a cooldown, just how to teleport them

wanton delta
#

hes asking for a plugin

kind cove
#

OH

wanton delta
#

not code

frigid ember
#

lmao

#

i am learning java soon lol

raven shell
frigid ember
#

i hate that plugin

kind cove
#

xD oof

raven shell
#

oof caps

frigid ember
#

that one ruined people's invintorys

#

and flooded the chat

raven shell
#

._.

solar magnet
#

does anyone know of a clean way to get stdout as a stream from a spigot server? I'm trying to do some screwy stuff with docker and go but the fact that the jar runs as a command line is screwing with things a bit

frigid ember
#

stdout?

solar magnet
#

standard output

raven shell
#

some programmer thing

frigid ember
#

OH WAIT

#

i forgot that term

#

i know c== not java lmao

#

++

raven shell
#

bruh

#

i love me some c==

frigid ember
#

ikr

solar magnet
#

because as it stands right now the only way I can run a server in a container and actually get the full interface to it is to run it as a temporary docker container and launch the server from bash within that

frigid ember
#

yet i still hate bedrock editon

#

@solar magnet simplify

solar magnet
#

lol this isn't even C++ or java this is just shell architecture

frigid ember
#

-_- yes ik

raven shell
#

@frigid ember get someone make you that plugin

frigid ember
#

@raven shell yes

raven shell
#

not me tho 👀

frigid ember
#

YES

#

lmao

solar magnet
#

I mean I could simplify my problem but if you don't know what I mean by the way I phrased that you probably won't be able to help. I don't mean to be a dick, I just know that I'm in some pretty uncharted waters here

wanton delta
#

alright now i gotta new issue

mossy crane
#
Error:(4,20) java: package litebans.api does not exist
Error:(5,20) java: package litebans.api does not exist
Error:(19,41) java: package Events does not exist
Error:(19,9) java: cannot find symbol
solar magnet
#

looks like you're missing a dependency

mossy crane
#

I put them into libraries

solar magnet
#

wait did you move these classes you're trying to import into different packages?

mossy crane
#

?

#

I'm confused

#

using this

solar magnet
#

ok wait are you developing a plugin or just trying to run something on a server

mossy crane
#

developing a plugin for a server

solar magnet
#

ok so you added the jar as a dependency in your IDE right?

mossy crane
#

yea

#

wait

#

a dependency or a library?

solar magnet
#

dependency

mossy crane
#

how do I do that?

solar magnet
#

are you using maven?

mossy crane
#

yea

solar magnet
#

add these blocks to your pom.xml:

This one is your repositories block:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

This one is your dependencies block:

<dependency>
    <groupId>com.gitlab.ruany</groupId>
    <artifactId>LiteBansAPI</artifactId>
    <version>0.3.2</version>
    <scope>provided</scope>
</dependency>
mossy crane
#

nvm thought I alr had jitpack

#

I didn't

solar magnet
#

so it works now?

mossy crane
#

code is fuck'd but yea

solar magnet
#

that's how it always be

mossy crane
#

It worked before the depend thing

#

but not now

#

so idk

solar magnet
#

well are you sure that it's pulling the library correctly now?

mossy crane
#

yea, I think so

#

yea, it is

solar magnet
#

alright cool

final quail
#

Is it possible to load in part of a world on both the server and client to get a smooth as possible teleport across worlds? Like lets say they are approaching a portal start loading in that world before they even hit it?

solar magnet
#

don't think that's possible without a client side mod, I know that back in tekkit we had anchors to handle that sort of thing but idk if minecraft vanilla has implemented any functinoality like that

dry kiln
#

Is there any way to get tab complete for a command.yml alias. The alias works but it still auto completes for the command im trying to mask which is a bit bothersome.

solar magnet
#

might be able to just declare it as a separate command in your plugin instead of an alias, should tab complete then

sullen crane
#

Hello
i was trying to figure out something for so long!
and after a day and a half found a solution
and didn't see a thing related to what i was looking for in the spigot website
where is the best way to post that solution so everyone can read about it
(sorry if i'm wrong about where i'm writing that i'm new and want to help other if they having the same problem)

solar magnet
#

well the stackoverflow way would be to google the problem you were having and post your solution in the first thread that comes up on google as a "Hey if you're googling this exact error, here's the solution you're looking for" kind of thing

sleek ivy
#

trying to get auto complete work for a command. I have onTabComplete implement, the list of suggestions does show, but when I keep typing it just keeps showing the full list and if I hit tab, the first option gets selected. any ideas?

sullen crane
#

well the stackoverflow way would be to google the problem you were having and post your solution in the first thread that comes up on google as a "Hey if you're googling this exact error, here's the solution you're looking for" kind of thing
@solar magnet there is a section on spigot website that my problem will be relevant to post or make a thread ?

solar magnet
#

not gonna lie I'm not the most familiar with the spigot website

#

I'm pretty new here so far, I literally just got on this server today, I'm just trying to help out and give advice because I have some level of development experience and it seems like a lot of this community is very much beginner programmers

sullen crane
#

lol me to like hour and so

#

Hello
i was trying to figure out something for so long!
and after a day and a half found a solution
and didn't see a thing related to what i was looking for in the spigot website
where is the best way to post that solution so everyone can read about it
(sorry if i'm wrong about where i'm writing that i'm new and want to help other if they having the same problem)
@sullen crane
reposing

nova mural
#

Anyone know if there are any massive issues with upgrading world files from 1.13 to 1.15

#

And if any steps should be taken to upgrade instead of just backing it up and just updating the server

#

I’d only be interacting with Overworld files

hallow surge
#
package me.y2k.nodeadbushremove;
import org.bukkit.ChatColor;
import org.bukkit.Material; 
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.plugin.java.JavaPlugin;


public class DeadBushRemove extends JavaPlugin {
    @EventHandler
    public void onDeadBushBreak(BlockBreakEvent event) {
        Player p = event.getPlayer();
        Block b = event.getBlock();
        Material m = b.getType();
        if(m == Material.DEAD_BUSH) {
            p.sendMessage(ChatColor.RED + "A Placed Deadbush is not simply broken");
            event.setCancelled(true);    }
}
}``` why isnt this code working im confused
#

what is a placed dead bush called I should ask

nova mural
#

@sullen crane the plugins are completely updated, my only concern is in world files

sullen crane
#

don't think that world file are an issue
maybe regions

nova mural
#

@hallow surge is your event registered? Material.DEAD_BUSH is a valid enum value, at least in latest docs

hallow surge
#

The event is in the main class should be registered

inland depot
#

this.getServer().getPluginManager().registerEvents(this, this)
Make sure to add this somewhere in the onEnable method if you haven't already.

nova mural
#

and your main should implement Listener

inland depot
#

yeah

hallow surge
#

omg

#

i forgot to regist the event

#

f

inland depot
#

haha have fun once it works 🙂

#

also I'm not sure if it's just me but I don't like to have EventHandlers in my main class, usually I place them in separate classes but that's just personal preference.

frigid ember
#

Hello,

I have created a plugin that allows players to mount a personal Ravager - reskinned as an "Appa" from the Avatar series through use of a server resource pack.
When the player mounts it, if not in motion, the player is able to move their cursor and the Ravager's head will follow, and once its neck is stressed, it will turn its body.
Once the player begins motion, the Ravager's body rotation will revert back to a state that it was in before being ridden - though the Ravager's head will move within the 135-ish degree range that it can rotate without moving the body. Obviously this causes some very derpy looking movement in cases where you're not travelling in the direction that the Ravager is pointing.

I have yet to find a solution to this - it's been a persistent issue for quite a number of days now. I've tried disabling AI (which causes the entity to be unable to move when mounted,) disabling Aware (same effect as AI,) disabling all Pathfinder goals (same result as having them turned on), setting the rotation after setting velocity (same result as original problem), teleporting the entity to the same location with the player's yaw and pitch, all with no luck.
Here is my code: https://hastebin.com/yowupemulu.java

There are no errors in console. Any help or advice that you are willing to share, I would appreciate. If someone has a working solution, I'd be happy to Paypal you $15 for the trouble.

hallow surge
#

me either i just threw this together ina second

inland depot
#

Also I've started to realize that custom events are so helpful

#

Makes things so much easier to code

frigid ember
#

What is a fitness event by feeling full(eat)??

inland depot
#

sorry can you rephrase?

nova mural
#

PlayerItemConsumeEvent

#

if health = full { yeet }

inland depot
#

yes, yeet indeed

nova mural
#

:^)

#

not health but food level oops

frigid ember
#

opps 😛 rephrase. What is a health fitness event by feeling full?

hallow surge
#

@inland depot might get into that than and learna bout custom events

radiant pollen
#

@frigid ember Do you mean health regeneration due to a full hunger bar?

frigid ember
#

yes !

radiant pollen
#

EntityRegainHealthEvent. Check if RegainReason is SATIATED.

frigid ember
#

Oh Thank you.

inland depot
nova mural
#

and entity is player ^

radiant pollen
#

RegainReason can only be satiated when entity is a player, but yeah.

nova mural
#

meh i do it just for redundancy

radiant pollen
#

It definitely doesn't hurt. Haha

nova mural
#

Also in the new update, pandas eating bamboo satiates their health no?

#

that was terrible phrasing

radiant pollen
#

Not sure, actually.

frigid ember
#

like an option or something

nova mural
#

There’s be no point as that logging is there for a very valid reason

#

But if you really want to, fork your own version of spigot and remove the loggings

#

afaik that’s the only way

frigid ember
#

im talking about the text before the INFO

#

in the prefix

#

server worker

#

i liked it when it had info only

#

it was neater

#

like this: [INFO]: Preparing spawn arena: 0%

radiant pollen
#

@frigid ember pretty sure you can't change that

#

it's not a spigot thing

frigid ember
#

@frigid ember are you trying to connect to a spigot server from bungee

#

pretty sure the spigot server needs to be in offline mode

#

watch a bungee tutorial

wanton delta
#

wdym

#

the spigot server needs to be in offline mode

#

once the spigot hooks into the proxy it will "be online" so to speak

#

@frigid ember

grim sapphire
#

Hey guys, is there a way to disable the vanilla console that is now included in the builds?

pastel basin
#

use nogui argument

#

java -jar spigot.jar nogui

tropic drum
#

need some help with the whole money note system

#

if any can help plz msg me so we can get in a discord chat

craggy tundra
#

yes

#

that is my sencond accout

#

yes i did

#

sorry

#

it just says invald amount when ever i try to with draw an amount and sorry you gonna have to tell me were to find the desk code

#

wat?

#

private chat

sleek ivy
#

this must be outdated, but the chat component says you can call create() on the chat builder and pass it directly to player.sendMessage(..) but that's no longer valid. any ideas how I need to send the result?

arctic stone
#

How do I get server to restart automatically at a certain time with a countdown?

frigid ember
#

Guys, do you know why my server takes a long time to load the worlds when its a new world?
https://hastebin.com/isunaxafiz.shell
With 1.8 the worlds load fine, but it takes a long time with 1.15, and I've had this problem on 2 hosting providers

patent monolith
#

@arctic stone first maybe try setting the restart script in the bukkit yml

buoyant path
#
    private int getNextHellStoneId() {
        int nextId = 1;
        if (hellStone.isEmpty()) return 1;
        ArrayList<Integer> keys = new ArrayList<>(hellStone.keySet());
        for (int i = 0; i < hellStone.size(); i++) {
            if (!hellStone.containsKey(keys.get(i) + 1)) {
                nextId = i;
                break;
            }
            break;
        }
        return nextId + 1;
    }``` Am I just dumb or why does this return 1 every time? hellStone is not empty, and I know that because I did a debug msg, Usually I would just use .size() + 1 but you might as well reuse Ids that dont exist anymore
#

I see it now AHHH

#

i break after every time lmfao

scenic osprey
#

is there a way to set where to launch the projectile from in player.launchProjectile?

buoyant path
#

You can do it with player.getWorld().launchProjectile

#

and then it takes a location, plus the projectile class

scenic osprey
#

i see ok

arctic stone
#

What is the restart script for spigot?

scenic osprey
#

@buoyant path There is no world.launchProjectile

buoyant path
#

Huh

#

I googled it and im pretty sure there is

scenic osprey
#

maybe an older version?

buoyant path
#

Ok so you need to spawn the projectile entity then give it velocity

#

launchProjectile is no longer in World

#

Are you using arrows or something else?

scenic osprey
#

Snowball, but got it spawnEntity then cast it to projectile

buoyant path
#

So you got it working?

scenic osprey
#

Yep

buoyant path
#

Sounds good

frigid ember
#

Hello,

I am using ProtocolLib to grab the Vehicle Steer and Vehicle Move packets while riding a Ravager. My end goal is that the ravager's body rotate to match the rotation of the player during movement. I've got this working, but now the player rubber bands hardcore. I believe the issue extends from the fact that I am cancelling packets and then sending new packets, but I don't know what else to do. If someone wouldn't mind skimming over my code to help me understand why this rubber banding occurs, I would appreciate it. Code: https://hastebin.com/axufifuhin.java

wanton delta
#

Maybe use pathfinder instead?

#

This happens because you are sending a packet

#

Server knows the vehicle is in one place

#

Client doesnt

#

Client will catch up to the server eventually

frigid ember
#

I've tried pathfinder, couldn't find a viable solution with it =\

dreamy ermine
#
05.05 23:48:31 [Server] ERROR Error occurred while enabling Pets v1.0 (Is it up to date?)
05.05 23:48:31 [Server] INFO java.lang.LinkageError: loader constraint violation: when resolving method "com.deserialize.pets.Events.PlayerInteract.<init>(Lcom/deserialize/pets/Pets;)V" the class loader (instance of org/bukkit/plugin/java/PluginClassLoader) of the current class, com/deserialize/pets/Pets, and the class loader (instance of org/bukkit/plugin/java/PluginClassLoader) for the method's defining class, com/deserialize/pets/Events/PlayerInteract, have different Class objects for the type com/deserialize/pets/Pets used in the signature
05.05 23:48:31 [Server] INFO at com.deserialize.pets.Pets.registerEvents(Pets.java:185) ~[Pets.jar:?]
05.05 23:48:31 [Server] INFO at com.deserialize.pets.Pets.onEnable(Pets.java:70) ~[Pets.jar:?]
05.05 23:48:31 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot-1.8.jar:git-PaperSpigot-"8b18730"]
05.05 23:48:31 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [spigot-1.8.jar:git-PaperSpigot-"8b18730"]
#

anyone know what's causing this?>

frigid ember
#

Code?

arctic stone
#

How do I make server auto restart? With a countdown?

dreamy ermine
#

I remove the line 185 all together and it still says its there

arctic stone
#

Nvm

dreamy ermine
#

this is line 185

#
        ItemStack item = player.getItemInHand();
#

@frigid ember

frigid ember
#

@frigid ember do you have a custom entity class? I'm just throwing things out there, but mabye override the tick method and set the head rotation or something?
This is a snippet from a dolphin mount plugin

        @Override
        public void tick() {
            if (d) { // isLooking
                d = false; // isLooking
                double x = e - a.locX;
                double y = f - (a.locY + (double) a.getHeadHeight());
                double z = g - a.locZ;
                a.pitch = a(a.pitch, (float) (-(MathHelper.c(y, (double) MathHelper.sqrt(x * x + z * z)) * Const.RAD2DEG)) + 10.0F, c);
                a.aS = a(a.aS, (float) (MathHelper.c(z, x) * Const.RAD2DEG) - 90.0F + 20.0F, b); // rotationYawHead
            } else {
                if (a.getNavigation().p()) { // noPath
                    a.pitch = a(a.pitch, 0.0F, 5.0F);
                }
                a.aS = a(a.aS, a.aQ, b); // rotationYawHead
            }
            float yawDiff = MathHelper.g(a.aS - a.aQ);
            if (yawDiff < (float) (-h)) {
                a.aQ -= 4.0F; // renderYawOffset
            } else if (yawDiff > (float) h) {
                a.aQ += 4.0F; // renderYawOffset
            }
        }
    }
#

I'm not using a custom entity, at least not yet

#

I'm not against the idea though

#

Mabye use player move event and set the players mount to the correct yaw? It appears the rotation's not being triggered by STEER_VEHICLE packet

#

Or am I misunderstanding the issue...

#

It's being triggered by the VEHICLE_MOVE packet, though I think I've found my issue - I was cancelling the VEHICLE_MOVE packets and sending a new one - but when I send a new one, it gets cancelled of course, because the listener is looking for that exact type of packet

#

So I need some way to "intercept" the packet without cancelling it

#

I actually spent quite a bit of time checking out Rideables and that file - I couldn't find anything of use 😦 Thank you for the suggestion

#

Well, I looked at RideableRavager

#

👍 sorry I couldn't be of more assistance

#

All good, I appreciate it

dreamy ermine
#

Does anyone know how to fix my error

frigid ember
#

what is your error though :p

dreamy ermine
#

Scroll up a bit

upper hearth
#

What does your Pets class extend?

dreamy ermine
#

It extends java plugin and listener

upper hearth
#

It looks like it's something with your dependencies

dreamy ermine
#

That’s what I thought, but couldn’t find anything that wasn’t right

upper hearth
#

Make sure you haven't used two different Spigot jars? Not really sure, haven't seen that error before.

dreamy ermine
#

I use maven to provide my dependices

dreamy ermine
#

Is anyone able to help?

valid mountain
#

would this be proof of a double NAT?

#

uh

#

wait

#

nvm, can't send pictures here

narrow carbon
#

Anyone know how to allow slime spawning?
Since there is a thing called a slime-chunk :3

valid mountain
#

how would I fix the problem of a double NAT? i have a netgear nighthawk AX4 and the software is not very flexible.

unreal hedge
#

Correct me if I'm wrong someone, but I believe either Spigot or Paper had an option to have all chunks as slime chunks.

narrow carbon
#

Let me take a look ^^

#

Doesn't seem to be in the spigot config.

#

Probb paper.

grave sand
#

I'm struggling with getting IntellJ IDEA to recognize my 'spigot-1.12.2-R0.1-SNAPSHOT.jar' is there. This is the error message I'm receiving.

import org.bukkit.plugin.java.JavaPlugin;```

I reviewed this page https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellijidea/

Any help would be appreciated.
sturdy oar
#

you're using gradle, check the imports

#

in the build.gradle

grave sand
#

Yes I am, do I add something like this? runtime files('libs/spigot-1.12.2-R0.1-SNAPSHOT.jar')

#

or implementation files('libs/spigot-1.12.2-R0.1-SNAPSHOT.jar')

sturdy oar
grave sand
#

Excellent! Mind blown.

#

Now 'JavaPlugin' and 'import org.bukkit.plugin.java.JavaPlugin;' do not resolve in my Main Class.

What am I doing wrong here? Thank you for working through this with me. I started with Eclipse got my Hello Worlds working, but I need to use Gradle and IntelliJ for some other integration I'm doing with Spigot.

    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven { url "https://oss.jfrog.org/artifactory/libs-release"}

    maven {
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'

        content {
            includeGroup 'org.bukkit'
            includeGroup 'org.spigotmc'
        }
    }
    maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url = 'https://oss.sonatype.org/content/repositories/central' }
    mavenLocal()
}

dependencies {

    compileOnly 'org.spigotmc:spigot-api-1.12.2-R0.1-SNAPSHOT-shaded'
}```
vital copper
#

Quick question; you are using IntelliJ, correct?

grave sand
#

Yes

vital copper
#

Are you using the Minecraft Development plugin?

grave sand
#

I'm using the BuildTools.jar, and I got it working on Eclipse with no issues.

vital copper
#

No, I mean, there is a plugin for IntelliJ.

grave sand
#

Not that I know of.

vital copper
#

Go to File --> Settings --> Plugins --> search Minecraft Development by DemonWav

grave sand
dreamy ermine
#

Mac all the way!

vital copper
#

Is intellij really different on the mac?

dreamy ermine
#

I use it on mac

vital copper
#

Apprently it's under Preferences..

dreamy ermine
#

it is

#

go to the Inellij Idea in bold

#

Then preferences

#

then plugins

#

then search for Minecraft Development

grave sand
#

Found it, downloading.

vital copper
#

This will also be useful.

grave sand
#

OK

#

IntelliJ asked me to restart the app but it appears to be hanging now, is it finishing an install in the background of the Minecraft Development plugin tools?

#

I would hate for force quit anything that its running in the background....

narrow carbon
#

@grave sand does whitemode hurt?

vital copper
#

Give it a couple minutes, perhaps.

grave sand
#

whitemode?

vital copper
#

Light theme*

grave sand
#

The background in coding? Nah.... doesn't bother me at all.

narrow carbon
#

:3

vital copper
#

It's painful at night, for me.

#

I don't mind using it during the day though.

grave sand
#

YA, for Discord and Chatting I prefer Dark mode, light mode is for getting work done. 🙂

red zenith
#

@frigid ember have you checked this out? it was created by Minidigger. Just Enter EntityRavager in the search field

grave sand
#

@vital copper well, installed Minecraft Development for IntelliJ, not sure that it's working for Gradle installs, it looks like for Mavin it will setup all the JAVA files, but not for Gradle. I guess I can do it the old fashion way and create my classes manually, but what's the point of Minecraft Development plugin.

hoary parcel
#

For bukkit that plugin is rather meh anyways

#

It does way more for forge

knotty karma
#

is there a way that I could fire an event when a particular chest is opened, without listening for all chests and going through a list of chests that I want to listen to and seeing if it's there? I anticipate this list getting quite large so it'd be very inefficient to do it that way

hoary parcel
#

Don't use a list then

knotty karma
#

the chest is generated by my plugin, if that helps. Is there any way I could put a certain NBT tag on all the chests i want to listen to, then check if the chest that is opened has the tag?

hoary parcel
#

But a better collection

#

You could use the persistent data API, yes

knotty karma
#

alright, i'll check that out. Thanks!

grave sand
#

Any idea why if I add "extends JavaPlugin" it gives me this error...

#

Error: Could not find or load main class com.rosebunnygamer.rbscoreboard.Main

#

I'm using IntelliJ with Gradle.

red zenith
#

Isn't that supposed to be in your plugin.yml?

#

Is that the package for your plugin class?

grave sand
#

Well, I have the following defined in my plugin.yml

version: 0.0.1
author: RoseBunnyGamer
main: com.rosebunnygamer.rbscoreboard.Main
api-version: 1.12.2```
..but why would it give me a compiling error at run?
#

I've seen that error at console when trying to load a plugin as a JAR but not when trying to get command line hello world output.

#

I'm struggling hard with Gradle and getting my Hello World setup.

#

Any ideas on why I would be getting this "Error" when add 'extends JavaPlugin' to my 'public final class Main extends JavaPlugin'?
Error: Could not find or load main class com.rosebunnygamer.rbscoreboard.Main

sturdy oar
#

something is messed up with your project

grave sand
#

Agreed!

valid ice
#

have you tried turning it on and off again

grave sand
#

Turned what on and off again?

valid ice
#

the computer

grave sand
#

AH. Oh you think it's a bigger issue.

valid ice
#

no im joking lol

grave sand
#

HAHAHA ok

valid ice
#

why is your main void static

#

private static String authtoken = "7wo3az91iyr3gp10gsqd4r952v6tdy"; //SECRET

#

static abuse also nice key

hoary parcel
#

Why is making a constant static static abuse?

valid ice
#

not the string

#

just everything else

grave sand
#

yea no reason

#

Just following best practices

valid ice
#

just use constructors

grave sand
#

You think that is the reason I'm getting this error?

valid ice
#

no it's just some advice

grave sand
#

OK

hoary parcel
#

Your main class isn't actually a proper main?

valid ice
#

lol

hoary parcel
#

Like, why does it have a public static void main?

valid ice
#

bro

#

public final class Main extends JavaPlugin {

#

how can it extend javaplugin if it's a final class?

#

that's your issue

grave sand
#

Oh god.

valid ice
#

lmao did you just copy this code from online?

red zenith
#

Could have printed it out first and typed it all in

hoary parcel
#

The final doesn't matter?

#

Like, at all?

valid ice
#

why wouldn't it

hoary parcel
#

It means you can't extent Main

valid ice
#

it's been way too long since i've done java

hoary parcel
#

main itself can still extend shit

valid ice
#

ah shit yh lol

grave sand
#

No that didn't solve the issue. But no didn't copy following Spigot and Twitch API guide. Not sure why I included final but that was something that was after the fact.

red zenith
#

also, I'd say that secret isn't very secret anymore

valid ice
#

great security

grave sand
#

Nah its all just test code...

#

The OAuth is just place holder.

red zenith
#

Well, I'd recommend making that a configurable property. Something that gets read from your config.yml

#

That way you never have to worry about potentially making a commit with an actual valid token

grave sand
#

hahah good point

#

So any idea on what else may be causing
Error: Could not find or load main class com.rosebunnygamer.rbscoreboard.Main

#

The "public class Main extends JavaPlugin {" has been updated without final, but is still giving issues

red zenith
#

why are you using a main method and not onEnable?

sturdy oar
#

😐

valid ice
#

dont think he knows java

red zenith
#

Unless it's full of caffeine and served in a mug?

valid ice
#

lmao

grave sand
#

no griefing my java skills, that's why I'm here.

#

hahaha

valid ice
#

read the javadocs before making plugins

red zenith
#

So, mall, are you just trying to check with twitch to see the status of your stream?

grave sand
#

YEP that's it.

#

I want to sent a message over to my MC server to show if we are online or not.

vernal spruce
#

twitch has a whole api with guides...

red zenith
#

Looks like mall is using a java api for twitch, I just didn't know if it would be easier to use a GET request.
Without knowing much, it seems like you might need an oauth token, but that seems odd, if you're just requesting the status of someone's stream.

grave sand
#

Yep, that's not where I'm having issues. It's "extend JavaPlugin" I have had Spigot tested and working in Eclipse, but I need to be using Gradle for some of the other tools I'm trying incorporate.

vernal spruce
#

yeah a simple request to that url would yield some data

grave sand
#

Yea, don't worry about that part, I'm just trying to get Spigot working JavaPlugin so I can use the Spigot library

vernal spruce
#

what u mean working? just add the jar to your dependencies and extend..

grave sand
#

@vernal spruce this is my gradle, but it's giving issues I believe

plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'



repositories {
    mavenCentral()
    maven { url "https://oss.jfrog.org/artifactory/libs-release"}

    maven {
        name = 'spigotmc-repo'
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }
    maven {
        name = 'sonatype'
        url = 'https://oss.sonatype.org/content/groups/public/'
    }
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile group: 'com.github.twitch4j', name: 'twitch4j', version: '1.0.0-alpha.19'

    // YAML Parser
    implementation group: "com.fasterxml.jackson.dataformat", name: "jackson-dataformat-yaml", version: "2.11.0"

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

import org.apache.tools.ant.filters.ReplaceTokens
vernal spruce
red zenith
#

take the code in your static void main method and move it into your onEnable method. Uncomment that method and comment out the main method

grave sand
#

OK.

#

I think I'm close, that makes sense

vernal spruce
#

idk why bother with gradle didnt found anything special rather than eclipse/intellij

sturdy oar
#

gradle is hella fast

grave sand
#

agreed, but that's how the Twitch4J library works

#

It's just something else to learn LOL

#

@red zenith I will try your suggestion. thanks

narrow crypt
#
if(config.getBoolean("prevent-otherthunder")) {
            if(event.getCause() != LightningStrikeEvent.Cause.WEATHER) {
                return;
            }

        //do the event results etc

is a good way to break the event

#

if the event is not caused by weather it needs to stop doing the things it would do normally

#

i do want the thunder to continue so no event.setcanceled

#

anyone?

valid ice
#

personally i'd check if it's is a lighting strike, if it is then do your stuff and if not then return

narrow crypt
#
    @EventHandler(priority = EventPriority.HIGHEST)
    void Lighting(LightningStrikeEvent event){
        
    if (event.getCause() != LightningStrikeEvent.Cause.TRIDENT) {
        if(config.getBoolean("prevent-otherthunder")) {
            if(event.getCause() != LightningStrikeEvent.Cause.WEATHER) {
                return;
            }
            
        }
        //do the event results etc
        
#

i have this

#

i need users to be able to switch that on and off

valid ice
#
    @EventHandler(priority = EventPriority.HIGHEST)
    public void Lighting(LightningStrikeEvent event){
        
    if (event.getCause() == LightningStrikeEvent.Cause.TRIDENT) {
    // do stuff if it's caused by trident
        if(config.getBoolean("prevent-otherthunder") && event.getCause() == LightningStrikeEvent.Cause.WEATHER) {
        // if the boolean is set to true and the cause was weather, do stuff
            } else{
            // if it's not weather
             return;
            }
            
        }
        //do the event results etc```
#

ive just done that in atom in a .py file so may not be perfect

#

but thats how id do it

narrow crypt
#
if(event.getCause() != LightningStrikeEvent.Cause.WEATHER && config.getBoolean("prevent-otherthunder")) {
            return;
        }
#

just went with this

valid ice
#

might not be perfect code either havent done java for abour a year and a half

#

ok fair enough

narrow crypt
#

no else required i believe

boreal tiger
#

Some of those comments are unnecessary as well 🤷‍♂️

formal nimbus
#

How can I distinguish between GUI and hotbar?

valid ice
#

open ur eyes @formal nimbus

boreal tiger
#

Lol

#

How can I distinguish between GUI and hotbar?
@formal nimbus the slots numbers in the hotbar are from 0 to 8

formal nimbus
#

clicking the first slot in a GUI returns 0 in event.getSlot()

boreal tiger
#

What event is that?

formal nimbus
#

InventoryClickEvent

#

am I using the wrong one?

lilac wasp
#

iirc they all start at 0

#

Pretty sure you can check the type of inventory

boreal tiger
#

They do,

formal nimbus
#

Pretty sure you can check the type of inventory
@lilac wasp How?

boreal tiger
#

But the player inventory starts at 0 in the hotbar

#

iirc

lilac wasp
#

I’m on a phone right now and I don’t know off my head you’ll just need to google that one

formal nimbus
#

aight

#

open ur eyes @formal nimbus
@valid ice also no need to be rude

sturdy oar
#

god returning to stop the method is just a weird practice

lilac wasp
#

👍

sturdy oar
#

like what's the reason of

if (n < 5) { return;}
doSomething();
#

just do

if(n > 5) { doSomething(); }
lilac wasp
#

Some people do both it varies on the person

#

Nothing wrong with any of them

sturdy oar
#

it's just unrequired code lines

lilac wasp
#

Because what if you wanted to check multiple conditions are met and only do one thing

sturdy oar
#

there are some specific cases where return; can be handy, but his didn't seem the case

lilac wasp
#

Yeah he shouldn’t really have it but it’s okay I guess

formal nimbus
#

better? ):

boreal tiger
#

The 8 is included

#

In the hotbar

formal nimbus
#

I know

boreal tiger
#

Ah right :+1:

formal nimbus
#

I was just addressing the issue of Fendi complaining about my if .. return statements

#

I'm going to try and fix the actual issue now

#

and figure out how to not include the hotbar

#

ah

#

I've fixed it 😄

#

turns out there's a getClickedInventory() event, rather than just a getInventory() event

#

@boreal tiger @lilac wasp thx for the help

sturdy oar
#

JetCobblestone one question

#

how do your eyes not hurt from absolute black background?

formal nimbus
#

very easily D-:<

shadow sigil
#

Hello i would like to ask stg.

#

In skript plugin i was using "stop" to stop the code

#

Are there anything i can use in java

#

I would like my code to stop if stg happens

sturdy oar
#

you can disable the plugin

narrow crypt
#

on a event you can just return;

shadow sigil
#

oh

#

okey

candid geyser
#

Can you buy plugins with paysafe card ?

boreal tiger
#

not on spigotmc forums

#

the developer might be selling the plugin in some other way/platform though 🤷‍♂️

candid geyser
#

its only paypel

boreal tiger
#

yeah on spigotmc its only paypal.

tiny dagger
#

but you can manually talk with the buyer to see if he can accept paysafe

vernal lance
#

I have had many of those 👀

paper compass
#

I'm trying to enable debugging for my plugin in eclipse but it says "Failed to connect to remote VM. Connection refused."

#

java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar server.jar

candid geyser
#

So who can I talk to so I can buy it with passage ?

tiny dagger
#

uh?

#

oh

#

to the buyer

robust valve
#

hello everyone, who should I talk to about an issue with logging into my spigotmc website account?

hoary parcel
#

?support

worldly heathBOT
robust valve
#

alright, thank you!

paper compass
#

nvm I just clicked the button more than once

violet pelican
#

Hi, I have a problem with bungeecord server. After two people joined the server, the third person could not join the server. And the error will be, "Too many connection from this IP adress". I set the server localhost.

vernal spruce
#

i mean its pretty obvious..

#

there is most likely a ip limit in the config

#

usually auth plugins have it

hoary parcel
#

Imagine using auth plugins

vernal spruce
#

40% of minecraft servers..

hoary parcel
#

Mmmh?

vernal spruce
#

you would be surprised by the amount of cracked servers out there

#

wich require auth plugin..

hoary parcel
#

It's not 40%

vernal spruce
#

in my country there is not even 1 premium server

#

only cracked

#

and boy we have alot of em..

hoary parcel
#

Like, authme has 10k servers, out of the 160k

vernal spruce
#

do people use authme anymore/

tiny dagger
#

mini you forget auth servers usually disable bstats

hoary parcel
#

Even skin restorer only runs on 18k servers

#

Why would they be more likely to disable bstats than any other server?

vernal spruce
#

...

#

its also funny how popular the cracked launchers are

sturdy oar
#

Why would someone disable bstats at all

vernal spruce
#

its preference

sturdy oar
#

I don't see anything wrong with anonymous data

vernal spruce
#

overall doesnt help the server at all..

hoary parcel
#

If you disable bstats, you servers demographic isn't represented

tiny dagger
#

because they have something to hide i guess

hoary parcel
#

And ppl will drop support for you sooner

#

I use my own cracked launcher actually

#

For launching multiple clients locally

#

Cause I only have 3 mc accounts

tiny dagger
#

i have a bot creator myself

hoary parcel
#

Anyways, death to offline servers

vernal spruce
#

1.9% online servers using authme wait wut?

hoary parcel
#

Death to 1.8

sturdy oar
#

I hope java 8 and 1.8 will just die

hoary parcel
#

They will

#

If you'd stop supporting it

vernal spruce
#

1.16 will help that alot

#

with the new features

sturdy oar
#

BungeeCord should just drop 1.8 to be honest

hoary parcel
#

1.16 will also help paper 😂

vernal spruce
#

how come?

frigid ember
#

if 1.15.2 didnt help then how will 1.6 help?

vernal spruce
#

tbh 1.15 didnt bring that much

hoary parcel
#

The wast majority of 1.15 servers run paper

sturdy oar
#

73%

frigid ember
#

Anyone know how to get the location of where a tnt entity was spawned (PrimedTnt)

vernal spruce
#

You can listen to interact event and check hand/block..?

frigid ember
#

Right now my server gets it right but then gets it wrong

tiny dagger
#

if we drop support they would move but everyone has to do it otherwise is pointless

hoary parcel
#

No

#

Somebody has to start

#

The rest will follow

sturdy oar
#

Bukkit

vernal spruce
#

mostly the big plugins have to do it

#

worldedit/guard/essentials/vault

#

otherwise its...

sturdy oar
#

They already

tiny dagger
#

we did i think

sturdy oar
#

We all hope 1.16 will be the new good PvP update

#

And people will finally migrate

tiny dagger
#

yup

#

that would move them for sure

hoary parcel
#

1.16 will not change combat?

sturdy oar
#

how come

#

What about the snapshot

#

They had experimental PvP changes

hoary parcel
#

Combat snapshots aren't part of the 1.16 branch

tiny dagger
#

they can change combat tho

hoary parcel
#

Yes, they are experimental and not done yet

vernal spruce
#

tbh got used to new combat

#

its no longer who spams the hardest

hoary parcel
#

1.16 is almost done at this point

#

I wouldn't be surprised to see a prerelease in a few weeks

sturdy oar
#

Will Mojang ever start to push Java 11

hoary parcel
#

Yes

#

They already said they will drop legacy gpus

sturdy oar
#

define legacy

hoary parcel
#

But like, it's still a high percentage of the user base

#

Idk, some Intel shit iirc

#

Bone said something years ago

sturdy oar
#

Is a GTX960 legacy?

hoary parcel
#

Nah

#

And I mean

#

We have a chance to get render dragon

#

Then we could easily update java

sturdy oar
#

Red dragon

#

Or render dragon

#

Wut

hoary parcel
#

Render dragon

#

The rendering engine bedrock uses

sturdy oar
#

Do you know about red dragon tho

tiny dagger
#

haven't seen a mouse to render

vernal spruce
#

you know what i would want? a good launcher wich can download files needed for the server

#

like csgo/arma...

#

so we can easly play a modded server on a click

hoary parcel
#

Why need a launcher for that?

tiny dagger
#

it does that

hoary parcel
#

Oh, modded

#

Lmao

hoary parcel
#

Nobody cares about red dragon

#

I want render dragon

vernal spruce
#

idk i enjoyed some modpacks.. rlcraft/sevtech/skyfactory/ozone alot of shit

#

i played

hoary parcel
#

Imagine render dragon plus papers no tick view distance set to 32 😍

#

Or even higher

sturdy oar
#

Imagine not using Streams

tiny dagger
#

mc should implement no tick chunks in vanilla imo

sturdy oar
#

I don't know if it's fault of the obfuscation or something else, but Mojang code is really outdated and wrong

vernal spruce
#

usually code keeps improving overtime..

sturdy oar
#

not theirs

hoary parcel
#

Wat

#

I don't know if it's fault of the obfuscation or something else, but Mojang code is really outdated and wrong

#

This makes no sense

sturdy oar
#

there are many unused variables which I haven't found a use of

#

not to mention outdated java syntaxes and usage

hoary parcel
#

Unused variables come from paper/spigot/cb modifications

#

And from stripping out client code

#

Proguard removes methods and classes not used by the server

#

Or tries to

sturdy oar
#

Understandable, I guess it would take a really long time to revisit by hand each one

#

so no one does it

tiny dagger
#

i don't know if playerconnection was supposed to be accesed directly as a field

shadow sigil
#

Hello guys i wanna ask stg

#

i have a config like this
Itemler: TuğrulKılıcı: Tür: Kılıç İsim: §6Ahmet Beyin Ceketi Eşya Tipi: DIAMOND_SWORD Gereken Seviye: 10 Saldırı Değeri: 20.5 Saldırı Hızı: 0.87 Kırılmazlık: true Nadirlik: §7§lSIRADAN TuğrulZırhı: Tür: Zırh İsim: §6Ahmet Beyin Zırhı Eşya Tipi: DIAMOND_CHESTPLATE Gereken Seviye: 5 Defans: 10 Can: 22 Kırılmazlık: true Nadirlik: §7§lEN AZ TUĞRUL KADAR

#

How can i make my plugin to tell the names of the items

#

I mean i tried getConfigurationSection and only get but i couldnt make it

#

I want to tell my admins the names with a command like /itemlist

ashen stirrup
#

for(String string : config.getConfigurationSection().getKeys(false))

#

String itemName = config.getString(string + ".İsim");

shadow sigil
#

i dont want the ones İsim: i want the original names xd

#

But i think i get what u are trying to say

ashen stirrup
#

for(String string : config.getConfigurationSection().getKeys(false))

shadow sigil
#

ill try thx

#

Man it worked thx

#

But i wanna ask one more thing

#

Can i make it one sentence ?

#

Oh i can make an array list i believe

ashen stirrup
#

Can someone help me with Scoreboards?

        manager = Bukkit.getScoreboardManager();
        blankBoard = manager.getNewScoreboard();
        board = manager.getNewScoreboard();
        o = board.registerNewObjective("scoreboard", "");
        o.setDisplaySlot(DisplaySlot.SIDEBAR);

I have that code, I set it to the player when they join. I then have a runnable which should update the specific player's scoreboard according to their player info. But it seems to just flicker between accounts, e.g I have account X and account Y, it would flicker between Name: X and Name: Y

Objective pobj = player.getScoreboard().getObjective("scoreboard");

I'm using that code to update the player's scoreboard, any help?

boreal tiger
#

I'm not sure, but you have to use teams to prevent flickering iirc

cloud sparrow
#

Well you aren't registering individual scoreboards per player

#

All you are doing is updating 1 scoreboard for all players in game.

#

Instead of updating that player's scoreboard.

ashen stirrup
#

Score spacer2 = pobj.getScore(Formatting.colorize("&8 "));
When I tried before, there was always an NPE on lines where you get the score

cloud sparrow
#

To update it smoothly you must use teams.

#

Explanation: https://bukkit.org/threads/preventing-scoreboards-from-flickering-changing-objectives.238711/

subtle blade
#

:(( Why'd you wrap the link in code blocks?

#

That's just mean

tiny dagger
#

😂

paper compass
#

HIIIII MR. CHOCOLATE

cloud sparrow
#

My bad @Choco. Next time I won't.

paper compass
#

LMAO

tiny dagger
#

i love how people were talking about async to stop flickering

#

back then

paper compass
#

hah

subtle blade
#

Async Bukkit KEKW

paper compass
#

All you need to do is update a team thingy (forgot what is was called) and ez

#

"was"

#

You just said was

tiny dagger
#

i guess now it's paper

paper compass
#

lmao no

tiny dagger
#

👀

subtle blade
#

Who's gonna tell him that Spigot's primary dependency is Bukkit FearSweat

paper compass
#

ikr

#

I wonder how they make a server jar thing

ashen stirrup
#

So what difference does it make using teams?

paper compass
#

its really cool

tiny dagger
#

well it was a needed dependency wasn't it?

#

imagine how many plugins wouldn't had worked if that was dropped

paper compass
#

Say yes if Skript sucks

#

yes

tiny dagger
#

i started with skript

paper compass
#

wtf

hoary parcel
#

Who's gonna tell him that Spigot's primary dependency is Bukkit :FearSweat:

#

actually

#

spigots doesnt really depend bukkit

#

its a fork

paper compass
#

dont use skript 😦

cloud sparrow
#

SuperiorFork.BUKKIT

tiny dagger
#

hating on it is pointless because c++ people hate java too and i think it's because they don't understand it's uses

paper compass
#

skrip bad

#

You can do ANYTHING with java

#

I don't think you can do EVERYTHING with skript

#

but idk

hoary parcel
#

skript is good if used right

paper compass
#

true

hoary parcel
#

just as any programming language

#

this discussion is pointless

paper compass
#

ok

cloud sparrow
#

MiniPaper is bad if used right

paper compass
#

Why is santas sack so big? Because he only comes once a year.

hoary parcel
#

here come the preschool jokes

paper compass
#

hah

#

uh..

shadow sigil
#

guys i wanna replace [ in my array list with "" but the bracket makes an error

#

how can i fix it

hoary parcel
#

wut?

#

show code

paper compass
#

lol

#

send code

#

I know what hes doing

#

list.toString()

shadow sigil
#

String gonder = "§4Mevcut Eşya Listesi: " + items; gonder.replaceAll("[", "");

#

items is an array list

paper compass
#

lol

#

do this:

shadow sigil
#

so it causes [ at the start and ] at the end

#

i wanna remove them

hoary parcel
#

items.join(",")

tiny dagger
#

^

#

you can nest them too

#

so cool

paper compass
#

so cool

tiny dagger
#

nvm

#

it's stringjoiner

shadow sigil
#

Ooookey thx then ill try

cloud sparrow
#

Guava's API would be so useful in this situation.

haughty sundial
#

Hey guys, I was wondering how you could take one experience level from somebody, I've searched those methods but i think those experience methods are not about full levels but experience points

cloud sparrow
#

ChatColor.translateAlternateColorCodes('&', "&4Mevcut Eşya Listesi:" + Joiner.on(",").join(items))

tiny dagger
#

you just setlevel - 1

hoary parcel
#

Imagine using translateAlternateColorCodes and §

haughty sundial
#

setLevel is a method? XD

tiny dagger
#

exp is for bar and it's a percentage

hoary parcel
#

solo is sleeping 😄

tiny dagger
#

from 0 to 1

haughty sundial
#

Ah alright lmao thank you

cloud sparrow
#

Forgot to remove it after translating it 🤢