#help-development

1 messages · Page 605 of 1

umbral ridge
#

it could be useful.. it allows you to provide different tab completion behaivor based on the used command alias

pseudo hazel
#

I guess so

#

my main point was with it also being in onExecute

#

but i didnt really read which one was talked about

umbral ridge
#

maybe you have 1 command but a few types of it eg,
setblock, alias: setblockx, setblocky, setblockz

umbral ridge
wet breach
#

Its main reason dates back to when it was normal to provide help pages. But most of the time you wont really need it except for some other niche thing

umbral ridge
pseudo hazel
#

i see

vague mason
#

Is this format okay for storing authentication data?

Black1_TV:
  algo: SHA-256
  hash: 53a047d337611884f1241bb6374acc6d48fcd6d9692299396f02b5344221dcd3
  salt: 705d30b93af6929e2821eff1ac0dc0370206b8d20623b31cb0e84b0d3ae2f33b

Or should I base64 encode it to a single string so it would be something like:

Black1_TV: U0hBLTI1Njo1M2EwNDdkMzM3NjExODg0ZjEyNDFiYjYzNzRhY2M2ZDQ4ZmNkNmQ5NjkyMjk5Mzk2ZjAyYjUzNDQyMjFkY2QzOjcwNWQzMGI5M2FmNjkyOWUyODIxZWZmMWFjMGRjMDM3MDIwNmI4ZDIwNjIzYjMxY2IwZTg0YjBkM2FlMmYzM2I=

or just use it like that:

Black1_TV: SHA-256:53a047d337611884f1241bb6374acc6d48fcd6d9692299396f02b5344221dcd3:705d30b93af6929e2821eff1ac0dc0370206b8d20623b31cb0e84b0d3ae2f33b
umbral ridge
rigid otter
#

So, what is the difference between it and label in CommandExecutor#onCommand?

remote swallow
#

none

vague mason
#

All of them are salted the same way, just stored in yml file in different formats.

remote swallow
umbral ridge
molten sleet
#

hi!
how to call virtual anvil?

I use

Inventory anvilInventory = Bukkit.createInventory(player, InventoryType.ANVIL);
player.openInventory(anvilInventory);

The anvil opens, but I can't enchant items, all actions are cancelled. I think this is due to the fact that the inventory should be associated with the block
and what's the problem with classes? (pics)

umbral ridge
# vague mason Thanks

it's good to store them separately because if in the future, you change the hashing algorithm, it'll be easier

#

and its also more readable I guess

vague mason
# umbral ridge and its also more readable I guess

Yeah so like if you update Java version and newer Java version includes better hashing algorithm then the server owner can change to it and notify all users that still have stored their password with old algorithm to just change it.

#

Java 8 seems to have SHA-256 as the "most secure" hashing algorithm included out of the box

#

Newer Java versions have more secure algorithm to choose from

#

but as plugin support Java 8+ then I should probably use SHA-256 as default as it's included in Java 8

umbral ridge
vague mason
#

So basically even if I die and plugin won't get updated anymore, it would still include the most up to date hashing algorithms that comes with newer Java versions.

#

Future proofing plugin for 500+ years in advance 😂

#

but will Java still be updated after 500+ years?

#

Probably not

umbral ridge
umbral ridge
#

maybe in 500 years, we won't even have minecraft anymore

vague mason
#

Basically Minecraft is a game that will still look decent after hundreds of years.

umbral ridge
vague mason
#

For example if you look at games that are 10 years old and try to make their graphics realistic it basically doesn't feel right now.

shadow night
vague mason
#

Minecraft is a game that doesn't want to be realistic. So it has unique square look that looks decent even after 10 years

shadow night
#

Yes

umbral ridge
vague mason
shadow night
#

Well, if minecraft would, why wouldn't intel

shadow night
#

I wonder how terraria will look in a hundered years... 1.17 final update number 17!!!

vague mason
#

Minecraft has been one of the most popular game for years. Most games die or get replaced with sequels.

#

Minecraft is a game that never needs to have a sequel.

shadow night
#

Well, neither bedrock, dungeons or legends will replace old good minecraft lol

vague mason
#

except if Bedrock would be 1:1 copy so servers would still run in Java, but clients will run in Bedrock.

#

and Minecraft devs said that they plan for Bedrock to be 1:1 copy

shadow night
#

Imagine if mojang/microsoft does some shit and people start protesting by not buying the game, refunding (those who are able to) and people just stop making content about minecraft

shadow night
#

It took them like several years to sync the versions

vague mason
#

There are already quite a lot of MC clients

shadow night
#

Imagine somebody at mojang says one wrong word and poof, EVERYTHING is gone

remote swallow
#

im pretty sure the code is on github

vague mason
#

Probably Bukkit, Spigot and Paper devs would get toggether and start releasing newer versions

remote swallow
#

bukkit devs dont exist

#

other than frostalf

shadow night
remote swallow
#

yeah

shadow night
#

Or did they just evolve?

remote swallow
#

all but frostalf disappeared or went to work for jank

vague mason
#

I bet forge will still add support for MC 1.30

#

and this is how we can contrinue developing on MC even tho the game "died"

umbral ridge
remote swallow
shadow night
vague mason
#

So basically the community can replace Microsoft completely

#

basically official MC developers

shadow night
#

If something like that happens half mojang would probably not stop working on mc lol

#

By half mojang I mean the people

remote swallow
#

gnembon wont forget

vague mason
#

yeah this would most likely just continue working XD

#

even if they won't get paid anymore. Like in free time

vivid cave
#

If I listen to InvClickEvent,
Do I need to listen to InvCreativeEvent too ? (I don't care if the action is done in creative I just need to know whenever inventory is clicked/interacted with, creative or not)

To put it straight forward, are there scenario where invCreativeEvent triggers but not InvClickEvent ?

umbral ridge
#

no you dont have to, InventoryClickEvent is always fired regardless of the GameMode you've in

#

InvCreativeEvent is specifically related to creative mode inventory opening

vivid cave
umbral ridge
vivid cave
#

InventoryCreativeEvent correspond to clicks AND drop from inventory in creative

#

Is the second scenario covered from InvClickEvent too when in creative ?

umbral ridge
#

?jd-s

undone axleBOT
umbral ridge
#

ohh right I see

remote swallow
#

aim to make all of ur stuff work in survival

vivid cave
#

I read the docs and what I'm telling you rn is what I saw in docs

remote swallow
#

just ignore creative events

umbral ridge
#

you can combine them

#

or just use InventoryClickEvent that fires always

#

regardless of the gamemode

vivid cave
# remote swallow just ignore creative events

No no no
Take me for a mad person but I have made creative work 100% so far.
I catch when creative is about to synchronise the fake Armor back to the server and when it's the case I turn it back to how it's supposed to be.

#

I just feel way too many events trigger in creative

vivid cave
vivid cave
#

I c

#

Thx

umbral ridge
#

welcome

vivid cave
#

I love your PFP btw

umbral ridge
#

ty xD

#

its my cat

vivid cave
#

On a whole different subject,
Do you guys know how to retrieve an image of a chestplate (rendered, not as itemstack) from the front ?

#

(with default ressource pack )

vivid cave
umbral ridge
alpine urchin
#

lol

#

a real man would never post that

umbral ridge
#

i actually have like 7 cats

#

4 are small like the one in gif

#

btw what are some free and good plugin obfuscators?

meager lynx
#
SkullMeta meta = (SkullMeta) pick.getItemMeta();
meta.setOwner("1");
``` guys is this the correct way?
meager lynx
#

yea

#

EventException: null its showing an error tho

#

its saying it cant pass event

#
Inventory inventory = Bukkit.createInventory(null, 46, "Welcome!");

ItemStack pick = this.createGuiItem(Material.SKULL_ITEM, "§6§lGet a class!", "§f§oYou will be granted with a class in random!");
SkullMeta meta = (SkullMeta) pick.getItemMeta();
meta.setOwner("804c4b20-e62b-4c3a-9a78-9b9ffc5e435e");

inventory.setItem(22, pick);
``` this is what i did basically
#

this.createGuiItem just gives an ItemStack

eternal oxide
#

read the error. What is null?

umbral ridge
#

SKULLs are way back in 1.8? around there? I haven't been coding in that version for awhile so i dont know what's different..
basically, pick.setItemMeta(meta);

silent steeple
#

any1 got plugin ideas

umbral ridge
#

yes

silent steeple
#

what

vivid cave
silent steeple
#

how would u make a 2d game in 3d

vivid cave
#

Maps

#

😛

chrome beacon
#

Or titles

#

Ah wait that requires a resource pack

#

nvm

trail coral
#

basically lets you change everything about the vanilla game from the config

#

like even mob spawning rates, default item damages, recipes, how much xp each mob drops, how much damage they deal, etc

#

very big project

meager lynx
# eternal oxide read the error. What is null?
[12:40:28 ERROR]: Could not pass event PlayerJoinEvent to CheeseRPG v1.0
org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:314) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:173) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [patched_1.8.8.jar:git-PaperSpigot-445]
#

this is the error

meager lynx
#

actually nvm

#

i managed to fix it

meager lynx
#

i forgot to set the meta

#

and also the chest size was wrong

umbral ridge
#

Ok nice xD

meager lynx
#

but now i have a skeleton head

#

it doesnt show the correct head

umbral ridge
#

Have you tried using the texture value instead?

meager lynx
#

how do i do that

umbral ridge
#

its on the bottom of the page

silent steeple
#

how do i edit the lines on a sign

vivid cave
#

😛

silent steeple
#

Material.Sign has no way to edit the lines

#

no method

meager lynx
silent steeple
#
public void onSignPlace(BlockPlaceEvent e) {
        Player p = e.getPlayer();
        if (e.getBlockPlaced() instanceof Sign) {
            Sign sign = (Sign) e.getBlockPlaced();
            // how do i change the first line???
        }
    }
#

oh wrong import

#

i just realised wtf is a sign

#

why is it pronounced sein

#

when its sig n

umbral ridge
chrome beacon
#

No owner uses username

#

You need nms for the texture value in 1.8

silent steeple
#

do sign lines start at 0

chrome beacon
#

Yes

umbral ridge
silent steeple
#

ok

#
public void onSignPlace(BlockPlaceEvent e) {
        Player p = e.getPlayer();
        if (e.getBlockPlaced() instanceof Sign) {
            Sign sign = (Sign) e.getBlockPlaced();
            sign.setLine(0, String.valueOf(p.getAddress()));
        }
    }
meager lynx
#

aight

umbral ridge
#

Yeah

meager lynx
#

tried, its still a skeleton head

umbral ridge
#

Let me pull up the one of my older projects with server.pro 🤓

#

One sec

meager lynx
#

alr

chrome beacon
#

You need to set damage to 3

meager lynx
#

damage?

wild basin
#

can we send our spigot project here ?

chrome beacon
umbral ridge
# meager lynx alr

There you go

public ItemStack getHeadWithData(String headName) {
    ItemStack itemStack = new ItemStack(Material.PLAYER_HEAD);
    SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta();
    skullMeta.setDisplayName(ChatColor.WHITE + "Head: " + ChatColor.valueOf(main.configValues.getHeadColor(headName)) + headName);
    
    List<String> itemLore = new ArrayList<String>();
    itemLore.add(ChatColor.YELLOW + "HeadHunter " + ChatColor.GOLD + "Head");
    itemLore.add(ChatColor.WHITE + "Points: " + main.configValues.getHeadPoints(headName));
    itemLore.add(ChatColor.WHITE + "Skins: ");

    if (getHeadSkinsByName(headName) != null) 
        for (String headSkin : getHeadSkinsByName(headName))
            itemLore.add(ChatColor.YELLOW + headSkin);
    skullMeta.setLore(itemLore);
        
    String skinName = main.configValues.getRandomHeadSkinCharsComb(headName) == null ?
        "" : main.configValues.getRandomHeadSkinCharsComb(headName);
    
    GameProfile profile = new GameProfile(UUID.randomUUID(), null);
    profile.getProperties().put("textures", new Property("textures", skinName));
    try {
        Field profileField = skullMeta.getClass().getDeclaredField("profile");
        profileField.setAccessible(true);
        profileField.set(skullMeta, profile);
    } catch (NoSuchFieldException | IllegalAccessException e) { 
        if (main.config.getBoolean("show-errors"))
            main.getLogger().warning(e.getMessage());
    }

    itemStack.setItemMeta(skullMeta);
    return itemStack;
}```
meager lynx
#

do u mean durability

wild basin
#

can we send our spigot project here ?

sullen marlin
#

Sure

chrome beacon
umbral ridge
sullen marlin
#

If you're asking a development question

chrome beacon
meager lynx
sullen marlin
#

TIL there's a code review thread

chrome beacon
#

Code review with md when

silent steeple
#
@EventHandler
    public void onSignPlace(BlockPlaceEvent e) {
        Player p = e.getPlayer();
        if (e.getBlockPlaced() instanceof Sign) {
            Sign sign = (Sign) e.getBlockPlaced();
            sign.setLine(0, String.valueOf(p.getAddress()));
        }
    }

anyone know why it doesnt do anything

meager lynx
chrome beacon
meager lynx
silent steeple
#

is sign.update() the method

chrome beacon
#

Yes

silent steeple
#

ok

#

ty

umbral ridge
#

you're using BlockPlaceEvent?

silent steeple
#

yes

umbral ridge
#

why not use org.bukkit.event.block.SignChangeEvent

umbral ridge
silent steeple
meager lynx
#

ok

umbral ridge
#

SignChangeEvent will fire when a sign is edited, when you're done with "editing the lines"

#

BlockPlaceEvent will fire when a block is placed and SignChangeEvent will just override anything you're trying to do with BlockPlaceEvent

#

Because its specifically for any sign type

meager lynx
#

@umbral ridge so how do i import GameProfile

#

also is it better to user paper api

#

to get the profile n stuff

umbral ridge
#

I always used SPIGOT api but yeah sure its your preference

meager lynx
#

how do import paper api

#

should i add a dependency

umbral ridge
#

xd

meager lynx
#

lol

#
<dependency>
    <groupId>io.papermc.paper</groupId>
    <artifactId>paper-api</artifactId>
    <version>1.8.8-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>
umbral ridge
#

yeah i dont know honestly i've never used it

meager lynx
#

this is what i tried

umbral ridge
#

and im in eclipse

#

one sec

meager lynx
silk ore
#

hello, if I send a file, there are 3 things that need to be added / edited, can anyone help?

umbral ridge
#

and then you can include it in maven/gradle as a dependency

#

i dont know much about thiws

meager lynx
#

i see

#

oh well

#

ima just use GameProfile

umbral ridge
#

Yeah it used to work around 2 years ago I hope it still does

eternal oxide
meager lynx
#

lmfao

#

i know, just clarifying

meager lynx
#

does it also need a jar?

eternal oxide
#

?nms

chrome beacon
#

It's part of authlib

eternal oxide
#

You shoudl not be using GameProfile. Spigot has PlayerProfile now

chrome beacon
#

1.8 users

umbral ridge
#

I don't really remember how I did it

#

This is all I needed: depend: [ PlaceholderAPI, HolographicExtension, ProtocolLib ]

#

It's 2 years ago from when I was developing that plugin

#

And those are all the imports for it, in the class:

...
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
eternal oxide
#

are you using 1.8?

meager lynx
#

yea

#

but now i gotta reinstall java 8, as i have java 18

#

to open buildtools.jar

eternal oxide
#

is there a specific reason you are stuck on 1.8?

meager lynx
#

its for the pvp

#

cause its a pvp plugin

#

and the 1.8.8 spigot api has basically everything i need atm

#

just thought of adding player heads to make the gui look cool

chrome beacon
#

Which the API cannot do in 1.8

meager lynx
#

i see

silver viper
meager lynx
#

but how do other servers have it then

umbral ridge
#

Try this as well, one of the code snippet i found online, maybe it'll work

public ItemStack getPlayerHead(String playerName) {
    ItemStack playerHead = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
    SkullMeta skullMeta = (SkullMeta) playerHead.getItemMeta();
    if (skullMeta != null) {
        skullMeta.setOwner(playerName);
        playerHead.setItemMeta(skullMeta);
    }
    return playerHead;
}```
chrome beacon
meager lynx
silent steeple
#

sm fix this it dont work

@EventHandler
    public void onSignPlace(BlockPlaceEvent e) {
        Player p = e.getPlayer();
        if (e.getBlockPlaced() instanceof Sign) {
            Sign sign = (Sign) e.getBlockPlaced();
            sign.setLine(0, String.valueOf(p.getAddress()));
            sign.update();
        }
    }
chrome beacon
umbral ridge
silent steeple
#

idk how to use that event

#

what is changing bruh

#

dis valid

#

@EventHandler
public void onSignPlace(SignChangeEvent e) {
Player p = e.getPlayer();
e.setLine(0, String.valueOf(p.getAddress()));
}

#

?

umbral ridge
# silent steeple what is changing bruh
@EventHandler
public void onSignChange(org.bukkit.event.block.SignChangeEvent event) {
    Player player = event.getPlayer();
    Sign sign = (Sign) event.getBlock().getState();

    String lines[] = {
        event.getLine(0),
        event.getLine(1),
        event.getLine(2),
        event.getLine(3)
    };

    ...

}```
silent steeple
#

so

#
@EventHandler
    public void onSignPlace(SignChangeEvent e) {
        Player p = e.getPlayer();
        Sign sign = (Sign) e.getBlock().getState();


        sign.setLine(0, String.valueOf(p.getAddress()));
    }
#

thanks for the reply

#

didnt work!

umbral ridge
#

did you register events?

chrome beacon
#

You forgot to update again

#

Also use the event to update the line instead

umbral ridge
silent steeple
umbral ridge
#

I'm in 1.20.1

wet breach
silent steeple
#

im on 1.8

umbral ridge
#

30

#

this is like the cat island

wet breach
#

Its in the mountains. We breed cats and most stay outside for pest control a few every year get chosen to be inside cats. We find the extras homes when we have too many

silent steeple
#

how does this not work this is broken

@EventHandler
    public void onSignPlace(SignChangeEvent e) {
        Player p = e.getPlayer();
        Block block = e.getBlock();

        if (block.getState() instanceof Sign) {
            Sign sign = (Sign) block.getState();
            sign.setLine(0, String.valueOf(p.getAddress().getAddress().getHostName()));
            sign.update();
            System.out.println("set");
        }
    }
chrome beacon
#

not the state

wet breach
#

You check if the block is an instance of sign

#

Not the state

#

You cast state to sign when the block matches

silent steeple
umbral ridge
#

no it's because of sign.setLine(), the sign object wont change the actual block but just the object initialized in the function body

silent steeple
#

do i need it

umbral ridge
#

you have to use event.setLine...

chrome beacon
chrome beacon
silent steeple
#

so

#

@EventHandler
public void onSignPlace(SignChangeEvent e) {
Player p = e.getPlayer();
Block block = e.getBlock();

    if (block.getState() instanceof Sign) {
        Sign sign = (Sign) block.getState();
        e.setLine(0, String.valueOf(p.getAddress().getAddress().getHostName()));
        e.setLine(1, "test");
        System.out.println("set");
    }
}
wet breach
wet breach
#

It works for them because they can advertise kittens and cats etc

#

Ie we supply them

#

And we have a variety too from mancoons to calicos

silent steeple
umbral ridge
#

Cool cool xD

chrome beacon
silent steeple
#

how am i ignoring oyu

chrome beacon
#

Skip the state thing

#

Just set the lines

umbral ridge
silent steeple
#

that is what i am doung rn

chrome beacon
#

You still have the instance of check

umbral ridge
#

just googled them

#

they're like small lions

wet breach
silent steeple
#

@chrome beacon is this what u mean

 @EventHandler
    public void onSignPlace(SignChangeEvent e) {
        Player p = e.getPlayer();
        Block block = e.getBlock();

        if (block.getType() == Material.SIGN || block.getType() == Material.WALL_SIGN) {
            e.setLine(0, String.valueOf(p.getAddress().getAddress().getHostName()));
            e.setLine(1, "ok");
            System.out.println("set");
        }
    }
chrome beacon
#

The block will always be a sign in that event

#

You don't need to check that

umbral ridge
silent steeple
#

so remove that

#

and it will work

wet breach
umbral ridge
silent steeple
#

thanks it worked

wet breach
#

The common way of getting orange cats is cross breeding a taby with a calico but even then its not common to just have all orange and no other features

wet breach
#

In regards to cat shows orange cats are seen as unwanted though

#

Which is weird lol

umbral ridge
#

I think orange cats are smart

wet breach
#

Oh i also have some manxs too

#

Love them

umbral ridge
#

nice xD they look adorable

wet breach
#

They are the common ones you will see with the stubby tails

umbral ridge
#

but without tail?

#

hmm

silent steeple
#

i was testing that sign plugin on a minehut server and someone joined and thought that it was their ip so they messaged me "recording"

#

lol

umbral ridge
quaint mantle
wet breach
#

Only had 1 litter of pure bred ones all the rest are a cross breed lol

umbral ridge
#

Nice, so many cats xD

wet breach
#

However i just love cats. I am planning on getting a pair of kittens probably some time soon

#

I currently do not live close to the cali property otherwise i would just take a couple from there lol

umbral ridge
#

lol

#

im more of a cat person too

#

I like dogs too but if I ever had one it would be some small type

wet breach
#

I like them because for the most part they take care of themselves

umbral ridge
#

yes

#

they dont cause too much "drama"

#

my cat is outside for the most part of the day

#

she comes back in every evening and sometimes has a sleepover in the house xd

wet breach
#

Lol

#

Also when it comes to laying down they are not particularly heavy and dont hog the bed

#

I train my cats like dogs too. But i use meow calls to call them and they usually show up lol. I am like the cat whisper in the family

umbral ridge
#

If I knew cat language I'd talk to my cat

wet breach
#

I had a cat that i named dog. Because it would really act like one. Even licked you etc

umbral ridge
#

I used to have a cat that would fetch toys for me

#

a ball

#

she would run and come back with it

#

i dont know what is up with such catss why do they behave like that

#

but it was funny

quaint mantle
chrome beacon
#

?configs

undone axleBOT
steep plaza
chrome beacon
#

?conventions

chrome beacon
#

^^ follow these

steep plaza
#

thx

hoary mango
#

What's the difference between setMaximumNoDamageTicks and setNoDamageTicks from LivingEntity? having a hard time understanding the description in the docs and why there's a maximum value? 😅

edit: figured out (i think) to anyone who is interested in the future,
maximum is like the amount of time until you can hit the mob again (eg 10 ticks)
then no damage ticks is just a value from 0-10 that counts up when you hit a mob starting from 0
if you want no hit delay, use setMaximumNoDamageTicks(0)

quaint mantle
umbral ridge
#

in Eclipse, is there a .md file editor?

eternal oxide
#

yes

umbral ridge
#

What's it called, I've installed one but all I get is a white screen with no option to clikc on it and interact/edit it

eternal oxide
#

look at teh bottom, theres tabs

umbral ridge
#

of course

#

XD thanks

worldly ingot
#

You can change the default file association too

#

In your settings if you look for "File Associations" you can associate .md files with your newly installed editor so you don't have to swap each time

chrome beacon
quaint mantle
#

because I dont want to use the plugin instance to get the deafult, its a custom config factory

chrome beacon
#

so you'd rather hardcode it?

#

Also no one said you need the plugin instance for anything

quaint mantle
#

at the link you send, the use the plugin instance to get the config

eternal oxide
#

the default built in plugin config support, yes

#

there is also a custom config section lower that you didn;t read

quaint mantle
#

which one

eternal oxide
#

You are adding a default which (by default) will not be saved

#

Thats not how defaults work

#

a default is used if the value does not exist. Defaults are not saved (by default) in the config

#

you can either use set instead of addDefault or you can #copyDefaults(true) to make defaults overwrite values

quaint mantle
#

umm my bad, and thanks. Sometimes i'm stupid

kind prawn
#

ChatColor is deprecated what should i use?

eternal oxide
#

most people get defaults wrong. They are a little confusing

#

ChatColor

tender shard
wet breach
umbral ridge
wet breach
#

they don't really meow lol

#

they chirp and when they do try to meow its like this weird soft crackling meow XD

quaint mantle
wet breach
#

they might be using paper possibly

#

where they deprecated a lot of stuff

#

that isn't deprecated in spigot

quaint mantle
umbral ridge
wet breach
#

Also

#

they are one of those breeds that will really enjoy them cat towers

#

they like to be in high places 🙂

#

so if you feel the cat tower is being under used

#

just get a manx it will enjoy it XD

wet breach
#

the manx kitten I had, loved to watch tv with me when I went to bed 🙂

umbral ridge
#

I had a small tower for my orange cat where they can just scratch? but she destroyed it, it fell apart XD

umbral ridge
#

shes directly staring at it sometimes

wet breach
#

lol

umbral ridge
wet breach
#

yep

#

cause I moved to Texas last year and housing wasn't consistent. Not ideal situation for pets and what not as well as for the owners

#

so it was easier to just not have a pet with me

umbral ridge
#

Ahh

#

So i've got 4 small cats right and I was thinking of giving them away and I though, but that's not okay? They would be going away from their "parents", but they're all stray cats but you can pet them and they play

#

It's just that they're coming to my house every day and they cost money, food..

young knoll
#

Did someone say cat

#

Where

#

Gimme

wet breach
#

I never have pets by themselves

young knoll
#

So what you are saying is

#

Double cat

umbral ridge
#

Yes

wet breach
#

yes 🙂

umbral ridge
#

Double cat = double meowing, purring = double fun

wet breach
#

well, when you have to leave for a bit, they won't be alone either lol

umbral ridge
#

Right yeah, brother and sister cat situation

eternal oxide
#

Double cat = two noisy bastards chasing eachother around in teh middle of the night.

native ruin
#

is there a discord specific for protocollibs?

young knoll
#

lol not exactly wrong

#

But we still love them

fluid river
#

jree

brave cradle
#

hello i have a problem with my plugin, when i use the first command that place the player coordinate i a variable, and when i use the second command the player will teleport to the position seted by the first command, but that didn't work, can you help me?

chrome beacon
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

steady rapids
#

Hi, How do you make a plugin multiversion? what should I be looking for?

chrome beacon
#

Start by targetting the lowest version you want to support

#

Then add gradle or maven modules for the newer versions

#

and then only use classes that are supported on the current version

steady rapids
#

okay, so basically you build the plugin singularly for each version?

#

and change what needs to be changed for every version

chrome beacon
#

Pretty much

steady rapids
#

thanks

ivory sleet
#

SimpleDateFormat is troll but sure

#

Idk why they didn’t deprecate it

#

DateTimeFormatter

#

One it isn’t thread safe

#

And it operates with legacy date and time classes

#

Usually you wanna use time stuff that implements TemporalUnit, TemporalAccessor etc

#

Oh

#

it has ofPattern() static factory

#

Dw

#

You can invoke that static factory method and then invoke withZone or withLocale w/e you need

#

Yes

#

👍

brave cradle
# chrome beacon ?nocode

i know but i have check my code, it is verified by people and it is good, so i will an exemple of a code for do this

ivory sleet
#

Yeah well I’d say look at javadocs, but basically it can be time, date where it may be zones or offset or like other cultural impls

glad prawn
#

Doesn't the Java Tutorial have a tutorial on the Date-Time API

eternal oxide
#

local time has no month

ivory sleet
#

^

#

You want LocalDateTime

#

Pog pog

umbral ridge
#

If I set a gamerule doDaylightCycle to false, I still can set the world time via code right?

hard socket
#

how to open a sign gui and gets its input?

#

I tried using ClientboundOpenSignEditorPacket but didnt know how to get imput

ivory sleet
tawdry echo
#

how can create recipe with two avaible items type at slot

brave cradle
#

Hello who can show me the code of a home plugin or any other code to copy the position of the player and then teleport it to the execution of another command

umbral ridge
mellow pebble
#

?paste

undone axleBOT
mellow pebble
#

any help on this problem everything should be properly written also values from config.yml should be correct i just get this error every like 2 minutes or so

https://paste.md-5.net/eticegigep.java

eternal oxide
#

msglist.size() is zero

chilly hearth
#

@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
if (player.hasPlayedBefore()) ;
{
e.setJoinMessage("player has joined the server");
} else if(!(player.hasPlayedBefore())) {
e.setJoinMessage("Player has joined joined the server for the first time!");
}
}
}

#

its still giving the error of else without if

eternal oxide
#

remove the ; at teh end of the if line

chilly hearth
#

it still says else without if

eternal oxide
#

I gave you your fix/answer

#

remove the ;

chilly hearth
eternal oxide
#

teh ; ends the condition

#

you can use as many {} as you like and it won;t error

chilly hearth
#

btw

eternal oxide
#

it just groups code

chilly hearth
#

how can i change the cursor back

eternal oxide
#

yep

chilly hearth
#

how can i change the cursor in intellJ

#

back to noral

#

normal*

umbral ridge
chilly hearth
#

its not the normal one

#

like it covers the letter

umbral ridge
#

try to restart the program

chilly hearth
#

i did

cinder abyss
#

Hello, how can I get the height of a LivingEntity ?

chrome beacon
cinder abyss
shadow night
#

Does CustomModelData apply to how armor looks when worn?

chrome beacon
#

No

#

Armor models are hardcoded

shadow night
#

Minecraft bruh

chrome beacon
#

Well you can get a model on the head due to how that's rendered (using a non-helmet item stack)

#

but for the rest of the armor no

shadow night
#

Well

#

Cursed minecraft mechanics

#

I want to make specific armor look different that normal armor

chrome beacon
#

Just texture or model?

shadow night
#

Both

chrome beacon
#

Just textures might work

shadow night
#

The item texture obviously, but the model...

#

If I want to spawn particles at the players mainhand location, how would I know where that is?

shadow night
chrome beacon
shadow night
#

Well, I'm not making a mod like that myself, definitely

mental nymph
#

what event is fired when player copied item in creative?

chrome beacon
#

InventoryClickEvent could also be fired not sure

#

Try it

mental nymph
#

thanks

river oracle
mental nymph
#

💀

river oracle
#

A lot of it is completely client sided

shadow night
#

Yeah

river oracle
#

The server doesn't recieve packets for quite a few things especially with the inventory

#

It probably works for item copying but just caution going forward creative inventory isn't fun to work with

shadow night
#

It is so client sided that you could in theory give yourself any items using clients or the saved hotbar function

twin venture
#

race condetion

it load the data in server b faster than it save it in server a [which is lobby]

what is the best way to handle this issuse?

without using runnable or delaying the load method?

eternal oxide
#

you are transfering them so don;t send them before you have saved

twin venture
#

its same plugin , same database but it must save before player join the second server he suppose to

#

when i do something in server A it should save it , and it does in that server , but if i join server B , it won't be displayed there

eternal oxide
#

where are you saving data? sql?

twin venture
eternal oxide
#

is your plugin handling sending the player to the second server?

twin venture
#

its not a bungeecord plugin ..
its a spigot plugin

eternal oxide
#

answer the question

#

what are you doing to send them to the other server?

twin venture
#

when PlayerQuitEvent is triggered i save the data

eternal oxide
#

thats not what I asked at all

twin venture
#

only when PlayerJoinEvent , PlayerQuitEvent i do the loading and saving .

eternal oxide
#

then the only thing you can do is delay in teh async preLogin event until the data is updated

shadow night
#

hmm, guys, I need to make a system where the player will basically go out of his body and for that I need to save the players inventory in a way that it stays even after a reload of the server (or the player rejoining). How do I do that the best way?

eternal oxide
#

um

#

inventories are saved by the server

shadow night
#

well, I need to save it and then remove it/modify it with the ability to restore it fully

#

I might've not explained enough

young knoll
#

Inventories are just an array of items

#

Which can be saved in many ways

eternal oxide
#

all ItemStacks are serializable

shadow night
#

well, that does not tell me a lot

young knoll
#

BukkitObjectOutputStream can convert them to bytes

shadow night
#

what do I do? Databse? Json? Config?

young knoll
#

Spigot can serialize them to YML

#

Etc

shadow night
#

hm

#

what particle is played when a player sprints or jumps on a block?

young knoll
#

I think it’s just the block dust for said block

#

Or block crack, idk

shadow night
#

hmm

eternal oxide
#

not using sql

shadow night
eternal oxide
#

I already told him to delay the connection until sql updates

eternal oxide
shadow night
#

pdc?

eternal oxide
#

?morepdc

undone axleBOT
eternal oxide
#

use that lib and you can easily store an inventory in pdc

shadow night
#

hmm, that sounds like a great idea I wouldn't come up with

#

it's alex as always

#

what was the way to send the player an actionbar message?

eternal oxide
#

player#spigot

magic raptor
#

Hello, it's possible to summon a fake player using spigot api? if yes, how?

Also a player that appears on server counter

eternal oxide
#

not using just the api

magic raptor
#

Using nms also?

eternal oxide
#

yes

magic raptor
#

Any guide for summoning one?

shadow night
#

is there some event for when some entity moves?

eternal oxide
#

no

river oracle
#

Imagine how many packets

#

CowMoveEvent

shadow night
#

I need to be able to track when an entity falls

livid dove
fluid river
shadow night
#

well, no

#

that won't work

#

I need to make the player follow the mobs fall

dawn plover
#

hello
i was wondering if there are any changes since 1.14 to cancle the "swap" animation for items in hand
(because if you change the name of the item, it treats it as a new one, so it will do a hand animation that goes down and up again)

I found this forum about it that sais its not really posible
https://www.spigotmc.org/threads/change-item-in-the-hands-animation.470270/

but maybe someone found a work around that the cliendt doesnt think its a new item so it doenst even get a chance to do the aniamtion

magic raptor
#

Managed to spawn one, how can i make it permanent?

livid dove
dawn plover
#

also, where in F3 can you see that your game is lagging

river oracle
dawn plover
#

oh sorry, i ment the server

#

like, that the server is having a hard time

#

like, there is tx and rx for example, but i also have no idea what is normal for these numbers to be

river oracle
#

On the client you can't see tps in f3 afaik

#

For ping it'd be easier to just use a plugin than figure it out from sent and received packets

dawn plover
#

send is low so thats normal i think, but what is the avarage rx?

#

receive i have bwteen 200 and 350

river oracle
#

It depends

#

On

#

A lot

dawn plover
#

oh also probably the device that the server is running on

#

understandable

river oracle
#

Dyou have plugins, dyou have other shit and stuff. Dyou have mods are you moving around or standing still are you minig chatting crafting etc

#

All changes it

dawn plover
#

i have a verry weird problem

whenever i constantly update an items meta every 20 ticks
i am unable to place and mine blocks when its not an empty hand
(so not even with the item i am updating, just any item will have this problem)
but this problem onlly accurs when i have an item with a scheduled reapting task to update it

dawn plover
eternal oxide
dawn plover
quaint mantle
#
private void sendActionBar(Player player, String message) {
        player.sendActionBar(ChatColor.translateAlternateColorCodes('&', message));```
#

How can i fix this

dawn plover
#

and what might "this" be

quaint mantle
#

it will not send the Action Bar

shadow night
#

is there something to make mobs not reflect when the player goes to near?

dawn plover
#

like, for what mc version are you making it

quaint mantle
dawn plover
#

the sendActionBar method has been depricated since 1.17 as far as i know

quaint mantle
#

ooo

eternal oxide
#

it still works, but use the one which takes 4 args

ocean hollow
#

can i create text from json?'

tender shard
dawn plover
#

you could schedule a task for every item that is droped
but i dont think your server will like that when everyone is going to drop items so i woudnt do it that way
though i am no master so i might be not as bad as i think it would be

tender shard
#

Loop over all existing Items once per tick (or once per second), check their time alive, and if greater than X, remove it

eternal oxide
#

Spigot has a config setting for teh despawn timer on items dropped

#

item-despawn-rate

uneven cliff
#

Hi everyone ! Do you know any tutorial for 1.19.4 spigot's tablist or a fast and lightweight tablist api ? thanks !

uneven cliff
# tender shard what exactly do you wanna do?

I'd like to do the basics, put a header, a footer, and why not add a prefix for the players. Unfortunately I can't find any tutorials online. I don't want to install a plugin. And most of the things I've found use deprecated methods, which I also want to avoid.

kind hatch
#

The tablist header and footer can be set using.
Player#setPlayerListHeader()
Player#setPlayerListFooter()
or if you want both
Player#setPlayerListHeaderFooter()

young knoll
#

Header and footer are easily done with the api

#

Via those ^

tender shard
#

Yeah, and cant one use the players displayname for prefix etc?

uneven cliff
#

Player#setPlayerListHeader()
Player#setPlayerListFooter()
Player#setPlayerListHeaderFooter()
All three are deprecated in 1.19.4
In addition, I wasn't specific enough. I'd like the tablist to always be at maximum size (i.e. all 4 columns).
In 1.8 I know that we use packets for this, but I have no idea how to do it in 1.19.4.

paper cosmos
#

Why don't I have descriptions of methods and functions when mousing over them?

young knoll
#

You are not using the spigot api

uneven cliff
#

Yes, my bad, I've just seen that, I've been using Paper's API until now, it's not a big deal, I'll switch back to spigot then!

silver robin
#

BukkitScheduler async tasks question

paper cosmos
silver robin
kind hatch
#

He was answering his question.

paper cosmos
#

Ok I think I got it

#

It's intellijidea

silver robin
silver robin
paper cosmos
#

Anyway I found the button download documentation in dependencies. Seems like this is what I need

ivory sleet
#

Class loader shit

dull schooner
#

Why the ItemFlag isnt working?

#
@EventHandler
    public void aboutToEnchantItem(PrepareItemEnchantEvent event){
        ItemStack item = event.getItem();
        if (item == null){
            return;
        }
        if (EnchantingItemsOrBooks.getEnchants(item).size() > 0) {
            EnchantingItemsOrBooks.formatEnchantLoreText(item);
            System.out.println("this item is already enchanted");
            return;
        }
_________________________________________________________________________
public static void formatEnchantLoreText(ItemStack item){
        ItemMeta meta = item.getItemMeta();
        if(!meta.hasItemFlag(ItemFlag.HIDE_ENCHANTS)){
            meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
            item.setItemMeta(meta);
        }
        List<String> lore = new ArrayList<>();
        Map<Enchantment, Integer> enchants = EnchantingItemsOrBooks.getEnchants(item);
        for(Enchantment enchantment : enchants.keySet()){
            String enchantName = formatEnchantLoreLine(enchantment.getKey().toString());
            int enchantLevel = enchants.get(enchantment);
            lore.add(ChatColor.GRAY + enchantName +" "+ toRoman(enchantLevel));
        }

        item.setLore(lore);
    }
#

when i comment the EnchantingItemsOrBooks.formatEnchantLoreText(item);, it gives me the default enchantments name, which only makes sense if the tag isnt working

kind hatch
#

Enchanted books are weird. They use the POTION_EFFECTS tag to write the data for some reason.

umbral ridge
#

do you update the itemMeta?

#

or im not seeing it im blind

kind hatch
#

Every other ItemStack that can be enchanted uses the ENCHANTS flag to display them.

#

Ik, it's weird.

dull schooner
#

WHAT?

#

no way

dull schooner
umbral ridge
dull schooner
#

item.setItemMeta(meta)?

umbral ridge
#

yes

dull schooner
#

i did in the code lul

eternal night
#

you are using stored enchantments

dull schooner
#

can i add an ItemFlag to an item which already has the ItemFlag?

umbral ridge
#

Yeah you could xD

ivory sleet
#

What version are you on my buddy?

#

ItemStack::setLore was yeeted long time ago I believe (ItemMeta::setLore instead)

eternal night
#

they fall under additional, the stored enchantments

dull schooner
#

i know there's the item.lore, but this way is easier

dull schooner
eternal night
#

Well no

#

lore would still show iirc

#

which I presume is what you are after here ?

dull schooner
#

yep

#

im afraid to hide information that i dont want to

#

i just want to hide the enchantment text

eternal night
#

I mean

#

Don't use stored enchantments then ?

dull schooner
#

but this is only necessary for enchanted books, right?

eternal night
#

stored enchantments is a enchanted book thing yea

#

you are using it for some reason

#

idk why

pale topaz
#

Could someone help me. im trying to create an item forced into one of the players slot. and when any kind of interaction with the item (may it be drop click or try to drag out) it will open an inventory. How would i do that?

dull schooner
#

for working with anvils

young knoll
#

Oh yeah I forgot they were under the misc flag

#

Because of course they are

dull schooner
#

they dont detect if it's not on the stored tag

dull schooner
eternal night
#

Well then only hdie the specifics for enchanted books ?

young knoll
#

HIDE_POTION_EFFECTS is a bad name

eternal night
#

that is literally the only thing they add there

#

it is

#

|| fixed on paper ||

dull schooner
young knoll
#

Who’s they

umbral ridge
#

?whereami

eternal night
#

paper deprecated that

#

and added item_specifics

dull schooner
#

idk if its a paper or spigot thing

eternal night
#

so I presume they are working with paper-api

#

it is a paper-api thing

dull schooner
#

seems like its paper

young knoll
#

And didn’t PR it upstream

#

Idk why we haven’t done that yet tbh

dull schooner
#

anyway, thanks for the help!

eternal night
#

¯_(ツ)_/¯

kind hatch
#

DO IT NOW

eternal night
#

its kinda ugly because its an enum

#

as per usual KEKW

twin venture
#

its only for communcation i guess its not a type of database?

young knoll
ivory sleet
#

Redis as a message broker

eternal oxide
#

I already told you to stay with sql and delay in the async pre login event

twin venture
eternal night
#

could also go with postgres

#

that baby has queing inbuilt

eternal oxide
#

if you are on 1.8 I can;t help you

twin venture
#

my problem is : race condetion

it load the data in server b faster than it save it in server a [which is lobby]

ivory sleet
#

I think elgar meant use redis to signal updates of the persistence database such that servers may know when to invalidate locally cached data

twin venture
ivory sleet
#

Yk

eternal oxide
#

then you can use async pre login

twin venture
ivory sleet
eternal oxide
#

your player is switching between servers and you are on 1.19+ so you can definitely use asyncpreloginevent

strange rain
#

Is it possbile to track the CPU usage of chunks?

eternal night
twin venture
# ivory sleet are these servers under a proxy?

yes , my problem is if won't use any proxy , it will save , load the data correctly on both servers

but if i use proxy , and do /server lobby :
then i select the thing i want and do /server something

it won't load it on that server

ivory sleet
#

Yeah right

twin venture
#

yes thats the problem

#

do you know a way to fix this?

ivory sleet
#

I think rabbitmq carried this one for me

twin venture
#

btw its a spigot plugin

#

not bungeecord

ivory sleet
#

Maybe you’ll have to end up writing a bungee plugin

#

Just as a way to make it determinate

eternal night
#

cat_what AsyncPlayerPreLogin does still happen under a proxy no ?

#

I am confused

twin venture
#

its a quests plugin of some kind ..

young knoll
#

I assumed so

#

But maybe not?

ivory sleet
eternal night
#

okay and ?

#

oh

twin venture
#

that's my problem yeah

ivory sleet
#

And I assume they sink the data on the quit event

young knoll
#

Took me a second to understand why you just screamed APPLE

#

XD

ivory sleet
#

Lol

eternal night
#

Ah KEKW

twin venture
#

but if iam not using any proxy it will work just fine ...

#

is there a good decent way to fix this problem ..? should handle 100+ players or more ..?

twin venture
ivory sleet
#

I know what you mean

#

I got this myself

twin venture
#

how did you manage to fix it?

eternal night
#

any messaging system fixes this

ivory sleet
#

i used a message broker (in my case rabbitmq) to solve it

#

^^^

twin venture
#

can i use redis ? for it?

ivory sleet
#

yes

eternal night
#

you only have to tell server B that server A is done saving data

#

and have server B block AsyncPlayerPreLogin until that message arrives

ivory sleet
#

im unsure; but maybe bungeecord offers some good events you could rely on

eternal night
#

before it loads data

twin venture
#

thank you guys .. will try it ..

ivory sleet
#

Best of luck

twin venture
#

never used redis before so its big struggle :p

ivory sleet
#

Checkout lettuce or redisson (:

twin venture
#

alright , thanks

young knoll
#

Mmm

#

Lettuce

eternal night
twin venture
#

just have few questions about the connections stuff if you don't mind :p

ivory sleet
#

Jedis, yikes, but yeah go on

#

First of all

#

You 99% wanna use a JedisPool

#

To pool ur jedis connections

twin venture
#

alright

ivory sleet
#

Its like a thread pool but with jedis instances

twin venture
#

i have a User class with UUID , Player , and ActiveQuests map

ivory sleet
#

Yeah

#

A data transfer class then

twin venture
#

if iam not mistaken or i may be , this is how i can use it ?

silent steeple
#

Vapor.getPlugin(Vapor.class).getConfig();

why should we use DI when we can just do this

ivory sleet
#

Two you depend on type and not instance, this leads to loosely coupled code

#

Three you can easier unit test by isolating the class

silent steeple
#

thanks

ivory sleet
#

Four its more principled, for instance using the static singleton makes open closed principle much harder to get by (just one principle as an example)

#

Five, all of this leads to more flexible code which you’ll thank yourself for later when you wanna do changes, it becomes significantly more important the more lines your code base gets

silent steeple
#

yeah i just used it like this

FileConfiguration config = Vapor.getPlugin(Vapor.class).getConfig();

in a util class

ivory sleet
#

Oh that’s probably not a utility class if it depends on stuff like that

#

You should probably just make it a normal class, no?

silent steeple
#

its a Constants class actually my bad

#

just stores some constants

ivory sleet
#

Myeah well I havenr seen ur code so ict

silent steeple
#

1 sec

#
@UtilityClass
public class VaporConstants {

    private final FileConfiguration config = Vapor.getPlugin(Vapor.class).getConfig();

    public boolean KITMAP_ENABLED = config.getBoolean("kitmap.kitmap_enabled");

    public Integer BORDER_SIZE = config.getInt("map.border_size");
    public Integer WARZONE_RADIUS = config.getInt("map.warzone_radius");

    public Integer FACTION_SIZE = config.getInt("map.faction.faction_sizes");
    public Integer ALLIES = config.getInt("map.faction.allies");

    public Integer BALANCE = config.getInt("map.default_balance");
    public Integer CLAIM_BALANCE_MULTIPLIER = config.getInt("map.claim_balance_multiplier");

    public Integer BLOCK_OPERATION_SPEED = config.getInt("map.block_operation_speed");

    // enchantment limiting
    public Map<Enchantment, Integer> ENCHANTMENT_LIMITS = ImmutableMap.of(
            Enchantment.DAMAGE_ALL, config.getInt("enchant_limiter.sharpness"),
            Enchantment.PROTECTION_ENVIRONMENTAL, config.getInt("enchant_limiter.protection")
    );
}
ivory sleet
#

Oh jeez luiz

#

Whats this 😔

silent steeple
#

Lmk how to improve

ivory sleet
#

If you wanna go about this the right way, just go with straight object mapping

silent steeple
#

never done that what does it go like

ivory sleet
#

Its a bit more engineered of a design through

#

Hmm have you ever read luckperms code or sponges code?

silent steeple
#

no

ivory sleet
#

Hmm I see, idk if perhaps, at this moment, this design is too complicated for you

silent steeple
#

what does it go like

umbral ridge
#

hey, for obfuscating java plugins, I could use allatori right? but it's not free? are there any free alternativeS?

ivory sleet
#

well Simon, let me simplify, use encapsulation, that means those getter methods rather than fields

#

And then pass the config through the constructor

#

(Lets skip object mapping for now)

silent steeple
#

never thought of it that way

ivory sleet
#

The reason getter methods can be nice is if lets say you reload ur config

#

Then the methods will automatically yield the most updated values

silent steeple
#

i can just use the @Getter annotation from lombok right?

ivory sleet
#

(There are other reasons as to why encapsulation is preferred)

#

Ehm, no

#

Because you don’t have an variables/fields

#

Basically what I mean

#

public int maxSize() {
return config.getInt("max_size");
}

#

also use int instead of Integer

#

(Unless you want it to be null?)

silent steeple
#

?

ivory sleet
#

You’re using Integer

silent steeple
#

so

ivory sleet
#

Which is nullable, and it is just an unnecessary wrap around int in ur case

#

Cuz getInt() is returning an int

#

So why use Integer?

silent steeple
#

there was a reason i did but i wrote the class a while ago

ivory sleet
#

Avoid Integer if possible

#

Same with all boxed primitive classes

pale topaz
#

Could someone tell me why this doesn't work?

@EventHandler
public void onJoin(PlayerJoinEvent event) {

    Player player = event.getPlayer();

    ItemStack Menu = new ItemStack(Material.NETHER_STAR, 1);

    for (Player pl : Bukkit.getOnlinePlayers()) {
        player.getInventory().setItem(9, Menu);
    }
}
silent steeple
#

why are you giving everyone a netherstar when 1 player joins

ivory sleet
#

^

silent steeple
#

also you want it in slot 8

pale topaz
silent steeple
#

hes not even he has 2 player instances

young knoll
#

Actually

#

You are setting a nether star in slot 9 for the joining player

#

Once for every other player online

silent steeple
#

so if 50 players are online then they person who joined gets the netherstar 50 times?

pale topaz
ivory sleet
#

What r u trying to do

young knoll
silent steeple
#

yeah

pale topaz
#

Im trying to make whenever a player joins they will get an specific item on slot 9 which when interacted with in any kind of way it will open an inventory (im working on it 1 step at a time)

silent steeple
#

slots start at 0 first of all

umbral ridge
#

and then go on from there, Bukkit.CreateInventory, etc..

pale topaz
pale topaz
umbral ridge
#

if you want to prevent the player from dropping the item out of the inventory / dragging it, you can use InventoryClickEvent, InventoryDragEvent, PlayerDropItemEvent

silent steeple
#

in the code

pale topaz
umbral ridge
pale topaz
#

btw. how would i change it so it only gives it once every time someone joins instead of it now giving it the amount of players that are online lol

silent steeple
#

check if its the first time they join

pale topaz
#

that's what their in rn

silent steeple
#

if it is set the 9th slot with that item

pale topaz
#

just remove the if statement then?

umbral ridge
#

Idk if this works, but it's there

pale topaz
#

i've already got a system like that set up. if someone joins for the first time its a special welcome msg if not its just an regular

#

i just checked it worked for like half a moment but then it disapeared. could you tell me why?

(the code)
@EventHandler
public void onJoin(PlayerJoinEvent event) {

    Player player = event.getPlayer();

    ItemStack Menu = new ItemStack(Material.NETHER_STAR, 1);
    player.getInventory().setItem(8, Menu);
    }
}
silent steeple
#

if you seen the netherstar for a second then maybe a different plugin is interfering?

pale topaz
#

which that would work fine now that i think of it

orchid hawk
#

hi guys, i am making my first plugin ever but i am getting an error when loading it 🙂

[22:53:28] [Server thread/ERROR]: Could not load 'plugins/TestPlugin.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152) ~[patched_1.8.8.jar:git-PaperSpigot-445]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136) [patched_1.8.8.jar:git-PaperSpigot-445]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) [patched_1.8.8.jar:git-PaperSpigot-445]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) [patched_1.8.8.jar:git-PaperSpigot-445]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched_1.8.8.jar:git-PaperSpigot-445]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
#

i have that

#
name: MyFirstPlugin
version: '${project.version}'
main: me.bertram.myfirstplugin.MyFirstPlugin
api-version: '1.20'
authors: [Bertram]
description: My first plugin
#

it's under resources

eternal oxide
#

don;t move it

eternal night
#

I mean, make sure you are compiling with maven

eternal oxide
#

are you building with maven?

orchid hawk
#

yes

eternal oxide
#

intelij?

orchid hawk
#

yup

eternal night
eternal oxide
#

you are using artifacts not maven

eternal night
#

so you have a task that runs the package goal think

eternal oxide
#

maven window right side of screen

orchid hawk
#

yes

eternal oxide
#

in lifecycles run package

quaint mantle
#

Mvn wrapper-> install

orchid hawk
eternal oxide
#

I just told you

#

run package under lifecycles.

orchid hawk
#

i cant press the button

eternal oxide
#

what button?

orchid hawk
#

the run button

#

oh

#

nvm

eternal oxide
#

not without configuring other things

#

find your new jar in the target folder

orchid hawk
#

okay ill try and run it again

#

it works thanks!

#

wait

#

nvm

light shell
#

Hi guys im developing a website like aternos how can i list plugins in spigotmc's website like aternos?

eternal night
#

pretty sure aternos does not list all plugins on spigot

#

they provide you a curated list of usable plugins

quaint mantle
#

Can java code be compiled in real time

eternal night
#

there is hot reload

quiet ice
#

Also real time is a rather variable definition. Don't expect compilation to happen instantly, regardless of which environment you are in.

outer prairie
#

Hey so i am making an addition to a plugin with permision. I keep getting java.lang.IllegalStateException: bStats Metrics class has not been relocated correctly!
I think I did it right, im very new to plugin dev so anyinfor would be great

chrome beacon
#

Show how you're relocating bstats

quiet ice
#

And it is also worth noting how you are building your plugin

outer prairie
#
 <configuration>
                    <relocations>
                        <!-- Relocate bStats to our own package -->
                        <relocation>
                            <pattern>org.bstats</pattern>
                            <shadedPattern>${project.groupId}.${project.artifactId}.utils</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
#

yeah ^^

#

i need help with that

#

some tutotial said to make an artifact and do it though that

#

but thats not how i learnd

quiet ice
#

Like, do you use eclipse's "Export" feature or do you use the IntelliJ artifact (or whatever it is called) feature?

outer prairie
#

atrifact

#

should i use export instead

quiet ice
#

Then don't. What you should use instead I cannot say

chrome beacon
#

No use maven

outer prairie
#

how do i use maven, sorry this all very new to me

quiet ice
chrome beacon
outer prairie
#

i do, thats where the relocation is

#

i dont have a thing in the top right of my screen that says run

chrome beacon
#

See the right side of IJ

outer prairie
#

wait im dumb

chrome beacon
#

Should be a button called maven

outer prairie
#

i totally missed maven in the confiurator

#

Thank you guys for ur help! that def worlked!

pale topaz
#

Could someone help me make it so you cannot move the item it will give you?

@EventHandler
public void onJoin(PlayerJoinEvent event) {

    Player player = event.getPlayer();

    ItemStack Menu = new ItemStack(Material.NETHER_STAR, 1);
    ItemMeta meta = Menu.getItemMeta();

    meta.setDisplayName(ChatColor.GOLD + "Profile");
    player.getInventory().setItem(8, Menu);
    }
@EventHandler
public static void onInteract(PlayerInteractEvent event) {
    if (event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK))
    {
        ItemStack menu = event.getItem();
        if (menu.hasItemMeta() && menu.getItemMeta().hasDisplayName()){
            if (menu.getItemMeta().getDisplayName() == (ChatColor.GOLD + "Profile")) {

            }
        }
        Player player = event.getPlayer();
        Inventory Profile = Bukkit.createInventory(player, 27, ChatColor.GOLD + "Profile");
        player = event.getPlayer();
        player.openInventory(Profile);

    }
}
young knoll
#

Compare strings with .equals

umbral ridge
#

Hey, how can you make on-hover messages configurable?
is it even possible? or you can't insert on-hover messages in normal message?

config.yml

message: "today is a {hover-msg} day." # {hover-msg} would be a message that can be hovered

code:

Player player = (Player) sender;

TextComponent message = new TextComponent("somewhat a nice");
message.setColor(ChatColor.GREEN);
message.setHoverEvent(new HoverEvent(Action.SHOW_TEXT, new Text("Hello World")));

player.spigot().sendMessage(ChatMessageType.CHAT, message);
#

How can I use TextComponent class to insert custom messages in the normal message?

#

I know it should be possible because default vanilla advancement messages come with a on-hover message at the end of the whole message

young knoll
#

You can .append components together

#

I would use a component builder tho

umbral ridge
#

Oh? But then how do I figure out which part do I have to append

young knoll
#

?

umbral ridge
#

So I have a string right? "klajsdakljsd {hover-messag} aisdajd"
do I go through the string for each word? and check if its {hover-message}?

hard socket
#

how do I get the input when the player closes the gui

umbral ridge
#

and then add the onhover event for it