#help-development

1 messages · Page 584 of 1

fluid river
#

old and irrelevant

#

so plugin:channelName

ruby mesa
#

thanks though

quaint mantle
#
public class TestZombie extends Zombie {
    public TestZombie(Location loc) {
        super(EntityType.ZOMBIE, ((CraftWorld) loc.getWorld()).getHandle());

        this.teleportTo(loc.getX(), loc.getY(), loc.getZ());

        this.setCanPickUpLoot(false);
        this.setAggressive(true);
        this.setCustomNameVisible(true);
    }
}

How do i make this thing spawn with armor on?

vast ledge
quaint mantle
#

is s your own function?

ocean hollow
vast ledge
#

Its in spigotapi

quaint mantle
#

im using mojang remappings ill try find it ig

vast ledge
#

you are using spigot tho..

quaint mantle
#

well yea but the s function doesnt exist

vast ledge
#

what ver u on?

quaint mantle
#

1.20.1

vast ledge
#

what does ur

this.xx
``` return?
#

or what is "this"

quaint mantle
vast ledge
#

doent actual do this.xx

#

what is "this"

#

is it a zombie

#

an entity

#

a plugin

quaint mantle
#

im guessing zombie

fluid river
#

TestZombie ig

quaint mantle
#

this = TestZombie

vast ledge
#

What is test zombie`?

#

oh

fluid river
vast ledge
#

yea

#

i c

fluid river
#

you need an expression evaluator?

ocean hollow
#

yeah

fluid river
#

write own evaluator 😉

ocean hollow
#

I did that, but it gave me error

fluid river
#

ask @tardy delta

vast ledge
fluid river
quaint mantle
vast ledge
#

It does tho

#

what did you break

quaint mantle
#

bro get a snipping tool

cloud tusk
#

can i get some help rq, i made a plugin to add a custom recipe "bonemeal on a stick" and i want to be able to apply bonemeal to a sapling that i right click with, i searched alot but i couldnt find any plugins that are new or any help threads that are new to learn from their source and answers. i was able to make crops like potatoes wheat etc grow but that one didnt require the use of bonemeal, the method i used on crops didnt work on trees but i hope the method im thinking of for trees also works on crops which is just simulation of the bonemeal event but i still dont know how. if any of u know please point me in the right direction and/or link me anything that helps wether its docs or open source code etc...

quaint mantle
#

Does the array need to be sorted to do a bubble sort?

tender shard
cloud tusk
#

ty, ill check it out and see

tender shard
quaint mantle
#

Using the Big O notations you know? Trying to sort an array using a bubble sort implementation

tender shard
#

if the array would already be sorted, then why would you need bubble sort?

fluid river
#

yeah

quiet ice
#

Am I missing some context here?

fluid river
#

why do you even need bubble sort

fluid river
quiet ice
#

But yeah, bubble sort is the wrong sort in every case except homework

tender shard
fluid river
#

does an array need to be sorted to sort it again

quaint mantle
#

yo @tender shard u are smart, how do i make custom NMS entities spawn with armor

quiet ice
fluid river
#

?remap

river oracle
fluid river
#

fuck how is that

#

thanks

eternal oxide
#

use world.spawn which accepts a consumer

quiet ice
#

But NMS?

quaint mantle
#

is this the right function?

eternal oxide
#

why nms at all?

quaint mantle
#

idk

#

how else

eternal oxide
#

world.spawn(entityType, e -> { })

#

or whatever teh method is

#

thats close

tender shard
quaint mantle
#

thanks

tender shard
#

np

eternal oxide
#

unless you are doing your own AI why are you creating yoru own Zombie?

tender shard
#

you didnt find that method in the mappings because you only looked at the zombie class, but setItemSlot is declared in the Mob class, since it applies to all mobs

quaint mantle
#

if i wanna add bosses or sm shit

quaint mantle
#

what the hell is a ichatbasecomponent

#

and how do i create one out of a string

tender shard
#

here's a method to sort an already sorted array:

    public static void sortAlreadySortedArray(Object alreadySortedArray) {
        if(!alreadySortedArray.getClass().isArray()) {
            throw new IllegalArgumentException("Not an array");
        } else {
            // Do nothing - array is already sorted.
        }
    }
quaint mantle
#

thanks!

flint coyote
spare hazel
#

is the default world name always gonna be "world?"

flint coyote
#

If you don't change it

spare hazel
#

alr

tender shard
spare hazel
#

is running a server on my own pc risky?

fluid river
#

you can change it in properties

fluid river
fluid river
#

i mean for testing no

flint coyote
#

no

fluid river
#

for hosting a network bruh

tender shard
#

the default world's name is Bukkit.getWorlds().get(0).getName()

fluid river
flint coyote
quaint mantle
#

Why

fluid river
#

and the default world itself is
Bukkit.getWorlds().get(0)

quaint mantle
fluid river
#

bruh having [1, 2, 3] and sorting it

quaint mantle
#

Maybe I wanna sort it after to 3,2,1

eternal oxide
#

what kind of sort do you want to do?

quaint mantle
#

Bubble

tender shard
#

if you're overly cautious you can definitely, always, get the correct default world name with NMS

((CraftServer) Bukkit.getServer()).getServer().getProperties().levelName;
fluid river
eternal oxide
#

Collections.sort(Comparator)

quaint mantle
#

Thats not bubble sir

fluid river
quaint mantle
#

I guess I could

eternal oxide
#

a bubble sort is pointless

fluid river
#

yeah

#

starting with this

fluid river
#

why are you sorting an array 2 times

#

if you can sort it once

#

you can just quick sort + reverse

#

or just quick sort

quaint mantle
#

How would I unsort the array since it's already been sorted due to a binary search?

eternal oxide
#

shuffle

tender shard
quaint mantle
eternal oxide
#

Collections.shuffle

quaint mantle
#

Any other way?

eternal oxide
#

hundreds

quaint mantle
tender shard
round finch
#

<T> void that is a new one for me 😯

tender shard
#

what's CustomEntity line 25

tender shard
round finch
#

i havn't seen it before

quaint mantle
# tender shard what's CustomEntity line 25
public abstract class CustomEntity extends Entity {
    final Location location;
    public CustomEntity(Location loc, EntityType entityType, String displayName) {
        super(entityType, ((CraftWorld) loc.getWorld()).getHandle());
        location = loc;

        this.teleportTo(loc.getX(), loc.getY(), loc.getZ());

        this.setCustomNameVisible(true);
        this.setCustomName(Component.literal(ColorUtils.translateStringWithColor(displayName)));
    }

    public final void spawn() {
        ServerLevel nmsWorld = ((CraftWorld)location.getWorld()).getHandle();
        nmsWorld.addFreshEntity(this);
    }
}
#

TestZombie extends that

round finch
quaint mantle
quaint mantle
#

Yes

tender shard
quaint mantle
quaint mantle
karmic phoenix
#

?paste

undone axleBOT
quaint mantle
#

If you don't register the entity, your client will crash once spawning the entity

karmic phoenix
quaint mantle
#

As it does not "exist"

tender shard
#

also you must extend an existing Entity class

quaint mantle
round finch
quaint mantle
# tender shard how do you create your custom entity? Why does your CustomEntity take an EntityT...

this is the testzombie class i created, the entity type is so i can make child classes with different entity types

public class TestZombie extends CustomEntity {
    public TestZombie(Location loc) {
        super(loc, EntityType.ZOMBIE, "%%COLOR_GREEN%%Zombie");

        setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(new QuacHelmet().getItem()));
    }

    @Override
    protected void defineSynchedData() {

    }

    @Override
    protected void readAdditionalSaveData(CompoundTag compoundTag) {

    }

    @Override
    protected void addAdditionalSaveData(CompoundTag compoundTag) {

    }
}
echo basalt
#

you should extend zombie

#

otherwise craftbukkit will shit the bed

#

pass -1

karmic phoenix
#

The plugin is having a stroke, a little help?

ERROR
https://paste.md-5.net/torinudicu.css

CODE

public class PointsCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player p = (Player) sender;
            String replaced = PlaceholderAPI.setPlaceholders(p, "%playerpoints_points%");
            p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aYou have &f" + replaced + " &apoints!"));
        } else {
            sender.sendMessage(ChatColor.RED + "You must be in-game to use this command.");
        }

        return false;
    }
}
tender shard
flint coyote
#

Shouldn't that copy the file with contents into the plugin folder? All I get is an empty file. When I do change the path however I get an exception that it can't find the file so the path seems to be correct. And the file definitly has content. I even checked inside the jar

plugin.saveResource(filename, false);
quaint mantle
echo basalt
#

try and see

tender shard
#

it cannot handle totally new entity types, you always have to extend an existing one

echo basalt
karmic phoenix
echo basalt
#

but people not doing that because they'd need to patch 50 different classes

quaint mantle
flint coyote
#

hmm

tender shard
quaint mantle
#

like make it extend EntityType<T> or whatever

karmic phoenix
flint coyote
#

well I load it before I actually create it. That's one thing.
Maybe that's the issue - even though I wouldn't expect it to be the issue. I'll test it anyway

twin venture
#

hi , nop question .. idk if its my brain stoped working or is it skill issuse .. anyway ..

if i add break statment ,it will add the item to the gui only first item , and it will give me the item only 1 time , and that is the correct thing ,
but if i remove the break statment , it will add all items , and it will duplicate the item that iam receiving xd?

flint coyote
#

oh nvm it actually is the reason. Because my load method creates an empty file. Woops. I can solve it then :)

quaint mantle
#

base class:

public abstract class CustomEntity extends PathfinderMob {
    final Location location;
    public CustomEntity(EntityType<? extends PathfinderMob> entityType, Location loc, String displayName) {
        super(entityType, ((CraftWorld) loc.getWorld()).getHandle());
        location = loc;

        this.teleportTo(loc.getX(), loc.getY(), loc.getZ());

        this.setCustomNameVisible(true);
        this.setCustomName(Component.literal(ColorUtils.translateStringWithColor(displayName)));
    }

    public final void spawn() {
        ServerLevel nmsWorld = ((CraftWorld)location.getWorld()).getHandle();
        nmsWorld.addFreshEntity(this);
    }
}
twin venture
#

ahhh ?
here ?

glad prawn
#

i mean

twin venture
#

under the additem method for the player?

quaint mantle
#

Is this the proper way to do a bubble sort java public void bubbleSort(int[] array) { for (int i = 0; i < array.length - 1; i++) { for (int j = 0; j < array.length - i - 1; j++) { if (array[j] > array[j + 1]) { int temp = array[j]; array[j] = array[j + 1]; array[j + 1] = temp; } } } }

twin venture
tender shard
quaint mantle
#

Why aren't you

#

It's just the motive you feel?

tender shard
#

I would just use Arrays.sort and call it a day

flint coyote
#

because bubble sort is slow af :/

#

There's a reason that java uses Tim-sort, an adaptation of merge-sort

#

quickSort can be faster at times. Or super slow, depending on the list

cloud tusk
tender shard
#

also when does one actually have to sort an array of a huge number of integers, besides for homework lol

soft tendon
#

hey, trying to register a command in a bungee plugin, but it's not properly registering?

// in my onEnable() method
getProxy().getPluginManager().registerCommand(this, new ReloadCommand());

// command class:
public class ReloadCommand extends Command {
        public ReloadCommand() {
            super("reloadpacks");
        }

        @Override
        public void execute(CommandSender sender, String[] args) {
            sender.sendMessage(new TextComponent("§aReloading eee..."));
            if (reload()) {
                sender.sendMessage(new TextComponent("§aeeee has been reloaded!"));
            } else {
                sender.sendMessage(new TextComponent("§cThere was an error reloading eeee!"));
            }
        }
    }

what am i missing? :/

somber scarab
#

hey guys How can I make my plugin available for multiple minecraft versions?

flint coyote
somber scarab
#

how can i do that?

quaint mantle
#

If you want to make your plugin compatible from 1.8 to 1.20, avoid using +1.9 API

somber scarab
#

oh

#

well too late for that

quaint mantle
#

You should be also be carefull because some API methods have been deprecated and removed in modern spigot

somber scarab
#

what i just wanna make sure it works for that major update

quaint mantle
#

So you should check whatever the method still exists in the latest spigot version

somber scarab
#

I just want it to work in 1.21 too

quaint mantle
#

Then your plugin should work in any >= 1.20 version, but might not work on 1.8 version

#

It completely depends on the API you are using

somber scarab
#

oohhh

twin venture
quaint mantle
#

Like, if you are just using the plugin to spawn an ArmorStand, it will work on 1.8

somber scarab
#

okay that's cool

quaint mantle
#

Even though you are using 1.20 API

#

But if you try to spawn a Warden, it won't work on 1.8

#

If you want to strip your plugin to 1.20, then in api-version, (plugin.yml) set it to 1.20

flint coyote
somber scarab
#

I just wanted to make sure does the API work on sub updates

#

of the same major update

#

like 1.20 and 1.21

quaint mantle
#

Well yes, they should. md_5 won't remove API methods without deprecating them first

#

So you should be good if there's any major API change

somber scarab
#

amazing.

#

thanks alot

quaint mantle
#

No thanks, gimme $50

young knoll
#

Generally deprecated methods don’t get removed at all

#

Unless they just become impossible to maintain

twin venture
#

is it maybe because of this 2 for loops?

flint coyote
#

no you still only return one itemstack. Just print your list and check if the content is fine

quaint mantle
#

What damageModifier is used when you hit someone/something without your attack cooldown being fully reset

cloud tusk
#

do i just paste my code here if i need help

quaint mantle
undone axleBOT
quaint mantle
young knoll
#

Player#getAttackCooldown

flint coyote
# twin venture the content is fine ..

then add a println inside your loop and print the item that gets added every time. Check if it's called twice for each item.
Also put a print above the loop to see if your function is called twice.

quaint mantle
#

using EquipmentSlots

#

where u add the attribute u can set an equipmentslot

glad prawn
soft tendon
young knoll
quaint mantle
modern vigil
#

where would I get help with mojang's Brigadier api?

somber scarab
#

how can I add a comment to a config file?

#

like essentialsX does alot

tender shard
#

it works since like forever

young knoll
#

Did you somehow accidentally install it twice

#

Can’t really tell ya much without more info

rain patio
#
@SuppressWarnings("deprecation")
    @EventHandler
    public void onClick(InventoryClickEvent e) {
        if (e.getClickedInventory() == null) {
            return;
        }
        if (e.getClickedInventory().getHolder() instanceof RPChat) {
            e.setCancelled(true);
            Player player = (Player) e.getWhoClicked();
            UUID playerUUID = player.getUniqueId();
            if (e.getCurrentItem() == null) {
                return;
            }
            if (e.getClickedInventory() == colors) {
                if (e.getSlot() == 0) {
                    RPChat.getInstance().primaryRoleplayColors.put(playerUUID, ChatColor.BLACK);
                    player.closeInventory();
                    player.openInventory(colors2);
                }

can someone help me figure out why e.setCancelled isn't working? I'm able to take out the items and I have no clue why

somber scarab
#

how can I add a comment to a config file?
like essentialsX does alot

tender shard
#

wdym

somber scarab
#

like a description to my config setting right above it

tender shard
#

you just insert it into the default config

rain patio
#

put # in front of the line?

somber scarab
pseudo hazel
#

no

#

open config.yml

tender shard
#

don't you include a default config.yml?

pseudo hazel
#

and add comments to it

#

though idk a good way to update those files

somber scarab
somber scarab
rain patio
#

ohhh, in your ide open the yml file and put the comment in there

somber scarab
#
        // CONFIG FILE
        config.addDefault("PlotMargin", 1000);
        config.addDefault("PlotSize", 50);
        config.addDefault("PlotAmount", 5);
        //
        config.addDefault("PlotAmount", 5);
        //
        config.options().copyDefaults(true);
        saveConfig();
desert tinsel
#

anyone has an idea of how to create custom entities that follows a path formed by a type of blocks, like following a path created by concrete?

pseudo hazel
#

in resources

tender shard
#

you just add the comments to your default config?

#

you can also do it like this but what's the point, you don't generate your config from code, you just save the included one

getConfig().setComments("whatever", Arrays.asList("This is a comment", "This is another comment"));
glad prawn
rain patio
#

yes it is, hold i'll put the whole class in a paste

somber scarab
rain patio
tender shard
pseudo hazel
#

thats also how I add config options to my config xD

somber scarab
#

ohhhh

#

the reasources

pseudo hazel
#

everything in resources gets compiled with the plugin

tender shard
#

if you call JavaPlugin#saveDefaultConfig(), it saves the config.yml exactly as it's included in your .jar

somber scarab
#

do I include them in the build?

tender shard
#

including all typos and comments and whatever and what not

tender shard
pseudo hazel
#

what ide are you using

somber scarab
#

intellij

pseudo hazel
#

with the mcdev plugin?

somber scarab
#

I just never made a config file that's all

pseudo hazel
#

then its already included

somber scarab
#

yea

pseudo hazel
#

all resource files will be included

tender shard
#

your config must be in /src/main/resources

somber scarab
#

like that?

tender shard
#

yes

somber scarab
#

is this the syntax I'll use?

tender shard
#

yes

somber scarab
#

ahhhh

somber scarab
pseudo hazel
#

btw alex do you know any good ways to update these files, like if I make an update to my plugin that adds options, is there a good way to not destroy all comments when generating the new files?

young knoll
#

Read the bundled and existing file

tender shard
#

I'M using my config updater library but it's not documented at all

young knoll
#

Copy any missing keys from the bundled file to the saved one

tender shard
pseudo hazel
#

I see

#

you have a lib for everything it seems

#

how long have you been makig plugins for?

tender shard
#

2018

pseudo hazel
#

I see

#

nice

#

thanks

noble lantern
#

PDC != Async Safe? or is it?

pseudo hazel
#

ill see if I can use it or take inspiration from it

tender shard
#

np but the config updater is not very good, it e.g. can't do nested keys

#

because I never use nested keys lol

pseudo hazel
#

I see

#

same lol

glad prawn
young knoll
#

Because that’s not… how java code works?

#

They should be connected with a .

quaint mantle
#

and the slot for that is EquipmentSlot.FEET

rain patio
ruby mesa
#
    private fun requestPlayerCount(player: Player, server: String) {
        val out: ByteArrayDataOutput = ByteStreams.newDataOutput()
        out.writeUTF("PlayerCount")
        out.writeUTF(server)

        player.sendPluginMessage(HubPlugin.instance, "hub:plugin", out.toByteArray())
        Bukkit.broadcastMessage("Black nopox")
    }

    override fun onPluginMessageReceived(channel: String, player: Player, message: ByteArray) {
        Bukkit.broadcastMessage("is it even getting sent? $channel")
        if (channel != "hub:plugin") {
            return
        }

        val `in`: ByteArrayDataInput = ByteStreams.newDataInput(message)
        val subchannel: String = `in`.readUTF()

        if (subchannel == "PlayerCount") {
            val server: String = `in`.readUTF()
            val playerCount: Int = `in`.readInt()
            if (servers.containsKey(server)) {
                servers.remove(server)
            }
            servers[server] = playerCount
        }
    }```

does anyone know why it just doesnt get sent? It doesn't broadcast `is it even getting sent? $channel`
#

im calling requestPlayerCOunt btw

twilit roost
#

is it possible for BungeeCord plugin to send player from 1 bungeecord to another?

#

if I know the IP

vast ledge
#

yes

trim creek
#

Maybe yes, but not with IP

twilit roost
vast ledge
#

oh

#

i though from 1 spigot to another

#

bungeecord to bungeecord i dont think so

tender shard
trim creek
# ruby mesa ``` private fun requestPlayerCount(player: Player, server: String) { ...
public HashMap<String, Integer> serverCount = new HashMap<>();

public void getCount(Player player, String server) {
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF("PlayerCount");
        out.writeUTF(server);

        player.sendPluginMessage(this, "BungeeCord", out.toByteArray());
    }

    @Override
    public void onPluginMessageReceived(String channel, Player player, byte[] message) {
        if (!channel.equals("BungeeCord")) {
            return;
        }

        ByteArrayDataInput in = ByteStreams.newDataInput(message);
        String subchannel = in.readUTF();

        if (subchannel.equals("PlayerCount")) {
            String server = in.readUTF();
            serverCount.put(server, in.readInt());
        }
    }

    public int getServerCount(Player p, String server) {
        getCount(p, server);
        if (serverCount.get(server) != null) {
            return serverCount.get(server);
        }
        return 0;
    }

This is how you do it.

ruby mesa
#

you just changed the channel name to bungeecord

#

but that wouldn't work since you need a :

twilit roost
# tender shard no, what'd be the purpose anyway?

we have a trial developer on our network
and he has console and stuff

but we don't want him to be able to modify stuff on bungee and other servers

so we are making another bungee, but still want him to be in Staff List and stuff

trim creek
#

It works to me

#

What do you mean it wouldn't work?

ruby mesa
twilit roost
#

he still has console
he can give himself * in seconds

trim creek
#

Funky since I use 1.18.2 🤣

vast ledge
#

Then dont give him console?

twilit roost
#

can't do dev stuff without it :D

ruby mesa
tender shard
vast ledge
ruby mesa
trim creek
#

First off: as far as I can see, it never calls the void "getCount", which would eventually get the playercount. For other good reasons, I use a hashmap to store the playeramount for each server, so it won't even break.

#

Something is wrong with your code, but I can't really read it as of as I see it is written in Kotlin.

ruby mesa
#

I just didnt paste the code that did it

trim creek
#

Also

tender shard
ruby mesa
trim creek
#

Instead of broadcasting in the message in the message void, broadcast it when you request the playercount

trim creek
trim creek
#

What kind of shit are you using? 🤣

ruby mesa
#

it broadcasts it

tender shard
ruby mesa
ruby mesa
#

but it broadcasts when I do requestPlayerCount

tender shard
#

from my experience, bungeecord messaging is extremely shitty anyway, I'd rather just use redis pubsub

somber scarab
#

weeeeee

tender shard
#

please tell me you don't print sth similar to console lol

noble lantern
#

oh jesus

noble lantern
#

phew

glad prawn
#

💀

tender shard
strange rain
#

Does anyone know how to install and use the world edit api?

fluid river
#

worldedit maven

flint coyote
#

You just add it as a dependency and follow their guide

strange rain
pseudo hazel
#

whats the diff between .stream().toList() vs .stream.collect(Collectors.toList())

glossy mantle
#

How do I set a sword's attack damage in 1.8.8 spigot?

tender shard
pseudo hazel
#

I see

#

nice

tender shard
#

the collector returns a modifiable list and is java 8+

pseudo hazel
#

okay

#

so I guess performance difference is like non existant

tender shard
#

toList() seems very weird to me lol

#

I would always rather use the collector, toList() literally creates an array, turns it into a list, turns that into an arraylist, and turns that into an unmodifiable list

#

the collector creates a new arraylist and then calls add for each element

#

asList should definitely be faster

#

but it still looks very weird

flint coyote
flint coyote
#

Might swap to the collector then. Also has the benefit of getting a mutable list

pseudo hazel
#

oh oof

tender shard
#

the collector adds each element individually, so the list has to be resized sometimes

#

the thousand arraylist calls in toList probably do an array copy which should be faster

#

but tbh it probably doesn't matter at all in 99.999% of cases, I'd just use the collector since it works on all java versions

young knoll
#

Could it not create the list with an initial size

flint coyote
#

well yeah it probably won't matter most of the time. Might still run some tests when bored. My current project won't let me get bored for this year though

chrome beacon
#

So don't rely on that

flint coyote
#

oh right I just read that yesterday and then used ArrayList::new as a custom collector

tender shard
tender shard
vast ledge
#

in IDE or spigot console?

#

hover over it, what options does it give you

flint coyote
vast ledge
#

not sure if the for the UUID field, just create a random UUID

#
 totemMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(UUID.randomUUID(),"attack", -1*0.1, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.OFF_HAND));
#

wdym, error on UUID?

#

Maybe i misswrote smth try using this

totemMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(UUID.randomUUID(),"attack", -1*0.1, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.OFF_HAND));
#

Why no intellij Idea

somber scarab
#

look at me being a professional 😎

vast ledge
#

Screenshot?

strange rain
remote swallow
#

import it

somber scarab
strange rain
#

A minigame creator

somber scarab
#

oh shit. I was planing on making my own as well

#

My minigame uses plots

#

maybe I can use urs uwu

strange rain
#

Noooo Its not my plugin

#

so

somber scarab
#

oh

#

but ur making plots?

#

how

strange rain
#

Well 'technically I am'

vast ledge
#

payed plugin?

strange rain
#

really I can't even get the blocks to generate atm

vast ledge
#

xD

strange rain
#

No its a private plugin

somber scarab
#

ur not coding it?

quaint mantle
#

How can I add the script that I use on one server, which is the plugin of the script that is used in spigot, to bungee to work on all servers and with the same data.

somber scarab
vast ledge
#

you already asked in help server

#

have patience

strange rain
#

Hopefully if it turns out well it will be like minehut-

somber scarab
#

if you need help with terrain generation im here

vast ledge
somber scarab
#

Each of my plots generates a completely random X*Z plot

#

and makes lava slowly rise

#

last to survive wins

vast ledge
#

ooh

strange rain
#

Oh thats fun

vast ledge
#

cool

#

cant wait to play 😄

somber scarab
#

Yeah 😎

strange rain
#

Reminds me of thoose build to survive gamemodes

somber scarab
#

Its on github rn but not completely done

vast ledge
somber scarab
#

its like

#

80% done

#

and I still need players to help test

vast ledge
#

if you need help lemme know

strange rain
#

Yo

somber scarab
#

Thanks alot bois

#

will deff need help testing

vast ledge
#

wats ur github, you dont have it linked to discord

somber scarab
#

there

vast ledge
#

@somber scarab

#

Naming conventions

somber scarab
#

yes

vast ledge
#

Please

somber scarab
#

example

vast ledge
#

"PlayerDieEvent"

copper scaffold
#

I have a problem with my custom enchant plugin when i remove the enchants with the grindstone i can only remove the enchant lore when i don't rejoin after rejoining i can't remove the lore anymore...

somber scarab
#

I do shit quick right away cuz I got dire ADHD then I sit down and fix and organize after Im done

#

I cant do both at the same time

#

also commenting

#

and other stuff

#

and name spaces

#

yeah all will be fixed

somber scarab
sharp bough
#

does anyone know why this happens?

[17:50:32 INFO]: [Citizens] Enabling Citizens v2.0.32-SNAPSHOT (build 3147)                                                                                                                                                                  [17:50:32 INFO]: [Citizens] Loading external libraries                                                                                                                                                                                       [17:50:33 ERROR]: [Citizens] v2.0.32-SNAPSHOT (build 3147) is not compatible with Minecraft v1_19_R2 - try upgrading Minecraft or Citizens. Disabling... 

latest citizens build fails to load in 1.19.3, tried with a couple of other versions and didnt work either

hushed spindle
#

maybe you should ask the developer of citizens?

#

seems pretty clear why that build doesnt work

sharp bough
#

i dont think its a build issue

hushed spindle
#

what makes you think that

sharp bough
#

i think its a me problem, thats why i ask here

young knoll
#

Maybe it just doesn’t support 1.19.3

#

Update

hushed spindle
#

the compatibility error is an error given by the plugin itself its not like a spigot error

#

so its a build issue

#

and you gotta contact the dev(s) for that

somber scarab
#

oh man bedless still going at it

young knoll
#

Idk why you’d stay on .3 anyway

hushed spindle
#

does anyone else's intellij at times just freeze and then spike at 100% cpu usage

#

specifically when selecting text

tender shard
hushed spindle
#

i tried disabling it and it still happens

#

updated too

tender shard
#

any other plugins?

hushed spindle
#

i guess i got a theme plugin but thats about it

tender shard
#

hm then no clue, which version are you on?

hushed spindle
#

i just recently updated so community edition 2023.1.2

tender shard
#

2023.1.3 should be latest

sharp bough
# hushed spindle does anyone else's intellij at times just freeze and then spike at 100% cpu usag...
#

use vscode

vast ledge
#

@somber scarab Here, i reformated it, created a master class, where you can handle all of your event

package Events;

import Utils.Tools;
import floorIsLava.FloorIsLava;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerJoinEvent;

public class GameEventManager implements Listener {

    public GameEventManager() {
        Bukkit.getServer().getPluginManager().registerEvents(urInstance, this);
    }

    @EventHandler
    public void onPlayerJoinEvent(PlayerJoinEvent event) {
        if (event.getPlayer().getWorld() == FloorIsLava.VOID_WORLD)
            if (event.getPlayer().getBedSpawnLocation() != null)
                event.getPlayer().teleport(event.getPlayer().getBedSpawnLocation());
            else
                event.getPlayer().teleport(Tools.getHighestUsableBlockAt(Bukkit.getWorlds().get(0), 0, 0).getLocation());
    }

    @EventHandler
    public void onPlayerDeathEvent(EntityDamageEvent event) {
        if (!(event.getEntity() instanceof Player)) return;
        Player player = (Player) event.getEntity();
        if ((event.getDamage() >= player.getHealth()))
            if (Tools.checkPlayerInGame(player)) {
                e.setCancelled(true);
                Tools.getGameFromPlayer(player).remove(player, true);
                player.setHealth(20);
            }
    }

    @EventHandler
    public void onPlayerQuitEvent(PlayerQuitEvent event) {
        Player player = event.getPlayer();
        if (Tools.checkPlayerInGame(player)) Tools.getGameFromPlayer(player).remove(player, false);
        if (Tools.checkOwnerInLobby(player)) Tools.getLobbyFromOwner(player).removePlayer(player);
        if (Tools.checkPlayerInLobby(player)) Tools.getLobbyFromPlayer(player).removePlayer(player);
    }
}
vast ledge
#

If all of the events are handling the game, you can create a "master" listener

somber scarab
#

huh

vast ledge
#

Like i did there

somber scarab
#

that's cooll.. i didnt know that

ionic terrace
vast ledge
#

you dont

tender shard
somber scarab
vast ledge
#

i just use the term master class, if you combine a bunch of things into one

#

it handles all of the events for the game

somber scarab
#

yeah i can see that

#

Thanks alot mister

#

or mam

#

or person

vast ledge
#

so i just put in in the constructor

young knoll
#

God class

vast ledge
#

Yea

#

basically

hushed spindle
#

ok so just make like a little util method that does that

vast ledge
#

but im to lazy xD

sharp bough
vast ledge
#

Oh also, talking about naming conventions @somber scarab
InviteLobby.java:24
You shouldnt capslock OWNER, it should be owner or ownerPlayer, you should only capslock in enums

young knoll
#

Static constants

tender shard
vast ledge
young knoll
#

Which is basically what enums are

tender shard
#

and a listener also shouldnt not reponsible for registering itself

vast ledge
vast ledge
young knoll
#

Yeah that’s weird

#

Just calling a constructor and doing nothing with it is wack

worldly ingot
#

It's a strange design pattern

vast ledge
worldly ingot
#

The constructor should seldom be changing state beyond its fields

#

If you're writing code like new MyListener();, you're doing something wrong

split lichen
#

does anyone know how to modify the player count of a server, as seen when the server is pinged?

#

and I'm not talking about max players

tender shard
vast ledge
#

Why 😦

copper scaffold
#

I have a problem with my custom enchant plugin when i remove the enchants with the grindstone i can only remove the enchant lore when i don't rejoin after rejoining i can't remove the lore anymore...

vast ledge
#

english

#

i do not understand

tender shard
# vast ledge Why 😦

for example it violates the single responsibility principle. a listener is there to listen to events. not to register itself with the plugin manager. that's the job of your main class.

also doing new Something(); without saving it somewhere already gives a hint that you're doing something wrong - a constructor should construct an object, and nothing else. your constructor has side-effects, it shouldn't have any. doing new Something(...) without using it later on is literally always a hint that you constructor is doing more than it should

whole surge
#

Hello. How do I get obfuscated field name from nms? Im just trying to get private stuff

soft tendon
tender shard
soft tendon
#

it doesnt even seem to exist

#

tried with and without a permission; nothing... weird part is that registering events a line above works just fine; registering the command doesnt

tender shard
#

there is no PlayerAsyncPreLoginEvent

young knoll
#

It’s AsyncPlayerPreLoginEvent

#

Afaik it blocks login indefinitely

#

No

#

It’s async, it’s not on the main thread

tender shard
#

wdym with "never finish"?

young knoll
#

while (true)

final monolith
#

How Oraxen/ItemsAdder creates custom inventories?

young knoll
#

Login isn’t on the main thread

final monolith
#

they use "custom model data"?

young knoll
final monolith
final monolith
#

How to apply this into an inventory?

young knoll
#

Use the font in the title

final monolith
#

ooh does sense

young knoll
#

Pretty much

#

Why are you infinitely blocking it :p

#

The main use of that event is to block login until you load their data

glossy mantle
young knoll
#

No idea if 1.8 has an attribute api

#

It’s 8 years old

vivid cave
#

Whenever there is an inventory event, I want to analyse the InventoryView (again, it's whatever inventory, container, being viewed by a player) and then send a fake 'inventory update' (purely visual) packet to the client with modified stuff/items

#

What is the packet name ?

#

im searching the protocol but i'm unsure

#

Set Container Content ?

#

Does that cover for all inventory events ?

tender shard
#
    @EventHandler
    public void onLogin(AsyncPlayerPreLoginEvent event) {
        try {
            System.out.println("LOGIN EVENT");
            Thread.sleep(5000);
            event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_FULL, "Calm down, imbecile. Wanna buy some " +
                    "alprazolam?");
            System.out.println("DISALLOWING");
        } catch (InterruptedException ignored) {}
    }
#

I waited 5 seconds and the client will also be waiting 5 seconds before it either connects or gets kicked

young knoll
#

There is a timeout on the client btw

#

Idk how long it is

pine cipher
#

I'm trying to overwrite texture using bitmap \uE001 (version 1.19.4) but it's not working why?

tender shard
#

30 seconds

tender shard
young knoll
#

Reasonable

green plaza
soft tendon
tender shard
green plaza
#

XDDDDDD

tender shard
soft tendon
#

absolutely 😦

#

i can send you the log but there aint anything there

tender shard
#

that is very weird lol

soft tendon
vivid cave
# vivid cave im searching the protocol but i'm unsure

anyone knows ?
I see two packets that may potentially interest me:

SetContainerContent "Sent by the server when items in multiple slots (in a window) are added/removed."
SetContainerSlot "Sent by the server when an item in a slot (in a window) is added/removed."

Which leaves me the following questions:

  1. does "updated" count (as removed/added)?
  2. is the cursor slot included ? (is it a slot?)
  3. does it cover all inventory event scenarios ? (if i send those packets 1 tick after to "fake update", after whatever invetory event, shoudl it work?)
young knoll
#

Should work for any inventory

vivid cave
#

oki ty

#

do you know if the cursor is a different thing ?

young knoll
#

Might be

#

Check the implementation of the spigot setCursor method

vivid cave
#

hm

#

k

#

thx

glossy mantle
#

I want to make an effect that changes the color of 8 glass panes starting from the first to pink then turns the second into pink and the first back to normal and so. How do I schedule this every 500ms while being able to cancel it when the inventory is closed?

#

I've got everything setup, I just need the timer shit

young knoll
#

?scheduling

undone axleBOT
young knoll
#

Use a repeating task, you can easily cancel it with the close event

#

Those don’t change tho

noble lantern
#

Is there a way to make this a one-liner on initialization other than a static block :((?

young knoll
#

Probably with streams

#

Not everything has to be one line tho :p

noble lantern
#

yeah true, just wanted to keep constructor empty for this example but, myeh im not switching it over to static just for that xD

remote swallow
#

use spigot api

young knoll
#

Evidently you also have paper somewhere

#

Because we don’t deprecate ChatColor stuff

quaint mantle
#

Any guide to create a tablist?

undone axleBOT
zealous osprey
young knoll
#

I mean you could

#

that’s a lot of lines tho XD

noble lantern
#

yeah thats the opposite of what i wanted xD

zealous osprey
#

True, but... not in the constructor XD

noble lantern
#

thats true as well

young knoll
#

I mean if you really don’t want it in the constructor

#

Hashmap blah blah = methodThatReturnsAHashMap

zealous osprey
#

Also, shouldn't that map be final?

noble lantern
#

i just opted for this design in the end imo

The class is mainly just serving as an example for those whos using it

noble lantern
umbral pendant
#

Hello. I asked chatgtp to write me code that makes a lifesteal smp plugin but where players dont actually loose health if they die and idk if this is good or how to make the plugin work and all that.

#

also idk how to show code in discord

young knoll
#

Ask someone to modify one for you

#

It’s probably just commenting out a few lines of code so I’m sure you can find someone to do it for free

umbral pendant
#

can you pls modify it for me? lol

noble lantern
#

if its open source ill do it rq

umbral pendant
#

lifesteal

young knoll
#

Ah ye that narrows it down

noble lantern
umbral pendant
#

ye

#

if the player dies they dont loose health but if the player kills someone they still gain health

zealous osprey
#

Wouldn't that just lead to 2 players continuesly kill each other and gain infinite hp?

young knoll
#

Probably

umbral pendant
#

maybe lmao

#

wait also can there pls be no cap on health? lol

noble lantern
#

thats a mc limitation

umbral pendant
#

wdym

#

idk how to change that in-game

noble lantern
#

minecraft limitation

health cant go over 1024 iirc

glad prawn
#

U can set to higher

umbral pendant
#

ok but I want it so I can go above 20 lol

#

how?

young knoll
#

The 1024 is a spigot setting

#

You can increase it

noble lantern
#

i could of swore in modded you eventually hit some limit with mc

umbral pendant
#

idk why people would need more than 1k health lmao

noble lantern
umbral pendant
#

lmao

noble lantern
#

ike why tf is there no config.yml smh

#

was gonna PR it as a config option but bro dont got a central config

umbral pendant
#

what does that mean? tbh I have no experience with coding or anything like this so idk any of what yall are saying when it comes to code lol

noble lantern
umbral pendant
#

alr ill see if I can find another lifesteal plugin

young knoll
#

Yeah tell him to fix his build process

#

:p

umbral pendant
#

it would actually be kinda fun to have lifesteal in 1.8 combat lol

#

without loosing health ofcourse lol

echo basalt
#

9

#

If it doesn't work then it's 0

noble lantern
umbral pendant
noble lantern
#

1.8 compatible too would be a big hard nope

#

in fact i wont touch anything older than 1.16 :p

seems this plugin works though

umbral pendant
#

Well then pls do it without 1.8 compatibility

#

Ty a lot

noble lantern
#

so just make it so victims dont lose health at all?

#

and no health cap?

umbral pendant
#

Ye

remote swallow
#

1.17 is the furthest back i would go

young knoll
#

What’s 1.17

#

I only know 1.20

remote swallow
#

whats 1.20

young knoll
#

I think I’ve heard of a 1.19 too

remote swallow
#

i only know 1.20.1

noble lantern
#

this code base is dookie ngl but ill do it xD

umbral pendant
#

Ty!

noble lantern
#

if ike comes back definatly switch back to his this ones uhh questionable xD

umbral pendant
#

Lol 😂

remote swallow
#

is it package private

noble lantern
#

dear fucking god guys

#

guys

umbral pendant
#

?

noble lantern
#

not you your fine talking to the other devs lol

noble lantern
young knoll
#

Oof hardcoded color character

glad prawn
#

Damn

noble lantern
#

for the health limit what limit do you exactly want just match spigots 1024?

umbral pendant
#

Ye

noble lantern
#

ngl

#

it has no limit

#

so i kinda dont need to do anything lol

umbral pendant
#

Well can u possible do the hearts lose on death? Lol 😂

noble lantern
#

it has a config

young knoll
#

Oh it already has the option

#

Nice

umbral pendant
#

Oh so I just do it in Mc

noble lantern
#

yee, idk why ike didnt think of this for his it must of slipped his mind xD

umbral pendant
#

lol 😆

noble lantern
umbral pendant
#

Alr ty

#

I do genuinely appreciate it even if you didn’t need to do anything

noble lantern
#

i wanna Pr and fix this up so bad but ion got the time CH_CatCry

#

hrngernerhnn

young knoll
#

Hey it works

noble lantern
#

it definatly does i give them credit for them

young knoll
#

No user will ever notice or care

noble lantern
#

im 100% sure its a first time plugin which tbh is fine

#

but just seeing that slightly huts cryYou

young knoll
#

Hey duct tape and dreams is what holds together half the world

#

:p

umbral pendant
#

Lol 😂

noble lantern
#

i need me a can of flex seal in my life

young knoll
#

Ah man another NPE

#

Pours flex seal into PC

noble lantern
#

i remember when i first started coding i would catch npes

glad prawn
#

He doesn't know how expensive Double instead of double is

noble lantern
#

might of used an outdated ide/java version too

#

because hes using explicit types when initilizing stuff like lists and maps

#

HOWEVER

#

BIG BRAIN

#

they shipped the gradle container with source code

#

so like + 1

glad prawn
#

ye

noble lantern
#

for not making me downlod that weird jre they were using

#

how come people version configs?

#

why dont yall just outright add the new value if they dont exist

young knoll
#

Idk

noble lantern
#

like so many plugins use config version maybe somethings going over my head here

young knoll
#

What if old stuff changes

#

Like something goes from a string to an int

#

For some reason

noble lantern
#

isString

#

isInt

#

we have all those checking methods for config

young knoll
#

Too hard

noble lantern
#

i wish everyone just understood json so we can use pojo classes

young knoll
#

Just make the same for yml

remote swallow
#

yaml is a subset of json ¯_(ツ)_/¯

ruby mesa
#

can potion effects show infinite in spigot 1.20?

young knoll
#

Should be able to

worldly ingot
#

Yes

#

PotionEffect.INFINITE_DURATION

young knoll
#

Use the constant

#

Magic values bad

worldly ingot
#

The constant reads better

ruby mesa
#

ah ok

#

last time I coded it was just Int.MAX_VALUE

#

so yeah

#

thanks though

young knoll
#

Yeah Mojang added proper support for infinite

#

Not super hard

#

Get a nice custom model, slap it on an armor stand/display entity and spawn particles as it flies

#

Then do some fun maths to give it a nice curve

rain cloud
#

Say I wanted to develop a plugin to be compatible with as many versions of Spigot and possibly Bukkit as possible, does anybody have any advice on this? Like I have the option of developing things using the 1.8 Spigot API, but as far as I can tell, Spigot did exist prior to 1.8, and Bukkit also existed for prior versions. Does a compatible API version exist for versions prior to 1.8, or am I best just sticking with 1.8+?

remote swallow
#

if you want to support 1.8+ bukkit just dev for the 1.8 bukkit api

#

but literally no one runs plain bukkit anymore

young knoll
#

No api versions before 1.8 are still publicly available

#

And if anyone is using a version that old they are on there own in every way possible

remote swallow
rain cloud
rough drift
#

@umbral pendant @glad prawn @noble lantern There is a config, it's just auto generated

umbral pendant
#

What?

rough drift
#
maxHealth: 20 # Hearts, ik dumb naming
useMaxHearts: true
```plugins/LifeSteal-Smp-Plugin/config.yml
#

also @remote swallow there are some deps you need to clone from other repos

#

that are not on central

rough drift
noble lantern
#

ah so its not an embedded resoruce then i was expecting it to be

rough drift
#

you'll kill me if you do

young knoll
#

LOOK AT IT

noble lantern
rough drift
#

well it's ~400 lines of pure reflection

#

recursive reflection in loops

young knoll
#

geez my entire config library isn’t even that big

rough drift
#

I added enums, lists, serializing child types if that type is also a config type

#

it's a whole of a lot complex

#

and made by stupid 2 years ago me

tender shard
young knoll
#

Mine can do enums, collections, maps

#

Not pojo yet

tender shard
noble lantern
umbral pendant
#

How would I config it?

rough drift
#

wdym

rain cloud
rough drift
#
@Config("playerScore")
public class PlayerScoreConfig {
  public static int level = 0;
  public static int xp = 0;
}

@Config("players")
public class PlayersConfig {
  public static List<PlayerScoreConfig> scores = List.of(new PlayerScoreConfig());
}

it's dumb ik

tender shard
rain cloud
#

Why not

tender shard
#

because it's unneccessary work for you

umbral pendant
rain cloud
#

Creating the plugin at all is unnecessary work, I'm fine either way

noble lantern
tender shard
#

and users of recent versions will be annoyed because you e.g. cannot add a certain 1.20+ feature because you're stuck on 1.4.6 API

rough drift
rough drift
#

I actually will make the config in game commands

#

Wait what plugin

noble lantern
#

that ones dupixa iirc

rough drift
#

If it's what I am thinking of they claim mine is shittier than theirs

tender shard
#

imagine rockstar would still stick to windows 98 API and directX 5, I doubt GTA 5 would be a great game then lol

#

if you really wanna go for old versions, at least use 1.8.8 instead of going even older

rain cloud
#

i.e. stripped logs

#

So yeah, that makes sense

rough drift
rain cloud
#

Thanks for pointing that out

rough drift
#

but like burchard

#

Lemme open up some crazy aahh weird code

tender shard
rough drift
#

14

#

no shit

#

13

rain cloud
rough drift
#

yeah

#

my memory was right

tender shard
#

ah yeah that's good, the 1.13+ API is great because of the new material stuff etc

#

1.12 <> 1.13 has breaking changes

rain cloud
#

When you use an older API version, can you just not reference newer block types at all, or?

tender shard
#

yeah well you can in theory also use XMaterial instead

#

that should work on all versions

noble lantern
#

its easier to manage it in modules that way each module can use the version of api your devving on

rain cloud
#

I guess maybe you can do at least run-time checks like .name == "WHATEVER_BLOCK"

noble lantern
#

oh yeah xmaterial forgot about that

umbral pendant
tender shard
rough drift
#

(I use ❤️ as funny joke, dw about it)

#

I am actually doing it fyi

noble lantern
#

oh no not saying your not 😛 i just find it funny there was supposed to be a command xD

rough drift
#

There wasn't

#

so many people are asking for it that there now is going to be one

rain cloud
#

I think I'll just make my plugin using the 1.19 API and then see if I can backport it later if I'm bothered about it

visual laurel
#

how can i stop my plugin overwriting the config.yml file when it restarts? im using this.saveDefaultConfig();

#

💀 i think i forgot to actually save the config

#

its saveConfig(); for config.set isnt it?

remote swallow
#

yeah, config.set then save or save on shutdown

visual laurel
#

alright thanks

umbral pendant
rough drift
#

Since that message I've been writing one arg 💀

umbral pendant
#

Lol 😂

#

I do appreciated it ngl

umbral pendant
young knoll
#

WORK FASTER

#

AHHHH

umbral pendant
#

fax

#

lol

noble lantern
#

i hate this so much who gave me this idea last night smh

compact haven
#

what are you doing

#

and why the fuck is IFluidStorage not an interface

#

it’s not even an abstract class

noble lantern
#

converting forge's energy api into a spigot friendly thing

#

placeholders

tender shard
#

what is "energy"?

noble lantern
#

ignore fluids

noble lantern
#

eletricity

#

whatever you want

#

but a type of energy

compact haven
#

I want to make EnderIO as a spigot plugin I think

noble lantern
#

its like vault, how vault as an economy but you dont know what it is

compact haven
#

I think that’s a cool resource

#

no one can take that idea btw i have it claimed

noble lantern
#

Im using alex's block PDC lib for it as well

compact haven
#

an API for what

noble lantern
#

forge provides abasic power impl that makes all power mods work friendly with one another

#

similar to like vault

compact haven
#

Ah

#

Ahh I see

noble lantern
#

that way if you make an enderio thing, and someone makes like mekanism, both of your machines would work 🙂

#

?paste

undone axleBOT
compact haven
#

that’s neat

noble lantern
young knoll
#

It’s heavily based off the older api from thermal expansion

#

Fun fact of the day

noble lantern
#

yee, even in forges source they express that a lot xD

Dudes who made that original power api were nuts

#

one sec lemme find the comments cause im using forge as like a referance

young knoll
#

Shoutout to king lemming

noble lantern
#

i wonder why forge doesnt provide BlockFace methods for extracting energy though

#

ig they expect mod devs to make that a feature on theyre end

young knoll
#

/shrug

tranquil prairie
#

For some reason this doesnt work with the crafting 2x2 in the players inventory

        Inventory inventory = player.getInventory();
        for (int slot = 0; slot < inventory.getSize(); slot++) {
            ItemStack itemStack = inventory.getItem(slot);

            if (itemStack != null && itemStack.getType() != Material.DIODE &&
                    itemStack.getType() != Material.CHEST && itemStack.getType() != Material.SLIME_BALL) {
                inventory.setItem(slot, new ItemStack(Material.AIR));
            }
        }```
umbral pendant
umbral pendant
#

just a question

rough drift
#

I don't understand it

umbral pendant
#

can u add a command that lets u not loose a heart when u die as well?

#

for ops though obviously

#

data/minecraft/functions/give_stone_tools.mcfunction

scoreboard players set @s joined 1

Give stone tools

give @s minecraft:stone_pickaxe
give @s minecraft:stone_axe
give @s minecraft:stone_shovel
give @s minecraft:stone_sword

is that actual java code

#

chatgtp sent me it

karmic phoenix
#

The plugin is having a stroke, a little help?

ERROR
https://paste.md-5.net/torinudicu.css

CODE

public class PointsCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player p = (Player) sender;
            String replaced = PlaceholderAPI.setPlaceholders(p, "%playerpoints_points%");
            p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aYou have &f" + replaced + " &apoints!"));
        } else {
            sender.sendMessage(ChatColor.RED + "You must be in-game to use this command.");
        }

        return false;
    }
}
umbral pendant
#

then what is it?

torn badge
#

Datapack

umbral pendant
#

oh nvm im dumb. I asked it for data packs LOL

torn badge
karmic phoenix
#

I only have 2 classes

#

main and a commandexecutor

torn badge
#

Show both

karmic phoenix
#

Main basically has this on enable:
getCommand("points").setExecutor(new PointsSystem());

noble lantern
#

show your plugins folder sounds like you got it uploaded twice in there prolly

torn badge
#

PointsCommand

#

Not PointsSystem

noble lantern
#

ooof

torn badge
#

You’re initializing your main class, can’t do that

karmic phoenix
#

wdym?

vapid lake
#

How to delete all vanilla commands?

#

i want this

torn badge
karmic phoenix
#

oh damn

#

i just realized

#

thanks mate

noble lantern
#

tbh how did that even compile

karmic phoenix
#

i dont even know

#

intellij got sick of me probably

torn badge
noble lantern
#

out of the many years ive done this ive never known that wow

you learn something new everyday

karmic phoenix
#

how do I rename the plugin entirely

#

plugin.yml?

young knoll
#

Yes

karmic phoenix
#

thanks y'all

tranquil prairie