#help-development

1 messages · Page 1503 of 1

dire marsh
#

works thanks, i honestly hate this block data api

sharp bough
#

whats the warning?

last sleet
#

Its just nullpointerexception

#

Maybe assert item1 != null?

sharp bough
#

no not the error

#

the warning

last sleet
#

Wdym by warning?

sharp bough
#

put the mouse on top of the getType

hardy swan
#

it is not warning

last sleet
sharp bough
#

you see how it has a yellow thing on getType

hardy swan
#

it highlights the same words

#

ooo

last sleet
sharp bough
#

cuz you forgot to check

#

if its null

#

if (clickedItem == null || clickedItem.getType().isAir()) return;

hardy swan
#

what are you trying to achieve actually

last sleet
quaint mantle
#

got some entity desync on Spigot 1.17 (20tps, enough mem free)

#

rip 😦

hardy swan
#

original as in splitting into two

sharp bough
last sleet
#

it checks if it has a custom thing in the name

sharp bough
last sleet
#

yes

sharp bough
#

you can check the inv instead

last sleet
#

I know it works because for Item1, when i put an item in there and close it it works

#

but when I put item2 and no item1, it reutrns nullpointerexception

sharp bough
#

when you do
Inventory inv = ...

on invClickEvent
if (event.getInv != inv) return;

sharp bough
#

but its not recommended

hardy swan
#
if (item1 != null && item1.getType() != Material.AIR){
....
}
if (item2 != null && item2.getType() != Material.AIR){
....
}

this

sharp bough
#

just saying

sharp bough
#

there might be a detail missing

last sleet
#

hm i also says that

hardy swan
#

ohh, that's because you asserted it to be, but in reality might not be

paper viper
#

no no no no

#

just DONT use titles

#

to compare inventories

hardy swan
#

for example it would have failed before even reaching that line

paper viper
#

there is a reason why it even got removed in later versions iirc

sharp bough
#

don't so assert

last sleet
#

ok

sharp bough
#

use*

paper viper
#

dont use titles to compare inventories, use InventoryView

last sleet
#

Yeah it stills throws the error

#

its super wierd

#

this is line 20 btw

hardy swan
#

yes

#

because you didn't check for null there

paper viper
#

its because item1 is null...

sharp bough
#

Cuz item1 might be null

last sleet
#

I fixed it by asserting it

hardy swan
#

so basically, if an item is null, you cant call any methods on it

paper viper
#

Asserting doesnt fix anything

sharp bough
#

don't assert

#

return

paper viper
#

do you know what assertion means?

sharp bough
#

when its null

last sleet
#

ok

paper viper
#

assertion -> a confident and forceful statement of fact or belief.

hardy swan
paper viper
#

this isnt anything confident

last sleet
#

Maybe do

paper viper
#

then dont return

last sleet
#

&& item != null

hardy swan
#

actually should be in front

#

lmao

#

item != null &&

paper viper
#

java checks in order

#

and if that is false

#

then it just doesnt go through the next check

last sleet
#

Finally it works

#

I always tought it was the check for null in the player.getinv.additem

#

but it was actually in the pane check

#

ty <3

sharp bough
#

nice

wanton rampart
#

On Maven, what is the Source version supposed to be for minecraft 1.17?

glossy scroll
#

does anyone know how to use the mojang mappings when developing plugins?

hardy swan
wanton rampart
#

Right now it's set to 1.8 for me but that should be Java 8. For Java 16, 1.16 doesn't work

#

Not sure if I just don't understand or it's busted on my side

wanton rampart
#

Worked for me as well

#

Just making sure I'm not doing it wrong xD

hardy swan
#

should be alright

mighty sable
#

Hey @sullen marlin apparently my plugin was taken down as it had the hypixel branding in the name. Yes I do admit it's my mistake, but it wasn't taken down without any warning whatsoever?

ivory sleet
#

Hmm from what I have seen resources get taken down without a warning if they break any rule.

mighty sable
#

Ouch

#

Pretty bad

#

It's been up for a year and gained quite a bit of popularity. Kind of pissed off by the warningless action

ivory sleet
#

Yeah I mean personally I believe a warning or just block public accessibility until the issue has been resolved would be better but yeah, it is what it is.

atomic garden
#

I didn't realize how many extra api methods paperspigot had until I was forced to use spigot for 1.17

last sleet
#

My crafting recipes kinda stopped working for no reason at all, some people told me it's because of the namepsacedkey.minecraft but im not sure.

proud basin
#

How come when /reload is executed the config resets kinda like if something is set false it set to true but in config its still false?

ivory sleet
chrome beacon
last sleet
last sleet
hardy swan
#

Try using its constructor

#

new NamespacedKey(plugin instance, name of recipe)

last sleet
#

Ok

chrome beacon
last sleet
#

I did

quaint mantle
shadow gazelle
#

If I was making an enchantment that lets the user fly, what would the best event be to check if the user has the chestplate?

last sleet
#

Replaced minecraft namespacedkey with my own, seems to work now.

vast sapphire
#

I keep getting an internal error occured

shadow gazelle
#

To stop any possible exploits, bugs, etc.

chrome beacon
undone axleBOT
vast sapphire
#

i can't

#

post

#

images

hardy swan
#

No console messages?

vast sapphire
#

no

#

my build is fine

#

no errors

quaint mantle
#

get verified then you can post images

chrome beacon
#

Send the error ;/

vast sapphire
#

An internal error occurred while attempting to perform this command

#
package me.ebow;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

public class Commands implements CommandExecutor {



    public boolean onCommand(CommandSender sender, Command cmd, String s, String[] args) {
        Player player = (Player) sender;

        if (!(sender instanceof Player)) {
            sender.sendMessage("console command error");
            return true;
        }
        if (cmd.getName().equalsIgnoreCase("ebow")) {
            player.getInventory().addItem(new ItemStack[]{item.Explosivebow});
            return true;
            }
        return true;
        }

    }


#

commands class

chrome beacon
vast sapphire
#
    at org.apache.commons.lang.Validate.noNullElements(Validate.java:364) ~[patched_1.16.5.jar:git-Paper-771]
    at org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventory.addItem(CraftInventory.java:293) ~[patched_1.16.5.jar:git-Paper-771]
    at me.ebow.Commands.onCommand(Commands.java:21) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.5.jar:git-Paper-771]
    ... 19 more
quaint mantle
#

Item cannot be null

chrome beacon
last sleet
#

yea

hardy swan
#

addItem(@NotNull)

visual tide
#

im trying to update my plugin to java 16
why am i getting a 'process terminated' when the only thing ive changed is the pom?
my pom.xml:


chrome beacon
#

?learnjava This is useful..

undone axleBOT
ivory sleet
vast sapphire
#

oh i misspelled ExplosiveBow

#

thanks

chrome beacon
#

But then it shouldn't compile 👀

vast sapphire
#

no i didn't

last sleet
#

what

#

How do you know there is an error if you didnt compile it

vast sapphire
#
    private static void explosiveBow() {
        ItemStack item = new ItemStack(Material.BOW, 1);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName("Explosive Bow");
        List<String> lore = new ArrayList<>();
        lore.add("Arrows blow up");
        meta.setLore(lore);
        item.setItemMeta(meta);
        item = Explosivebow;

    }
    public static void init() {
        explosiveBow();
    }
}
#

here is my item manager class

quaint mantle
ivory sleet
quiet ice
quaint mantle
#

oh, discord didnt load the end so I cant see it

vast sapphire
quiet ice
#

You have two properties blocks, this is no good. Though idk if it causes this issue

ivory sleet
#
class Dope {
  public static final ItemStack STACK;

  static {
    STACK = new ItemStack(...);
    ItemMeta meta = STACK.getItemMeta();
    meta.setLore(Arrays.asList("Boo!"));
    STACK.setItemMeta(meta);
  }
}

@vast sapphire You can avoid manual static initialization with something like this, although since ItemStack is mutable you should probably prefer a factory method.

vast sapphire
#

oh

visual tide
quiet ice
#

any more info?

unreal quartz
#

do you have java16

quiet ice
#

I like how many issues java 16 has caused

visual tide
quiet ice
#

Your setup is cursed

hardy swan
#

You can refer to towny's pom

unreal quartz
#

what is the result of mvn --version

visual tide
#

OH MY FRICKING GOD IM DUMB

quiet ice
#

I do not know what is wrong, other than that something is wrong and is basically intercepting all issues

visual tide
#

downloaded 16 but didnt set it to 16

unreal quartz
#

nice one

hardy swan
#

Lmao

visual tide
#

also quick question do i have to change anything for the plugin to work with 1.17 or is spigot backward compatible

hardy swan
#

If you use nms, yes you have to change sth

ivory sleet
#

Assume one only depends on Spigot API, in that very case you can pretty much launch your plugin at any 1.17 spigot server.

quiet ice
#

Most 1.17 plugins only support 1.16.5 and 1.17, nothing before

#

However you could just not bind into 1.17 and still compile with Java 8 - 15 and allow previous versions to use the plugin

visual tide
hardy swan
quiet ice
#

Nmv, misread

quiet ice
hardy swan
#

I think even if you depend on 1.17's api, the plugin can still work on older versions

quiet ice
#

Basically, no most times yo do not need to change anything, provided that you code stuff correctly

#

I think you need J16 in order to bind against 1.17, which cannot be used by older mc versions. Though I do not know if I could still set the release version to a lower version, if that is possible then that my rant can be ignored

hardy swan
#

Yea you can still use 1.8 to compile 1.17 dependencies

red bolt
#

looks to me to be a Spigot or MC bug

chrome beacon
#

Yeah probably spigot

#

Things are a bit unstable atm

#

Make sure you're up to date

red bolt
#

yeah it's the latest

chrome beacon
#

Try submitting a bug report on JIRA

red bolt
#

yeah sure

#

gonna have to reproduce it myself first though

worldly ingot
#

1000% not a MV bug. I saw it in earlier versions when starting my world on my local server

#

I never got around to making a JIRA issue for it because I've been preoccupied with work and school

opal juniper
#

Is there a way to detect /reload ?

eternal oxide
#

yes

tardy delta
#

whats the difference between BARRIER and LEGACY_barrier?

eternal oxide
#

in your onLoad() method check for how many worlds are in Bukkit.getWorlds() If its empty its a fresh start.

vital ridge
#

I have this code:

private Skull changeSkin(Block b, String base64Str) {
        
        final Skull skull = (Skull)b.getState();
        
        GameProfile profile = new GameProfile(UUID.randomUUID(), null);
        
        profile.getProperties().put("textures", new Property("textures", base64Str));
        
        try {
            Field profileField = skull.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(skull, profile);
            
        }catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); }
        
        skull.update(); 
        return skull;
    }

and it gives me this error:

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState cannot be cast to class org.bukkit.block.Skull (org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState and org.bukkit.block.Skull are in unnamed module of loader 'app')
#

Now the problem is that I have the exact same code in my other plugin and there never were any errors with this code

#

The error points on this line:

#
final Skull skull = (Skull)b.getState();
#

Now about my imports, i dont have any imports associated with blockstate

#

So im not sure where this weird craftblockstate import comes from

#

it should be just normal bukkit import like the skull is, but it isnt

ivory sleet
#

The block isn't a skull

last sleet
#

Is there any way of changing an inventory title without creating a new one?

#

(I dont want to fire InventoryCloseEvent)

ivory sleet
#

Uh you probably have to reopen a new inventory with the desired title or reopen another inventory view

vital ridge
last sleet
ivory sleet
#

b.getState() does not instance of Skull @vital ridge

tardy delta
#

to use vault as an maven dependency do i need to include it in my pom.xml?

ivory sleet
#

Yes

vital ridge
#

How tho?

#

Skull is blockstate

ivory sleet
#

Just opening one shouldn't trigger it but can't promise anything

tardy delta
#

well i have this now and doesnt work

<!-- Vault API -->
        <dependency>
            <groupId>net.milkbowl.vault</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
        </dependency>
ivory sleet
vital ridge
#

So what should I do?

#

I still dont understand my error

#

CUz the same code worked perfectly in my last plugin

#

where i did the same exact task

#

should I check something?

ivory sleet
#

It just means the block you're passing isn't a skull

proud basin
#

Should I be storing kills & deaths in a database so I can use them?

ivory sleet
#

Sure jtx

tardy delta
ivory sleet
#

@vital ridge a simple

if (!(b.getState() instanceof Skull)) {
   return null;
}
Skull skull = (Skull)b.getState();

should fix it

vital ridge
#

oops

#

wait no i gave u

#

wrong code

#

wait

ivory sleet
#

?paste

undone axleBOT
vital ridge
ivory sleet
#

¯_(ツ)_/¯

#

I mean I can only tell you what the error means

vital ridge
#

aight

ivory sleet
proud basin
tardy delta
#

im wondering where to find it

ivory sleet
#

Plain files jtx?

proud basin
#

wym?

ivory sleet
tardy delta
#

is it this

<repository>
        <id>vault-repo</id>
        <url>http://nexus.hc.to/content/repositories/pub_releases</url>
        </repository>
ivory sleet
#

No it's on jitpack

#

jtx saying you wanna store it in json is kinda ambiguous, for instance you can use plain files to store data using json format but for instance MongoDB also uses a json format to store data I think.

last sleet
#

Since im making a custom anvil to combine my items, I don't want to remake the vanilla one since it'll be wayy too complex and take wayy to long. so I've placed that. It opens the right GUI but whenever i try and use it, any items gets deleted and it sends and error in my logs. Maybe it's because it has no block associated with it? Any fix?

#

My plugin doesnt open custom anvil when i use a damaged anvil, and when I tried that, it works just fine.

unreal quartz
#

sending the error would be a good start

tardy delta
#

i dont find what to write for the repo of vault

proud basin
#

hm

last sleet
unreal quartz
last sleet
#

Not supported yet?

tardy delta
#

ah found it

#

didnt saw the link

proud basin
ivory sleet
#

Using plain files I would probably start by choosing a Java json library, ideally gson since it’s shaded. Have you messed with writers and readers or is this your first time (not particularly hard)?

proud basin
#

first time

eternal oxide
#

The real question is, do you need a database?

ivory sleet
#

Yeah you could probably use PDC to store data

eternal oxide
#

Are you looking to track player vs player kills, or mobs?

#

If mobs, the API already has STATISTIC

proud basin
#

Well what I was planning was storing their kills and deaths so I can grab them and display them but also use it on a leaderboard and to get their killstreak

eternal oxide
#

these kill/deaths would be for all time or reset when?

foggy igloo
#

BlockEvent does not have a getHandlerList() method so i am getting this error (i am not using BlockEvent directly)

proud basin
#

all time

eternal oxide
#

it has deaths and entity kills

#

and player kills

proud basin
#

but with statistics Im not able to get their kill streak

eternal oxide
#

a kill streak is only going be over a certain time, so you can easily track that

#

you read the total kills at teh start and read them at teh end

proud basin
#

what's with you always saying teh

last sleet
#

Can anyone help me on how to open a vanilla anvil GUI?

#

When i simply create an inventory it glitches out and nothing works.

unreal quartz
last sleet
#

I found this post, but I dont know where to set it to false

chrome beacon
#

If I were you I would use a premade library for anvil GUIs

foggy igloo
last sleet
chrome beacon
last sleet
#

yea...?

foggy igloo
#

?paste

undone axleBOT
chrome beacon
unreal quartz
#

that's not where the error is thrown from

foggy igloo
#

it gives from there and i sended InGameListener class

last sleet
unreal quartz
#

PvPMask.java:81?

foggy igloo
#

and registerListener method is working properly

chrome beacon
last sleet
#

It's just not getting them

unreal quartz
last sleet
#

and yes, I did add the repo

unreal quartz
#

BlockPistonEvent is abstract

foggy igloo
#

ok

visual tide
#

how do i stop saveConfig(); deleting stuff

unreal quartz
#

be a bit more specific

#

saveConfig will just overwrite your config.yml with whatever is loaded in memory + whatever changes you made to it

visual tide
#

i have a configfixer like so

#
package me.outsparkled.itemblacklist;

import org.bukkit.Material;
import org.bukkit.plugin.Plugin;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

public class ConfigFixer {
    public void fixConfig() {
        Plugin plugin = ItemBlacklist.getPlugin(ItemBlacklist.class);

        plugin.getConfig().options().copyDefaults(true);
        plugin.saveDefaultConfig();

        List<String> bannedBlocks = plugin.getConfig().getStringList("banned-blocks");
        List<String> bannedItems = plugin.getConfig().getStringList("banned-items");

        List<String> fixedBannedBlocks = bannedBlocks.stream().parallel().map(Material::matchMaterial).filter(Objects::nonNull).filter(Material::isBlock).map(String::valueOf).map(String::toLowerCase).collect(Collectors.toList());
        List<String> fixedBannedItems = bannedItems.stream().parallel().map(Material::matchMaterial).filter(Objects::nonNull).filter(Material::isItem).map(String::valueOf).map(String::toLowerCase).collect(Collectors.toList());

        plugin.getConfig().set("banned-blocks", fixedBannedBlocks);
        plugin.getConfig().set("banned-items", fixedBannedItems);

        plugin.saveConfig();
    }
}```
#

and the config values i dont change just get deleted

unreal quartz
#

try calling reloadConfig before accessing your string lists

visual tide
#

k ima try that

#

😮

#

it works

#

thanks!

unreal quartz
#

don't remember the specifics but some things aren't loaded from the config file when trying to get values out of it during your onEnable

quaint mantle
#

?jd

visual tide
#

i see

unreal quartz
#

so calling reloadConfig ensures that the values in memory are current with the file

visual tide
#

ok thanks man!

proud basin
eternal oxide
#

getOfflinePlayers() and check their stats

proud basin
#

oih

#

that simple

novel lodge
#

How can I hide an Item's enchantements

#

Nvm I found it ITEMMETA_EXAMPLE.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);

lone vector
#

playerConnection not found, what should i use?

bleak atlas
#

One message removed from a suspended account.

#

One message removed from a suspended account.

torn crescent
#

Hey,
does anyone know how I can get the root folder of my linux server in my plugin?
I want to create a file on my website, which is at a completely different location.

bleak atlas
eternal oxide
#

The users running your server shoudl not really have access to the root

proud basin
mystic terrace
#

Hello! I'm trying to make a playSound event but it only play it in the location of the player, how I can make it for playing it in the entire world?
(It's a death sound)

eternal oxide
#

world.playsound

chrome beacon
#

Or that

mystic terrace
chrome beacon
#

....

mystic terrace
#

I'm a noobie

chrome beacon
#

World needs to be a world

wraith rapids
#

don't be dumb

mystic terrace
#

World world : ?

chrome beacon
#

?learnjava Highly recomnend

undone axleBOT
wraith rapids
#

that also doesn't make the sound global

mystic terrace
#

so... how?

wraith rapids
#

i don't know how to make a sound global tbh

mystic terrace
#

bruh

wraith rapids
#

i have hardly ever used sounds in my plugins, let alone global ones

#

look up a forum thread or something

mystic terrace
#

I did it

chrome beacon
#

I think looping players is the only way

wraith rapids
#

in the 10 years bukkit has existed I'm sure you're not the only or first one who's trying to do this

mystic terrace
#

how?

#

how I can loop?

vagrant stratus
#

look it up

#

not hard

wraith rapids
#

read the java tutorials that were linked

vagrant stratus
#

few seconds

chrome beacon
#

?learnjava

undone axleBOT
wraith rapids
#

this is java 101

#

learn the basics before asking "how 2 plugin"

quiet ice
#

semi outdated given that the oracle JRE is hard to obtain nowadays

wary harness
#

ever tutorials

mystic terrace
wary harness
#

I started with him 10 years ago

#

😁

vagrant stratus
#

has some issues though @wary harness
explaining the "this" keyword for example 👀

wraith rapids
#

all tutorials that I've seen are incredibly lacking in the oop department

#

imo that's the first thing that should be done away, the concept and the layout and structure of a project, before you write a single line of code

wraith rapids
#

there are so many people who can write a script, write code, but can't for the life of them write a program

wary harness
#

with tutorials about tuna

vagrant stratus
#

there's this https://www.youtube.com/watch?v=luggwIg0w2c&list=PL_c9BZzLwBRLW7Kw8bqc_PJqAnjCJI63P but it's short so far @wraith rapids probably missing stuff too

wary harness
#

and his exse girls

wraith rapids
#

at least it has oop in the title

mystic terrace
wraith rapids
#

no.

#

go back

mystic terrace
#

xd

quiet ice
#

Books are a good alternative, though I guess they are outdated by todays standards

mystic terrace
#
            Bukkit.broadcastMessage(ChatColor.DARK_RED + "¡" + p.getName() + " HA MUERTO!");
            players.playSound(p.getPlayer().getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 1);       ```
wraith rapids
#

yes, better

mystic terrace
#

I have that

#

Yes

#

But now

#

How I can loop the sound

wraith rapids
#

you are

mystic terrace
#

But it only plays it on the player location

vagrant stratus
#

p. needs to be players.

quiet ice
#

for (int i = 0; i < x; i++) {/* code */}

mystic terrace
#

thanks

wraith rapids
#

yes, it plays for each player at that player's location

eternal oxide
#

Why is he looping over all players? World has the method that plays to all.

wraith rapids
#

yes, but plays all doesn't mean global

#

it plays the sound at a given location

eternal oxide
#

I thought that was what he wanted

vagrant stratus
#
  for (Player players : Bukkit.getServer().getOnlinePlayers()) {
            Bukkit.broadcastMessage(ChatColor.DARK_RED + "¡" + players.getName() + " HA MUERTO!");
            players.playSound(players.getPlayer().getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 1);  

is correct @mystic terrace

main tangle
#

Okay so, you need 5 stacks of 32 diamonds placed like a plus in the crafting table. And when you pick the result it takes away all 32 diamonds from all 5 stacks. like in hypixel skyblock. how can i do that in 1.12.2?

wraith rapids
#

by updating to 1.16

mystic terrace
wraith rapids
#

or i guess 1.17 if you're feeling extreme

mystic terrace
#

Lemme record a video and I'll send it

#

I think that you can understand it better my problem

wraith rapids
#

i won't watch it

mystic terrace
#

ok, no worries

#

That's it

main tangle
wraith rapids
#

shared hosts are cheap

main tangle
#

not just the server

#

the client also for some reason

wraith rapids
#

you can get a server that outspecs your machine tenfold for like 1 dollar 50 cents a month

#

you can install viabackwards and play on a 1.12 client

main tangle
#

Hmmph you are right

mystic terrace
wraith rapids
#

what is the issue

mystic terrace
#

I told you before

wraith rapids
#

tell it again

main tangle
mystic terrace
#

I want to make a playSound event in the complete world in a death event

wraith rapids
#

your code does that

mystic terrace
#

And i sended a video of what happened

mystic terrace
wraith rapids
#

and i said i won't watch it

#

describe to me what happened

mystic terrace
#

Why?

wraith rapids
#

my client doesn't support playing video

mystic terrace
#

It's legit 7 secs

#

Oh

quaint mantle
#

Is spigot is working on world generation also ?? As in vanilla there are no lush cavs and drip stone caves generation

mystic terrace
#

Basically it plays it in one area

#

not in the entire world

wraith rapids
#

you mean when you move, the sound seems to stay in one position

mystic terrace
#

Yes

wraith rapids
#

try increasing the volume to like 100 or something

main tangle
quiet ice
#

$10/month on the higher end of the scale

wraith rapids
#

sure, but still outspecs your crappy laptop tenfold at $1.5/month

quiet ice
#

damn stuff is cheap nowadays

wraith rapids
#

yeah

#

that's what capitalism does for you

main tangle
#

i mean like what hosts?

wraith rapids
#

shared hosts

#

some shit tier hosts include elixirnode and shockbyte

mystic terrace
wraith rapids
#

some better shared hosts include dedicatedmc and heavynode

lusty cipher
#

Btw on Spigot is there some way I could publish a JAR which is built with Java 8 for 1.14 to 1.16, and also provide a JAR built with Java 16 for 1.17 and higher? (Similar to CurseForge)

quiet ice
#

You might be looking at multi-release jars

#

Don't ask me how you can do that, you would need to search that for yourself

wraith rapids
#

more realistically, and what people usually do, you just have a big bold dark red text in your description telling people to download specific versions for specific server versions

opal sluice
#

Isn't Java 16 retro compatible with Java 8 anyway ?

wraith rapids
#

which nobody then reads and proceeds to rate the plugin 0 stars

opal sluice
#

(If you don't use new things about this version)

wraith rapids
#

no, java can't load newer class version files at all

#

it's the other way around

lusty cipher
#

yeah ^

#

I found the JEP for multi release JARs and gonna look through the gradle blog for it

quiet ice
#

Even then it is not

#

Spigot 1.16.4 will not run on Java 16, no questions asked

ebon heron
#

Does anyone know how to make a world with a larger height limit in spigot api 1.17?

floral kindle
#

Does anyone know what the new PacketPlayOutWorldBorder 1.17 package is new?

upper mica
#

Can Bukkit#getPlayer(String) return null if player with that name never joined the server?

unreal quartz
#

think all the packets are in net.minecraft.network.protocol.game

eternal oxide
upper mica
#

oh, I thought it would return as OfflinePlayer, now that I think about it, OfflinePlayer cannot be casted to Player

wraith rapids
#

it can

#

or wait

#

which way was it

quiet ice
#

It can be casted

wraith rapids
#

Player extends OfflinePlayer

quiet ice
#

Correct

wraith rapids
#

yeah, you can cast it, but only if you check it's a Player first

quiet ice
#

But casts can be done both ways

wraith rapids
#

every Player is an OfflinePlayer, but not every OfflinePlayer is a Player

#

the method you're looking for is getOfflinePlayer

iron condor
#

hey what does that mean?

java.lang.NullPointerException: Cannot read field "type" because the return value of "net.milkbowl.vault.economy.Economy.withdrawPlayer(org.bukkit.OfflinePlayer, double)" is null```
upper mica
#

but OfflinePlayer does not extend Player

wraith rapids
#

yes, but an OfflinePlayer might be a Player

#

a rectangle might be a square

#

if its sides are the same length

eternal oxide
#

If the player is not online there never will be a Player object

wraith rapids
#

similarly, a Fruit might be an Apple

quaint mantle
#

cancelling note block powering by redstone?

wraith rapids
#

an Apple is guaranteed to be a Fruit

#

and any Fruit could be an Apple

#

but only some Fruit's are actually Apple's

halcyon topaz
#

Wise words

upper mica
#

interesting

wraith rapids
#

i'm a pretty wise guy

loud swift
#

Hey guys, i was wondering if anyone could help me out.
I'm new to asynchronous programming and can't seem to figure out why this permanently stucks the server:

  private final ConcurrentHashMap<String,CompletableFuture<String>> testMap = new ConcurrentHashMap<>();

  public void testProblem(){
    final CompletableFuture<String> testString = new CompletableFuture<>();
    testMap.put("test", testString);
    new BukkitRunnable(){
      @Override
      public void run() {
        testString.complete("test value");
      }
    }.runTaskAsynchronously(BlocksEvolved.getInstance());
    try {
      System.out.println("Test String is: "+ testMap.get("test").get());
    } catch (InterruptedException | ExecutionException ex) {
      Logger.getLogger(StorageProblemTester.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
upper mica
#

btw I like your username

quaint mantle
wraith rapids
#

are you blocking on the testString future somewhere

#

like, calling .get on it

loud swift
#

no, the only method im using is testProblem

wraith rapids
#

you are

#

"Test String is: "+ testMap.get("test").get()

#

you are getting the future

#

and then blocking until the future is complete

loud swift
#

yes, but that should just wait for the async runnable right?

wraith rapids
#

yes

loud swift
#

but it never gets completed

wraith rapids
#

but the issue is

#

that you are waiting on the main thread

#

the bukkit scheduler is controlled by the main thread

#

if the main thread stops, no tasks will be run

wraith rapids
#

so your future will never complete

#

so your .get will never stop blocking

loud swift
#

but doesn't the asynchronous task run on another thread?

wraith rapids
#

yes

#

but it's controlled from the main thread

#

only the running is done on another thread

#

the ready-start-go is done on the main thread

loud swift
#

yeah, but the ready start go is done before get isnt it?

wraith rapids
#

it's not

#

ready start go is done in between ticks

#

ready start go is done as the first thing before a tick

loud swift
#

i see

wraith rapids
#

before or after plugins fire their logic

loud swift
#

how can i prevent this scenario, any idea?

wraith rapids
#

generally, do not block the main thread

loud swift
#

but i do need to block the main thread

wraith rapids
#

use a dedicated worker thread

loud swift
#

because some event handlers need this info

wraith rapids
#

that is separate from the scheduler

#

or a thread pool

#

doesn't matter what, as long as it doesn't need to go through the bukkit scheduler

loud swift
#

ok, so basicly just run async using something that isn't the bukkit scheduler

#

that'd be the solution?

wraith rapids
#

pretty much yes

loud swift
#

ok, thank you.

wraith rapids
#

iirc completablefuture has an util method for doing just that

eternal night
#

Why are you even using the scheduler in combination with a completable future. Completable futures can run on their own

wraith rapids
#

supplyAsync or something

eternal night
#

yea, it is executed on the common fork join pool afaik

loud swift
#

testString.completeAsync(supplier) ?

#

mmmm i'll google on how to use that

#

thanks for pointing me in the right direction guys

wraith rapids
#

i'm a pretty pointy guy

loud swift
#

haha 🙂

eternal night
#
final CompletableFuture<Integer> heavyComputed = CompletableFuture.supplyAsync(() -> {
    return 1 + 1; // HEAVY LOGIC OFF MAIN THREAD
});
#

maybe that saves you a little googling

wraith rapids
#

the heaviest task

#

you better not tell about this to the 1.8 anticheat developers

#

they will legitimately do 1 + 1 on a dedicated thread

loud swift
#

lol

eternal night
#

lol

lyric grove
#

anyone know how to fix this maven error?

#

im using this

eternal night
#

it got worse, 1.8 isn't even the worst omg

wraith rapids
#

hh

#

now i need to assemble a 1.7 team to ping at random

eternal night
#

please install the jar into your local repo

wraith rapids
#

like. do you realize, do you genuinely comprehend

eternal night
#

you cannot publish the spigot server jar anyway

wraith rapids
#

just how fucking old 1.7 is

#

we are at 1.17

eternal oxide
#

1.7 is when the dmca happened

quiet ice
#

August 2014 iirc

cinder haven
#

Hello there! I'm working on my first plugin. It's giving me Invalid plugin.yml although I see nothing wrong with it.
this is my yml:

name: HelloWorld
version: 1
main: sussy.live.firstplugin.Main
description: My first bukkit plugin!

commands:
hello:
aliases: [hi]
description: This is the hello command

wraith rapids
#

what is the actual error

eternal night
#

Also please ?paste

#

?paste

undone axleBOT
eternal night
#

just to make sure discord doesn't do funky formatting

cinder haven
#

ah ok

cinder haven
wraith rapids
#

no, i want the full error

cinder haven
#

org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
is this what you needed?

wraith rapids
#

more

cinder haven
#

1 sec

chrome beacon
#

Paste the plugin.yml first

#

It's the most important

cinder haven
#

ok

cinder haven
wraith rapids
#

no.

cinder haven
#

this is the entire error

wraith rapids
#

wrap the yml in code formatting

#

we can't see the indentation properly

quaint mantle
#

Code blocks

cinder haven
#

oh ok

wraith rapids
#

org.yaml.snakeyaml.scanner.ScannerException: mapping values are not allowed here

#

it is not valid yaml syntax

#

plug it into a yaml validator and see what the issue is

quaint mantle
#

``````yml
Code
``````

#

That didn’t work great but yeah

cinder haven
#
name: HelloWorld
version: 1
main: sussy.live.firstplugin.Main
description: My first bukkit plugin!

commands:
  hello:
   aliases: [hi]
   description: This is the hello command
#

?

wraith rapids
#

this is also not the same yaml that is in the plugin

#
Caused by: org.yaml.snakeyaml.scanner.ScannerException: mapping values are not allowed here
 in 'reader', line 4, column 56:
     ... ukkit plugin! Used this tutorial: https://www.youtube.com/watch? ... 
#

you need to escape special characters or wrap the string in ""

#

look up a yaml tutorial, use an online yaml validator to figure out whether the yaml is valid or not

cinder haven
#

ohhhh

#

tysm

quaint mantle
#

This is a code block with syntax highlighting

wraith rapids
#

next time around, read the error

proud basin
#

Is there a way to check if a player moves?

quaint mantle
#

Player move event iirc

proud basin
#

rip

vital ridge
#

EntityExplodeEvent is not correctly working, if im creating the explosion in my plugin. So does anybody have any idea how should I check the destroyed blocks or smthing then?

#

Cuz i need to.

#

Basically the e.blocklist is not printing out when the explosion is created by my plugin

wraith rapids
#

wut

#

if you are creating an explosion directly with your plugin, it obviously won't fire an entityexplodeevent, as no entity actually exploded

#

you're just creating an explosion

vital ridge
#

Right

#

Yea okay ill try the blockexplodeevent

wraith rapids
#

that won't get fired either

#

as no block actually exploded

#

you're just creating an explosion

eternal oxide
#

if you are using the createExplosion methods it should generate an event

vital ridge
#

BlockExplosionEvent

#

catched it

#

worked

proud basin
#

So Im using PlayerMoveEvent but how can I "link" it with my command?

vital ridge
#

seems not logical that it would, but it did

wraith rapids
#

depends on your definition of "link"

proud basin
#

idk if you could say Implement

chrome beacon
#

... what are you trying to do

wraith rapids
#

explain yourself, nose and chin man

proud basin
#

wow, I have a command and what I'm wanting to do is if the player moves then the command is canceled

#

so I have the PlayerMoveEvent

quaint mantle
#

Could have like a map of players waiting for a command to finish and check that on player move and if the player is in the map cancel the command

#

I’m just throwing an idea off the top of my head doe

wraith rapids
#

yeah, that is generally what is done

lucid gazelle
#

my plugins placeholder doesnt work in a gui of the same plugin
but it works in featherboard
why is that?

wraith rapids
#

the crystal ball says...

#

install pex

quaint mantle
#

part of programming is coming up with your own solutions... is there a problem with what i suggested?

proud basin
#

Mhm

#

Very slow

quaint mantle
#

then figure out a better way.. lol

wraith rapids
#

it isn't particularly slow

sage swift
#

youre particularly slow

wraith rapids
#

your mom

quaint mantle
#

particularly slow with ur mum

shadow gazelle
#

Hopefully I'm allowed to ask this here, sorry if I'm not:
Alright, so, I'm kind of stuck on what I should do here and want some opinions. I'm working on some custom enchantments, with the two I have right now, the first lets you fly if you have it on a chestplate and the second makes blocks you break go into your inventory automatically without dropping on the ground. I want people to be able to get these in "vanilla" survival, but I don't want to use a normal book and anvil/enchantment table, I was thinking something like dropping items and their tool/armor onto a certain block(s) to get it. Any ideas on what I could do?

lucid gazelle
#

https://gist.github.com/polkacentral/5efa92924680b518ff44328c126dc483

I have plugin with a currency.

In the SHOP gui class part of the plugin, where you spend that currency, when i add %gems_amount% placeholder into the lore of an item in the gui in the config, it will not show up.

If I use the placeholder anywhere else outside of the plugin, the placeholder works perfectly
Do I need to register the placeholder or something in this class or something?

wraith rapids
#

check for the drop item event or whatever

granite stirrup
wraith rapids
#

then after a second or two check back on the item and see where it landed

#

and then check whether that is "a certain block"

quaint mantle
shadow gazelle
wraith rapids
#

populate it as dungeon/mineshaft loot

sage swift
wraith rapids
#

rare drops from mobs like withers/guardians/elder guardians

#

expensive villager trade

sage swift
#

there's a method to replace placeholders in a string

shadow gazelle
#

I mean for someone adding the enchant @wraith rapids

sage swift
#

loot context

wraith rapids
#

one plugin had you "combine" two stacks of items

#

one being the item you wanted to enchant, the other being the enchanted book/tome/whatever

shadow gazelle
#

hm

#

I'll take a look at doing that

wraith rapids
#

you'd then intercept this click event and apply the enchant onto the item the enchant was dropped on

shadow gazelle
#

What blocks keep their NBT values when placed?

lucid gazelle
#

papi is a depend

wraith rapids
#

tile entities

lucid gazelle
#

i setup ```java

String translatePlaceholders(String s, GemUser gemUser, GemPick pick, EnchantmentItem item) {
    String levelsAdded = "+" + item.getLevelsAdded();
    int upgradePrice = item.getUpgradePrice(pick.getEnchantmentLevel(item.getEnchantmentType()));
    String price = ChatColor.WHITE + MessageFormat.format("\u2666{0}", upgradePrice);
    if (!gemUser.hasEnoughGems(upgradePrice)) {
        price = ChatColor.RED + MessageFormat.format("\u2666{0}", upgradePrice);
    }

    GemEnchantment enchantment = EnchantmentRegistry.getRegistry().getEnchantment(item.getEnchantmentType());
    if (pick.getEnchantmentLevel(item.getEnchantmentType()) == enchantment.getDynamicMaxLevel(pick.isBoosted())) {
        price = Message.STATUS_LORE_MAXED.toString();
    }


    return s.replace("%levelsAdded%", levelsAdded)
            .replace("%currentlevel%", String.valueOf(pick.getEnchantmentLevel(item.getEnchantmentType())))
            .replace("%gembalance%", String.valueOf(gemUser.getGems()))
            .replace("%price%", price);
}```
shadow gazelle
lucid gazelle
#

thats in inventoryconfig.java

wraith rapids
#

yes, only tile entities

lucid gazelle
#

i want to use that placeholder in upgradeconfig.java

shadow gazelle
#

Well shit

wraith rapids
#

other blocks are not able to store anything

lucid gazelle
#

do i need to mention something about those placeholders in upgradeconfig.java?

sage swift
#

String.valueOf and not "" + whatever

shadow gazelle
#

Maybe a beacon for the ones that should be rarer...

wraith rapids
#

i don't remember if a beacon is a tile entity

shadow gazelle
#

Do beacons keep their data?

wraith rapids
#

i think it might be

shadow gazelle
#

Oh

#

Time to check

wraith rapids
#

check the javadocs

#

see if TileState has something beacon related as a subclass

shadow gazelle
#

I'll only really be checking for a custom name, so if that's still there after I place and break it then it should work

#

Name doesn't save

wraith rapids
#

use the pdc

#

if it's tile entity, it has a persistent data container

#

store your "this is special" information there

grave mason
#

Hey when i leave as passenger the vehicle i will get kicked with the messages "Disconnected" and no error in console

shadow gazelle
#

These seem to be tile entities

#

So I would have to use one of them...

#

hm

granite stirrup
#

bruh why is savagefactions so shit

shadow gazelle
#

Lectern doesn't store a custom name

#

rip

wraith rapids
#

like i said

#

use the pdc

#

store your "this is special" there

#

you don't need a custom name

granite stirrup
#

idk about the campfire

#

XD

#

lectern needs to store the book data i think

shadow gazelle
wraith rapids
#

campfire needs to store the shit you cook on it

granite stirrup
#

yeah

shadow gazelle
#

lol

shadow gazelle
#

Oh

wraith rapids
#

tile entities are persistent data holders

#

they hold a persistent data container

#

which can persistently hold arbitrary data

shadow gazelle
#

I'm kind of thinking a custom name so that I can make a resourcepack to go with it

granite stirrup
#

its probs possible to make a plugin that adds nbt to basically every block

#

but idk how u would do it

wraith rapids
#

not really, not through bukkit anyway

granite stirrup
wraith rapids
#

spigot and paper are bukkit

#

attempts have been made but they are relatively crude, inefficient, and ineffective

shadow gazelle
#

Paper is a bit different

#

But not by too much

wraith rapids
#

and paper hasn't been called fucking paperspigot for like 5 years

#

paper, spigot, tuinity and purpur and all of that downstream shit are all implementations of the Bukkit API

shadow gazelle
#

Anyway, I was thinking a custom name so that I could make a custom model for it with OF or something

wraith rapids
#

then your options are limited pretty much solely to containers

shadow gazelle
#

I like the idea of a brewingstand

granite stirrup
shadow gazelle
#

Typing go brr

wraith rapids
#

and I call you stupid

shadow gazelle
#

lmao

granite stirrup
#

i dont know why

#

i just type spigot at the end

#

it is a fork of spigot tho...

#

i think it should be called paperspigot

wraith rapids
#

yes, and tuinity should be called tuinitypaperspigot

#

and spigot should be called spigotcraftbukkit

granite stirrup
wraith rapids
#

do you realize how dumb that is

granite stirrup
#

yes but i meant just paper should be called paperspigot

wispy fossil
#

paperspigot has more of a ring to it

granite stirrup
#

paperspigot sounds like more appealing than just paper

#

paper just seems boring

wispy fossil
#

yeah

granite stirrup
#

also i think i heard to much people calling it paperspigot

#

that i decided to call it paperspigot now

wraith rapids
#

that's just because you run in stupid 1.8'er circles

wispy fossil
#

lol

granite stirrup
#

XD

wispy fossil
#

what percentage of servers use 1.8 again?

granite stirrup
#

like 2%

wraith rapids
#

8

granite stirrup
#

i thought it was 2%

wraith rapids
#

it's like 2 on paper probably

cinder timber
#

i thought it would be way more...

wraith rapids
#

it's not as popular as people think it is

granite stirrup
#

i either use 1.12.2 or 1.16.5

proud basin
#

so I have ```java
Map<String, Integer> killstreak = new HashMap<String, Integer>();

granite stirrup
#

getKey?

wraith rapids
#

that's not how maps works

#

the gig of a map is that you give it the string to get the integer

granite stirrup
#

idk how u use maps

wraith rapids
#

not the other way around

proud basin
#

hm 😦

#

Im just trying to get the killstreak now 😦

wraith rapids
#

also don't key it by string

#

key it by UUID

proud basin
#

ok

wraith rapids
#

map.get(player.getUniqueId())

granite stirrup
#

i thought it was getKey

wraith rapids
#

you thought wrong

granite stirrup
#

u know what idk anything about maps i never used them

#

XD

#

because i havent really made any plugins yet

proud basin
#

aw

#

i get null

wraith rapids
#

that's because you haven't put anything in yet

#

if a given key does not have an associated value, null is returned

proud basin
#

I did killstreak.put(name, kills);

wraith rapids
#

did you make it use UUIDs

proud basin
#

yea

wraith rapids
#

then don't put name

granite stirrup
#

u need to put the uuid not the name

wraith rapids
#

put the uuid

proud basin
#

doesn't change anything though

wraith rapids
#

if it returns null, that key does not have a value

#

which means you're not calling put with the same key before

proud basin
#

oh yea forgot to tell you my map is static hehehhe

wraith rapids
#

that shouldn't matter

proud basin
#
public static Map<UUID, Integer> killstreak = new HashMap<UUID, Integer>();

    @EventHandler
    public void PlayerDeath(PlayerDeathEvent e) {
        Player player = e.getEntity();
        if (player.getKiller() instanceof Player) {
            Player killer = player.getKiller();
            addtokillstreak(killer);
            killstreak.put(player.getUniqueId(), 0);
        }
    }

    public void addTokillstreak(Player killer) {
        UUID uuid = killer.getUniqueId();
        if (killstreak.containsKey(uuid)) {
            int kills = killstreak.get(uuid);
            kills++;
            killstreak.put(uuid, kills);

        } else {
            killstreak.put(uuid, 1);
        }
    }
wraith rapids
#

you are always putting 0

shadow gazelle
wraith rapids
#

are you reloading the plugin

shadow gazelle
#

Using /reload from MC

wraith rapids
#

restart

grave mason
granite stirrup
#

make sure in ondisable u unregister the nchantment maybe

proud basin
wraith rapids
#

killstreak.put(player.getUniqueId(), 0);

#

you are always overriding the value with 0

shadow gazelle
#

Uh

#

How would I do that?

#

Also, that shouldn't break items that have the enchant, right @granite stirrup?

granite stirrup
#
public static Map<UUID, Integer> killstreak = new HashMap<UUID, Integer>();

    @EventHandler
    public void PlayerDeath(PlayerDeathEvent e) {
        Player player = e.getEntity();
        if (player.getKiller() instanceof Player) {
            Player killer = player.getKiller();
            addtokillstreak(killer);
            int killstreak = killstreak.get(player.getUniqueId());
            // do extra stuff with killstreak
        }
    }

    public void addTokillstreak(Player killer) {
        UUID uuid = killer.getUniqueId();
        if (killstreak.containsKey(uuid)) {
            int kills = killstreak.get(uuid);
            kills++;
            killstreak.put(uuid, kills);

        } else {
            killstreak.put(uuid, 1);
        }
    }```?
proud basin
#

oh

granite stirrup
wraith rapids
#

it doesn't

shadow gazelle
#

How do you unregister an enchantment, anyway?

wraith rapids
#

through a very annoying and difficult procedure that involves nms and reflection

granite stirrup
#

idk

wraith rapids
#

just restart your server

granite stirrup
proud basin
#

kill streak

wraith rapids
#

probably not

granite stirrup
#

oh

#

hang on

wraith rapids
#

nose and chin man

#

get me the actual exception

granite stirrup
#
public static Map<UUID, Integer> killstreak = new HashMap<UUID, Integer>();

    @EventHandler
    public void PlayerDeath(PlayerDeathEvent e) {
        Player player = e.getEntity();
        if (player.getKiller() instanceof Player) {
            Player killer = player.getKiller();
            addtokillstreak(killer);
            int killstreak = (int)killstreak.get(player.getUniqueId());
            // do extra stuff with killstreak
        }
    }

    public void addTokillstreak(Player killer) {
        UUID uuid = killer.getUniqueId();
        if (killstreak.containsKey(uuid)) {
            int kills = (int)killstreak.get(uuid);
            kills++;
            killstreak.put(uuid, kills);

        } else {
            killstreak.put(uuid, 1);
        }
    }```
proud basin
#

null

wraith rapids
#

and send the actual class over pastebin

granite stirrup
#

try that?

wraith rapids
#

null is not a fucking exception

proud basin
#

lmao

#

there isn't any exception

#

it just prints null

#

there isn't any value

wraith rapids
#

what prints null?

#

there's nothing that'd print anything in this entire block of code

proud basin
#

KillStreaks.killstreak.get(p.getUniqueId())

wraith rapids
#

that does not print anything

granite stirrup
#

that doesnt print anything lol

proud basin
#

....

wraith rapids
#

you are testing my patience nose and chin man

proud basin
#

you joking

wraith rapids
#

System.out.println(KillStreaks.killstreak.get(p.getUniqueId()))
would print something

#

get alone does not print anything

#

you casting it to int blindly may throw a null pointer exception

#

but it does not print anything by itself

shadow gazelle
#

Would ARMOR_TORSO also include an elytra?

opal juniper
#

Afaik yes

wraith rapids
#

i have no clue

#

one would think not, but it's mojang

opal juniper
#

I mean - it’s on the torso slot

wraith rapids
#

but it's not armor

opal juniper
#

I thought it was considered so

granite stirrup
wraith rapids
#

in some bastardized fashion yes it could be considered armor

wraith rapids
#

but it's not actually, really armor

#

what does it print exactly

#

send your logs

proud basin
#

there isn't any logs

#

it's just printing null

chrome beacon
#

....

wraith rapids
#

then where the fuck are you reading the null

#

nose and chin man

#

you are not making any sense

opal juniper
#

From the sys out he means

proud basin
wraith rapids
#

there is no sysout in his code

opal juniper
#

I thought that’s what you just wrote

#

Above

proud basin
#

that's what I wrote

wraith rapids
#

i did write a sysout example

opal juniper
#

Yeah and he copied it

wraith rapids
#

but we haven't seen code with a sysout in it

granite stirrup
#

wait wherever u wrote it did it have a player variable

proud basin
#

also

wraith rapids
#

god imgur is fucking laggy

proud basin
#

I didn't think it would needed to show it

opal juniper
proud basin
#

I

granite stirrup
#

show code where it is

main tangle
#

Okay so, you need 5 stacks of 32 diamonds placed like a plus in the crafting table. And when you pick the result it takes away all 32 diamonds from all 5 stacks. like in hypixel skyblock. how can i do that in 1.16.5?

opal juniper
#

So you can send images

proud basin
#

um

#

idk how to

opal juniper
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

wraith rapids
#

you would need to listen to prepare craft event or something

#

recipes themselves don't support stacks

proud basin
#

I don't remember my spigot account

wraith rapids
#

send updated code

granite stirrup
proud basin
main tangle
#

.

wraith rapids
#

send updated code

main tangle
#

oh shout i am on my alt

proud basin
#
@EventHandler
    public void PlayerDeath(PlayerDeathEvent e) {
        Player player = e.getEntity();
        if (player.getKiller() instanceof Player) {
            Player killer = player.getKiller();
            addToKillstreak(killer);
        }
    }

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

        } else {
            killstreak.put(uuid, 1);
        }
    }
wraith rapids
#

that still does not have a sysout in it

#

that does not print anything

proud basin
#

it prints in a different class

granite stirrup
#

show that class

#

then

#

;-;

proud basin
#
public void run() {
        for (Player p : Bukkit.getServer().getOnlinePlayers()) {
            Player killer = p.getKiller();
            ScoreboardHelper board = this.scoreboardHandler.getScoreboard(p);
            board.clear();
            board.add(lines);
            board.add(separator + "&c");
            board.add("Killstreak &a"));
            board.update(p);
            System.out.println(KillStreaks.killstreak.get(p.getUniqueId());
        }
    }
wraith rapids
#

have you killed another player

proud basin
#

yes

wraith rapids
#

since last loading the plugin in

proud basin
#

yea

#

oh wait

wraith rapids
#

verify that your event handler works

proud basin
#

no

wraith rapids
#

then that is why

proud basin
#

woopsy

granite stirrup
#

yeah if u want to fix that ur gonna need to store kills somewhere

quaint mantle
#

.

wraith rapids
#

i already answered you

proud basin
#

woops

#

wrong reply

quaint mantle
#

np lol

granite stirrup
#

lol

quaint mantle
proud basin
#

I already have the kills

wraith rapids
#

i answered you a second time

granite stirrup
#

no i meant if u want keep it after reload

shadow gazelle
#

?paste

undone axleBOT
quaint mantle
proud basin
#

oh

#

god damit

proud basin
#

Should I just store it in a json?

quaint mantle
#

statistics

wraith rapids
#

no, you should store it in the player's persistent data container

shadow gazelle
#

These are the events I have for enabling flight with the enchant, I can still fly after I take the chestplate that has the enchant off, any ideas about what's wrong?
https://paste.md-5.net/jafogacadi.cs

quaint mantle
#

there. are. statistics.

wraith rapids
#

yes, but they don't track streaks

proud basin
wraith rapids
#

click events are fired before the actual action has been performed

#

so during the click event, the item is still equipped

#

and thus your code doesn't fire

shadow gazelle
#

Oh

granite stirrup
shadow gazelle
#

crap

wraith rapids
#

in the playerdata

shadow gazelle
#

Any idea how I could fix that?

wraith rapids
#

check whether the player is clicking on the armor slot

granite stirrup
wraith rapids
#

yes, but that doesn't do file stuff

shadow gazelle
granite stirrup
wraith rapids
#

you'd have to use the event to figure out whether the item was removed and had the flight enchant

#

instead of the inventory

#

yes, the server does file shit when saving the world and playerdata

wraith rapids
#

async on paper, probably sync on spigot because splögget sux

#

nose and chin man has condemned himself

#

use json or whatever i guess

shadow gazelle
granite stirrup
wraith rapids
#

yes, but in the current event you are checking the inventory

#

use the event itself

shadow gazelle
#

So...

wraith rapids
#

get the clicked slot

#

if it's not the chest armor slot, ignore the event

proud basin
#

may I ask why 0 is null?

wraith rapids
#

it's not

#

if it is the chest armor slot, check what is in the slot

#

if the slot contains your special item, remove fly

#

however, keep in mind that there are several ways for players to equip and unequip armor

granite stirrup
wraith rapids
#

and the only way to actually keep track of what players are wearing is to check every tick

#

or use paper, which has an armor change event

paper viper
#

or use the lib

shadow gazelle
wraith rapids
#

which checks it every tick

#

it could break