#help-development

1 messages · Page 2007 of 1

tender shard
#

as said, print out the player's inv

hasty prawn
#

It's just invisible 🙄

quaint mantle
#

no way

smoky oak
#

oooooooooh

#

yea

#

i remember

#

that was a thing

tender shard
#

try in survival mode

smoky oak
#

if you modify player inventory

#

you need to send a force inventory update

young knoll
#

What

#

In what world

tender shard
lost matrix
#
        ItemStack foundItem = Items.getItem(item);
        System.out.println(">> BEFORE");
        System.out.println(Arrays.toString(p.getInventory().getContents()));
        p.getInventory().addItem(foundItem);
        System.out.println(">> AFTER");
        System.out.println(Arrays.toString(p.getInventory().getContents()));
smoky oak
#

tf is the isue then?

tender shard
#

have you tried it in survival mode instead of creative?

#

the creative inventory is weird

hasty prawn
#

That shouldn't matter tho

tender shard
#

sometimes it does though :/

iron tundra
#

When I click on a villager, the trade gui doesn't show up as designed but I don't get the player name nor do I get the gui pop up on my screen. If you happen to know why I might not be getting the player information I would appreciate it!

    @EventHandler
    public void OpenGUi(TradeSelectEvent event) {
        Player plr = (Player) event.getWhoClicked();
        System.out.println(plr.getName());
        event.setCancelled(true);
        openNewGUI(plr);
    }
young knoll
#

Let's settle one thing first

tender shard
#

creative inventory is really weird sometimes in enwer versions

young knoll
#

What weird version is this

smoky oak
#

I've yet to encounter issues with addItem

lost matrix
#

In this case it should make no difference

quaint mantle
#

@lost matrix

10.03 21:30:54 [Server] Server thread/INFO >> BEFORE
10.03 21:30:54 [Server] Server thread/INFO [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
10.03 21:30:54 [Server] Server thread/INFO >> AFTER
10.03 21:30:54 [Server] Server thread/INFO [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
#

All null

hasty prawn
#

Hm, I've never had an issue with creative but it's worth a shot ig

quaint mantle
#

Btw, my version is 1.18.1

tender shard
#

can't hurt to go to survival for one second

quaint mantle
#

OH, and I also tested in survival

smoky oak
#

can u post your item class?

tender shard
#

ok

quaint mantle
#

And no workie

young knoll
#

Well

kindred valley
#

i made the command, registered it to the main and plugin yml but not working

young knoll
#

At least it isn't SuperDuperSpigot 1.8

smoky oak
#

*items

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

quaint mantle
# smoky oak can u post your item class?
package me.emerald.emeraldsplugin;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.*;

public class Items {
    public static ItemStack getItem(String item){
        HashMap<String, ItemStack> itemList = new HashMap<>();
        itemList.put("BasicKey", BasicKey());

        if(itemList.get(item) != null){
            return itemList.get(item);
        }else{
            return null;
        }
    }

    private static ItemStack BasicKey(){
        ItemStack item = new ItemStack(Material.TRIPWIRE, 1);
        ItemMeta iMeta = item.getItemMeta();
        iMeta.setDisplayName(ChatColor.GREEN + "Basic Key");
        iMeta.addEnchant(Enchantment.DURABILITY, 1, true);
        ArrayList<String> iLore = new ArrayList<>();
        iLore.add(ChatColor.GOLD + "A key! can open a basic crate.");
        iMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        iMeta.setLore(iLore);
        item.setItemMeta(iMeta);

        return item;
    }
}
kindred valley
tender shard
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

lost matrix
kindred valley
#

in game im trying to execute it but there is no command

tender shard
#

do you have permission to your command? did you get any error in the log?

tender shard
#

I was talking to @kindred valley

kindred valley
hasty prawn
quaint mantle
#

@lost matrix

>> BEFORE
10.03 21:33:43 [Server] Server thread/INFO [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
10.03 21:33:43 [Server] Server thread/INFO >> AFTER
10.03 21:33:43 [Server] Server thread/INFO [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
smoky oak
#
public static ItemStack getItem(String item){
        if(item.equals("BasicKey")){
            return BasicKey();
        }else{
            return null;
        }
    }

It might just be that your null check is messing with things

#

this does essentially the same with less extra steps

young knoll
#

They print the item

#

And it's not null

quaint mantle
quaint mantle
# lost matrix There are messages missing
10.03 21:33:43 [Server] Server thread/INFO AnEmerald issued server command: /specialgive BasicKey
10.03 21:33:43 [Server] Server thread/INFO >> BEFORE
10.03 21:33:43 [Server] Server thread/INFO [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
10.03 21:33:43 [Server] Server thread/INFO >> AFTER
10.03 21:33:43 [Server] Server thread/INFO [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
lost matrix
quaint mantle
#

oh hold on

#

forgot to update

solid cedar
#
                        DriverManager.getConnection("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database,
                                this.username, this.password));

                Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "MYSQL CONNECTED");
                String query = "SELECT * FROM testkeys";
                Statement st = getConnection().createStatement();
                ResultSet rs = st.executeQuery(query);
                  while (rs.next())
                  {
                      String key = rs.getString("keeeeyysss");
                      if(key == getConfig().getString("klucz")) {
                          System.out.print("Zgadza sie!");
                      }
                  }
            }
                
            } catch (Exception e) {
                e.printStackTrace();
        }
    }``` **Why I have no answer, my String is correct and in table**
quaint mantle
#
10.03 21:35:21 [Server] Server thread/INFO AnEmerald issued server command: /specialgive BasicKey
10.03 21:35:21 [Server] Server thread/INFO >> BEFORE
10.03 21:35:21 [Server] Server thread/INFO [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
10.03 21:35:21 [Server] Server thread/INFO Adding: ItemStack{TRIPWIRE x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"green","text":"Basic Key"}],"text":""}, lore=[{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gold","text":"A key! can open a basic crate."}],"text":""}], enchants={DURABILITY=1}, ItemFlags=[HIDE_ENCHANTS]}}
10.03 21:35:21 [Server] Server thread/INFO Returns: {}
10.03 21:35:21 [Server] Server thread/INFO >> AFTER
10.03 21:35:21 [Server] Server thread/INFO [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]
``` @lost matrix
quaint mantle
lost matrix
#

Why did i only read it now

smoky oak
#

thats a block

quaint mantle
#

OH MY GOD

#

LMAO

pliant oyster
#

when I do /heal it says internal server error but I said when the args is 0 it will do something else```
String playerName = String.valueOf(args[0]);
Player target = Bukkit.getPlayer(playerName);

    if(Bukkit.getPlayer(playerName) == null){
        sender.sendMessage(ChatColor.RED+"Player is not online.");
    } else if(Bukkit.getOnlinePlayers().contains(target)){
        target.setHealth(20);
        sender.sendMessage(ChatColor.YELLOW+target.getName()+ChatColor.AQUA+" has successfully been healed!");
    } else {
        sender.sendMessage(ChatColor.RED+"Player is not online.");
    }

    if(playerName.length() == 0){
        Player player = (Player) sender;
        player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(aDouble);
        sender.sendMessage("You have successfully been healed!");
        return true;
    }```
lost matrix
#

STRING

young knoll
#

Oh yeah tripwire is the block

#

TRIPWIRE_HOOK iirc

#

is the item

quaint mantle
#

LMAO

#

THATS ALL THAT WAS WRONG?

young knoll
#

mhm

smoky oak
young knoll
#

not an npe

#

ArrayIndexOutOfBounds

quaint mantle
#

Im so sorry lol

smoky oak
#

do args.length() == 0

quaint mantle
#

I didnt realize there was a difference

#

Thats kinda confusing

pliant oyster
quaint mantle
#

@lost matrix It gives it now

#

LMAO

#

Thank you guys so much

#

Sorry for the waste of time

tender shard
#

oh lol

young knoll
#

I feel like some kind of exception should be thrown there

quaint mantle
#

^^^

smoky oak
#

i cant say forsure

quaint mantle
#

Kinda dumb that no error was detected

#

For that

tender shard
#

yeah the actual tripwire is a string in the inv, not TRIPWIRE

#

lol

pliant oyster
smoky oak
quaint mantle
#

Whats sad is the fact that I completely missed that

smoky oak
young knoll
#

Maybe make ItemStack throw an IAE if the material is not isItem

#

Or maybe have addItem throw it instead

#

idk

pliant oyster
#

alr

young knoll
iron tundra
#

When I click on a villager, the trade gui doesn't show up as designed but I don't get the player name nor do I get the gui pop up on my screen. If you happen to know why I might not be getting the player information I would appreciate it!

    @EventHandler
    public void OpenGUi(TradeSelectEvent event) {
        Player plr = (Player) event.getWhoClicked();
        System.out.println(plr.getName());
        event.setCancelled(true);
        openNewGUI(plr);
    }
quaint mantle
#

Question: How do I make it so that the tripwire cant be placed?

#

Do I just make it so that CanBePlacedOn is none

smoky oak
#

theres a block place event iir

young knoll
#

Only works in adventure mode

#

Use the block place event

quaint mantle
#

Kay Kay

young knoll
#

Hmm

#

I do not know how what do do about this PR

quaint mantle
#

Also, how do I make so that if a player were to name an item the same, it still wouldnt work as that named item?

solid cedar
#

ping

quaint mantle
#

At this time thats a massive issue

#

And I dont know how to fix that

lost matrix
quaint mantle
#

Is there like a NBT tag system I can use

iron tundra
young knoll
#

Yes

#

?pdc

quaint mantle
#

Oh ty!

young knoll
#

so...

ornate patio
#

how do i set this text under the item

lost matrix
ornate patio
#

you can color lore?

vocal cloud
#

yup

young knoll
#

Yes

#

Any of the uhh

vocal cloud
#

And you can remove the italics

lost matrix
#

You can color any text

ornate patio
#

oh alright

#

thanks

young knoll
#

255^3 available colors

tender shard
ornate patio
young knoll
#

ChatColor.of

#

Takes hex colors

vocal cloud
young knoll
#

(Bungee chatcolor, not the bukkit one)

tender shard
#

it's more like piss

ornate patio
quaint mantle
#

so like this??

NamespacedKey key = new NamespacedKey(EmeraldsPlugin.jp,"crateKey");
iMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "basicCrate");
young knoll
#

I could add brewing to my plugin, since I plan to add grapes, that could be fun

tall dragon
#

which plugin?

young knoll
#

But making a reasonable drunk effect in mc is hard

quaint mantle
#

Ease of Access globally

kindred valley
young knoll
#

Feel free to judge the bad code

#

:p

tall dragon
lost matrix
tender shard
# kindred valley <@!632994436401594368>

something MUST happen when you run your comand

  1. you get an error
  2. it says comand not found
  3. you get a message printing out your comand's help or the command name
kindred valley
#

2

young knoll
tender shard
dire salmon
young knoll
tender shard
kindred valley
tender shard
#

and don't call your executor "healme"

dire salmon
#

lol

lost matrix
tender shard
#

callit HealMeCommand or similar

quaint mantle
#

Uhhhh...

#

How do I get a blocks metaData key?

kindred valley
tall dragon
quaint mantle
#

it apparently is required

#

For the thing im doing

smoky oak
young knoll
#

You probably could

young knoll
tall dragon
#

would probs be a little janky tho

#

and not smooth

tender shard
smoky oak
#

ur aware that this is a 'fix it' server and not a code design class

young knoll
#

Alcohol may make you a bit wibbly wobbly

#

But it does not make you get stuck to a wall

tender shard
tender shard
young knoll
#

Genius

dire salmon
#

stonks

tender shard
#

have you seen the video of david hasselhoff trying to eat a burger?

tall dragon
young knoll
#

No

#

Should I

tender shard
#

definitely

#

lol

#

he is so wasted

young knoll
#

There's a video of me trying to play a harmonica

quaint mantle
#

?

young knoll
#

It went well

dire salmon
#

lol

quaint mantle
#
block.getMetadata()
#

How do I get the key for accessing its MetaDataa?

tender shard
dire salmon
lost matrix
young knoll
#

Metadata and pdc are not the same

dire salmon
#

getData*

smoky oak
#

do items have PDC?

young knoll
#

Yes

smoky oak
#

wait

young knoll
#

Items, Entities, TileEntites, Chunks, and Worlds

smoky oak
#

how tf do chests store their items

young knoll
#

NBT

smoky oak
#

ah

young knoll
#

Chests are tile entities

tender shard
#

hm let's imagine I create a scheduled task in my discord bot - should I just do java while(true) sleep to keep the program alive?

smoky oak
#

blocks dont have any PDC which can be annoying at times

lost matrix
#

TileState blocks have PDCs

young knoll
#

Blocks themselves don't have PDC, but some weird German guy has a wrapper for that

dire salmon
#

how do i increase a value everytime the code is ran?

smoky oak
#

or value += n; if you want a number other than 1

young knoll
#

value -= -1;

smoky oak
#

NO

tall dragon
kindred valley
dire salmon
#

value *= (n=1)

quaint mantle
#

Figured it out

#
TileState state = (TileState) block.getState();
PersistentDataContainer cont = state.getPersistentDataContainer();
young knoll
#

value += queryVeryImportantNumberDatabase(1)

tender shard
#

Files.copy sucks

#

why can't I just use null for CopyOption...

tall dragon
#

++value - 1

kindred valley
lost matrix
#

x -= ++x - --x;

dire salmon
#

wasnt meant to be reply

young knoll
#

value+-+-+-+-+-+-+-+-+-+ 1

#

Shh, idc if it's not valid

dire salmon
#

value+1-1+1-1+1-1+1-1

lost matrix
#
        int next = x + 1;
        while (x != next) {
            x = ThreadLocalRandom.current().nextInt();
        }
dire salmon
#

that would be a random number, not value+1?

lost matrix
dire salmon
#

oo

kindred valley
#

?paste

undone axleBOT
tall dragon
kindred valley
lost matrix
quaint mantle
dire salmon
#

jeez

tall dragon
kindred valley
young knoll
#

No that's an imgur album

#

No embed plz discord

lost matrix
#

The random one is literally my favourite. I always crack up when i see it.

dire salmon
young knoll
#

I like the PI one

lost matrix
kindred valley
tall dragon
kindred valley
tall dragon
#

-?

kindred valley
#

no error

#

?paste

undone axleBOT
kindred valley
tall dragon
#

idk looks right to me

#

tho idk why u have the cmd check

tender shard
#

jda question: anyone know how to get a MessageChannel regardless of whether it's a news channel, text channel, or any other similar channel type?

    private MessageChannel getChannel() {
        TextChannel textChannel = jda.getTextChannelById(channelId);
        if(textChannel != null) return textChannel;
        NewsChannel newsChannel = jda.getNewsChannelById(channelId);
        if(newsChannel != null) return newsChannel;
        return null;
    }
tall dragon
#

unless you have multiple commands on the same executor

dire salmon
quaint mantle
#
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_18_R1.block.CraftBlockState cannot be cast to class org.bukkit.block.TileState (org.bukkit.craftbukkit.v1_18_R1.block.CraftBlockState and org.bukkit.block.TileState are in unnamed module of loader java.net.URLClassLoader @2e5d6d97)
#

help?

young knoll
#

What block is it

tall dragon
young knoll
#

^

quaint mantle
#

Its a Tripwire

young knoll
#

That is not a tile entity

dire salmon
# dire salmon doesnt seem to work tho
public void run(){
degree %= 360;
            Player player = Bukkit.getPlayer(playerID);
            if (player == null) {
                this.cancel();
                return;
            }
            double radians = Math.toRadians(degree);
            double x = Math.cos(radians) * radius;
            double y = Math.sin(radians * waves) * height;
            double z = Math.sin(radians) * radius;
            Location particleLoc = player.getLocation().add(x, y, z);
            player.getWorld().spawnParticle(Particle.END_ROD, particleLoc, 0);
            particleLoc.subtract(x, y, z);
            degree += 5;
}

should draw wave circle thing

young knoll
#

It's a normal block that cannot hold PDC

quaint mantle
#

How would I get a PersistantDataContainer from a block then?

tall dragon
#

tile entities are blocks like a furnace, dispenser

tender shard
quaint mantle
tender shard
dire salmon
tender shard
tender shard
tall dragon
tender shard
#

np

young knoll
#

Honestly alex needs to pay me every time I link his libs

#

smh

tall dragon
#

thanks for making that. really usefull

tender shard
#

then you can get 1% of those 1%

tender shard
#

lol

young knoll
#

Weird dream

tender shard
#

I dream about coding way too often

tall dragon
#

yea, you code in your dreams?

tender shard
tall dragon
#

if only said dreams could be interpreted.

#

insane productivity

young knoll
#

No no

#

They should be compiled, it's faster

iron tundra
#

How do I access the player that clicked on a merchant to trade? No matter what I do I can't get the player who clicked

young knoll
#

PlayerInteractEntityEvent

#

Has a player

iron tundra
#

Imma try that

tall dragon
#

whats even the dif between PlayerInteractAtEntityEvent & PlayerInteractEntityEvent

tender shard
#

you can get the InventoryView's viewer

#

IIRC only one person can have the trading window open

dire salmon
iron tundra
#

This took way too long to figure out smh, I have used PlayerInteravtEntityEvent before also

#

This is embarrassing

quaint mantle
#

@tender shard How do I install librarys

#

lol]

tender shard
quaint mantle
dire salmon
#

learnjava comming

tender shard
#

well then just add my repository and the dependency name to your build.gradle file

ancient jackal
#

?learnjava

tender shard
#

like you did with spigot-api

undone axleBOT
ancient jackal
#

but use maven

dire salmon
#

maven 🛐

ancient jackal
#

maven 💯

quaint mantle
#

So it was a fast setyp

#

:/

dire salmon
#

maven=log4j issue

tender shard
#

I don't know the gradle syntax but you basically have to check your build.gradle file, see how it added spigot, then do the same with my repository and the CustoBlockData dependency

#

I have no idea how it works in gradle

dire salmon
#

doesnt jitpack shows how to put it?

quaint mantle
#
plugins {
    id 'java'
}

group = 'me.emerald'
version = '1.0.0'

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

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
}

def targetJavaVersion = 17
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}
#

Yea idk how it does it

tender shard
quaint mantle
#

this is my build.gradle file

pliant oyster
#

when I do /heal without args it gives internal error but I made it so if the args isnt 0 it would do something else

        String playerName = String.valueOf(args[0]);
        if(playerName.length() != 0){
            Player target = Bukkit.getPlayer(args[0]);
            if(Bukkit.getPlayer(playerName) == null){
                sender.sendMessage(ChatColor.RED+"Player is not online.");
            } else if(Bukkit.getOnlinePlayers().contains(playerName)){
                target.setFoodLevel(20);
                target.setSaturation(20);
                sender.sendMessage(ChatColor.YELLOW+target.getName()+" has successfully been fed!");
            } else {
                sender.sendMessage(ChatColor.RED+"Player is not online.");
            }
        } else if(sender instanceof Player){
                Player player = (Player) sender;
                player.setFoodLevel(20);
                player.setSaturation(20);

                sender.sendMessage("You have successfully been fed!");
                return true;
        } else{
            sender.sendMessage("You can't heal the console!");
        }
tender shard
#
implementation 'com.jeff_media:CustomBlockData:1.0.5@jar'
tender shard
quaint mantle
#

or

#

in dependancys

tender shard
quaint mantle
#

ok so what about repositories

#

how do i insert that

tender shard
#

one sec

#
    maven {
        name = 'jeff-media-public'
        url = 'https://hub.jeff-media.com/nexus/repository/jeff-media-public/'
    }
quaint mantle
#

ohhh

#

ok ty

tender shard
tender shard
#

obviously you FIRST have to check if the length is > 0 BEFORE accessing anything from the array

quaint mantle
#

wait @tender shard so if i appied it to an item, like a holding item

#

how would I retrieve it from the placed block?

tender shard
tender shard
#

like in blockplace, get the data of the item and put it into the block

digital haven
#

Is this the extent nms is deobfuscated or did I import the wrong jar or smth?

pliant oyster
tender shard
digital haven
#

Yeah I'm not an expert in obfuscation I only know how to use java 👀

brave sparrow
#

Obfuscation is Java

digital haven
#

in fact I'm clueless in obfuscation lfmao

brave sparrow
#

Lmao

tender shard
brave sparrow
#

I link that to people all the time lol

tender shard
#

me too lol

#

about twice daily on this discord

brave sparrow
#

It was funny, someone asked how to do it so I googled it

tender shard
#

it's # 2 on gnoogle lol

brave sparrow
#

And then the other day I was like “oh that’s his”

pliant oyster
ancient jackal
#

alex is just clutch

tender shard
#

if you don't define it, it's not defined

#

how should java know what the playername is supposed to be?

digital haven
tender shard
#

those classes are still there

#

they just have different names

#

you will have to rename everything once, then you're set for future versions without major problems though

#

you can basically use the exact same code for all future versions

pliant oyster
brave sparrow
#

?learnjava

undone axleBOT
tender shard
#

if noone enters a playername, you have no playername

ancient jackal
digital haven
brave sparrow
minor blade
#

hello, i can't verify because discord change _

tender shard
dawn hazel
#

anyone know how to fix this?
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.woolmc.lifestealcore.LifeStealCore.getCommand(String)" is null

this.getCommand("heartset").setExecutor(new HeartSetCommand());```
the command thats causing issues
and heres the commands class
tender shard
dawn hazel
#

it is defined

digital haven
tender shard
#

you can just look through the packages to find your stuff

kindred valley
#

how to use event in another event

tender shard
#

most of the time, the mojang names are pretty obvious

dawn hazel
digital haven
#

Alrighty, thanks!

tender shard
#

if you're looking for a specific class, let me know, maybe I remember it

dawn hazel
kindred valley
# dawn hazel what do you mean?

i have PlayerDeathEvent, i want to block the jumping when player dies. I need to use move event but i cant use it in another event

dawn hazel
#

why do you want to block jumping when the player dies?

lost matrix
brave sparrow
#

You can’t reference the PlayerDeathEvent from later movement

tender shard
#

well one could just store every player's last death event, but what do you even mean with "the jumping when player dies"?

brave sparrow
#

They have this custom setup going on where players don’t actually die

tender shard
#

oooh

brave sparrow
#

They just lose their ability to move

#

And other players can come heal them

dawn hazel
#

you could cancel the death event and store a variable in a map then when the player tries to move but they are marked as dead then cancel the movement

brave sparrow
#

Well you can’t cancel the death event

#

But they set their health back to 0.5

dawn hazel
#

oh right

brave sparrow
#

They need to store the player or flag the player somehow though yes

#

I don’t think they’re quite experienced enough with Java to figure out how though

#

Which is going to continue to be a problem

dawn hazel
#

i wouldnt recommend using hashmaps for a lot of stuff

#

but you might be able to get away with it here

brave sparrow
#

I would use a set

#

There’s no value so no reason to use a map

tender shard
#

well... Player<>Event

#

or UUID<>Event

#

or are we talking about something else meanwhile?

kindred valley
brave sparrow
tender shard
brave sparrow
#

They just wanted to be able to get the player from the event in their next event

#

Which is an xy problem

brave sparrow
tender shard
#

weird fact: ArrayList.contains is faster than HashSet.contains

#

I always thought a set would be faster

young knoll
#

wut

ivory sleet
#

uh

#

in the beginning ArrayList is faster probably but it scales worse

tender shard
#

wait now I just also read that Set.contains is faster

#

which is what I also always said

#

someone sent a link some weeks ago that said the opposite

lost matrix
dire salmon
#

in runTaskTimer(), the longs are ticks right?

lost matrix
#

But in most cases ArrayLists are a tiny bit faster at the beginning

tender shard
dawn hazel
young knoll
#

Fox maximum speed just have hashCode always return 1

tender shard
lost matrix
dawn hazel
tender shard
#

show the full file

young knoll
#

That doesn't looked indented right

tender shard
#

exactly

dire salmon
#

yea

tender shard
#

it must be

commands:
  heartset:
kindred valley
dawn hazel
lost matrix
#

Actually. I want to jmh ArrayList<UUID>/ArrayList<String> vs HashSet<UUID>/HashSet<String> now and see when they diverge

brave sparrow
#

?learnjava @kindred valley

undone axleBOT
tender shard
undone axleBOT
tender shard
#

a Player is not a HashSet

brave sparrow
#

Lol

young knoll
#

Lifesteal plugin

#

hehe

young knoll
digital haven
tender shard
#

because md5 wasn't durnk when he made the API

lost matrix
dawn hazel
digital haven
dawn hazel
#

all the other commands work

quaint mantle
#

How do I get the item that was used to place a block ,in BlockPlaceEvent

tender shard
#

getItemInHand()

quaint mantle
#

ty

young knoll
#

public class CraftPlayer extends HashSet

#

🧠

brave sparrow
#

😂

ivory sleet
brave sparrow
#

ArrayList#contains is O(n), HashSet#contains is amortized O(1)

#

But for a small enough n that amortized O(1) may still be slower

young knoll
#

So technically

ivory sleet
#

yeah, time complexity does not denote actual time it takes so ye

young knoll
#

Small collections where you are doing .contains

#

May be better as an arraylist

brave sparrow
#

That’s why for example when sorting large amounts of data with a radix sort the smallest divisions of the data should be sorted with insertion sort because for small amounts of data it’s faster

ivory sleet
#

but yeah setting the initial capacity of HashMap might change the time it takes for a small group of elements

brave sparrow
young knoll
#

Man now I gotta redo my material sets :p

#

I mean it probably doesn’t matter, but still

ivory sleet
#

EnumSets are incredibly fast

#

doubt you need to

young knoll
#

Yes

#

But

#

MD said you should avoid them

#

But also said they shouldn’t break after the change

#

So idk

brave sparrow
#

Is he planning to make Materials not an enum?

tender shard
#

yes

young knoll
#

Yes

brave sparrow
#

Ew

ivory sleet
#

been a plan for long time

young knoll
#

But still binary compatible

#

Because spigoot

quaint mantle
#

why is PlayerChatEvent deprecated?

ivory sleet
#

AsyncPlayerChatEvent

young knoll
#

AsyncPlayerChatEvebt

tender shard
#

lol

brave sparrow
#

Rip

tender shard
#

check the docs

quaint mantle
#

k

#

Does it work the same or

young knoll
#

Kinda

#

It’s async

#

So be careful with Bukkit API

tender shard
ivory sleet
#

hehe can still run sync

tender shard
#

it's literally a huge banner in the docs

young knoll
#

You can run sync

sacred mountain
#

hashmap? i cant store per player variables

young knoll
#

I really want the enums of keyed things to die

#

But I understand it takes time

tender shard
#

wow SnakeYaml is really picky

brave sparrow
young knoll
#

They are becoming extendable?

#

Biome already is

#

Enums are not designed for that

#

In fact you can’t get the namespaced key of a custom biome without NMS

#

Very sad

dire salmon
#

please no ?learnjava
cant longs be decimal?

#

like 3.5L

young knoll
#

No

ivory sleet
#

I mean the best part is that the change reflects mojangs code more accurately

dire salmon
#

so i cant do runTaskTimer(this, 3L, 3.5L)

#

is there another way to have 3.5 ticks cd?

young knoll
#

No

#

Well, kinda

#

But it won’t matter, minecraft runs on ticks

dire salmon
#

?learnjava

undone axleBOT
young knoll
#

Just like

#

Uhh

#

NFTs

ivory sleet
#

lol ye

brave sparrow
young knoll
#

Yes

#

Since 1.16.2

brave sparrow
#

It seems unlikely that materials will go the same route though no?

young knoll
#

They will one day

#

It’s clear that’s the direction Mojang is heading

dire salmon
#

is making custom world generation hard?

#

im not going to make it, just wanted to know

young knoll
#

If you are good at math, maybe not

#

But noise stuff hurts my brain a bit

brave sparrow
chrome beacon
#

Making world generation isn't super hard.
Making good world gen on the other hand...

dire salmon
#

then rip
barely make 1+1 :p

young knoll
#

Because they are designed for that?

brave sparrow
#

Well I guess I’ll watch the 1.19 PRs to see if there’s any custom materials lol

young knoll
#

Easier, yes

brave sparrow
#

More efficient, no

#

Lol

young knoll
#

^

dawn hazel
#

it is not more efficient

brave sparrow
#

It’s not even comparably efficient

young knoll
#

Databases are good at storing large amounts of data in compact form

tender shard
#

does anyone know spiget's rate limits? I haven't found anything on their website

dawn hazel
#

plus if something happened and the server got deleted or corrupted

young knoll
#

And support fancy queries

dawn hazel
#

all data would be lost

#

including the json file

young knoll
#

I mean

#

The can happen with a database too

dawn hazel
#

yeah

#

also its a lot more convenient once you get the hang of it

dire salmon
#

is there a way to make a runnable run for x ticks then wait another ticks to run again?

#

except for runTaskTimer, isnt too cool for what im doing rn

young knoll
#

You can have a counter and just skip execution based on its value

#

Meh

#

Price?

dawn hazel
#

bruh

young knoll
#

Maintenance?

dawn hazel
#

you can get databases for free

#

most server hosts include atleast 3 for free

young knoll
#

Plus there is yknow

#

SQLite and h2

dawn hazel
#

my guy you literally used price

brave sparrow
#

I just don’t think you understand the scale of data we use databases for

#

JSON files would not work

young knoll
#

Yeah if you have a tiny amount of data

#

Json is probably fine

dawn hazel
#

json is highly impractical for large data amounts

young knoll
#

But no one wants to store all of hypixels data in json

#

Even though they kinda sorta do that

ivory sleet
#

hehe parties

dawn hazel
#

this. might not seem like a lot but all this data can add up after a while. you dont want all that on one json file plus its going to take forever just to search and load that file

young knoll
#

I mean

#

You can do one file per user

#

Or just shove it in pdc

dawn hazel
#

true

tender shard
#

why the heck does IntelliJ's console show INFO log entries in red? o0 that's... confusing at best

dawn hazel
#

my other admin strongly advised i dont use json for data reasons

young knoll
#

Because InteliJ sucks

dire salmon
dawn hazel
#

my guess is that intellij is interpreting the text being sent to console as red

young knoll
#

Lol IntelliJ is fine

#

But making fun of IDEs is a law here

dawn hazel
#

yall use ides?

young knoll
#

No

#

I use Microsoft word

hexed hatch
#

I use lotus notes

dire salmon
#

i use paper, fear me

dawn hazel
#

i use notepad

young knoll
#

I use a really small tool to flip the switches on a hard drive manually

dire salmon
hexed hatch
#

I use parchment and inked feather

fair rock
#

Anyone know how to overwrite vanilla structures?

young knoll
young knoll
#

Well, for some

#

For others you’d have to basically replace the world generator

#

Actually in 1.18.2 you could just disable them and add your own with the new datapack features

dire salmon
young knoll
#

Oh god

#

That’s the best staircase I’ve ever seen

wet breach
dire salmon
fair rock
wet breach
#

you can physically inspect a rom for their data

dawn hazel
#

thats a giant staircase

wet breach
#

by looking at the bits that are set 🙂

young knoll
opal juniper
hexed hatch
young knoll
#

That code belongs in a museum

fair rock
young knoll
#

Structures

dire salmon
hexed hatch
#

It’s literally the Tower of Babel in Java

#

God will strike it down

young knoll
#

You can do semi custom trees with datapacks

#

But you don’t have full freedom

#

Take a took at terralith and incendium

dire salmon
young knoll
#

They do some great stuff with just datapacks

fair rock
#

Thanks :)!

dire salmon
#

is there a way or no?

young knoll
#

Yes

tender shard
#

hm anyone knows how I can attach a custom formatter to java.util.logging.Logger?

quaint mantle
#

How do i detect if I right click an object?

young knoll
#

It’s called math and loops

tender shard
dire salmon
#

i mean

hexed hatch
#

What

dire salmon
#

idk if there is one

hexed hatch
#

No that is not an event

tender shard
#

PlayerInteractEvent

hexed hatch
#

PlayerInteractEvent

dire salmon
#

i have been making slimefun addons for too long

hexed hatch
#

Fuck you Alex

tender shard
hexed hatch
#

No die

dire salmon
young knoll
#

Oh god slimefun

hexed hatch
#

That explains a lot

#

lol

dire salmon
#

wha

young knoll
#

I mean slimefun is cool

#

But I’ve heard the code is bad

hexed hatch
#

Coll did you ever see that video of that nested runnable in SlimeFun?

young knoll
#

No

dire salmon
#

only cargo's code that used to took 40% of tick

hexed hatch
#

It was basically exactly what you just saw

#

But more

young knoll
#

Imma make the new slimefun

#

MagmaCubeFun

dire salmon
#

funny slime

young knoll
#

md_5fun

dire salmon
#

duke funk

hexed hatch
#

I can’t find it

young knoll
#

I mean I would actually love to work on a project like that

#

But oh god would it be a big project

dire salmon
young knoll
#

Use a runnable

#

And split the loop up using that

dire salmon
#

wat?

young knoll
#

?scheduling

undone axleBOT
dire salmon
#

no learnjava

young knoll
#

Essentially using a repeating task as a delayed for loop

hexed hatch
#

?learnjava

undone axleBOT
young knoll
#

Heh

dire salmon
hexed hatch
#

ok

#

so put

#

the

#

runnable

#

inside

dire salmon
dire salmon
#

i put the loop inside the runnable :thonk:

quaint mantle
#

What event can I use to detect a click?

#

On per say,a grass block

hexed hatch
#

PlayerInteractEvent

quaint mantle
hexed hatch
#

Even on a grass block

quaint mantle
#

Pogger

dire salmon
#

even on probably anything

young knoll
#

Well

#

Any block

hexed hatch
#

even on your mom

#

and if you have an item in your hand

young knoll
#

There is another event for entities

dire salmon
#

ye

young knoll
#

Nah right clicking a block with no item can be detected

hexed hatch
#

entities like your mother

buoyant viper
young knoll
#

Just not air

quaint mantle
#

So this would work?

#
event.getAction().equals(Action.RIGHT_CLICK_BLOCK)
#

For a detection?

young knoll
#

Because the client doesn’t send a packet for right clicking air with no item

#

Which is fair, I mean why would it

quaint mantle
#

The only use for that

#

is breathing

hexed hatch
#

so I can shoot lasers on right click

#

without holding anything

#

mojang fix

dire salmon
#

on enable

for(int counter=0; counter<360; counter++) {
            if (counter <= 100) {
                new CustomArmorTask().runTaskTimer(this, 2L, 1L);
            }else{
                continue;
            }
        }
#

armor thing is the stair

#

mhm yea nvm that just crashed the server

lost matrix
#

@ivory sleet Was curious. So those are the results for up to 250 elements. Which is not surprising.

#

But even if the collections had <5 elements the hashset outperformed the arraylist

young knoll
#

Did you use like

#

That library for benchmarking

lost matrix
#

Yes jmh

young knoll
#

Interesting

lost matrix
#

I should add: For UUIDs

young knoll
#

Hmm

#

I’d be curious to see for a more complex object

visual tide
#

CraftServer 🙂

young knoll
#

Lol

#

I love my hashset of CraftServers

dire salmon
ivory sleet
#

Did you set initial capacity for both?

lost matrix
brave sparrow
#

Actually

#

It could

#

Lol

lost matrix
#

Hm?

brave sparrow
#

The number of buckets controls the number of LinkedLists with hash collisions

#

So if you had a really fast hashCode method and the right capacity to minimize collisions, you’d have a very fast contains

lost matrix
#

I see... But when this gets relevant the arraylist is long over the moon

young knoll
#

Store all your stuff as one big string

#

And use string.contains

lost matrix
#

Actually. I would like to see how the length of a String affects the performance of contains

#

brb

young knoll
#

See, another great idea from me

tall dragon
#

Genius..

lost matrix
#

Any predictions?

tall dragon
#

I predict its indeed gonna affect performance

ivory sleet
#

Myeah pretty much

main dew
lost matrix
#
Benchmark                           (elementCount)  (stringLength)  Mode  Cnt   Score   Error  Units
StringContains.arrayListContainsHit               10               1  avgt    4  15,469 ± 0,648  ns/op
StringContains.arrayListContainsHit               10               2  avgt    4  15,473 ± 0,750  ns/op
StringContains.arrayListContainsHit               10               3  avgt    4  17,110 ± 3,105  ns/op
StringContains.arrayListContainsHit               10               4  avgt    4  16,662 ± 1,236  ns/op
StringContains.arrayListContainsHit               10               5  avgt    4  16,893 ± 0,373  ns/op
StringContains.arrayListContainsHit               10              10  avgt    4  16,509 ± 1,320  ns/op
StringContains.arrayListContainsHit               10              20  avgt    4  16,581 ± 1,523  ns/op
StringContains.arrayListContainsHit               10              30  avgt    4  16,257 ± 0,449  ns/op
StringContains.arrayListContainsHit               10              40  avgt    4  16,632 ± 0,066  ns/op
StringContains.arrayListContainsHit               10              50  avgt    4  16,668 ± 0,384  ns/op
StringContains.arrayListContainsMiss              10               1  avgt    4  30,813 ± 0,451  ns/op
StringContains.arrayListContainsMiss              10               2  avgt    4  30,712 ± 0,761  ns/op
StringContains.arrayListContainsMiss              10               3  avgt    4  38,276 ± 0,282  ns/op
StringContains.arrayListContainsMiss              10               4  avgt    4  31,320 ± 0,650  ns/op
StringContains.arrayListContainsMiss              10               5  avgt    4  31,575 ± 0,302  ns/op
StringContains.arrayListContainsMiss              10              10  avgt    4  31,524 ± 0,513  ns/op
StringContains.arrayListContainsMiss              10              20  avgt    4  31,652 ± 0,526  ns/op
StringContains.arrayListContainsMiss              10              30  avgt    4  30,462 ± 0,123  ns/op
StringContains.arrayListContainsMiss              10              40  avgt    4  33,719 ± 0,426  ns/op
StringContains.arrayListContainsMiss              10              50  avgt    4  33,437 ± 0,614  ns/op

Not as big of a difference as i thought.

#
Benchmark                           (elementCount)  (stringLength)  Mode  Cnt   Score   Error  Units
StringContains.hashSetContainsHit                 10               1  avgt    4   1,997 ± 0,008  ns/op
StringContains.hashSetContainsHit                 10               2  avgt    4   2,845 ± 0,005  ns/op
StringContains.hashSetContainsHit                 10               3  avgt    4   3,522 ± 0,107  ns/op
StringContains.hashSetContainsHit                 10               4  avgt    4   2,022 ± 0,034  ns/op
StringContains.hashSetContainsHit                 10               5  avgt    4   2,873 ± 0,158  ns/op
StringContains.hashSetContainsHit                 10              10  avgt    4   2,874 ± 0,203  ns/op
StringContains.hashSetContainsHit                 10              20  avgt    4   3,557 ± 0,070  ns/op
StringContains.hashSetContainsHit                 10              30  avgt    4   2,854 ± 0,067  ns/op
StringContains.hashSetContainsHit                 10              40  avgt    4   2,845 ± 0,006  ns/op
StringContains.hashSetContainsHit                 10              50  avgt    4   3,502 ± 0,006  ns/op
StringContains.hashSetContainsMiss                10               1  avgt    4   2,188 ± 0,003  ns/op
StringContains.hashSetContainsMiss                10               2  avgt    4   2,189 ± 0,007  ns/op
StringContains.hashSetContainsMiss                10               3  avgt    4   2,188 ± 0,009  ns/op
StringContains.hashSetContainsMiss                10               4  avgt    4   2,407 ± 0,005  ns/op
StringContains.hashSetContainsMiss                10               5  avgt    4   2,406 ± 0,005  ns/op
StringContains.hashSetContainsMiss                10              10  avgt    4   2,188 ± 0,005  ns/op
StringContains.hashSetContainsMiss                10              20  avgt    4   1,970 ± 0,002  ns/op
StringContains.hashSetContainsMiss                10              30  avgt    4   3,064 ± 0,002  ns/op
StringContains.hashSetContainsMiss                10              40  avgt    4   1,612 ± 0,007  ns/op
StringContains.hashSetContainsMiss                10              50  avgt    4   2,188 ± 0,005  ns/op

And hashsets are more or less constant too

#

Although there is a weird dip at 40...

#

Maybe i should regen the Strings per invocation

lost matrix
sterile token
#

avgt?

lost matrix
#

Mode.AverageTime

sterile token
#

doesnt make sense

lost matrix
sterile token
#

No thanks

#

I already understand

sage dragon
#

Is the dragon immune against velocity?

#
Vector direction = passenger.getLocation().getDirection();
dragon.setVelocity(direction.multiply(1.5));

Because the dragon just stays put...

young knoll
#

Dragons are magic

#

And have complex AI controlled by a DragonFight object

#

Iirc

sage dragon
#

Ooof 😅

young knoll
#

Afaik without one they just sit there

#

And then eventually pathfind towards 0,0

tall dragon
sage dragon
hexed hatch
#

That's unfortunate to hear, I've been thinking of writing a plugin that completely reconstructs the dragon fight

#

sounds like I'll have to dig deeper into nms than I really wanted to

young knoll
#

There is some API for it

hexed hatch
#

Probably not near enough coverage for what I want to do

#

does the ender dragon even follow traditional pathfinding?

#

like, do they have pathfinder goals

past vapor
#

Any way to tell if a player has a GUI open

#

Any GUI

#

inventory, anything

young knoll
#

getOpenInventory

past vapor
#

I cant compare that to null

young knoll
#

It’s never null afaik

#

I think it returns the player inventory if they have nothing open

past vapor
#

Ill try that

#

cheers

past vapor
#

Perfect thanks

sage dragon
tender shard
young knoll
#

That’s not trivia

#

But it seems like a decent concept

dawn hazel
#

and yes i have been trying for a long time to get it to work

buoyant viper
#

send your plugin.yml

#

maybe theres some wrong formatting

#

?paste

undone axleBOT
young knoll
#

I believe they have and it looks fine

buoyant viper
#

o

dawn hazel
#

already sent this

young knoll
#

Look at the one inside your jar, make sure it’s the right one

tender shard
undone axleBOT
tender shard
#

erm wait no

#

I meant

#

upload your .jar somewhere

#

or DM it to me

buoyant viper
dawn hazel
#

just a side note this is kind of a confidential plugin

young knoll
#

It’s a lifesteal plugin

#

No offence but you aren’t breaking new ground

tender shard
#

then open your .jar with winrar, and check if the included plugin.yml actually is the one you sent a screenshot of

young knoll
#

Winrar? Ew

#

:p

buoyant viper
#

7zip supremacy

dawn hazel
#

i just would rather it doesnt get leaked cause someone finding an exploit with leaked source code scares me

tender shard
buoyant viper
#

just make sure there are no exploits 😎

dawn hazel
dawn hazel
# tender shard what line does the error message show
[22:19:04 INFO]: [LifeStealCore] Registering Commands
[22:19:04 ERROR]: Error occurred while enabling LifeStealCore v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.woolmc.lifestealcore.LifeStealCore.getCommand(String)" is null
        at com.woolmc.lifestealcore.LifeStealCore.onEnable(LifeStealCore.java:35) ~[LifeStealCore-1.0.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:501) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:562) ~[purpur-1.18.1.jar:git-Purpur-1564]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:476) ~[purpur-1.18.1.jar:git-Purpur-1564]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:741) ~[purpur-1.18.1.jar:git-Purpur-1564]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:508) ~[purpur-1.18.1.jar:git-Purpur-1564]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:349) ~[purpur-1.18.1.jar:git-Purpur-1564]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1227) ~[purpur-1.18.1.jar:git-Purpur-1564]
        at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:322) ~[purpur-1.18.1.jar:git-Purpur-1564]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[22:19:04 INFO]: [LifeStealCore] Disabling LifeStealCore v1.0```
#

wait did you mean the stacktrace or no

river oracle
#

LifeStealCore.java:35

dawn hazel
#

thats this line

        this.getCommand("heartset").setExecutor(new HeartSetCommand());```
buoyant viper
#

purpur moment make sure the plugin.yml from the jar in the server matches the one in ur development env

vocal cloud
#

That error indicates the config is busted inn some capacity

young knoll
#

This is why you go open source

tender shard
young knoll
#

Make other people fix your exploits

tender shard
#

at least in the .jar you sent to me

dawn hazel
#

in my editor it shows that its heartset

young knoll
#

Hmm

#

Sounds sus

tender shard
dawn hazel
#

and if i remove the heartset executor it starts fine

vocal cloud
young knoll
#

Exactly

#

That’s how spigot survives

dawn hazel
young knoll
#

Hehe

buoyant viper
#

cant go off of decompiled output for STs tbh

young knoll
#

True

dawn hazel
#
public class HeartSetCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(args.length == 0)) {
            try {
                OfflinePlayer oPlayer = Bukkit.getOfflinePlayer(args[0]);
                try {
                    int hearts = Integer.parseInt(args[1]);
                    if (hearts >= LifeStealCore.config.getInt("values.maxheartcount")) {
                        sender.sendMessage("§aSet " + oPlayer + "'s heartcount to " + hearts);
                        LifeStealCore.data.setHearts(oPlayer.getUniqueId(), hearts * 2);
                    } else {
                        sender.sendMessage("§cOver max heartcount");
                    }
                } catch (NumberFormatException e) {
                    sender.sendMessage("§cMust be a number");
                }
            } catch (NullPointerException e) {
                sender.sendMessage("§cMust be a player");
            }
        }
        return true;
    }
}```
#

heres the code for the command itself

buoyant viper
#

has nothing to do with the command class methinks

dawn hazel
#

hmm

buoyant viper
#

just double check your plugin.yml in the exported jar

vocal cloud
#

It's 100% a config issue. Do that ^

#

Also when in doubt rewrite it out

dawn hazel
#

and that is set correctly

buoyant viper
#

the plugin.yml file

dawn hazel
#

i know

#

im checking it

vocal cloud
#

plugin.yml is the config in question. If every other command works except this one rewrite the portion of the config for it just in case. Then compile check the compiled jar

dawn hazel
#

and thats set in the decompiled jar

#

hmm

#

ok

buoyant viper
#

hmm

vocal cloud
#

hidden character 🕵️

young knoll
#

Where’s my zero width space

#

#

There it is

vocal cloud
#

Dammit

young knoll
#

It makes the messages look very weird

dawn hazel
#

when it actually is working now

#

that was really odd

vocal cloud
#

What fixed it

dawn hazel
#

after i rewrote the command in plugin.yml

#

that seemed to pretty much fix it

buoyant viper
#

poggers

vocal cloud
#

When in doubt rewrite it out. 50% of the time works every time

tender shard
#

the plugin.yml is correct

young knoll
#

Have you tried turning it off and on again

digital haven
#

Does anyone know what units minecraft uses for potion effect duration?

young knoll
#

Ticks

tender shard
digital haven
#

i thought it would be miliseconds for some reason lmfao

tender shard
#

@dawn hazel

#

the .jar you sent to me works fine

dawn hazel
#

that is odd

buoyant viper
#

now he has access to all ur personal files 😎

tender shard
dawn hazel
buoyant viper
#

meant the other way around

dawn hazel
#

all that there is in that plugin is just about 500 lines of mistakes

young knoll
#

Ah

#

Just like my life

dawn hazel
#

lmfao

#

same

#

i just dropped a powdered donut on my desk and now theres sugar powder everywhere

quaint mantle
#

it seems quite basic idk

dawn hazel
#

i just overcomplicated the hell out of it

tender shard
dawn hazel
#

with databases and unnecessary stuff

buoyant viper
#

im guessing its i hit u i take ur hearts

quaint mantle
#

if you kill a person you gain one

#

litterally all it is basically

buoyant viper
#

oh like mario kart balloon battle

vocal cloud
#

Ah the smp stuff

quaint mantle
#

mhm

young knoll
#

Yeah it’s a new fad

vocal cloud
#

Kms

dawn hazel
#

when u actually get to coding this

#

oh boy was that a bumpy ride

young knoll
#

Look out for my premium AsyncAdvancedLifesteal

#

You don’t even need paper API

quaint mantle
#

storing hearts, making sure it doesnt bug out

#

detections

#

etc

dawn hazel
#

yeah

vocal cloud
quaint mantle
#

it gets a bit crazy

dawn hazel
#

for whatever reason minecraft hearts are very wonky

quaint mantle
#

not as bad as minecraft bedrock

#

it took me 2 weeks to make a working apple bush

young knoll
#

You don’t really even need to store anything

dawn hazel
#

i ran into issue after issue cause of how weirdly broken mcjava hearts are

young knoll
#

Minecraft remembers what attributes a player has

dawn hazel
young knoll
#

Meh

dawn hazel
#

plus i want to have stats on the website so i kinda needed a database

young knoll
#

I guess

dawn hazel
#

when u use the incorrect exception type

#

lmfao

quaint mantle
#

did the website cost you money or

unreal quartz
#

Magic

quaint mantle
#

just wondering as id like to make my own database for my own plugin at 1 point

dawn hazel