#help-archived

1 messages ยท Page 219 of 1

fading frost
#

any reason why Server#getUnsafe() is deprecated?

#

Can you still use it without trouble?

frigid ember
#

@fading frost Probably because the whole UnsafeVaules class has been deprecated, should still work, just be aware it may have weird functionality at times ๐Ÿคท

tranquil aurora
#

[xxxxxx] disconnected with: Invalid payload REGISTER! what does this mean

fading frost
#

@fading frost Probably because the whole UnsafeVaules class has been deprecated, should still work, just be aware it may have weird functionality at times ๐Ÿคท
@frigid ember does spigot still use it though?

#

or is there an alternative now

frigid ember
#

Not too sure tbh

#

@tranquil aurora presuming you have client side mods loaded?

tranquil aurora
#

the person was using fabric

#

they changed to of and it was fine

frigid ember
#

Yeah there you go

subtle blade
#

It's meant for internal use

tranquil aurora
#

so why did it fail? i dont want ppl using mods not being able to join

subtle blade
#

UnsafeValues is not really meant to be used by plugins. It can be - it has a front-facing API, though Bukkit's ideology of forwards compatibility does not apply to this class

frigid ember
#

Failed because something they're using meant the client wasn't conforming to the protocol standards ๐Ÿคท

subtle blade
#

It's Bukkit's equivalent of sun.misc.Unsafe

jagged torrent
#

Spigot uses unsafe internally, but there's absolutely no reason for plugin devs to use it

#

which is why its deprecated

fading frost
#

Yeah ok, I'm using it to emulate the transformations happening when loading classes regularly

#

I reckon this is the best way

#

Although I could use commodore directly of course.

paper pumice
#

If I have a method that gets a value from the config:

    public int getTimeUntilSwitch() {
        return main.getConfig().getInt("time-until-switch");
    }```

if I create a private field at the top of the class that = getTimeUntilSwitch(), when I refer to that variable will it still pull it from the config every time?
fading frost
#

no

paper pumice
#

Ah alright

frigid ember
#

Any good guide on how to start making plugins? everything I have found with google is giving us troubles. Bukkit is not recognizing our pluggin.

wispy pewter
#

Use youtube

timid edge
#

^^^

paper pumice
#

Udemy

#

good old pogostick29 ;)

timid edge
#

pogostick ๐Ÿ˜

warped coyote
#

I'm new to plugin development so don't look at me

paper pumice
#

Pogostick was bae

warped coyote
#

Wait...wrong chat. Sorry

timid edge
#

Pogo was the first person who really got me started

paper pumice
#

Same with me lol

#

Hm the static abuse he used ๐Ÿ˜

timid edge
#

thenewboston and thesourcecode also

#

those three guys

paper pumice
#

yeah they're decent

quick arch
#

did anyone say static abuse?

#

๐Ÿ˜

wispy pewter
#

60% of the beginning programmers don't know what half of their code means.

quick arch
#

Formattings broken (new line spaces)

warped coyote
timid edge
#

@wispy pewter Can confirm

quick arch
#

Do 100 incognito chrome tabs >:)

wispy pewter
#

They ask for help in discord and use the code they are given

#

without searching what it dos

#

does

#

and why its being used.

sturdy oar
#

What's a java???

wispy pewter
#

Coffee

warped coyote
#

A type of coffee

timid edge
sturdy oar
#

So I can only make plugins from the island?

#

I have to go to Indonesia?

warped coyote
#

You need an eclipse first tho

timid edge
#

or a j that is intelligent

warped coyote
#

Or internet beans

sturdy oar
#

Ok so I go to Indonesia and wait for eclipse

wispy pewter
#

Use wordpad

#

best editor ever

#

Only real man use wordpad

sturdy oar
#

Nano ftw

warped coyote
#

I use Kate

frigid ember
#

Wordpad++ or noob

timid edge
#

๐Ÿ‘€

wispy pewter
#

Thats notepad++

#

Which is terrible

warped coyote
#

I'm on KDE

wispy pewter
#

Sublime is betteer

sturdy oar
#

Yes

frigid ember
#

no

wispy pewter
#

Sublime, Atom, VS-Code

sturdy oar
#

Sublime text + Sublime merge and boom you're already best developer

frigid ember
#

wordpad++

#

only program you'll ever need

#

trust

warped coyote
#

wordpad++
@frigid ember
Sounds like word with less steps

frigid ember
#

Tbf there probably is a wordpad++ out there somewhere and it's probably a cheap knock off of notepad++ lmao

sturdy oar
#

Real developer use Alexa/Siri and voice-to-text to write their code

frigid ember
#

Found one on source forge lmao

wispy pewter
#

NO

frigid ember
#

it's a legit thing

wispy pewter
#

fuck off bot

#

Real devs use Console Line to write codes

sturdy oar
#

Yes

timid edge
#

@frigid ember I would just give up at that point

#

Switch to web dev @frigid ember

sturdy oar
#

Can you not lol

wispy pewter
#

Switch too Assembler lol

timid edge
#

@frigid ember Become a web developer, this isn't worth it

wispy pewter
#

Alpfa let the man be

quick arch
#

๐Ÿค”

timid edge
#

๐Ÿคฆ

wispy pewter
#

Why dont you start writing power shell

timid edge
#

What IDE are you using @frigid ember

wispy pewter
#

Command prompt

warped coyote
#

Discord to Spigot is fun ... when your plugin runs on Bungeecord

timid edge
#

Thats the issue

#

You can't use Eclipse for web

sturdy oar
#

Is there a way to modify itemstacks from vanilla villager trades?
I'm trying to code a halloween plugin, and basically it's that every single item that will be collected while my plugin is running, will have a custom lore that I made.
I already made it work when picking up, when crafting, and even when looting, but now I was thinking...
What if a player tries to trade while the plugin is running?
The villagers will trade normal items without lore...
How can I get their itemstacks? Is there an event in which I can get their inventory?
@frigid ember you can do this

wispy pewter
#

For web use PHP storm

timid edge
#

^

#

And intellij for java

#

๐Ÿ˜

bold anchor
#

Merchant stuff

timid edge
#

Any jetbrain product ever โค๏ธ

warped coyote
#

I use eclipse

wispy pewter
#

xD

#

Weee

formal nimbus
#

hey guys ๐Ÿ™‚

warped coyote
#

Pain in the but to get working...but sunken cost fallacy is sunken cost fallacy

sturdy oar
#

Simply listen to InventoryDragEvent , if the item has been dragged from a villager inventory type , give him the lore I guess?

formal nimbus
#

is there a way to check if a player clicked on their hotbar in InventoryClickEvent?

#

there is event.getClickedInventory.getType()

#

but I don't know what to compare that to?

warped coyote
#

Why not just disable villager trading?

quick arch
#

Couldn't you just create villagers with custom trades ๐Ÿค”

formal nimbus
#

is there a type hotbar?

sturdy oar
#

Couldn't you just create villagers with custom trades ๐Ÿค”
@quick arch also... Maybe

wispy pewter
#

@timid edge TIP: The change Inteliji memory from 2 to 4

#

it will become 10000X faster

timid edge
#

@wispy pewter Im doing that right nowwwww thank you

#

I didn't think about that

quick arch
#

uh...

sturdy oar
#

Mhh idk about that

timid edge
#

Idk chief

quick arch
#

Just change their trades when they spawn? ๐Ÿค”

sturdy oar
#

Make custom trades

daring oracle
#

Players can see /pl on my server somehow and I didn't give them permissions on pex? How do I fix this?

warped coyote
#

Could you even trade renamed items?

formal nimbus
#

anyone?

mellow wave
#

@daring oracle The permissions are true by default you need to manually set them to false

timid edge
#

@wispy pewter Thank you, I changed it

daring oracle
#

What is the permission for /pl?

#

and how to set it to false?

mellow wave
#
BukkitWiki

The following are all the server commands either a server administrator or admin in-game can enter with CraftBukkit out-of-the-box. In addition to the original vanilla SMP commands there are 4 additional commands which are specific to CraftBukkit. CraftBukkit provides built-in...

#

A bit old but should still work

timid edge
#

oh no

#

outdated stuff

mellow wave
#

I believe it's still the same

#

No reason to make any changes to that

daring oracle
#

and how to disable the permission? I can only give it them

#

Is it in the config?

mellow wave
#

I don't use pex so idk

#

I recommend LuckPerms instead :)

timid edge
#

๐Ÿคฎ

#

Use UltraPerms

mellow wave
#

oh no

warped coyote
#

I wrote something in my plugin to handle LuckPerms stuff... I'll be honest.. I'm still confused to whether my code for that is working correctly

sturdy oar
#

If it doesn't crash it works

timid edge
#

^^^

sturdy oar
#

That's how I publish my plugins

timid edge
#

Every programmer ever

bold anchor
#

I test it on 1.5->1.16 and expect the code to work on 1.16+, if not it was made incorrectly.

timid edge
#

If it doesn't crash it works
@sturdy oar Im going to start using that

sturdy oar
#

I think I should support 1.8-1.12.2 for my plugin

timid edge
#

1.5?

#

Who plays on 1.5

#

I can understand 1.7 but 1.5?

sturdy oar
#

Lol literally everyone

bold anchor
#

Clearly someone

sturdy oar
#

The 1.5 community is so huge

warped coyote
#

It doesn't crash...but the code reminds me of ducktape

timid edge
sturdy oar
#

I know at least 6 servers that use 1.4.7

timid edge
#

and how big are these servers?

bold anchor
warped coyote
#

There is probably a few servers that still run 1.2.5

bold anchor
#

nty

#

I'm lazy, the only reason it supports those is simply because 1.7 support provided support for those too

warped coyote
#

Due to the old technique packs

#

I want to test my plugin for 1.8...

bold anchor
#

do it

warped coyote
#

I'm guessing my advancement things will break

bold anchor
#

Comment it out

warped coyote
#

Although 1.8 doesn't go to fancy with achievements. I could just run a version check and say "if you're running on 1.11.1 or older. Just don't bother with advancements"

ionic hound
#

How do i fix this?
java: me.gui.gui.commands.guicommand is not abstract and does not override abstract method onCommand(org.bukkit.command.CommandSender,org.bukkit.command.Command,java.lang.String,java.lang.String[]) in org.bukkit.command.CommandExecutor

bold anchor
#

Import it

ionic hound
#

package me.gui.gui.commands;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;

public class guicommand implements CommandExecutor {

}

#

i have

vernal spruce
#

so where is the method the interface gives ya?

paper pumice
#

Is there a Map API or class that Spigot has?

vernal spruce
#

not much detailed sadly

#

it hasnt received much attention

paper pumice
#

Thanks mate

languid hill
#

Can some one help me im having trouble with bungee cord

ionic hound
#

i can

languid hill
#

22:45:01 [SEVERE] Exception in thread "main"
22:45:01 [SEVERE] java.lang.RuntimeException: Invalid configuration encountered - this is a configuration error and NOT a bug! Please attempt to fix the error or see https://www.spigotmc.org/ for help.
22:45:01 [SEVERE] at net.md_5.bungee.conf.YamlConfig.load(YamlConfig.java:73)
22:45:01 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:71)
22:45:01 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:272)
22:45:01 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
22:45:01 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
22:45:01 [SEVERE] Caused by: while scanning for the next token
found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
in 'reader', line 27, column 14:
address: 116.202.229.20:25404

ionic hound
#

send me your bungee config

languid hill
#

gosh im dumb found the error lmao

#

@ionic hound

ionic hound
#

lol

languid hill
#

ty though

#

whoops

paper pumice
#

How can I get a player locator map in 1.16 using Spigot

frigid ember
#

@languid hill btw, don't forget to add a firewall rule to block any traffic that isn't from your bungee front end, otherwise people will be able to UUID spoof onto your servers using their own bungee instance

raven summit
#

Hello. I need some help. How can you set the border, outside which the world will not generate? I try to run server on raspberry pi zero w and I want to make very small flat world. It won't be used for normal playing, I want it to be something like on this video at 2:50.
https://www.youtube.com/watch?v=YNrFOClrzTA

#

I tried "world border" plugin, but it doesn;t seem to work. Or maybe it works, but, when i login, world outside trimmed border is generated again.

lapis wedge
#

how do you monitor packets?

#

I want to prevent certain players from sending packets to other players

obsidian scroll
#

What exactly are you trying to do? Players don't "send packets" to other players, only to the server, who in turn sends different packets to players

lapis wedge
#

yeah that's what I mean

#

I want a player to be completely invisible

obsidian scroll
#

Oh, you want something like VanishNoPacket

lapis wedge
#

no bounding box or anything

#

yea

#

I want to implement it by myself though, is it open source

obsidian scroll
#

It is

lapis wedge
#

thanks

obsidian scroll
#

You're welcome

urban wharf
#

eh guys

#

can someone help me fast

frigid ember
#

i have a question if you have group2 taking inherit from group 1... would group 3 4 and on inherit all lower groups even though you have it group 5> group4>group3>group2>group1?

obsidian scroll
#

@urban wharf Presumably your BungeeCord instance has no online servers to send you to

bold anchor
#

Yes

#

If you use default settings from luckperms yes.

urban wharf
#

@urban wharf Presumably your BungeeCord instance has no online servers to send you to
@obsidian scroll All the servers are up and owrking

bold anchor
#

You can choose how it resolves all that in the config.

obsidian scroll
#

can your hub actually connect to any of them, though?

urban wharf
#

Yes i can

obsidian scroll
#

Hm

frigid ember
#

you might have your throttle connection set to -1?

urban wharf
#

139.99.124.204:25568

#

you might have your throttle connection set to -1?
@frigid ember Lemme check

#

that's my config

frigid ember
#

if no luck check your server properties and port forwarding too

urban wharf
#

All set properly

#

it was working like 10 mins ago

#

everything is untouched

deft zinc
#

is the powermine 1.16 compatible?

frigid ember
#

did you test connection directly to the other servers? just asking

urban wharf
#

Yes i did

#

and that's working

#

this is very weird

#

I can connect to hub without any problem

frigid ember
#

hopefully someone else who understands more depth on this can help. its been years since i have done bungee

urban wharf
#

Ah i see

#

i feel like flipin jPremium plugin is causing this

vernal spruce
#

hmm anyone experienced in sql can tell me what this might result into?

#
        String makeTable = "CREATE TABLE IF NOT EXISTS "+tableName+" ";
        StringBuilder stringBuilder = new StringBuilder();
        for(String s : values){
            stringBuilder.append(s+" ");
        }```
urban wharf
#

this starteed happening after i updated jpremium

deft zinc
#

please

frigid ember
#

i have had issues with some plugins causing startup/shutdown issues so i added .bak to the broken ones and server runs fine again. just let the plugin developer know of the issue and they should fix it asap.

deft zinc
#

1.16

#

msg me on dis

#

?

frigid ember
#

doesnt look like it is @deft zinc

deft zinc
#

frick

ionic hound
#

if(e.getClickedInventory().getTitle().equalsIgnoreCase(ChatColor.AQUA + "Custom GUI")){

anyone know why getTitle is not working ?

deft zinc
#

how did i join a server tha was on 1.16 and yet it had it?

urban wharf
#

i have had issues with some plugins causing startup/shutdown issues so i added .bak to the broken ones and server runs fine again. just let the plugin developer know of the issue and they should fix it asap.
@frigid ember Yee it was jPremium

ionic hound
#

viva verson

urban wharf
#

Gonna have to ping dev asap lol

deft zinc
#

wha viva version

subtle blade
#

inventories don't have titles, tdash

#

their views do

#

in your case, an inventory event, event.getView().getTitle()

raven summit
#

Can you help me? I'm trying to put "3;minecraft:air;127;decoration;2;" into generator-settings in my server.properties, to create empty world, but i get JsonParseException. What am i doing wrong?

#

Also tried to put \ before :

ionic hound
#

@subtle blade if(e.getClickedInventory()getView().equalsIgnoreCase(ChatColor.AQUA + "Custom GUI")){
What what would i do to fix it i tried if(e.getClickedInventory()event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){

subtle blade
#

Right so... do you confidently understand the basics of Java? Because based purely on that I'm going to assume not

ionic hound
#

I have recently started java i did a bit a long time ago

vernal spruce
#

is this even a viable way of returning something from a try/catch? IDE seems to think so

#
        final ResultSet[] resultSet = new ResultSet[1];
        asyncExecute(new StatementSQL() {
            @Override
            public void execute() {
                ResultSet temporaryResultSet = null;
                try {
                    temporaryResultSet = statement.executeQuery(path);
                }catch (SQLException e){
                    e.printStackTrace();
                }
                resultSet[0] = temporaryResultSet;
            }
        });
        return resultSet[0];
    }```
subtle blade
#

why is that an array though?

vernal spruce
#

basically making an array,filling out index 0 then trying to return it

#

thats why im asking intellij thinks this is alright for auto-correct

fading frost
#

this will not work

subtle blade
#

it will work it's just very poor design

fading frost
#

no it won't

subtle blade
#

or are arrays pass by value?

vernal spruce
#

bit hard to pull something out of try/catch

fading frost
#

the array is populated asynchronously

subtle blade
#

yeah, though that value will inevitably be set

#

ideally you'd be using completablefutures

vernal spruce
#

yeah most likely ill end up using it

fading frost
#

yeah, though that value will inevitably be set
@subtle blade at the point of return this will be null

vernal spruce
#

dont think there is any faster way

subtle blade
#

yes of course, though at some later point in time it will not be

#

depends on how that method is used lol. though again, completablefuture here is best

fading frost
#

the caller won't see this change though

subtle blade
#

are arrays pass by value?

vernal spruce
#

damn im making the most scuffed sqlhelper

fading frost
#

also async arrays are a different issue

#

everything is pass by value

subtle blade
#

I suppose the value being passed is the reference, yeah

fading frost
#

yes

#

while this is technically a race condition, the return will always be faster than the task

vernal spruce
#

so completablefuture is basically a way of delaying the return till the value is set

ionic hound
#

@subtle blade How would i fix this if(e.getClickedInventory()event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){

subtle blade
#

completable future acts sort of as a wrapper for an object that may or may not have been set

fading frost
#

so completablefuture is basically a way of delaying the return till the value is set
@vernal spruce no, it will return instantly. But the caller can decide what to do with it, e.g. register a callback for when it's done or wait

subtle blade
#

right. it's the call backs that are useful from future instances

vernal spruce
#

ahh so it gives me full control what happens at the end

subtle blade
#

from the caller, yes

#

Tdash, just event.getView().getTitle().equals("whatever")

bold anchor
#

Do views still have tittles?

fading frost
#

yes

vernal spruce
#

man this bout to be so scuffed

#

so this might do it?

#
        CompletableFuture<ResultSet> completableFuture = CompletableFuture.supplyAsync(new Supplier<ResultSet>() {
            @Override
            public ResultSet get() {
                try {
                    return statement.executeQuery(path);
                } catch (SQLException e) {
                    e.printStackTrace();
                }
                return null;
            }
        });
        return completableFuture.get();
    }```
quick arch
#

use prepared statements

#

๐Ÿ‘€

fading frost
#

this defeats the purpose of completable futures

#

you're meant to return them

#

also yes, use prepared statements and try-with-resources

subtle blade
#

yeah, it's the CompletableFuture that you want to return

#

On that object you can invoke methods like whenComplete() where you can pass a completion stage invoked when the future has been completed

#

Avoid get(). That's a blocking operation and defeats the purpose entirely

vernal spruce
#

so...

#
        return CompletableFuture.supplyAsync(new Supplier<ResultSet>() {
            @Override
            public ResultSet get() {
                try {
                    return statement.executeQuery(path);
                } catch (SQLException e) {
                    e.printStackTrace();
                }
                return null;
            }
        });
    }```
subtle blade
#

Yeah, though you can simplify with a lambda as well

vernal spruce
#

fine..

#
            try {
                return statement.executeQuery(path);
            } catch (SQLException e) {
                e.printStackTrace();
            }
            return null;
        });```
subtle blade
#

ye

vernal spruce
#

but how does it work once called

subtle blade
#

when you call it, use the completion methods

vernal spruce
#

will it just return the object i placed?

subtle blade
#

getData().whenComplete(data -> { });

vernal spruce
#

hmm

subtle blade
#

That gets called whenever your async task is done

vernal spruce
#

so this is more of a utility method

proud sierra
#

also yes, use prepared statements and try-with-resources

solemn verge
#

how do you get spigot to place a player skull?

#

I know how to make one with a itemstack but you can't place itemstacks

vernal spruce
#

are you sure there is no PLAYER_HEAD when talking about blocks?

bold anchor
#

Are you using pre 1.13?

#

If so you place a skull and then set the data of the block to 3.

solemn verge
#

you can place using .getType() but it can't be a custom one it can only be a steve one

bold anchor
#

Which version are you using?

solemn verge
#

no I'm using 1.16.1

#

3?

#

I said 1.16.1

#

how would I do that?

#

sorry I'm new to spigot

bold anchor
#

Do what i said last.

solemn verge
#

but how?

#

how would i cast it?

#

idk how to cast

#

I just know basic stuff like:

#

player.sendMessage(ChatColor.GREEN + "hello");

#

@bold anchor thanks for your help tho

frigid ember
#

I Need Help with a Plugin..

proud sierra
#

Go ask your question ...

spring coyote
#

@solemn verge to cast means to do something like Player player = (Player) sender
Casting is to change one variable to another by putting it next to a data type in parenthesis

frigid ember
#

Im about to download some plugins for my Server, but then i ran into a problem with This plugin "EasyPlant" And the Console says this... Could not load 'plugins/EasyPlant (2).jar' in folder 'plugins': uses the space-character (0x20) in its name

solemn verge
#

so I would do block b = (skullmeta) loc.getBlock();

proud sierra
#

no

frigid ember
#

What can i do to fix the Problem and fix the Plugin?

solemn verge
#

@frigid ember

#

is there a space in name of the plugin

ionic hound
#

Anyone know why this does not work ?
if(e.getClickedInventory()event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){

frigid ember
#

Yea Between P (

lone fog
#

Not the jar name

#

The internal name

#

if(e.getClickedInventory()event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){ That shouldn't even compile?

ionic hound
#

it does not

lone fog
#

Well yeah... e.getClickedInventory()event.getView()

frigid ember
#

Where do i find the Internal name? (Sry not a pro...)

lone fog
#

plugin.yml

ionic hound
#

how do i fix it

lone fog
#

Remove e.getClickedInventory()

ionic hound
#

so if(event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){

frigid ember
#

Can i speak with one of you guys to get help?

lone fog
#

I mean you need a .equals too

#

Do you know java?

ionic hound
#

not well

#

if(equals().event.getView().getTitle("ChatColor.AQUA + "Custom GUI")){

lone fog
#

no..

#

getTitle() returns a string which you should compare with .equals

subtle blade
#

i swear you're writing this poorly on purpose lol

#

there's no way you can fuck it up that badly

#

i seriously advise stopping what you're doing and learning a little bit about the basics of the language. it will help you ten fold

#

my initial message would have resolved your issue much earlier

bold anchor
#

Youโ€™d be surprised

subtle blade
#

not to mention i literally gave you, word for word, what to write in order to get it to work

solemn verge
#

its getting heated

ionic hound
#

This is why i hate asking for help. I want to try and get away from script and i am just trying to fucking learn

subtle blade
#

that's fine

#

so take the time to learn

#

right now you're learning the wrong thing

vernal spruce
#

@subtle blade what would be the difference from thenApply and whenConfirm when trying to get the data from the completeablefuture?

#

The documentation for it is so fkd jeez

subtle blade
#

whenComplete() uses a BiConsumer that passes through a throwable object as well

#

thenApply() just uses a Consumer with the result. Throwable is ignored

#

CompletableFuture can complete exceptionally as well so whenComplete() takes that into consideration

#

if you wanted to delegate your exception through the completable future, you could do that and do your exception handling from the caller rather than from within the async implementation

fierce briar
#

Thatโ€™s sad. I almost type Like Code. ๐Ÿ˜‚ :F

little salmon
#

hello srry if this isnt supposed to be on this text channel but does anyone have a plugin which makes a item stay in a certain number on a players hotbar when they spawn in?

subtle blade
#

i do have to say... the completable future documentation is an absolute mouthful

Returns a new CompletableFuture that is completed when this CompletableFuture completes, with the result of the given function of the exception triggering this CompletableFuture's completion when it completes exceptionally; otherwise, if this CompletableFuture completes normally, then the returned CompletableFuture also completes normally with the same value.

#

like, holy fuck. take a shot every time you see a variation of the word "complete"

#

You're 11 shots in. Lesgo

fierce briar
#

Lmao

ancient ridge
#

The CompletableFutue Future Complete FutureCompletable

bold anchor
#

Coroutines >

fierce briar
#

CompletableFuture when it completes. Duh Itโ€™s already in the name.

subtle blade
#

hello srry if this isnt supposed to be on this text channel but does anyone have a plugin which makes a item stay in a certain number on a players hotbar when they spawn in?
you're in the right channel though it's not often that people have these sorts of recommendations, especially for niche plugins like this. Most active users here offering assistance are plugin developers, not server owners

vernal spruce
#

Still trying to read what does block mean when calling .get

subtle blade
#

meaning the main thread will halt trying to get the value

vernal spruce
#

Like does it stop that specific operation or the entire thread

subtle blade
#

i.e. it's not async anymore

#

it will wait until that async task is done which... y'know... defeats the purpose of asynchronousy

vernal spruce
#

then why are so many examples spamming it

tiny dagger
#

we have no idea

subtle blade
#

because some people don't know how to use that API properly lol

fierce briar
#

Me: Learning Code.
Alsocode: CompletedFuture.
Innerme: We are not Immortal.

subtle blade
#

it is rare that you will ever need to call get() on a Future instance

#

it should all be handled through completion stages

vernal spruce
#

also where did you even find things about whenComplete

#

i literally cant find anything but javadoc

subtle blade
#

yeah, that's where I look are the javadocs lol

#

though i've also had experience with this API in the past so I'm not unfamiliar with how it's used

vernal spruce
#

wich just points to a interface not making it easyer to simply return that resultset

subtle blade
#

You'll probably want to use thenAccept() which just passes you that data

bold anchor
#

Hmm, isnโ€™t that executed on the async thread

subtle blade
#

the thenApply() method does the same thing, only it returns another completable future with a new result. Kind of like Stream#map()

#

No

#

thenAcceptAsync() is

bold anchor
#

Ah isre

fierce briar
#

Damn, Reading that is like predicting the future. Explains alot.

subtle blade
#

Could get fancy by using both if you want

#

getData().thenApply(MyData::getString).thenAccept(System.out::println);

bold anchor
#

I saw that semi colon

subtle blade
#

no you didn't

#

lies

warped coyote
#

๐Ÿ˜

fierce briar
#

When two or more threads attempt to complete, completeExceptionally, or cancel a CompletableFuture, only one of them succeeds.
I feel like this summarizes it.

vernal spruce
#

Could get fancy by using both if you want
@subtle blade where did that MyData come from tho?

subtle blade
#

I was just pulling things out of my ass, but you get the idea lol

bold anchor
#

Got a lot of stuff up there? ๐Ÿ˜

fierce briar
#

Tell me whatโ€™s longer the Bible or learning to code? xD

bold anchor
#

The bible is a book

#

It can be finished

frigid ember
#

what would be the entrySet for HashSet's

#

so entrySet's are for HashMaps

bold anchor
#

HashSets has no idea of entries

subtle blade
#

i'm confused about the question lol

warped coyote
#

Depends...java or C?

frigid ember
#

but what if you would have to save a hashset storing UUID

#

into a yml file

fierce briar
#

Anything can be finished if you live long enough. ;)
Unless your girl/guy left ya.

bold anchor
#

Save it as a list

#

Programming is a continues effort that wonโ€™t be reached any time soon

frigid ember
#

save the hashset as a list?

fierce briar
#

Anyways off to general,
As for that Slot Plugin.
BSP addon โ€œGUI Shop Managerโ€

frigid ember
#

wym

bold anchor
#

Itโ€™s like how a musician keeps practicing to not forget or learns new stuff to not get outdated

fierce briar
#

Would be my recommendation
k1 (If they see it lol).

frigid ember
#

public final List<UUID> someListStoringUUID = new ArrayList<>();

#

or do you mean it like this @bold anchor ?

bold anchor
#

I just meant you can save it as a list

vernal spruce
#

holy shit my brain start to turn into a mush

#
        ResultSet resultSet;
        resultSet = (ResultSet) completableFuture.thenApply(resultSet1 -> {
            return resultSet1;
        });```
#

holy shit ima bout to simply look for another solution

subtle blade
#

๐Ÿ˜… do all your logic in a thenAccept method

warped coyote
#

Use gson

bold anchor
#

Donโ€™t cast that

#

That bad

subtle blade
#
getResult(path).thenApply(result -> {
    result.getString("whatever");
    // Do everything here
});```
frigid ember
#

JanTuck I meant how would you loop through all uuids in the Map to save them into the .yml file

subtle blade
#

you have your result and it's passed to that callback

bold anchor
#

Could just use taskchain

lone fog
#

Can't you just wrap it with bukkit.runTaskAsync

bold anchor
#

You can easily loop over the values in a hashset

subtle blade
#

task chain is also a viable solution but you also have completable future just part of the sdk

vernal spruce
#

Thing is i dont want to do logic

subtle blade
#

no reason not to use it

#

what is it you want to do?

vernal spruce
#

i need to return a ResultSet

subtle blade
#

why's that?

frigid ember
#

save hashset info into .yml file

#

ohh him

vernal spruce
#

basically the object itself

bold anchor
#

Why

vernal spruce
#

its basically a helper for sql

subtle blade
#

if you want to do something asynchronously, you can't

vernal spruce
#

so you can just call this method

#

and get that resultset

subtle blade
#

there's never a guarantee that the returned result will be available at any given point if you're fetching is asynchronously

#

that's why you use a callback that gets invoked when it is available

bold anchor
#

Return a CompletableFuture<ResultSet> then

vernal spruce
#

time well spent i guess

#

lol

#

@subtle blade so for example everything
inside the interface "accept" will run?

#
            @Override
            public void accept(ResultSet resultSet, Throwable throwable) {
                //Code goes here
            }
        });```
subtle blade
#

Yes

vernal spruce
#

Hmm guess its pretty manageable

subtle blade
#

(though, again, you probably really only need thenAccept())

#

you don't delegate your exception so the whenComplete() is a bit excessive

vernal spruce
#
            @Override
            public void accept(ResultSet resultSet) {
                
            }
        });```
#

?

subtle blade
#

ye

#

or, result -> { } to simplify, but yes, same idea

vernal spruce
#

fair enough

bold anchor
#

Ugly anonymous inner class

vernal spruce
#

oh yeah

#

` getResult("รค").thenAccept(result ->{

    });`
#

faster

bold anchor
#

Looks better nothing about speed

vernal spruce
#

fair enough

sleek ivy
#

does &r not reset formatting too when used with TextComponent.fromLegacyText? I see it resetting the color but not formatting, like bold

sleek raven
#

Do anyone know a raid farm design that will work on Spigot?

unkempt ridge
paper pumice
#
    private int randomTime;

    private void registerLightning() {
        List<Player> online = new ArrayList<>(Bukkit.getOnlinePlayers());
        Bukkit.getScheduler().scheduleSyncRepeatingTask(main, () -> {
            
            randomTime = new Random().nextInt(30);
            world.strikeLightningEffect(online.get(new Random().nextInt(online.size())).getLocation());
            
        }, 0, randomTime * 20);
    }```

Why isn't "randomType" setting to the new Random? it's staying at 0?
solid sundial
#

someone here should make a parkour plugin with which you can detect if someone is flying during it, and a item in inventory that can tp them back to last checkpioint

balmy sentinel
#

I'm pretty sure that already exists and if not and you know some Java it's really not that hard to code. Just put them in a map when they enter "parkour mode" and disable flight and add an item to their inventory. Listen for PlayerInteractEvent and when they click that item just teleport them back to a checkpoint or the beginning of the parkour stage.

lapis kestrel
#

would looping through all players' inventories and modifying items if they fit a criteria cause lag?

ionic hound
#

Any one know why i am getting this:
[19:36:05 ERROR]: Could not load 'plugins\ExampleGui-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: main class `me.dash.examplegui.ExampleGui' does not extend JavaPlugin

balmy sentinel
#

does not extend JavaPlugin

lone fog
#

main class me.dash.examplegui.ExampleGui' does not extend JavaPlugin

#

Pretty much means that

paper pumice
#

Make your main class extend JavaPlugin

lapis kestrel
#

public class ExampleGui extends JavaPlugin {

ionic hound
#

o shit

#

i am stupid

balmy sentinel
#

nobody is stupid, just silly mistakes.

solid sundial
#

alright

ionic hound
#

thanks

solid sundial
#

sounds easy enough

#

but now, if i want one of those leaderboard plugins to be able to see my player's times

#

what would i have to do for that

balmy sentinel
#

Have a data class then that stores the player's uuid, their time, and their last checkpoint

#

then save the time in a yml or database for future use.

solid sundial
#

yes

#

but would i have to put it in a mySQL thing

balmy sentinel
#

if you want to store the information in a database than yes

solid sundial
#

ok lol

#

guess i have to learn some more lol

balmy sentinel
#

it's really not that bad or hard imo and it's a very efficient way of storing data.

lapis kestrel
#

would looping through all players' inventories and modifying items if they fit a criteria cause lag?

lone fog
#

Depends how often you are doing it

ionic hound
#

this is a stupid question but how would i call public ExampleGui() { in my code

paper pumice
#

new ExampleGUI();

ionic hound
#

i just did ExampleGUI();

paper pumice
#

new

#

to create a new instance

ionic hound
#

dam i get java: cannot find symbol

paper pumice
#

show me

lone fog
#

if ExampleGUI is your main class do not do new ExampleGUI

ionic hound
#

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (command.getName().equals("die")) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (player.hasPermission("test.test")) {
sender.sendMessage(ChatColor.RED + "hi");
new ExampleGUI();

            } else {
                sender.sendMessage(ChatColor.RED + "You Don't have permission");
            }

        }

    }

    return false;

}

}

balmy sentinel
#

You have to do something like ExampleGUI myGUI = new ExampleGUI();

tulip orchid
#

any way to show more details like coords of death
06.08 02:48:08 [Server] INFO loveandy was blown up by Creeper

balmy sentinel
#

then player.openInventory(myGUI.methodName());

lone fog
#

Create a custom plugin that prints more detail

#

Or find one

tulip orchid
#

Oki ty

unkempt ridge
lone fog
#

I would just put the player identifier and then a unique key of some sort to represent the achievement

unkempt ridge
#

but like in a database?

#

or yml file

frigid ember
#
    public void onEnable(){
        this.getServer().getPluginManager().registerEvents(this, this);
        saveDefaultConfig();
        loadData();
    }
    public void onDisable(){
        saveData();
    }

    private void loadData() {
        if (getConfig().getConfigurationSection("GUIinformation") != null) {
            for (String lore : getConfig().getConfigurationSection("GUIinformation").getKeys(false)) {
                UUID uuid = UUID.fromString(lore);
                List<String> listString = getConfig().getStringList(lore);
                guiInformation.put(uuid, listString);
            }
        }
    }

    private void saveData() {
        for (Map.Entry<UUID, List<String>> guiInfo : guiInformation.entrySet()) {
            getConfig().set("GUIinformation." + guiInfo.toString(), guiInformation.get(guiInfo));
        }
        saveConfig();
    }```
lone fog
#

Each achievement is its own row, not sure if thatโ€™s the most efficient way but itโ€™s easily expandable because you donโ€™t need to add more columns to add new achievements

frigid ember
#

its not saving anything

#
private final HashMap<UUID, List<String>> guiInformation = new HashMap<>();```
#

btw

unkempt ridge
#

I was thinking of storing uuid, achievementA, achievementB, etc. and then have it set to like true and false

#

just trying to weigh every option and see what will work out best and be the most efficient

lone fog
#

I do player identifier then name

#

And just add a new row for each one

frigid ember
#

any1?

trail hare
#

Anyone have time for yml assistance? I have a long command that is confirmed working in the console, but because it contains item naming/data stuff it is full of single and double quotes, which I can't just escape or encapsulate in a simple way. I've tried multiple methods of escaping things, and the ONE time I got notepad++ to actually show it as a properly encapsulated string it said "invalid escape character" on the singlequote escaped with another singlequote (as the yml primer I was following said to use).

 - "replaceitem entity %player_name% armor.head turtle_helmet{display:{Name:'[{\"text\":\"Grippli Respiration\",\"italic\":false}]',Lore:['[{\"text\":\"You can\\'t wear helmets,\",\"italic\":false}]','[{\"text\":\"but you can breathe\",\"italic\":false}]','[{\"text\":\"underwater for longer!\",\"italic\":false}]']},Enchantments:[{id:binding_curse,lvl:1},{id:vanishing_curse,lvl:1},{id:respiration,lvl:1}],Unbreakable:1,HideFlags:39} 1" 
#

nevermind, NP++ is being dumb and just highlights it wrong.

spare tiger
#

guys i need help

#

im bad at spigot

#

here's my issue

#

I have a block at a location

#

it is a spawner

#

first I want to set its block entity data

#

like i t this command

#

/setblock ~ ~1 ~ spawner{SpawnData:{id:zombie},Delay:299}

#

the stuff like SpawnData and Delay

#

second, I want to get the block entity data

#

so I want to be able to get this stuff

#

how do I do this

lone fog
#

Block.getState cast to creatureSpawner

spare tiger
#

ok

#

but then I don't know what to do after that /:

#

because

#

like

#

I know how to set the zombie as the id

#

wait actually give me a second

spare tiger
#

I want to set an armorstand

#

and then set stuff like Invisible and armor items

ionic hound
#

does anyone know of a good tutorial on how to make a gui?

spare tiger
#

google has some pretty good ones

lone fog
#

Youโ€™ll have to use nms to modify stuff like that

spare tiger
#

thanks @lone fog

#

@ionic hound just google like spigot api chest menu

lone fog
#

I donโ€™t believe there is any API for it

spare tiger
#

alright epic

#

I can't even get the data as a string

#

bruh

#

I don't know how to convert CreatureSpawner interface into NMS Spawner

#

oh

#

can I use getMetadata for that?

#

since it implements Metadatable

#

does getMetadata and setMetadata have that infor?

lone fog
#

No

spare tiger
#

ok thanks

#

now to figure out how to do the nms for that

#

ugh i don't like nms

lone fog
#

I think you can use worldServer.getTileEntity

spare tiger
#

hm

quick arch
#

custom blocks?..

spare tiger
#

hm?

#

hahaha

#

i will say nothing of the matter

lone fog
#

Ah the spawner method

#

Not the worst

spare tiger
#

I don't want to use mushroom blocks

lone fog
#

Spawners are too laggy in large amounts unfortunately

spare tiger
#

I am not planning to have large amounts

#

so we good

lone fog
#

So many methods but none are perfect

#

Dangit mojang

spare tiger
#

it will be a great day when we can natively have mods that are server only and only require a resource pack on the client

#

without mods and shit

#

@lone fog what are all the methods

#

theres mushroom blocks best solution

#

armor stand + barrier laggiest and you can't break blocks

#

and spawner which is less laggy than just straight up armor stand but is still laggier than mushroom blocks

#

mushroom blocks are the best but they're also limited

#

because you don't have basically infinite additions

quick arch
#

the spawner is laggier than the armor stand

#

Some other plugins are already using the mushroom blocks

spare tiger
#

it is?

quick arch
#

yeah, the client has to render the spawners

spare tiger
#

I thought tile entities were less laggy than normal entities

quick arch
#

normal entities is heavier on the server, spawners is heavier on the client

spare tiger
#

ah I see

lone fog
#

Thereโ€™s a new one in 1.16

spare tiger
#

hm?

quick arch
#

ooh, which one

lone fog
#

Walls have a bunch of unused block states

spare tiger
#

ohhh

quick arch
#

pogchamp

spare tiger
#

so adding on to mushrooms then?

lone fog
#

And can make more shapes than mushroom blocks

spare tiger
#

we can have even m ore mushrooms

#

well you can modify the model for each blockstate of the mushroom blocks right

lone fog
#

Yeah

#

Iโ€™ll probably use mushrooms if I decided to add a resource pack to my server

spare tiger
#

but still that adds to our list of usable blocks

#

epic

lone fog
#

Unless mojang comes out with something first

spare tiger
#

right

#

@quick arch I would like to use barriers and armor stands if its less laggy on the client

#

but

#

you can't break barriers in survival

#

and I want players to mine my blocks

quick arch
#

oh, just change it to something else, i.e. stone

lone fog
#

You can use any block if the armor stand model covers it

spare tiger
#

and make the armor stand slightly bigger?

lone fog
#

Which is nice for breaking speed

spare tiger
#

ohhhhhhh

#

that makes sense

#

ok

#

I think I'll do that then

lone fog
#

It also allows you to have stair shapes and stuff

quick arch
lone fog
#

But yeah itโ€™s just too laggy on a large scale

quick arch
#

that one was with a stone block and an armor stand

spare tiger
#

the only annoying part is you can't get block breaking textures that way

#

ยฏ_(ใƒ„)_/ยฏ

#

I guess you could if you really wanted to

#

by like rapidly changing the model

#

but that would be a major paing

#

pain

quick arch
#

oh, you definitely can

spare tiger
#

the real epic thing

quick arch
#

Custom mining speed

#

There's probably a way to cancel the particles from showing

lone fog
#

Skript, ew

spare tiger
#

would be if mojang added custom model data for blocks

quick arch
#

do hope that's coming soon

spare tiger
#

but i bet that would require some rewriting of the render engine

lone fog
#

Simple data driven blocks would be nice

spare tiger
#

because I believe minecraft renders the world to one mesh instead of a seperate mesh for each block

lone fog
#

But it would need to be sent to the client

spare tiger
#

which is much more efficient

#

but it would have to be designed for sudden changed

quick arch
#

require some rewriting of the render engine
Pretty sure they rewrote it in 1.14 or something

spare tiger
#

changes

#

yea

lone fog
#

1.15

spare tiger
#

i mean if forge can do it mojang can too right?

#

i mean its not like sudden resource loading

#

actually disregard my previous statement

quick arch
#

forge is server and client side though

spare tiger
#

I know

#

and mojang is server and client side

lone fog
#

They would need to add something like a ContentPack

spare tiger
#

well you know what

lone fog
#

And then send it to the client on login

spare tiger
#

they wouldn't really need to rewrite the render engine

#

because the way it currently works, whenever you reload the resources, it puts new models and stuff into memory

#

so obviously there is a method

#

since we're not adding new stuff on the fly

#

we're adding i t when resources are reloaded

#

at least new models

#

so I think its possible

#

I wonder if mojang is working on it? It's possible they tried it and it was too laggy...

or they just don't give a shit ยฏ_(ใƒ„)_/ยฏ

lone fog
#

I would guess they are

#

We donโ€™t really know what they plan to do with 1.17 yet

spare tiger
#

right

#

seems like no ones suggested it on the feedback site yet

quick arch
#

It feels more like 75% of the feedback site is "1.8 pvp"

spare tiger
#

lol

#

well like the top thing is cave update

#

so obviously people have some priorities

quick arch
#

Forget about the cave update, I'd rather have custom blocks

spare tiger
#

that's true

quick arch
#

Could just make your own cave with that update

spare tiger
#

lets make our own cave update

quick arch
#

:D

spare tiger
#

exactly

quick arch
#

๐Ÿค”

spare tiger
#

baobab

quick arch
#

It almost feels like the next update is going to be about the desert

spare tiger
#

but mountains are next...

quick arch
#

A lot of that are desert stuff

spare tiger
#

is mojang pulling one over on us

quick arch
#

probably

lone fog
#

We know those are coming because of the biome vote

#

But no idea when

quick arch
#

the only winter thing on that is the Goat

lone fog
#

And we also have the new combat update at some point

#

Frogs and desert stuff was also in the biome vote

spare tiger
#

when did they add custom model data?

lone fog
#

And termites, chest boats, etc

spare tiger
#

1.14?

quick arch
#

yup

lone fog
#

Technically they have 5 biome updates they said they would do eventually

#

Who knows when

spare tiger
#

exactly

#

maybe they'll do the first two before the 3 new ones

#

nobody expects that

#

so desert and the other one

quick arch
#

+5 years ๐Ÿ˜ฌ

spare tiger
#

than mountains

#

swamp

#

...

quick arch
#

There's mainly around 1 update per year or something

lone fog
#

2

quick arch
#

๐Ÿค”

lone fog
#

They aim for 2

quick arch
#

o

spare tiger
#

remember 1.13

quick arch
#

you mean 1.14

spare tiger
#

that felt so long

#

that felt like back in 1.7

#

1.7 - 1.8

quick arch
#

Less than a year ๐Ÿค”

spare tiger
#

almost a year

#

that was actually when I first got into minecraft

#

didn't notch used to do updates like weekly/monthly

#

way back when

#

when the game was simpler

quick arch
#

yeah

spare tiger
#

1.6 to 1.7

#

july to october

#

1.7 to 1.8

quick arch
#

1.0 to 1.1 took only 2 months

spare tiger
#

october to september the next year

#

remember when 1.8 first came out?

lone fog
#

To be fair they seem a bit bigger now

spare tiger
#

1 block commands

#

that's true

lone fog
#

And they keep doing big rewrites internally

spare tiger
#

which will hopefully make newer updates faster

#

gotta get rid of all that shitty notch code

#

from back when he was not an experienced developer

#

nah jk

quick arch
#

And they keep doing big rewrites internally
heh, Optifine 1.15 isn't out while Optifine 1.16 is out

spare tiger
#

there's a preview version

#

for 1.15

quick arch
#

yeah, preview 30

spare tiger
#

he's not gonna make any more

#

when a new version comes out all old version development ceases

quick arch
#

mhm

spare tiger
#

notch can make a game in lwjgl

#

the most i can do is make the screen pink

#

i'd say he's a pretty good developer

#

also wasn't the first version of cave game made in like a day

#

or a week

#

or some very short time period

#

rubberninja is typing

#

or not

unkempt ridge
#

I'm looking for someone who has worked with paginated GUIs before. PaginatedMenu class - https://paste.md-5.net/ovudexipey.java and my GUI class - https://paste.md-5.net/axuxayurow.java . I currently have an array list of strings of 31 phony punishments. In my PaginatedMenu class I set the limit to 28 items per page, however, items 29, 30, and 31 still show up on the first page and nothing shows up on the second page. There are no errors, yes I registered my events, and yes the list is populated. I can open the GUI as intended, however, items after 28 aren't being added onto the next page.

spare tiger
#

@quick arch @lone fog I'm going to upload this post to Minecraft Feedback

In 1.14, a new feature was added to Minecraft: Custom Model Data! This new feature allowed developers of datapacks and custom maps to add new items without having to use item durabilities. This allowed datapack developers to add new items to the game without having to take the slots of other items (like low durability versions of hoes).

This feature has added so much to the game and is so helpful. So when is it going to come to blocks? I understand it is a big undertaking to add this feature for blocks, but it would be so helpful to the Java edition community and would really allow for extensive mod support using only datapacks and resource packs, no external tools.

Datapack developers currently get around this by using armor stands wearing an item with custom model data, or putting an armor stand wearing an item with custom model data in a structure block. These are laggy methods that give a subpar experience to players. Don't get me wrong, this is some powerful stuff, but support for CustomModelData with blocks would open up so many possibilities for modding Minecraft without an external tool, just a resource pack and a datapack (and maybe a text editor and photo editor to make those with ;) ).

Does this seem good? Any edits I should make?

quick arch
#

Yeah that's good

spare tiger
#

Epic

#

Posting

#

ok its pending approval so I don't know if you can see it

#

but here's the link

#

seems like you can't see it until its approved

#

well check back on it tommorrow i guess

#

gn everyone

quick arch
#

yup can't see it

empty seal
#

I am looking to set a timer for an event I want to happen in 1.15.2. Any help / suggestions?

opal adder
#

I mean honestly man, I just use multicraft for most scheduled events I have. There are loads of ways to do scheduled events, a lot of people are disgusted by multicraft, because they associate it with shared servers. However, you can attach multicraft to a dedicated server and it runs perfectly fine.

frigid ember
#

is there aplugin for making it so if someone does a command it does sonthing different?

#

that what the command is

opal adder
#

I don't understand what you even mean by that. You can make a command that is "/Dog" do literally anything you want

frigid ember
#

no like

#

if i want to change /kill to do someting else than kill some1

opal adder
#

I mean, I'm pretty sure /kill is built into spigot. You might be able to make a plugin and create a /Kill command. I'm not sure if it would override it or not, I've never done that. Why would you even want that.

frigid ember
#

becus

opal adder
#

What?

#

I mean I guess maybe you could cancel to playercommandpreprocessevent when they type it, and then do something else? I mean that would be so weird but it might work

empty seal
#

well I am trying to make a plugin that every 5 mins it randomly teleports players to somewhere in the world and I need a timer in the code.

opal adder
#

I mean the only timer I'm really personally comfortable with is a bukkit runnable, however I'd probably get shit on in here for suggesting you should use it haha. Really any timer within java or bukkit will work for that.

quick arch
#

/spreadplayers ๐Ÿค”

ebon girder
#

i installed buildtools but i cant see git

#

it isnt in the start menu and i cant right click to access it...

quick arch
#

you have to download git manually

ebon girder
#

oh

quick arch
spring coyote
#

How can I have a player open their own inventory? with the armor gui showing

frigid ember
#

If I have a Location with world already set.. how can I fix this to remove the .getWorld() ```List<Entity> entities = new ArrayList<>(l1.getWorld().getNearbyEntities(l1, 25, 25, 25));

[this is location already grabbed] Location l1 = new Location(dl, -32.0D, 65.0D, 89.0D);```

steady osprey
#

how would i stop vindicators from dropping banners and iron axes

balmy sentinel
#

EntityDeathEvent??

steady osprey
#

yeah

#

how would i remove them from event#getDrops

viscid tundra
#

Hey I am pretty new to spigot plug-ins and I was wondering if I need to state a class other than the main class in the yml doc

balmy sentinel
#

@steady osprey try event.getDrops().clear();

#

@viscid tundra if youโ€™re talking about the plugin.yml then no.

viscid tundra
#

K thx @balmy sentinel

steady osprey
#

try event.getDrops().clear();
@balmy sentinel that would remove all the drops though

frigid ember
#

event.getDrops() returns list

#

iterate over list and remove specific items if they meet a criteria

steady osprey
#

how would i remove them from the list though

balmy sentinel
#

same way you remove any object from a list.

steady osprey
#

thats no help, how would i figure out the index of the item i want to remove

frigid ember
#

Isn't that the basics of Java tho?

#

yes

steady osprey
#

Isn't that the basics of Java tho?
@frigid ember im still learning jav

#

java

balmy sentinel
#

pretty much so I donโ€™t understand how my response โ€œwas no help.โ€ If you donโ€™t understand something then use your search engine to look it up. and that search engine better not be google

frigid ember
#

Learn Java, then learn spigot-api?

#

It'll make your life so much easier.

#

g o g l

steady osprey
#

what else am i supposed to use microsoft edge ๐Ÿ˜‚

frigid ember
#

๐Ÿค”

#

๐Ÿ˜•

balmy sentinel
#

DuckDuckGo is actually very good and useful if you know how to use a search engine. DuckDuckGo also doesnโ€™t save and sell your data to other companies like google.

frigid ember
#

bing it

steady osprey
#

id rather stick with google

frigid ember
#

every single thing you touch saves your data ๐Ÿค”

#

^

#

yep

#

how do u know duckduckgo isnt saving ur data

steady osprey
#

welp china gonna see the freaky stuff in my search history, idc lol

frigid ember
#

๐Ÿ‘€

balmy sentinel
frigid ember
#

I mean who cares if Google saves & sells your data lol ๐Ÿคทโ€โ™‚๏ธ

forest pendant
#

Does anyone know of a plugin that allows a github repository to be used as a file store for a servers config files and syncs it automatically?

spring coyote
#

How can I have a player open their own inventory? with the armor gui showing, not the player.openInventory(player.getInventory) or is that client side

balmy sentinel
#

When a player opens their own inventory itโ€™s client side

spring coyote
#

Ok but is there any way to replicate the armor gui?

faint lance
#

How do I hide my custom command from users who dont have permission to use it

balmy sentinel
#

no idea, you could create your own GUI and have it mirror what armor a player currently has on.

#

@faint lance check if they have permission to execute it.

spring coyote
#

I think he means stopping the client from seeing it on the tab list

faint lance
#

I want to hide it from them

balmy sentinel
#

mhmm you could try tab complete, but Iโ€™m not sure.

faint lance
#

because if they type / in chat it shows the command

#

let me try that

balmy sentinel
faint lance
#

I found that as well

frigid ember
#

hi cna i get help with cpanel

#

how do i disable people to redirect to the domain

#

nd only allow connections within the server

tranquil anvil
#

Hey md I found your Spigot-Plugin project and I'm having watchdog issues.
It says to report the issue to http://spout.in/cbpp but the URL seems dead :/
Says The server has stopped responding! and then a stacktrace.

grizzled remnant
#

spotted pls, let vic use the most performance increasing CraftBukkit plugin out there

tranquil anvil
#

:/

dense rampart
#

@strange roost do u know?

strange roost
#

?

dense rampart
#

why is it breaking

grizzled remnant
#

pls help our server is dying

tranquil anvil
#

^

#

my 1.2.5 server is dying pls help :(

viscid tundra
#

Have you tried turning it off and turning it back on

sage summit
#

how do i get only the first word of a string and delete all the words past the first word?

dense rampart
#

string = string.split(" ")[0]

sage summit
#

ok thanks

plush nexus
#

when I try to set PlayerFishEvent drops to Material.AIR or null, it throws an error and gives a normal drop
when i try to cancel the event completely, the bobber stays in the water
is there a way to make the catch nothing (without errors) or retract the fishing bobber when i cancel the event?

sage summit
#

How do you make it so players cant use the /pl or /plugin command?

lone fog
#

when I try to set PlayerFishEvent drops to Material.AIR or null, it throws an error and gives a normal drop
when i try to cancel the event completely, the bobber stays in the water
is there a way to make the catch nothing (without errors) or retract the fishing bobber when i cancel the event?
event.getCaught.remove

lapis wedge
#

is there a way to get BuildTools to be silent?

#

I want to run java -jar BuildTools and see no output until it done, is that possible?

#

ok so I'm running java -jar BuildTools.jar > /dev/null but that feels dirty, are there any flags for this?

plush nexus
#

thank you Coll

hollow thorn
#

can i store an int in a persistant data tag

tiny dagger
#

yes

#

but i think it has to be boxed

hollow thorn
#

how do i get a specific scoreboard tag which stores a variable

tranquil aurora
#

If this is not the right place then I apologise, but I'm currently running a network just by running the jar file hosted myself. Is there anyway I could use a web panel and which one?

hollow thorn
#

how do i get a specific scoreboard tag which stores a variable

fierce briar
#

For ender

warm stirrup
#

i am a beginner in use of NMS and what not. I've watched youtube videos where they are able to import multiple versions of NMS on the same project? (notably: https://www.youtube.com/watch?v=Yzte-aAfFsQ)

but they don't go any detail into how this works. as if they just made the tutorial and are fine with how it "just works" and not actually going into specifics. could someone explain that to me?

for example: i only have one import here https://imgs-i.sabel.dev/w3ptspp.png

glad summit
#

Hey everyone!
I have a question/bug regarding aliases
I am new to Spigot, and haven't checked if this problem exists in other versions besides latest (1.16.1)

The problem is:
My aliases are registered to the command list in the server (they are suggested in the tab completer if I just press /)
But most of them aren't really registered....

plugin.yml as follows:

commands:
  addGravityBlock:
    description: Add a gravity affect to a block.
    usage: "ยง4Usage: /addGravityBlock <block> <gravity>"
    aliases: [gb, gbAdd]
  removeGravityBlock:
    description: Remove a gravity affect from a registered block.
    usage: "ยง4Usage: /removeGravityBlock <block>"
    aliases: [gbRemove, gbRem]
  listGravityBlocks:
    description: List all blocks registered with a gravity affect.
    usage: "ยง4Usage: /listGravityBlocks"
    aliases: [gbs, gbList]
warm stirrup
#

"arent really registered"?

#

what does that mean

glad summit
#

You're right, I'll clarify:
It means that if I use them - I get the "command not found" thing (the one that tells me to use /help to see all commands)

warm stirrup
#

that syntax works on my plugins and they work fine in 1.16

hollow thorn
#

how do i get an equation from a message

glad summit
#

Interesting, I'll try to update my spigot, maybe it is a bug that was fixed already..

mellow wave
#

@warm stirrup NMS isn't recommended unless you really need it. It's higly version depended and will break with almost every update

#

...

warm stirrup
#

cool. i really need it

mellow wave
#

Alright what are you trying to do

warm stirrup
#

actionbar

mellow wave
#

ah I see

warm stirrup
#

which literally uses actionbar as an example but it goes into no detail as to how to actually be able to import multiple versions

mellow wave
#

You will have to add every jar to the project

tiny dagger
#

^

#

if you use maven

#

you need to modulize the versions

warm stirrup
#

i am using maven...

#

thats just not the solution im looking for though

mellow wave
#

I would just manually install all of the jars in to the local repo

#

Not sure what's the best way

tiny dagger
#

you can i think just remove everything exceppt the nms classes

#

in repo

#

for each version

#

that way no clashes will happen

#

due to their package difference

#

it's a hack tho

mellow wave
#

I know a certain repo that might contain NMS...

#

I'm 99% sure they shouldn't but they decided to put it there

warm stirrup
#

yeah you cant distribute that :/

#

here's what im trying:

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.16.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
#

then of course i put another dependency with 1.15.2 instead

#

but then it yells at me for it being a duplicate

mellow wave
#

Yeah you need modules

#

One module per version

#

And then a parent POM that compiles everything together

warm stirrup
#

but I would have multiple jar files, one for each version, no?

mellow wave
#

You would

#

But only one per module so they don't conflict

warm stirrup
#

yeah that isnt exactly what I'm looking for either. my goal is to have a jar that works no matter the server version

mellow wave
#

Then you need reflection

tiny dagger
#

do my hack then

#

๐Ÿ‘Œ

#

create local repo with only the nms package

#

and of course craftbukkit package

warm stirrup
#

i think i know what you're getting at thanks. so either way im still gonna have those folders with the different versions

mellow wave
#

If you're using reflecton you don't need all the versions

#

Reflection allows you to get the class from a string

#

Which means that you can do something like "net.minecraft.server." + version + ".actionbar" and grab the actionbar class. This will also allow you to access all of it's methods

#

I do have to note that it's slower

steady yacht
#

is there a way to put " : " to "unknown-command:" on spigot.yml

warm stirrup
#

yee that one video noted that it takes like 400ms longer to do that method?

#

but in theory it shouldnt be that bad if i have a switch statement for each supported version?

mellow wave
#

You don't need a switch statement

#

All you need to do is grab the correct NMS version on startup and then grab the class with reflection

#

Then when you want to send the actionbar you need to invoke a method inside of the class

wraith thicket
#

You can easily use a multi module system to put together one jar that works on all the versions you wish to support

mellow wave
#

Yeah we already talked about that

#

Isabel didn't want that approach

warm stirrup
#

do you mean "one jar" as in like one jar for each version? because yeah that's not quite what I'm looking for

wraith thicket
#

No

mellow wave
#

It will create one jar file for all versions

tiny dagger
#

no lol

warm stirrup
#

oh

tiny dagger
#

internally each module has only a dependency

#

which then you will add them to a parent

wispy pewter
#

Hey

warm stirrup
#

so i can use maven just how ive been doing it, I just need modules for each version and maven will sort it all out?

#

sort it all out as in, make one jar file that works

mellow wave
#

oh sorry for confusing you