#help-development

1 messages · Page 1505 of 1

sacred vector
#
                    if(!player.getWorld().hasStorm()){
                        player.getWorld().setStorm(true);
                    }
                    if(player.getWorld().hasStorm()){
                        player.getWorld().setStorm(false);
                    }
``` Is something incorrect about this, that it doesn't disable the storm when there is one
quaint mantle
#

"dun"?

hardy swan
#

Don't

#

Lol

#

Like say i have a shield in hand when I interact with a block

#

I can't cancel shield use

quaint mantle
covert bluff
#

is there

#

an event

#

for when player use shield

quaint mantle
#

interactevent

#

or when it is interacted with?

sacred vector
covert bluff
#

because im searching everywhere and there's not much

quaint mantle
sacred vector
quaint mantle
#

what are you trying to do

sacred vector
#

well you right click the item, and if its no rain it will turn rain on. but if it is raining it will turn it off

#

rn it doesnt turn of the rain when u click it again

covert bluff
#

show the entire code

#

we can't rule out anything if you're just gonna show the part where it toggles storm

sacred vector
#

its a lot....

covert bluff
#

please don't tell me it's full of if statements

sacred vector
#

no

#

im not new to coding, just new to java

dusk flicker
#

paste it

#

?paste

undone axleBOT
sacred vector
#

this is just the event handler

#

do you want the actual item as well?

dusk flicker
#

send the entire class

covert bluff
#

have you registered the event

#

or put @EventHandler above it

sacred vector
covert bluff
#

have you put the @EventHandler annotation abovei t

sacred vector
covert bluff
#

because it wont work if you dont

river shell
#

Is there a way to delete a worlds chunk and have it regenerate?

dusk flicker
#

I expected a few hundred lines from what you were saying

sacred vector
#

my main file is 400 rn u said main class. and i wasnt going to do that lol..

quaint mantle
#
# pseudo

on playerinteractevent:
    if player doesn't have myItem: return
    
    player.setPlayerWeather(player.getPlayerWeather() is WeatherType.CLEAR, 
        if true WeatherType.DOWNFALL 
        else CLEAR
    )

@sacred vector

#

also your code is really messy

undone axleBOT
covert bluff
#

also

#
if(getConfig().getBoolean("Ocarina-Item") == true){
#

remove == true

sacred vector
#

oh no that part isn't done, im adding it to the config to toggle if you want it enabled or not

covert bluff
#

ye

hardy swan
covert bluff
#

i heard there were some things wrong with that

#

or no?

hardy swan
#

Delayed

covert bluff
#

ye, i know shields would always have something like a 250ms delay

hardy swan
#

Thought Player Is-A HumanEntity

jagged monolith
shy skiff
#

Need help, how i get a string from a class command to another class (but the string is args[0])

gloomy edge
#

I'm the best programmer 10/10

dusk flicker
#

oh

#

my

#

dear

#

lord

gloomy edge
#

lol

covert bluff
#

that

#

is so painful

#

the things that hurt the most are the ones that are bent over

dusk flicker
jagged monolith
granite stirrup
covert bluff
#

just gave me a lot of ideas

#

on how i could make better code

ebon siren
gloomy edge
#

LOL o

#

i'm crying laughing

covert bluff
#

didn't know you could do

fuckyou
  .fuckyou()
  .fuckyou();
hardy swan
granite stirrup
covert bluff
#

does continue go to the next iteration loop or does it break the entire loop

hardy swan
#

Next

#

Break breaks

#

Continue continues

covert bluff
#

what about return

#

ends both lloop and method?

hardy swan
#

Return returns

covert bluff
#

or just lop

#

oh

hardy swan
#

Yea end everything

covert bluff
#

NamespacedKey.minecraft("sharpness") does not work

hardy swan
#

Deprecated i think

covert bluff
#

no, protection and unbreaking worked for me

#

i just figured out that the reason why it wasn't working is that i forgot to add the two to the list

#

i was being an idiot

#

the problem was so simple

#

lol

#

does anyone nkow how i can make a .yml file come with the plugin other than it being config and plugin

hardy swan
#

Search create custom config spigot

covert bluff
#

i did htat and opera crashed

hardy swan
#

Add as part of <include> if maven

covert bluff
#

i had too many tabs open

dusk flicker
#

in that

covert bluff
#

ty

#

i need a code reviewer to review my code

dusk flicker
#

we arent here to "review code"

#

We're here to answer questions

covert bluff
#

well damn

granite stirrup
#

Why not a getter bruhhhh

#

Or pass through

covert bluff
#

there's a getter

#

wtf

#

oh

#

i don't rememberp utting public there

granite stirrup
#

U put static

covert bluff
#

but there's a getter for it

granite stirrup
#

Whhyyyyy

covert bluff
#

what was i supposed to do

paper viper
#

That isnt me

#

LMAO

hardy swan
#

oh

granite stirrup
#

Pass instance to other classes using constructor

paper viper
#

read the messages above

hardy swan
#

lol

paper viper
#

dont you dare critique me

#

/s

covert bluff
#

what do i do

#

:/

#

first i was told to do singleton method then i'm told to pass it to other classes

#

wtf

granite stirrup
#

Don't use static please

paper viper
#

for plugin instances, both are valid methods but the latter is arguably better

#

otherwise, you should NEVER use static

ebon heron
#

What’s wrong with static?

sage swift
#

electricity

ebon heron
#

lol

timid delta
#

Nothing is wrong with static if you understand when to use it

hardy swan
#

doesn't really matter here tbh, but it just makes people feel better to not 😛

ebon heron
#

Ah ok.

paper viper
#

ahaha

granite stirrup
#

I mean u shouldn't ever use static

#

Its pointless

paper viper
#

like utility methods

hardy swan
#

arguably some things which suppose to belong to a plugin instance

timid delta
#

Lol, it is plenty useful

paper viper
#

just dont abuse it

granite stirrup
paper viper
#

like what hes doing

#

lmao

covert bluff
#

what od i do

quiet hearth
#

I am trying to make a plugin that give different effects to the player on consumption. However when I eat any of the foods it give me all the effects that are listed within the program. Rather than just giving the individual effects. If someone could check to see what is wrong I would greatly appreciate it. Thanks.

hardy swan
timid delta
#

Don't make blanket statements on things you should/shouldn't do not knowing what someone is doing 😄

covert bluff
#

create a class that contains all of it and then make getters?

#

which are non-static?

#

then make the stuff accessible using constructor?

paper viper
#

which promotes OOP concepts

#

and i dont want to go into a full explanation about it

#

so thats why i just say "dont use it"

#

¯_(ツ)_/¯

granite stirrup
#

No pass through constructor of other classes the plugin instance

paper viper
#

cause most beginners just like

#

dont know how to use it correctly

#

and later on they will learn how to use it correctly

covert bluff
hardy swan
sage swift
#

@quiet hearth ItemStack#getMaterial

covert bluff
#

that is actually the first thing i tried believe it or not

#

i'm not sure if intellij is broken or not

#

but it's just showing up errors

#

and i'm sure i did nothing wrong

#

which is why i just resorted to "abusing" static

#

not knowing that it's actually a very bad practice

paper viper
#

Never resort to that

#

never EVER

covert bluff
#

methods were public

#

never static

quiet hearth
sage swift
#

🏖️ resort

covert bluff
sage swift
#

who cares

granite stirrup
#

U need to pass in the instance to the other classes via constructor and make a field in that class to set that in the constructor then use that field wherever u use the instance

#

Sorry I can't explain it well XD

covert bluff
#

getInstance() method or get the plugin by class' constructor (pass plugin as argument)

granite stirrup
#

U know what I give up

covert bluff
#

Ok

timid delta
#

@quiet hearth
Why are you comparing the the ItemMetas instead of just the Material?
Also store some variables so you don't have to keep re-getting them

proud basin
#

I have this ```java
File file = new File(pluginFolder + File.separator + subPath + fileName + ".json");
File filePath = new File(pluginFolder + File.separator + subPath);
filePath.mkdirs();
if (!file.exists()) {
file.createNewFile();
}
FileWriter fileWriter = new FileWriter(file);
fileWriter.write(main.toJSONString());
fileWriter.flush();
fileWriter.close();

wet breach
#

needs a bit fixing up

hardy swan
wet breach
#

I see you used File.separator, but why not in the rest of the places?

jagged monolith
#

Is it just me, or did 1.17 break hex colour support

granite stirrup
hardy swan
#

oopsie

#

watever just the idea

covert bluff
#

he was just giving an idea

quiet hearth
granite stirrup
candid silo
timid delta
quiet hearth
hardy swan
timid delta
timid delta
proud basin
granite stirrup
#

Yeah jtx I can't help u

proud basin
#

aw

timid delta
proud basin
#

worth a try

timid delta
proud basin
#
public class JsonHandler {

    private Volzo plugin;
    private String pluginFolder;

    public JsonHandler(Volzo plugin) {
        this.plugin = plugin;
        this.pluginFolder = this.plugin.getDataFolder().getAbsolutePath();
    }

    public void writeJSON(String fileName, String subPath, String object, String value) {
        JSONObject main = new JSONObject();

        main.put(object, value);

        try {
            File file = new File(pluginFolder + File.separator + subPath + fileName + ".json");
            File filePath = new File(pluginFolder + File.separator + subPath);
            filePath.mkdirs();
            if (!file.exists()) {
                file.createNewFile();
            }
            FileWriter fileWriter = new FileWriter(file);
            fileWriter.write(main.toJSONString());
            fileWriter.flush();
            fileWriter.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
timid delta
proud basin
#

jsonHandler.writeJSON("playerData", "data","t", "w");

timid delta
#

Make sure you add an extra File.separator in that case here:

File file = new File(pluginFolder + File.separator + subPath + fileName + ".json");

to

File file = new File(pluginFolder + File.separator + subPath + File.separator + fileName + ".json");
#

That appears to work for me. What do you get as a result?

proud basin
#

playerData is outside of data

#

but lemme test that

worldly burrow
#

So apparently Player.getItemInHand() is a deprecated method, is there a reason it is deprecated/is there an alternative?

timid delta
#

there's two hands now, so there's a getItemInMainHand and getItemInOffhand

proud basin
#

it works

worldly burrow
#

ah

proud basin
#

thanks

timid delta
# worldly burrow ah

For future reference, if you ctrl+click into a deprecated method, it usually tells you the replacement or reason it is deprecated. Or even hover over it (at least in Intellij)

worldly burrow
timid delta
#

See my previous comment, it specifically mentions they are in PlayerInventory

worldly burrow
#

ohh

#

How can I add NBT tags to a block?

timid delta
#

What are you trying to do?

worldly burrow
#

Set an NBT tag which indicates that the block cannot be broken by a player who is not an operator

proud basin
#

?paste

undone axleBOT
proud basin
stone sinew
proud basin
#

i see that

#

so that means I can't check if its false

stone sinew
#

player.setAllowFlight(true)

dapper gazelle
#

How do I download 1,17 from the website
the server link

stone sinew
#

?bt

undone axleBOT
dapper gazelle
#

do i replace the buildtools with server?

quaint mantle
#

no

#

you read

dapper gazelle
#

with server.jar

proud basin
#

What's the difference between setFlying and setAllowFlight?

stone sinew
dapper gazelle
#

Ok

quaint mantle
#

read the damn wiki

#

lmao

dapper gazelle
#

so I did that and opended it

stone sinew
dapper gazelle
#

lmfaoo wheres the file at im so lost

timid delta
dapper gazelle
#

Could we hop in a vc rq? I just want to screenshare

stone sinew
# dapper gazelle so I did that and opended it

Steps:
1. Place the BuildTools.jar file into an empty folder.
2. Open gitbash or which ever console program you prefer.
3. Type the command to run build tools and make sure to enter the version you want. (version 1.17 requires java 16)

timid delta
#

Please don't DM me, follow the directions listed

quaint mantle
#

hey guys how do I loop trough all the numbers in a multiplication (example: 2x2 = 2, 3, 4) (example: 3x3 = 3, 4 ,5 ,6 ,7 ,8 ,9)

paper viper
#

For build tools

quaint mantle
#

it's cooler

#

lol

paper viper
#

Loop from x to x squared

#

and make sure to set x squared constant

quaint mantle
#

ok but maybe not always squarred

#

like

#

it could be 3*6

#

8*12

paper viper
#

No difference

#

Lmao

vague oracle
#

Does anyone know how long you have to wait to remove a NPC for its skin to always show? I have tried 50 ticks but that works only 75% of the time.

paper viper
#

Then just set that

#

And loop it

stone sinew
quaint mantle
#

so for example for 4*19```

for(int i=4;i<=19;i++) {
sysout(i);
}``` would that be it?

wanton fjord
paper viper
#

No that loops from 4 to 19 inclusive

quaint mantle
#

forgot to multiply lol

paper viper
#

You have to multiply

#

Yeah

wanton fjord
#

i was never really able to figure it out on my own yet either

quaint mantle
#

thank you so much 😄

paper viper
#

Np

stone sinew
#

What is the new package for net.minecraft.server.v1_16_R3.Blocks.AIR.getBlockData()?
net.minecraft.world.level.block.Blocks.AIR.getBlockData() shows AIR cannot be resolved or is not a field

proud basin
#

How come when I do /fly and on the ground while having fly enabled it apparently false

stone sinew
proud basin
#

I did

stone sinew
#

Show new code

#

setAllowFlight(true) is the method that allows you double jump to enable flying.

#

if its false you can't fly

stone sinew
#

I don't use builders

young knoll
stone sinew
quaint mantle
#

yeah if you want to use deobf class/field/method names you need to dev against the deobf and remap with the specialsource maven plugin

young knoll
#

Nah that was spigot

quaint mantle
#

literally not mojang

young knoll
#

Spigot is transition to Mojang mappings

#

And we are in a weird transition period

stone sinew
#

Ok same for spigot then. Always breaking things LMFAO

young knoll
#

You should read the entire 1.17 post

#

You can use a Mojang mapped version and then remap it on compile

#

But that won’t support reflection strings and whatnot

quaint mantle
#

mixins 😌

young knoll
#

If only

worldly burrow
#

Any on player death event?

young knoll
#

What

worldly burrow
#

well is there any event that gets dispatched when a player dies?

quaint mantle
#

yeah... you named it yourself

#

PlayerDeathEvent

timid delta
worldly burrow
#

Oh, its in org.bukkit.event.entity and not org.bukkit.event.player

quaint mantle
#

oh god

timid delta
#

I mean, there's a search bar

young knoll
#

Yes, it subclasses the entity death event

timid delta
#

My Intellij also gives all the events for players when you type PlayerEvent. Gotta love a good IDE

proud basin
#

I'm setting killstreak to 0 by default but it stays at null ```java
public static Map<UUID, Integer> killstreak = new HashMap<UUID, Integer>();

public void addToKillstreak(Player killer) {
UUID uuid = killer.getUniqueId();
killstreak.put(uuid, 0);
if (killstreak.containsKey(uuid)) {
int kills = killstreak.get(uuid);
kills++;
killstreak.put(uuid, kills);
} else {
killstreak.put(uuid, 1);
}
}

young knoll
#

killstreak.getOrDefault may help you here

proud basin
#

nope

#

still set to null

young knoll
#

That’s not possible

#

getOrDefault either returns the value in the map, or the default

proud basin
#

might of fixed it

young knoll
#

Unless you explicitly put null into the map

quaint mantle
#

map.merge(uuid, 1, Integer::sum) mmmmmmmmmm

young knoll
#

That is also useful

proud basin
#

oh no

quaint mantle
#

that's like 8 out of 9 lines condensed into 1 lol

proud basin
#

killstreak doesn't reset to 0 when they die

#

rip

ebon siren
#

PlayerDeathEvent getEntity() returns the person who killed the player right

young knoll
#

No it returns the dead player

ebon siren
#

oh

#

how would i go about getting the killer then

young knoll
#

Player#getKiller

ebon siren
#

ok

#

thanks

proud basin
#

Is there a reason why when a player dies in 1.8 they get pushed

quaint mantle
#

hey guys when i do for(int i=0; i<totalLength;i=+1) { it loops everytime but it never does + 1 (I've tried with i++) doesn't work either

hardy swan
#

+=1

young knoll
#

Should be +=

hardy swan
#

or ++

quaint mantle
#

still

#

++ doesn't work either

young knoll
#

Is totalLength > 0

quaint mantle
#

int totalLength = 10;

hardy swan
#

do you have a break;

quaint mantle
#

nope

#
            i=i+1;
            e.getPlayer().sendMessage("normal: "+ String.valueOf(i));
            for(int _i=Math.min(data.getLoc(), data.getLoc()+fish.getLevel().lenght); _i <= (data.getLoc()+fish.getLevel().lenght); _i=+1) {
                _i=_i+1;
                e.getPlayer().sendMessage("not normal: "+ String.valueOf(_i));
                if(i== _i) {
                    if(cursor.loc == i)
                    {
                        label = label+ChatColor.BLUE + "|";
                    }
                    else
                    {
                        label = label+ChatColor.GREEN + "-";
                    }
                }
            }
            if(cursor.loc == i)
            {
                label = label+ChatColor.DARK_BLUE + "|";
            }
            else
            {
                label = label+ChatColor.RED + "-";
            }
        }```
#

the player.sendmessages are just for debugging

jagged monolith
#

For loop with no break, infinite loop danger

hardy swan
#

ok so you shoultnt have i=+1

#

in this case you reset i to 1 every loop

quaint mantle
#

I know I changed it but still doesnt work

#

when i print out

#

i

young knoll
#

For loop with no break is pretty common

quaint mantle
#

it says its 0

hardy swan
quaint mantle
#

uhm should work normally

#

idk what's wrong tbg

#

tbh

hardy swan
quaint mantle
#

yes

#

oof

#

that's just a screenshot of my chat

young knoll
#

Doesn’t just importing a class that doesn’t exist throw class not found

young knoll
#

Oh right

stone sinew
#

Hence why the top one works. I just don't know why the bottom one doesn't for some reason

young knoll
#

Duh

hardy swan
#

erm

#

are you using 1.9.sth

whole stirrup
#

When handling an AsyncPlayerChatEvent, what is the best way to retrieve information about a player synchronously and then use that data to set the chat format?

stone sinew
young knoll
#

Don’t know, check if the 1.9 check is somehow passing

stone sinew
young knoll
#

Are you sure you haven’t imported something

stone sinew
#

But if I comment 1.9 out it will say its missing 1.10 lol and so on up to 1.17

young knoll
#

And this is why I never let two NMS versions exist in the same class

stone sinew
#

None are imported

hardy swan
#

normally when I do this I would have loaded n.m.s.%s.***, if you get what I mean

#

which works all the way up to 1.16.5

#

1.17(+) uses net.minecraft.network.sth i forgot

young knoll
#

I reflectively load a NMS Adapter class based on version

hardy swan
#

yea, dun class cast it

#

leave it as Class<?>

stone sinew
#

This code is old lol... And I don't want to sit here for a few hours doing reflection

hardy swan
#

it could be worth the time ngl

stone sinew
young knoll
#
    private void initializeNMSAdapter() {
        String version = VersionUtils.getServerVersion();

        try {
            adapter = (NMSAdapter) Class.forName("me.jishuna.challengeme.nms.NMSAdapter_" + version)
                    .getDeclaredConstructor().newInstance();
            getLogger().info("Version detected: " + version);
        } catch (ReflectiveOperationException e) {
            getLogger().severe("Server version \"" + version + "\" is unsupported! Check the plugin page for updates.");
            getLogger().severe("Plugin will now be disabled.");

            Bukkit.getPluginManager().disablePlugin(this);
        }
    }```
#

Works for 1.16 and 1.17, and I assume anything else

quaint mantle
#

ANYONE WANNA HELP?

hardy swan
quaint mantle
#

yes

#

I have

hardy swan
#

try this

for(int i=0; i<totalLength; i++) {
            e.getPlayer().sendMessage("normal: "+ i);
            for(int _i=Math.min(data.getLoc(), data.getLoc()+fish.getLevel().lenght); _i <= (data.getLoc()+fish.getLevel().lenght); _i++) {
                e.getPlayer().sendMessage("not normal: "+ _i);
                if(i== _i) {
                    if(cursor.loc == i)
                    {
                        label = label+ChatColor.BLUE + "|";
                    }
                    else
                    {
                        label = label+ChatColor.GREEN + "-";
                    }
                }
            }
            if(cursor.loc == i)
            {
                label = label+ChatColor.DARK_BLUE + "|";
            }
            else
            {
                label = label+ChatColor.RED + "-";
            }
        }
quaint mantle
#

I'll try

hardy swan
#

I only changed the ++ and removed the String.valueOf

quaint mantle
#

alright

#

thanks

hardy swan
#

cuz for string concat not neccessary

quaint mantle
#

I'l ltruy

young knoll
#

Please rename _i at some point too

timid delta
young knoll
#

I J K are generally only for the value in a for loop

timid delta
#

yup, but never _i

young knoll
#

Descriptive names should be used otherwise

hardy swan
#

cool kids uses .forEach

young knoll
#

Or just go full manual obfuscation and name it iliiliiililiii

hardy swan
#

wat if the first person who popularized the use of i intended it to be roman numeral

#

ngl that looks pretty clean

#

at least you do not have this

#

god knows what is above

timid delta
young knoll
#

Don’t catch generic exception

stone sinew
#

Replied to the wrong message

young knoll
#

Java has ReflectiveOperationException for convenience

hardy swan
#

lol

#

LOL

young knoll
#

ReflectiveOperationException tells the reader that this code can throw various exceptions because of reflection

#

Exception tells the reader it could throw any dang exception under the sun

hardy swan
#

oh, you meant generic as in Exception

young knoll
#

Yes

hardy swan
stone sinew
#

Whats worse is the error doesn't say the exact line... its just says the line the creates the class.

hardy swan
#

is there a version method analogous to compareTo()

#

but not String's

young knoll
stone sinew
#

Uggg so annoying. I've tried moving the method around the class, using switch instead of 'if', etc... I can't figure out why one method works and the other causes a class not found exception.

hardy swan
#

analogous to compareTo

#

wait, can you actually just compare the string...

young knoll
#

You would have to write your own to compare them without the string

hardy swan
#

you can wtf

young knoll
#

A simple semver class would work

hardy swan
#

nvm im dumb

#

string comparison doesn't work

candid silo
#

How would I make it so that a player can't dismount a mount, but if they try it ticks up a counter?

young knoll
#

Use the dismount event

candid silo
#

tried but canceling doesn't cancel the dismount

young knoll
#

Iirc it’s cancellable, if not just mount them again a tick later

#

Or even the same tick may work

candid silo
#

I tried that but tbh could just be my spaghetti code that I made 6 months ago and so now I'm recoding it.

sage swift
young knoll
#

Makes sense

#

The client doesn’t wait for the server to tell it it’s allowed to dismount

#

You could probably just send a mount packet back

sage swift
#

I think it does though

#

but the event sends it despite being cancelled

young knoll
#

What

#

When a player dismounts the client just assumes it will succeed, you could probably fix this by sending a mount packet back when you cancel the event

#

Or you could just not cancel it and manually mount them again

sage swift
#

I don't think it does assume it though

young knoll
#

I don’t see why it wouldn’t

sage swift
#

Because I've had situations where i can't dismount because the server is lagging/crashing

#

95% sure it does wait for a packet

young knoll
#

Hmm

#

Weird

candid silo
#

if you cancel an event it stops running the listener at that line right?

sage swift
#

Nope

candid silo
#

k

#

😃 🔫
i never called the event

quaint mantle
#

[How to make sign gui for input string WITHOUT PROTOCOLLIB? :D] Hello! I was making it yesterday and I tried to make it by searching for threads and resources (API) and most of them were using protocollib. I tried to make with a non-protocolib api, but I encountered several problems. And I flew for as long as four hours. And I cried. How do you simply create a signgui (If the player closes it, he can get the string written on it.) without protcolib? it uses PacketPlayOutBlockChange and PacketPlayOutOpenSignEditor First of all, I can open the sign on the API I'm using. But I can't get a text message when I close it.

sage swift
#

[Not an answer to your question D:] Hello! I don't know!

quaint mantle
#

how to continue a for loop when you get out of a for loop inside of it???

#

but only if you exited the first one before

sage swift
#

that sounds like bad code structure to me

quaint mantle
#

mhm

#

so that's my code for(int i=0; i<totalLength; i++) { for(int _i=Math.min(data.getLoc(), data.getLoc()+fish.getLevel().length-1); _i <= (data.getLoc()+fish.getLevel().length-1); _i++) { if(i== _i) { e.getPlayer().sendMessage("_i: " + _i); if(cursor.loc == i) { label = label+ChatColor.BLUE + "|"; break; } else { label = label+ChatColor.GREEN + "-"; break; } } } if(cursor.loc == i) { label = label+ChatColor.DARK_BLUE + "|"; continue; } else { label = label+ChatColor.RED + "-"; continue; } }

sage swift
#

but you could use a boolean outside of the loop and set to true when you break

quaint mantle
#

ooh good thinking

hasty otter
#

Hello, saterday I updated my plugin to 1.17 but some users are getting these errors, when they type /shop it should open the main inventory but here it crashes the server, is this a problem with the plugin or the server?

sage swift
#

?paste holy fuck

undone axleBOT
quaint mantle
#

thank you 😄

hasty otter
#

Which channel should I use?

#

Server help?

sage swift
#

hmm, the one where you can get help for your server maybe

hasty otter
#

Well, idk if this is a problem with the server or the plugin so thats why I posted here, but I will move it

sage swift
#

If you didn't make the plugin it doesn't go here

hasty otter
#

Well, Im the dev

quaint mantle
#

loll

hasty otter
#

So, is this a server issue or a issue from the plugin?

#

It looks to a server issue to me but can't say that for sure

#

They're both on spigot 1.17 servers if you need that.

covert bluff
#
public class EntityDamageListener implements Listener {
    private KitSelector plugin;

    public EntityDamageListener(KitSelector plugin) {
        this.plugin = plugin;
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }


    final int combatTagTime = this.plugin.getConfig().getInt("combatTagTime");
    HashMap<UUID,Integer> combatTagList =  this.plugin.getCombatList();

    public static void onInterval() {
        Map<UUID,Integer> tempCombatList = new HashMap<>();
        for (UUID id : combatTagList.keySet())
        {
            int timer = combatTagList.get(id) - 1;

does anyone have any idea why this is producing "cannot be referenced from a static context"

#

(combatTagList line)

#

nvm

#

i didn't notice method was static

sage swift
#

you could see what happens if you put /shop (something)

sage swift
hybrid spoke
quaint mantle
#

how do we set the BarFlag to do nothing in a bossabr

#

bossbar*

narrow berry
#

I have a waterfall server to which I want to connect the server with mods, I was able to connect this server but players on client forge are kicked from the server because the server detects that they have pure minecraft , is there anyone able to help me?

quaint mantle
#

oof now I know why<

#
                BarColor.GREEN, BarFlag.CREATE_FOG);```
sage swift
#

Main.getPlugin(Main.class) wow that's a really good way to get the instance!!

hasty otter
# hybrid spoke we would need the code to proof that
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {
            Player player = (Player) sender;
            if (hasAccesInWorld(player)) {
                if (args.length == 0) {
                    if (player.hasPermission("EconomyShopGUI.shop")) {
                        GUIShop.openMainShop(player);
                    } else {
                        player.sendMessage(Lang.NO_PERMISSIONS.get());
                    }
                } else if (args.length == 1) {
                    boolean found = false;
                    for (String section : plugin.getShopSections()) {
                        if (args[0].toLowerCase().equals(section.toLowerCase())) {
                            if (player.hasPermission("EconomyShopGUI.shop.all") || player.hasPermission("EconomyShopGUI.shop." + section)) {
                                GUIShop.openShopSection(player, section, 1, disableBackButtonWithShopSectionCommand);
                            } else {
                                player.sendMessage(Lang.NO_PERMISSIONS_TO_OPEN_SHOP.get());
                            }
                            found = true;
                            break;
                        }
                    }
                    if (!found) {
                        player.sendMessage(Lang.NO_SHOP_FOUND.get());
                    }
                } else {
                    return false;
                }
            }
        } else if (sender instanceof ConsoleCommandSender) {
            if (args.length == 1) {
                Player p = plugin.getServer().getPlayer(args[0]);
                if (p != null) {
                    GUIShop.openMainShop(p);
                } else {
                    SendMessage.infoMessage(Lang.PLAYER_NOT_ONLINE.get());
                }
            } else if (args.length == 2) {
                Player p = plugin.getServer().getPlayer(args[1]);
                if (p != null) {
                    boolean found = false;
                    for (String section : plugin.getShopSections()) {
                        if (args[0].toLowerCase().equals(section.toLowerCase())) {
                            GUIShop.openShopSection(p, section, 1, disableBackButtonWithShopSectionCommand);
                            found = true;
                            break;
                        }
                    }
                    if (!found) {
                        SendMessage.infoMessage(Lang.NO_SHOP_FOUND.get());
                    }
                } else {
                    SendMessage.infoMessage(Lang.PLAYER_NOT_ONLINE.get());
                }
            } else {
                return false;
            }
        }
        return true;
    }

    private boolean hasAccesInWorld(Player player) {
        if (disabledWorlds != null && (!disabledWorlds.contains(player.getWorld().getName()))) {
            return true;
        } else {
            player.sendMessage(Lang.COMMAND_DISABLED_IN_WORLD.get());
            return false;
        }
    }
sage swift
#

?paste

undone axleBOT
sage swift
#

holy shit

sage swift
#

it's a terrible way

quaint mantle
#

why so?

#

alright but is that what's causing the issue?

sage swift
#

well first of all the main class is named Main

#

second of all you're not doing dependency injection

#

third of all you should make a getInstance method if you're set on using a static singleton

#

since getPlugin is generic too...

quaint mantle
#

like this ? 😭 ``` static Main getInstance;

public void onEnable() {
    getInstance=this;
sage swift
#

ah yes a field called getInstance

#

genius

quaint mantle
#

D:::

#

why be ,eam

sage swift
#

best way to learn

quaint mantle
#

then like that ? ``` static Main instance;

public void onEnable() {
    instance=this;
    getServer().getPluginManager().registerEvents(new FishEvent(), this);
    getServer().getPluginManager().registerEvents(new RightClickEvent(), this);
}

public static Plugin getInstance() {
    return instance;
}
sage swift
#

not Plugin

#

Main but dooooont call it mainnnn

quaint mantle
#

Should I call it

#

Core?

#

or

#

idk

sage swift
#

just call it the plugin name

#

simple

quaint mantle
#

alright

#

Thank you

#

so

#

for

#

the bossbar

sage swift
#

that's a lot of messages for very little information

quaint mantle
#

sorry

#

but im trying to get this done

#

so for this code it says its not right ```BossBar bossbar = Bukkit.createBossBar("BossBar", BarColor.GREEN, BarStyle.NOTCHED_10, BarFlag.CREATE_FOG);

#

no idea whats wrong

halcyon topaz
#

what's the actual error

quaint mantle
#

no error

#

wait

#

hold on

elder harness
#

@sage swift I've seen a couple of messages from you and you don't come over too helpful. For your own pleasure, I would like to ask you to not respond if you are not willing to help out here in a normal manner

sage swift
#

are we in a manor? (the message above used to say "in a normal manor")

quaint mantle
#

gecko how long you been coding for ?

sage swift
#

1 day at least

quaint mantle
#

damn 😳

elder harness
#

@quaint mantle Could you summarize your issue?

quaint mantle
#

its says the arguments are not applicable for the constructor

halcyon topaz
#

what are you trying to do with the bossbar

elder harness
#

Where does it say this?

halcyon topaz
#

if you're just creating it, it should not be erroring

quaint mantle
#
 BossBar bossbar = Bukkit.createBossBar("BossBar", BarColor.GREEN, BarStyle.NOTCHED_10, BarFlag.CREATE_FOG);
        bossbar.setTitle(ChatColor.GREEN + "That Close to catching the fish");
        bossbar.setProgress(data.getScore()/fish.getLevel().winScore);
        bossbar.setVisible(true);
        bossbar.addPlayer(e.getPlayer());```
sage swift
quaint mantle
sage swift
quaint mantle
#

i know

#

i know

#

still says an error tho

sage swift
#

then clearly it's either an old version of spigot or something else is wrong

quaint mantle
#

I got the 1.16.5 so I don't think that's the problem

sage swift
#

if you remove the line does the error persist elsewhere

quaint mantle
#

the lines

#

?

sage swift
#

well yeah

elder harness
#

What exact parameter in createBossBar gives you the error?

quaint mantle
#

here

sage swift
#

oh well yeah

#

youre using the wrong imports

elder harness
#

I see you are importing from BossBattle

#

You have to fix your import and import from the right package

quaint mantle
#

what the fuck

#

dude

#

I checked like 5 times

#

the imports

#

i am so dumb

halcyon topaz
#

lol

elder harness
#

No issues

#

We have all been there

quaint mantle
#

yes sorry for lying D:

#

about my name

#

and how do I remove my bossbar from the player once I'm out of the method

halcyon topaz
#

bossBar.removePlayer

quaint mantle
#

there aren't any methods to remove it from the player?&

elder harness
#

Eventhough it is the documentation of 1.17, it is still very similar

pseudo quiver
#

how could i make a real time 5 mins delay for this event

@EventHandler
    public void onHoldingShift(PlayerToggleSneakEvent event){
        Random random = new Random();
        int rannum = random.nextInt(99);
        int z = rannum++;
        if(z==1) {
random ledge
#

Now I'm encoding the itemstack in base64 but it has very long text size, is there any way to adjust it?

elder harness
random ledge
elder harness
#

Either use a repeating scheduler to keep track of a timer or just delay the scheduler by 5 minutes

#

Both should work, but it also depends on how you would like to make it work

pseudo quiver
#

i want it like

#

just like a skill

#

it have cooldown

elder harness
#

What I did is only save everything that is necessary to retrieve the ItemStack object back from your database

random ledge
elder harness
#

You can make an object in Java that holds this necessary data

#

Then you can use GSON to convert the object into a string

random ledge
elder harness
#

You can optionally convert this GSON into base64, but this is not recommended for bigger strings, because then the string becomes bigger than the actual GSON

#

And then just save the string in your database and deserialize it to the object in Java once you need it again

#

In the object you can even make a static method or whatever which builds back an ItemStack instance

quaint mantle
#

Using current time millis then you calculate next time they do it

pseudo quiver
quaint mantle
#

A task is a no go for something 5 minutes long

#

Runtasklater is definitely not horrible tho

pseudo quiver
#

i made this

if(cooldowns.containsKey(player.getName())) {
          if (cooldowns.get(player.getName()) > System.currentTimeMillis()) {
            long timeleft = (cooldowns.get(player.getName()) - System.currentTimeMillis()) / 1000;
            return;
          }
        }
          cooldowns.put(player.getName(),System.currentTimeMillis()+300000);

inside of the

 @EventHandler
    public void onHoldingShift(PlayerToggleSneakEvent event){
        Random random = new Random();
        int z = random.nextInt(101);
        if(z==1) {
#

do i have to put any thing else in

quaint mantle
#

Check if there in the map in togglesneak

#

And I recommend you use Threadlocalrandom.current().nextInt

pseudo quiver
#

Threadlocalrandom.currentn().nextInt?

#

semi to random ?

quaint mantle
#

or double rand = ThreadLocalRandom.current().nextDouble(101)

pseudo quiver
#

like this ?

quaint mantle
#

What are you even using it for?

#

There’s a 1% chance of this happening whatever you’re trying to do

pseudo quiver
#

idk u told me to

quaint mantle
#

You already were using a random

#

What are you doing in that if statement

pseudo quiver
#

give player item

hybrid spoke
#

?paste

undone axleBOT
quaint mantle
#

So why are you making it a 1% chance to give the item?

pseudo quiver
#

oh

#

oh

#

now i understand

#

i thought

quaint mantle
#

Yea haha I’m just confused

pseudo quiver
#

i was like

#

there only 1% that my code will run

quaint mantle
#

There is a 1% chance that if statement will run

pseudo quiver
#

i made 20 copy of them so it actually 20%

quaint mantle
#

20? Why

pseudo quiver
#

and it go from 1 to 100

hybrid spoke
#

20 what

#

copies

pseudo quiver
#

like % giving item

quaint mantle
#

Why not just check if it’s <20

#

21

hybrid spoke
#

or loop it

pseudo quiver
#

oh

#

why dont i

quaint mantle
#

No don’t loop here

pseudo quiver
quaint mantle
#

Just change if z <=20

#

Boom 20 percent

hybrid spoke
pseudo quiver
#

i typed from 1 till 100

quaint mantle
#

Lol jesus bro, no you really will never have to do that

pseudo quiver
#

this is the end of that 100 list

#

if i put the cooldown here

#

inside the onSneak event

#

will it actually make a cooldown

#

or it just go nuts

quaint mantle
#

And that loop would be pointless it doesent do anything in this case. You want to check before you run any code btw

#

So at the top of the event

#

You do your cool down check

pseudo quiver
#

ok

#

youtube tutorial this bad

hybrid spoke
#

"how to make a mess in 10 minutes"

pseudo quiver
#

a mess in 10 mins but typed for 40 mins

#

how to not practice

quaint mantle
#

I don’t think the tutorial made you type out 100 different if x==whatever

quaint mantle
#

You just over thought

pseudo quiver
#

im nuts

quaint mantle
#

No that’s horrible lol

#

You need to delete all of that….

pseudo quiver
#

ok

quaint mantle
#

And just check if it’s

#

Less than 21

#

Boom 20 percent

pseudo quiver
#

lemme test the plugin

#

also

#

ty

marble granite
#

so, i am trying to make a custom recipe with the event: PrepareItemCraftEvent, but it only works when i drop single items in the slots with rightclick

#

this is my code:

    public void onCraft(PrepareItemCraftEvent e){
        System.out.println("ran");

        //used to track how many slots have diamonds, if 4, we go!
        int diamondCount = 0;
        for (int i = 0 ;i < e.getInventory().getMatrix().length; i++){
            try{
                if (e.getInventory().getMatrix()[i].equals(new ItemStack(Material.DIAMOND))) diamondCount++;
            } catch(NullPointerException nex){ }
        }
        System.out.println(diamondCount);
        if (diamondCount == 4) e.getInventory().setResult(Items.COMPACTED_DIAMOND.getItem());
    }
#

so, it doesnt work when shift clicking, and this is the first time that i am creating custom recipes, so i really have no idea how to do this..

quaint mantle
drowsy helm
marble granite
#

yes, i just found out, thats for replying though

#

but, is it possible to , for example: i have a square as recipe, can i register that recipe as a square, or do i need to make 4 recipes, one for each possible square on the craftingtable?

drowsy helm
#

shaped recipes already account for that, you can just leave the 3rd column and row empty

marble granite
#

ah, thatnk you, that was my question :)

#

god darn this has just become a whole lot easier

drowsy helm
#

yeah lmao sometimes messing with the craft event can be really iffy

marble granite
#

yup

quaint mantle
#
        for(Field f : packet.getClass().getDeclaredFields()) {
            System.out.println(f.getName());
            f.setAccessible(true);
            System.out.println(f.get(packet));
            f.setAccessible(false);
//        }``` this code prints the values of all the fields and WORKS, but for some reason: 
```if(pl.getInteractionManager().getValue(packet, "action").toString().equals("INTERACT_AT")) {
            return;
        }```
```public Object getValue(Object packet, String name) {

        Object result = null;

        try {
            Field field = packet.getClass().getDeclaredField(name);
            field.setAccessible(true);
            result = field.get(packet);
            field.setAccessible(false);

        } catch(Exception e) {
            e.printStackTrace();
        }

        return result;

    }```
doesn't work. anyone have ideas? ive been struggling with this same problem for 2 days now.
#

the getValue returns null btw, but i cannot figure out why

eternal night
#

are you on 1.17 ?

#

also what packet are you targeting

quaint mantle
#

ignore i worked out im dumb

#

sorry lol

eternal night
#

oh lol

summer scroll
#

How can I make something like, This reload took ...ms?

quaint mantle
#

You can do it in the spigot itself idk how to do it outside of it. I recommend just not reloading :3

summer scroll
#

huh, i want to make a reload command

quaint mantle
#

To do what?

#

Cause spigot had /reload

summer scroll
#

to change things without restarting the server

#

and it will only reload my plugin

#

not the entire plugin

#

and only reload the necessary things

eternal night
#

when you are talking about reload, do want to represent changed classes ?

#

like, your plugin was recompiled/has changes?

#

or just reload configuration

summer scroll
#

no no, i mean i want to do something like reinitialize the config value

#

yeah reload configuration

eternal night
#

I mean, then just write a command for it ?

#

i am confused as to what the issue is

summer scroll
proper notch
#

long startTime = System.currentTimeMillis();
do reload
long timeTaken = System.currentTimeMillis() - startTime;

summer scroll
#

ah alright, thanks

kind coral
#

How can I check what was added in 1.17? ( Spigot )

#

Like events objects etc.

sick portal
#

Hi everyone, is using custom events a good practice for performance ? And more over, i find difficult to understand if getPluginManager().callEvent() does it sync or async

eternal night
#

the method does both. Calling an event using that method while off the main server thread will fail if the event requires to be called on main thread.

sick portal
#

So if the event is specified to be async it will be called in an async manner without blocking the main thread, otherwise it will be sync in the main thread ?

eternal night
#

no, the caller of the callEvent method has to call off main thread for off main thread events etc

opal juniper
#

What is the way to add the remapped jar to the m2 repo?

ivory sleet
eternal night
sick portal
#

So for example, if i have this code in a CommandExecutor class, which i guess is called by the main thread, will this event be runned in the main thread ? And more over, does the command function wait for the event to finish before going further ?

#

case "recent" -> plugin.getServer().getPluginManager().callEvent(
new RequestRecentXEvent(playerUUID, world.getName())
);

opal juniper
ivory sleet
#

Code runs linearly when it’s just one thread

sick portal
#

And what happens if in the event handler i've set it to handle it in a runTaskAsync ?

#

Does it still wait ?

ivory sleet
#

Nope

sick portal
#

Is this good practice to use events for async operations or are there better ways ? Like calling runTaskAsync not in the event handler but before spawning the event

ivory sleet
#

No generally no need to

#

Doing small operations like sending a message async and what not is most likely going to hurt performance. Async operations are good for io, big operations like sorting a big list or something like that. But I doubt it’s going to help you in your case as the consumer of the event needs to additionally handle the async execution of the event which might involve the need of using some sort of lock mechanism and what not.

sick portal
#

Ok, thanks for your kind answers. Would you generally recommend using events for super-frequently refresh operations or are there better methods ?

ivory sleet
#

Is it more frequent than the player move event?

sick portal
#

No, it is not. I guess your question already answers my question.

ivory sleet
#

Yeah and of course if performance is a real problem then you can always try doing it async or using a custom event bus to adjust it.

sick portal
#

What do you mean by a custom event bus ? Sorry if i bother, but i'm just new to spigot programming in general

ivory sleet
#

Uh something like luckperms, they don’t use the spigot event api, they have their own event system.

sick portal
#

Is it just another thread pool with a queue for events inside ?

ivory sleet
#

Uh I think the biggest difference is that it might not use reflection, I shouldn’t say too much as I haven’t looked at it myself.

sick portal
#

Mmmm.. is this worth it tho ? I think the main reason they've done it is to abstract themselves from platform-specific runners, or am i missing some benefits ?

ivory sleet
#

Yes that’s it but if I am correct Lucko has probably optimized it also

sick portal
#

Allright, thanks. Just to be sure i understood correctly, it isbetter to run runTaskAsync directly and inside calling the event, than handling it with runTaskAsync on the event handler, so the command or everything else wont have to wait a little bit more

ivory sleet
#

That depends

#

It comes with the cost of enforcing async as I mentioned above might have other cons

sick portal
#

Yeah, we are actually using async for mostly everything related to updating a ConcurrentLinkedList, which of course is expensive itself.

#

As we keep track internally of some data in order for the plugin to work

ivory sleet
#

Well, I for sure don’t know much about your plugin so do what you think is best. You can always change it later.

sick portal
#

Thank you, you helped me a lot to understand more of what is happening under the hood of spigot.

quaint mantle
#

i have custom recipe with using meta in ingredients, and this recipe was added to knowledge book. With clicking on recipe i've wrong recipe. How i can fix that?
https://imgur.com/rxu027O

vital ridge
#

How can i check if player is placing spawn eggs in water?

#

I cant check if e.getclickedblock is something cuz that returns null

quaint mantle
#

get block

vital ridge
#

e.getclickedblock returns null when clicking a spawnegg on water

quaint mantle
#

are you using PlayerInteractEvent?

vital ridge
#

Yep

quaint mantle
#

are you checking action how right click on block?

vital ridge
#

ye

quaint mantle
#

are you checking if block isn't null?

wraith rapids
#

you can't click water

vital ridge
#

I can with spawn eggs

#

it swings hand

#

and spawns the entitys where i clicked

#

its like clicking on the block

wraith rapids
#

as far as the api is concerned, you can't

quaint mantle
vital ridge
#

okay

quaint mantle
#

get coords and get material of block how alternative

#

or blockstate

wraith rapids
#

you may need to do your own raytrace

quaint mantle
vital ridge
#

wbu getlineofsight?

#

I could use that and a loop

quaint mantle
#

use raycast

vital ridge
#

No idea what is raycast

wraith rapids
#

searching for blocks in a straight line

quaint mantle
#

Search: Raycast spigot

#

I have some Questions:

How do i rename an item in a gui?

Is there a Event when player opens inventory?

And: How can i make, that it opens an enderchest when player executes a command?

#

🙁 Help me please o.o

ivory sleet
#
  1. Get the item, rename it, set it back 2. InventoryOpenEvent 3. Implement CommandExeucutor, get the sender, safety cast it to a Player, call openInventory iirc.
quaint mantle
maiden briar
#

Is it possible to add my own packet listener into NMS? Without ProtocollLib because it's not updated

quaint mantle
maiden briar
#

Yes

quaint mantle
#

check first guide of creating this

maiden briar
#

Yes because I need to inject it towards a channel handler

gloomy finch
#

you have to inject the player into a reader

maiden briar
#

Yes I know, but how/where?

quaint mantle
#

in Reader/Writer

maiden briar
#

Which class is that?

quaint mantle
#

its in your listener

gloomy finch
#

just create a class with a few methods, i'll provide an example found on yt

maiden briar
#

Ok show me

quaint mantle
#

Tysm for your help!!

I have only to find out how to do that with the enderchest x

#

xd

#

Now I have a question. I can to create variable recipe with one NamespacedKey(something like any axe recipe)?

maiden briar
#

Hm how do you mean?

#

Oh you want to create multiple recipes with one key?

wraith rapids
#

define variable recipe

maiden briar
#

That is not possible

quaint mantle
#

yup

wraith rapids
#

that would be a ComplexRecipe

#

which is not up for implementation by plugins

#

so no; you can not change the product of a recipe based on the ingredients

gloomy finch
quaint mantle
#

ah, that isn't possible?

maiden briar
#

Thanks, how to use it?

gloomy finch
#

this is an example, you have to adjust it on what you have supposed to use

maiden briar
#

Ah ok

#

I want to listen for PacketStatusOutServerInfo

quaint mantle
gloomy finch
young knoll
#

You could do it with the PrepareItemCraftEvent in theory

maiden briar
#

Yes I know the fields

quaint mantle
maiden briar
#

But then if the packet is sent there is no player online

quaint mantle
#

or i can...

wraith rapids
#

don't copy paste methods

#

leverage oop

#

it's like copy pasting, but less gay

gloomy finch
maiden briar
#

I only want to listen

#

So the player pings the server then the server will send PacketStatusOutServerInfo, but I want to catch that

gloomy finch
#

okay, dunno if a pipeline exists just for the server...

quaint mantle
maiden briar
gloomy finch
#

i'm trying to find that

maiden briar
#

Ohhh I think I understand, if the player pings the server it will first send a handshake and then the packet?

gloomy finch
#

maybe from CraftConsoleCommandSender=

#

?

quaint mantle
#

I am sorry, but idk how to change the name of the items in the gui? Is there a way to change the item meta

#

*?

maiden briar
#

Nah I mean if you click in the multiplayer list on "refresh"

maiden briar
#

Then a packet will be send to the server, and then the server will respond with PacketStatusOutServerInfo

quaint mantle
#
ItemMeta meta = item.getItemMeta();
meta......;
item.setItemMeta(meta);
gloomy finch
#

should be PacketIn then?

maiden briar
#

I don't know that

#

I also don't know how to catch the PacketStatusOutServerInfo

gloomy finch
#

sendPacket() can send a Packet<?> so In and Out

quaint mantle
quaint mantle
maiden briar
quaint mantle
#

that is more useful, than ask a question every time

maiden briar
gloomy finch
#

can't do that with ServerListPingEvent?

maiden briar
#

Not everything from that

#

It is not enough

quaint mantle
#

And iirc is enderchest?

maiden briar
#

I started with this, but that is broken since 1.17

gloomy finch
#

u have to adjust it

#

i don't thinks it's all broken

quaint mantle
#

that is very bad choose

gloomy finch
#

no lol

#

they are useful

quaint mantle
#

as md_5 said

#

oh no, that's for nms

#

sorry

gloomy finch
#

md_5 says that Scoreboard are simple things to do

#

but they aren't

young knoll
#

They are though

quaint mantle
#

They are

gloomy finch
#

lmao

#

they are if u want to do them flicker

quaint mantle
#

but Packets better, but harder

quaint mantle
gloomy finch
young knoll
#

Use prefix and suffix to avoid flicker

gloomy finch
quaint mantle
young knoll
#

Why

gloomy finch
#

and special chars

young knoll
#

There is already an API for prefix and suffix

quaint mantle
gloomy finch
quaint mantle
#

simply or symbols

#

or something other

maiden briar
quaint mantle
#

or any string

gloomy finch
#

how u display the image

young knoll
#

I see why MD put that in the update message now

quaint mantle
gloomy finch
maiden briar
gloomy finch
quaint mantle
gloomy finch
#

what's tagapi?

quaint mantle
#

resourcepack doesn't count

#

on 1.17 PacketPlayOutScoreboard or something like that is broken

gloomy finch
#

1.17 is out from 2 days ago

quaint mantle
#

2-3

gloomy finch
#

and i don't think the packet is broken

#

we just have to know how to use they. cause they're changed

quaint mantle
#

all network system in 1.17 is remaded

gloomy finch
#

yes. we have to understand how the new system works

chrome beacon
#

You know you don't have to use packets

quaint mantle
#

PacketDataSerializer - now the fear of every NMS'er

gloomy finch
#

i prefer use nms to do all what i want

paper viper
#

?

gloomy finch
#

but i dont gonna hate you for what u've choosen

paper viper
#

do you know why API is always better than packets?

#

because API doesnt friggin change every version

#

or at least that much often as like

#

NMS

quaint mantle
gloomy finch
paper viper
#

The API itself has very little changes either way...

chrome beacon
potent pecan
#

SkullMeta#setOwningPlayer

does not work with MHF_Exclamation as offline player, it returns a Steve head. Is there a way to fix?

quaint mantle
gloomy finch
quaint mantle
#

I have a question, how do i make, that the enderchest safes the items in it?

paper viper
gloomy finch
paper viper
#

because spigot wanted them for long term compatability and so older plugins are compatible with newer ones

quaint mantle
paper viper
#

Meaning that they are trying to create little change

paper viper
paper viper
#

so that means the api is reliable, and wont change as much

#

as NMS

quaint mantle
gloomy finch
#

lmao

paper viper
quaint mantle
#

My API != Spigot API too

gloomy finch
#

the current API is okay for what most of the ppl do. but for someone is not enough then they gonna use nms

paper viper
#

ProtocolLib has a different goal too...

#

Also, you are freely able to use any version of the lib as long as its supported in your mc version

#

and Spigot API is focused on making sure

quaint mantle
#

packets have undergone changes no less than NMS in 1.17

paper viper
#

that plugins run stable

paper viper
#

I mean sure, but how is that related

#

lmao

paper viper
#

and also wdym by no less than NMS in 1.17

gloomy finch
#

an example to use nms: i did the system used in murdermistery to show died players. With the current API that is not possible.

paper viper
#

tablist?

gloomy finch
#

their bodies on the ground

#

"fake players"

paper viper
#

Well duh, Spigot doesn't support NPCs

#

lmao