#help-development

1 messages Β· Page 2165 of 1

sullen dome
#

but no, it's 100% not spigot lol

regal anchor
#

What can't you create yourself in it

fierce swan
sullen dome
bright jasper
#

idk i rewrote my own essentials plugin but my server is kind of weird because it's a network and i decided to use TCP+Matchmaking servers+Redis

#

so essentials is useless to me

regal anchor
#

Essentials is not the wheel it would be the aesthetic wheel cover

sullen dome
#

i mean i personally never use any public plugins except worldedit

kind hatch
#

There's nothing wrong with using essentials. It's just that if you are developing your own server, you are likely going to run into issues/limitations with essentials, basically forcing you to rewrite it so it fits your needs.

sullen dome
#

because worldedit would be hell to recreate

bright jasper
#

ehhh im kind of mixed now on public plugins.

#

the only plugins i use that are public is denizens and itemsadder

#

itemsadder for custom models/items/blocks/gui and denizens for npcs with custom models

#

because im not gonna fuckin do all that NMS shit, hell no

#

πŸ”

#

oraxen exists but it uses the NMS where itemsadder uses packets so itemsadder is way faster in my experience

sullen dome
#

even currently recreating my own discordsrv alternative, because discordsrv has so much stuff that annoys me

bright jasper
#

despite closed source

bright jasper
#

you reminded me i should continue this (this is designed to work on multiple servers btw, fabric and spigot)

regal anchor
#

All of that I get

#

But Essentials

sullen dome
#

alltho my bot is bascially only there for verification (whitelisting) and the console sync

bright jasper
#

i implemented lwjgl 3d head rendering and then i realized it needs an actual gpu to run

sullen dome
#

all the other stuff from discordsrv was either buggy, or unneeded

bright jasper
#

and might not work on headless

#

so now im kinda... split on that

sullen dome
#

i hate gl rendering

#

with all my power

bright jasper
#

as in you hate writing gl rendering?

#

same lmao

#

πŸ₯° beautiful tho

#

these are old screenshots, its evolved

#

i need to finish my finals and finish this plugin

sullen dome
#

mine's just working, nothing special

#

one sec

#

you send him a random generated code, and it saves your uuid to a config file

#

thats all

bright jasper
#

oh uh mine is a bit funky

#

lemme find an example

quaint mantle
#

Riku your GitHub page is so 😍

bright jasper
#

sends stuff through webhook

sullen dome
#

cool

bright jasper
#

linked users send as their actual pfp

#

non linked users send the image of their mc head

sullen dome
#

i got to the point where i had to re-think about the console thing lol

bright jasper
#

including my own eventbus and DI and command framework (with annotation autocompletions)

sullen dome
#

because it would spam the discord thing and make it rate-limit all the frickin time

bright jasper
#

i kind of regret not doing this in kotlin tho

quaint mantle
#

What if you add those to one large embed and when the description limit is reached it starts building another one?

sullen dome
#

can we all agree on the fact that discord's rate-limit is completely trash?

bright jasper
#

yes

sullen dome
#

thanks

#

you can change channel dscriptions every uhhh... 10 minutes?

#

like wtf

bright jasper
#

i know the dev of https://pylon.bot/ (really cool v8 embedding made in rust btw). They had to actually make a load balancer/bridge for discord ratelimits

#

lemme find the doc page on it

regal anchor
sullen dome
#

well i just found out how to detect the console output

#

and just disabled the sync for certain messages

#

which are likely spammy

bright jasper
#

its not OSS but there is a gateway wrapper that wraps discords gateway and works over multiple servers

#

so its kind of like a rotating proxy/better discord API so you dont need to constantly rewrite shit

sullen dome
#

i think i may start making more plugin stuff again. only did clientside stuff for like half a year now

bright jasper
#

the only time i can get motivated is with shit like custom models and stuff like glyphs and the magic post 1.14 resource pack stuff

#

the problem is, im not an artist and can't actually make the content, just the code

#

🀑

sullen dome
#

exactly same

#

i made a mod with custom cosmetics which are free

#

but uhhh

#

it only has wings and capes

#

fuck, i'm no nitro anymore fml

#

only because i'm not creative enough to create own models

fallow violet
sullen dome
fallow violet
#

want it back? :o

sullen dome
#

nah

#

my paypal broke

#

idk why... didnt want to receive the payment

fallow violet
#

i got nitro from one friend :>

#

3 months in a row

sullen dome
#

i miss my pink name in here tho

fallow violet
#

pink is best

sullen dome
#

^

kind hatch
#

Is it possible to replace a column name in a mysql query using the ? syntax?
E.G. String query = "UPDATE indicators SET ? = ? WHERE uuid=?";

Cause I'm running into an issue with it. Currently my workaround is to do this. However, this seems like a fancier version of string concatenation.
String query = "UPDATE indicators SET %test = ? WHERE uuid=?".replace("%test", type.getValue());

wraith marsh
#

how do i go through an arraylist in a yml file?

kind hatch
#

Depending on the type of list, you can call FileConfiguration#getStringList() or FileConfiguration#getIntegerList()

#

Apparently there is also a generic #getList()

fallow violet
kind hatch
#

H2 drivers aren't provided by spigot. You will need to depend on an external library. Take LuckPerms for instance, it downloads extra libraries in it's plugin folder and uses them to run. H2 is one of the libraries.

fallow violet
#

this fixes the error?

kind hatch
#

I mean, your error says that no suitable driver was found so, yea, it should.

lethal python
#

: /

#

i have it in dependencies

kind hatch
lethal python
#

what

kind hatch
#

What's the issue you are having with it?

lethal python
#

the one in the link

kind hatch
#

Yes... what's the problem with it though?

lethal python
#

knuffeliger what is the problem

#

@fallow violet

fallow violet
#

what?

#

oh yeah

#

the h2 database cannot connect. Thats the problem.

kind hatch
lethal python
#

DriverManager.getConnection(the url) returns null and it is because the database cannot connect

humble tulip
#

why is the scope test?

#

shouldnt it be compile?

lethal python
#

i copied it from the page

#

like he did in the tutorial

#

let me check what his text said

kind hatch
#

It should be compile if you want it to be in your final jar.

humble tulip
#

^^

sullen dome
#

i return after months, and this channel still keeps me confused

#

love it

fallow violet
#

xd

lethal python
#

how did it work for him :V

fallow violet
#

how old is the tut?

humble tulip
lethal python
#

yes

humble tulip
#

well idk why it worked for him but did that fix your issue?

sullen dome
#

i mean, you could try using Class.forName("com.mysql.jdbc.Driver");
which may fix it

#

it did for me at least

fallow violet
#

for me not but i have'nt the maven dependency so maybe

sullen dome
#

tbh i dont even know what h2 is

#

never heard

fallow violet
#

database type

#

ram based

kind hatch
sullen dome
#

i see

lethal python
#

i am restarting😎

sullen dome
#

now i'm even more confused, thanks

fallow violet
#

xdd

#

just a database

uneven fiber
#

yo

#

how do you add extra inventory spots to a chest

#

is it possible

sullen dome
#

if you mean slots, no

kind hatch
#

You don't.

uneven fiber
#

😒

sullen dome
#

they're clientside

fallow violet
#

you can make a triple chest xd

kind hatch
#

Well, you kinda can, but it breaks the UI.

uneven fiber
#

ok i guess i will just make the player invenotry big 🀞

kind hatch
#

It just overflows to where the next row would be.

fallow violet
uneven fiber
#

ight how does one add slots to a player inventory 🧐

fallow violet
#

nope

sullen dome
#

not at all

lethal python
sullen dome
#

it's straight up impossible

uneven fiber
#

what!

lethal python
#

it is : (((((((((

uneven fiber
#

disaster

fallow violet
#

yes

sullen dome
#

how would your client want to detect those extra slots to render them

#

if they don't exist in the base game

sullen dome
#

-_-

fallow violet
#

:>

uneven fiber
lethal python
#

yashboi make the inventory scrollable

sullen dome
#

you can't mess with stuff that is limited by the client

uneven fiber
#

code goes into complier box and commands work

lethal python
#

with pages

fallow violet
eternal oxide
#

An Inventory size can be defined when you create it. Multiples of 9. But those are custom Inventories not attached to objects. you have to manage opening them yourself

sullen dome
fallow violet
#

it does

sullen dome
#

imagine believing in things pff

fallow violet
#

woah :o

lethal python
#

that didn't fix my issue btw : (

fallow violet
#

sorry

lethal python
#

changing it to compile

wraith marsh
#

thanks

uneven fiber
sullen dome
uneven fiber
#

unfortunatley i tried this but it didn't work

fallow violet
#

xd

eternal oxide
#

54 is the max size. You could create a paginated Inventory (in code) but its not that easy to do

lethal python
#

hello

sullen dome
#

i mean, you can also just create 2 inventories, and then add an item to the last slot to switch to the second inventory

uneven fiber
#

does anyone know how many slots a player naturally has

#

its it 27?

kind hatch
#

28

sullen dome
#

36

kind hatch
#

counting the offhand

uneven fiber
#

🧐

uneven fiber
wraith marsh
#

9 * 4 + 1

sullen dome
#

46 then ig

#

i mean

lethal python
#

how 46 what

sullen dome
#

if you include crafting and armor

crisp steeple
#

36 + 1 + 4 + 4 + 1

uneven fiber
#

hmm ok then i will just add another 9

kind hatch
#

Oh sorry, 37 is the size

lethal python
#

crafting ;v

wraith marsh
#

crafting is not storable

uneven fiber
#

i overflowed da ting with 36!

wraith marsh
#

unless using a modified client

lethal python
#

shadow my problem not fixed ;(

sullen dome
#

that wasn't the question

crisp steeple
#

36 (inventory slots) + 1 (offhand) + 4 (crafting grid) + 4 (armor) + 1 (cursor)

eternal oxide
# uneven fiber

That code didn;t work because you forgot to cancel the event

#

It looks like you tried to override the player opening an inventory to open your own

kind hatch
uneven fiber
#

thanks elgarL you helped me yesterday too

sullen dome
uneven fiber
#

πŸ’‹

sullen dome
#

didnt know that

eternal oxide
#

You have to cancel the event else it will still open the inventory and close yours

kind hatch
#

It could be used for one yea.

crisp steeple
sullen dome
#

btw you forgot the crafting result field

kind hatch
sullen dome
#

-_-

crisp steeple
#

since the item isnt real yet

kind hatch
sullen dome
#

technically it is a slot

#

:/

crisp steeple
#

but it cant store anything

sullen dome
#

thats true

kind hatch
sullen dome
#

uhh

#

tf?

#

event.setCancelled(true);

crisp steeple
eternal oxide
uneven fiber
#

what!

sullen dome
#

faster hehe

uneven fiber
#

my bad

sullen dome
#

nope

spiral hinge
#

Hey so is there a way I can make the message with getLogger().severe() to be an exception? For whatever reason I cannot get it to work without errors

kind hatch
spiral hinge
quaint mantle
#

Exception#getMessage

#

right?

sullen dome
#

or #getStackTrace

#

dunno whats the difference

kind hatch
kind hatch
sullen dome
#

ah i see

#

so the message is just the first line basically

#

and the stracktrace is like 20+ lines

bright jasper
#

anyone got an OSS plugin that does custom entities from models?

#

Oraxen is only item and block atm

#

And the problem with modelengine is that it basically requires mythicmobs to run which i dont like

#

and itemsadder is severely limited in its java API

worthy yarrow
#

So I've been kind of spit balling here trying to make a custom teleport plugin where the functionality is to have a teleport request sent from playerA to playerB and where playerB has to then accept it for playerA to be teleported to playerB

#


import org.bukkit.plugin.java.JavaPlugin;
import static me.nuclearkat.customteleport.PlayerReceiver.playerb;

public final class CustomTeleport extends JavaPlugin {




    @Override
    public void onEnable() {
        System.out.println("Custom teleport plugin starting up!");
        getCommand("tpr" + playerb).setExecutor(new TeleportCommand());

    }



    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
#

This is my main class

#

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.UUID;

import static me.nuclearkat.customteleport.PlayerReceiver.playerb;

public class TeleportCommand implements CommandExecutor {



    static ArrayList<UUID> Player_UUIDs = new ArrayList<>();
    static org.bukkit.entity.Player Player;
    static UUID playerA = (getPlayerA().getUniqueId());
    static UUID playerB = (playerb.getUniqueId());

    public static org.bukkit.entity.Player getPlayerA() { return null;
    }



    @Override
        public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
            Player playerA = (Player) sender;
                if (sender instanceof Player){
                    if (playerA.hasPermission("customtp.teleport")){
                        if (getPlayerA().performCommand("tpr" + playerb.getUniqueId())){
                              playerA.sendMessage(ChatColor.DARK_AQUA + "You have requested to teleport to " + playerb + "!");


                            }







                    }


                } else {
                    playerA.sendMessage(ChatColor.DARK_RED + "You do not have permission to use this command!");

                }



        return false;
    }
}```
sullen dome
#

what the fuck

worthy yarrow
#

this is the playerA send request

sullen dome
#
getCommand("tpr" + playerb)```
what is `playerb`
worthy yarrow
#

one more class to send

keen star
#

hi

worthy yarrow
#


import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageRecipient;

import java.util.UUID;

import static me.nuclearkat.customteleport.TeleportCommand.*;

public class PlayerReceiver {


    static Entity playerb;
        UUID playerB = (playerb.getUniqueId());





    public static void messageReceiver(PluginMessageRecipient recipient, CommandSender sender) {
        Player playerB = (Player) recipient;
        Player messageSender = (Player) getPlayerA();
        Player_UUIDs.add(playerB.getUniqueId());


                    if (playerB.isOnline()){
                        playerB.sendMessage(ChatColor.DARK_AQUA + getPlayerA().getDisplayName() + "has requested to teleport to you!");

                        if (playerB.performCommand("tpa")){
                           getPlayerA().teleport(playerB);

                        } else if (playerB.performCommand("tpdeny")){
                            getPlayerA().sendMessage(ChatColor.DARK_AQUA + "Your teleport request to " + playerB.getDisplayName() + " has been denied!");


                        }

                    }





    }


}```
sullen dome
#

that's not how it works

keen star
#

how to make crops can't grow in bukkit?

worthy yarrow
#

this is where I define playerB

#

as well as add the functionality for playerB to accept the request

sullen dome
#

when sending the command, save both player's in a hashmap (the request sender as the key), then when the player accept's a request, do the teleport stuff

#

which you apparently already do

eternal oxide
#

static initializing Player object and then trying to use (while initializing)

keen star
sullen dome
#

what get's my mind blown is this

getCommand("tpr" + playerb).setExecutor(new TeleportCommand());```

i'm pretty sure he doesn't want to run `/tprplayername`
#

and if so, you would need to register a new command for every player

#

which would be dumb, and probably even impossible

worthy yarrow
#

Hmm

#

I was thinking this project would be a lot less complex than it is

#

and dont judge that line, I'm very new to the spigot api and java as a whole

sullen dome
#

you register a command with getCommand("baseCommand")

keen star
sullen dome
#

while basecommand is just the one after the /

worthy yarrow
#

yes

sullen dome
#

you don't register it with arguments

keen star
worthy yarrow
#

so how do i define baseCommand?

sullen dome
#

because he registered tprplayerb in his main

eternal oxide
#

This is never going to work```java
static UUID playerA = (getPlayerA().getUniqueId());
static UUID playerB = (playerb.getUniqueId());

public static org.bukkit.entity.Player getPlayerA() { return null;
}```
sullen dome
#

that's not his main problem lol

worthy yarrow
#

Like I said, new to the spigot api so just throwing ideas into code

eternal oxide
#

It is, it will NPE as soon as the class loads

sullen dome
#

lookup some command tutorial on yt ig

sullen dome
#

because of the tprplayerb command

eternal oxide
#

yes, everything is broken

worthy yarrow
#

It does enable, it just doesnt work as far as functionality goes

eternal oxide
#

due to design

sullen dome
#

tf?

#

show your plugin.yml please

worthy yarrow
#
version: '${project.version}'
main: me.nuclearkat.customteleport.CustomTeleport
api-version: 1.18
authors: [ NuclearKat ]
description: Custom player to player teleport command
commands:
  tpa:
  tpr:```
sullen dome
#

with this code and this yml file, your plugin shouldn't enable

worthy yarrow
#

Well it does

sullen dome
#

except you run a very old mc version which i dont know about

worthy yarrow
#

wdym old?

eternal oxide
#

With that code it will thrown an NPE at startup and disable

keen star
worthy yarrow
#

...

sullen dome
#

on enable, you register the command /tprplayerb

#

which isn't in the yml

#

which would straight up crash the plugin on startup

worthy yarrow
#

im not sure what to tell you

sullen dome
#

i suppose you want to have something like /tpr <playername>

worthy yarrow
#

Would that include the hash saving of player names?

sullen dome
#

then you would in your mainclass register it just with getCommand("tpr").setExecutor(WhateverExecutor());

worthy yarrow
#

as in saving the player name in a hash

#

so not just 2 people can use the command right?

#

give me a sec and i can think how to word this

#

So with the hash I do something that whenever playerA sends the request, the hash will save playerA and playerB's names, then if playerB accepts the command it will teleport playerA to playerB

#

Or would I even need to do that?

#

And I looked back through the console you were right, the plugin never enabled, but it showed up green when I did /pl

sullen dome
#

gimme a bit

worthy yarrow
#

Are you writing what will work?

sullen dome
#

i'll try

#

i don't accept friend requests

worthy yarrow
#

I wasnt sure if you'd be able to send messages to me or not, I'm tired and need to go to sleep

sullen dome
#

i'll just ping you in here

worthy yarrow
#

ok, is this channel active?

sullen dome
#

wdym active

worthy yarrow
#

do people talk here a lot

sullen dome
#

just check your discord mailbox lol

worthy yarrow
#

alright

#

Thank you by the way, if you figure it out you'd be teaching me a lot

sullen dome
#

@worthy yarrow

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player p) {
            if (args.length == 2) {
                if (args[0].equalsIgnoreCase("request")) {
                    if (Bukkit.getPlayer(args[1]) != null) {
                        Player target = Bukkit.getPlayer(args[1]);
                        map.put(p.getUniqueId(), target.getUniqueId());
                        p.sendMessage("Request sent.");
                        target.sendMessage("You got a teleport request from " + p.getName() + ". Accept with <whatever is your accept command>");
                    } else p.sendMessage("This Player doesn't exist, or isn't online.");
                } else if (args[0].equalsIgnoreCase("accept")) {
                    if (Bukkit.getPlayer(args[1]) != null) {
                        Player target = Bukkit.getPlayer(args[1]);
                        if (map.containsKey(target.getUniqueId())) {
                            target.teleport(p);
                            target.sendMessage("You were teleported to " + p.getName() + ".");
                            p.sendMessage(target.getName() + " was teleported to you.");
                            map.remove(target.getUniqueId());
                        } else p.sendMessage("You don't have any requests from this player.");
                    } else p.sendMessage("This Player doesn't exist, or isn't online.");
                } else p.sendMessage("Syntax: /tpr <request|accept> <player>");
            } else p.sendMessage("Syntax: /tpr <request|accept> <player>");
        } else sender.sendMessage("Please run this command as a player.");
        return false;
    }```

in your main, register it with ```getCommand("tpr").setExecutor(new YourCommand());```
and in your yml put ```yml
commands:
  tpr:
#

to be safe, remove the target from the map when they leave the server

worthy yarrow
#

Thank you I really appreciate it

tall dragon
#

would any1 here know of some kind of service that would let me visualize data through a rest api or something?, bassically like bstats but have your own charts, diagrams etc.

harsh totem
#

I use event.getEntity().getKiller() in EntityDeathEvent and it returns null when an denderman kills an endermite

#

tf?

harsh totem
chrome beacon
#

The event is. Get killer is for players only

harsh totem
#

ok so how do I get the enderman?

earnest forum
#

last damage cause

chrome beacon
#

^^

harsh totem
#

in EntityDamageEvent does event.getEntity() return the entity that got damaged or the entity that was damaging?

chrome beacon
#

?jd-s Please use the Javadocs

undone axleBOT
chrome beacon
#

(It's the damaged entity)

short raptor
#

InventoryClickEvent only fires for external inventories e.g. chests. What's an event with the same function, but for player inventory?

earnest forum
#

it does work on player inventory no?

chrome beacon
#

It should

earnest forum
#

check if the inventory is an instance of player inventory

#

i think thats an object

#

dont quote me on that tho

short raptor
#

It only works if I'm in a chest

chrome beacon
#

Make sure to listen to the drag event too

short raptor
#

If I just press e, the items are not deleted

#

But if I go into a chest then click the items, they are deleted

short raptor
chrome beacon
#

Because the click event isn't fired when you drag items around

earnest forum
#

u can check if the player has something in their hand

chrome beacon
short raptor
#

I don;t understand how the server would miss that

short raptor
#

Is there some mc feature I don't know about here lol

tender shard
chrome beacon
#

Hold left click and drag an item stack between slots

#

That way it splits the stack

short raptor
#

Oh that's called a drag event?

tender shard
#

if you move the mouse a bit on the same slot it's also a dragevent although its only one stack

short raptor
#

O ok I didn't know about that

short raptor
eternal needle
#

hi i think the plugin i have made does crash my server

bacus my server crash after som hours Pls help me

sullen dome
#

how should anyone help with this information

#

fix: remove your plugin

crimson terrace
#

how about you start by sending some errors it gives you when it crashes

sullen dome
#

that would be another idea

#

tho mine is more likely to fix it lol

crimson terrace
sullen dome
#

idk why

tender shard
#

there's the ?ask command for that

crimson terrace
#

i think there was something akin to ?nowork

tender shard
#

?notworking

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.

crimson terrace
#

XD

#

perfect

sullen dome
tender shard
sage goblet
#

anybody know how to add Claimblocks inside a Vote crate?

sullen dome
crimson terrace
#

we shall use it 20 times then

tender shard
sage goblet
#

I just wanna add like if a player opens a vote crate they can get 1000 claim blocks as a reward

#

and the other junk too. like swords and blocks etc

sullen dome
#

no one in here knows your plugin's code base

sage goblet
#

ExcellentCrates

dark arrow
#

Is there any entitydie event?

tender shard
#

EntityDeathEvent

sullen dome
#

i love such questions

tender shard
#

this channel is for coding your own plugins

dark arrow
#

Thanks i was able to find PlayerDeathEvent but could not enntity

sullen dome
#

most of the time they come from eclipse users, who don't know that ctrl+space exists lol

sage goblet
#

damn gg to you lot for coding ur own plugins

tender shard
sullen dome
#

for plugin-questions not related to coding

tender shard
#

yeah true but I doubt they'll get any useful answer there

dark arrow
tender shard
sullen dome
#

please add the tryitandsee command

#

or does it exist already

tender shard
#

?tryit

#

?tryitandsee

sullen dome
#

sad

#

add it

tender shard
#

suggest it on the forums

sullen dome
#

now

vocal cloud
#

?tas

undone axleBOT
tender shard
#

oh

sullen dome
#

tf

vocal cloud
#

Sadly it doesn't embed it

tender shard
#

tas is a weird command

sullen dome
#

who had that idea

#

tas

#

sounds like speedrun stuff

vocal cloud
#

It is speedrun stuff

sullen dome
#

i know

earnest forum
#

task assisted speedrun

#

basically plays the game for u lol

sullen dome
#

thanks sherlock

earnest forum
#

i think thats what it stands for

crimson terrace
#

try and see is more likely

sullen dome
#

basically baritone lol

vocal cloud
#

Tool assisted Speedrun

sullen dome
#

i love it when i cant join a discord server because it's full

#

1 million members... fuck my entire life

iron palm
#

Does PathFinderPetGoal class exist in mojang mappings?

tender shard
#

if it doesn't exist, then it simply has another name

iron palm
#

yeah and thats what im looking for

#

since i cant find it

#

also whats the name of EntityCreature in mojang mappings?

tender shard
#

to find it, I looked at the CraftFeature class and there you can see that it stores a PathfinderMob

#

basically you can find most of the proper NMS names by just looking at the corresponding CraftWhatever class

#

e.g. a NMS world is called ServerLevel. You can find that out by looking at CraftWorld. The second field stores a ServerLevel, so that's your NMS name

west crag
#

hey how can i any random spawnEntity after player breaking a block

crimson terrace
#

have a list with all entity types and randomly get one of them could be a solution

#

not sure if you can directly get a random entity type

#

oh nvm EntityType.values() and get a random index from 0 to length - 1

west crag
#

i mean from which method i can do this?

#

EntitySpawnEvent

#

this one?

crimson terrace
#

BlockBreakEvent I believe

west crag
#

but i cant able to do

crimson terrace
#

what have you tried?

west crag
#

there is no option to spawn any entity

crimson terrace
#

get the world the block is in and call spawnEntity

west crag
#

like this?

#

then call EntitySpawnEvent function?

crimson terrace
#

the EntitySpawnEvent is an event like the BlockBreakEvent which is called when an entity spawns.

you have to get the world from the location and then call the spawnEntity() method on the world in order to spawn a new entity

west crag
#

i didnt get what you are saying
get the world from the location?

#

can you please explain?

crimson terrace
west crag
#

ah...

tardy delta
#

i wish @Cleanup was an intellij annotation instead of a lombok one

summer scroll
#

what does that even do

tardy delta
#

inserts a try with resources iirc

#

@Cleanup Connection conn = getConn()

#

will be closed afterwards

summer scroll
#

well, it's a little bit useful

#

less curly brackets

wraith marsh
#

hey how can i turn this off

#

simple question, ive been looking for how to disable it, but nothing seemed to work

crimson terrace
#

you have to put in a @SuppressWarnings

wraith marsh
#

where?

eternal oxide
#

no

summer scroll
#

ignore it

eternal oxide
#

Thats an IDE warning not a code error

crimson terrace
#

or just check for null

eternal oxide
#

check for null, or add an assert statement. assert will be ignored at runtime

wraith marsh
#

so how do i make an assert statement instead of checking for null?

#

nvm

#

ill just check for null

eternal oxide
#

Either way you have to assign the value to a variable to be able to check it

wraith marsh
#

yeah

#

thanks

crimson terrace
#

when I'm sure it wont be null I just annotate the method

tardy delta
#

whats assert even doing?

crimson terrace
#

nothing

tardy delta
#

ah nice

crimson terrace
#

same thing as ObjectsRequireNonNull or whatever. never seen it do anything

eternal oxide
#

an assert is ignored at run time. during debug it stops the processing if it fails

wraith marsh
#

nvm the annotation doesnt work

#

just checking for null :)

crimson terrace
#

hold on, theres another

#

"ConstantConditions" Try this

wraith marsh
#

yes that works

#

thank you

crimson terrace
#

np

wraith marsh
#

can i disable it globally?

eternal oxide
#

probably

crimson terrace
#

i think module would be the one youre looking for

harsh totem
#

player.getInventory().setItem(7, null); why doesn't this remove a player's leggins?

crimson terrace
harsh totem
#

:trollface:

eternal oxide
harsh totem
#

wdym? it setItem(), shouldn't it update it automatically?

eternal oxide
#

call update() on the inventory

ivory sleet
#

requireNonNull is fail fast

crimson terrace
#

in terms of warnings that are shown in the ide i meant

ivory sleet
#

It can suppress "NullableProblems" inspection type iirc

#

so not totally useless

crimson terrace
#

in my experience it usually just makes the code less readable but it does suppress the single warning yeah

ivory sleet
#

Wut

#

how does it make code less readable

#

Like you usually call requireNonNull on incoming data such as on parameters

#

Or if you wanna lightly assert a variable won’t ever point to null at a certain point of time

crimson terrace
#

of course readability is relative, but it suggests it on a lot of things which usually make my if statements longer

ivory sleet
#

No readability is rather objective

#

Preference is subjective tho

crimson terrace
#

damn, theres no arguing with you is there XD

#

πŸ˜‚ πŸ˜‚ πŸ˜‚

#

you win

#

as revenge:

ivory sleet
#

Yeah well, when it comes to certain things I do stay up with it

#

Oh god

slim kernel
#

when I set a block to air how can I prevent that block from dropping what it was before?

slim kernel
#

I do this: location.getBlock().setType(Material.AIR) but the block that was in that location drops its item. How can I prevent that?

eternal oxide
#

it won't drop anythign when set to AIR

crimson terrace
#

that shouldnt be happening yeah

eternal oxide
#

it only drops if you do a breakNaturally

slim kernel
#

why there items then hmmm

crimson terrace
#

possibly another bit of your code or so?

slim kernel
#

ohhh its cause it breaks the blocks under the carpet first

#

and it drops before it gets set to air

#

thank you all

eternal oxide
#

use setType(Material.AIR, false)

#

I thknk thats the one

#

No physics updates so nothing attached should pop off

quaint mantle
#

can anyone tell me the difference between?

if(entityExplodeEvent.blockList().stream().map(Block::getType).toList().contains(Material.CHEST))

and

if(entityExplodeEvent.blockList().stream().map(Block::getType).collect(Collectors.toList()).contains(Material.CHEST))
summer scroll
#

The first one is immutable list and the second one is mutable list, cmiiw

slim kernel
tardy delta
#

an uuid is a varchar(36) right?

quaint mantle
tardy delta
#

ok

quaint mantle
#

b4c63faa-eedf-6f90-9ace-67abcfd00f7f

#

np

mortal hare
#

that would throw unchecked cast warning

river oracle
#

@SupressWarning ftw

tardy delta
#

i did SupressWarnings("all") once 😳

quiet ice
#

I do that all the time

ivory sleet
tardy delta
#

:(

#

you just summoned conclure

prime kraken
#

Hi team, i've one question, I have an InteractEvent on a door, I discover that door have two part x) on bottom part and one top part, how can i get this two part in my condition ?

tardy delta
#

hi team

#

kekw

river oracle
#

Spigot team

#

Yss

#

I am them

tardy delta
#

just found that on the forum

prime kraken
#

Yes I've already found that

tardy delta
#

why asking it then?

eternal oxide
#

if you have the Top you getRelative(BlockFace.DOWN) to get the other

tardy delta
#

java can be wonderful

eternal oxide
#

unchecked cast?

tardy delta
#

ye

eternal oxide
#

Yeah, its not that intelligent

eternal night
#

why wouldn't the method just take a parameter of type E

#

πŸ€”

tardy delta
#

wondering the same thing

eternal oxide
#

I wonder if thats just a stupid ide warn

#

You can get rid of the cast need with throws Throwable

#
public void sneakyThrow(Throwable t) throws Throwable {
    throw t;
}```
tardy delta
#

then you will have to add a try catch around that method

eternal oxide
#

no real need for the generics

#

You would have to anyway

ivory sleet
#

The throws E is needed to get rid of the try catch enforcement

eternal oxide
#

ah

tardy delta
#

using it like this

ivory sleet
#

Still a bit concerned why you use sneaky throws there

#

Just throw a new runtime exception that wraps the sql exception

tardy delta
#

cuz theres a cf wrapped around it which catches exceptions

#

that would do the same thing ye

clever musk
#

When will event handlers support type parameters?

tardy delta
#

wdym?

clever musk
#

Like this

#

if PacketEvent has type parameter of ClientboundUpdateTagsPacket, then I shouldn't have to use an if instanceof statement

#

It just seems dumb

ivory sleet
#

What does e::getPacket return?

tardy delta
#

just do PacketEvent<?>

clever musk
#

the packet object, type ClientboundUpdateTagsPacket

ivory sleet
#

Myeah no need to check for instanceof then?

clever musk
#

No I do

#

because the event fires for other packet types

#

even if the type parameter is ClientboundUpdateTagsPacket

ivory sleet
#

Oh

clever musk
#

Is that a bug?

ivory sleet
#

Might wanna ask retrooper about that then

#

But fyi bukkits system doesn’t support it by default

clever musk
#

Aw

ivory sleet
#

You’d have to register a custom event executor

clever musk
#

Great....

#

Okay

tardy delta
#

love how clean it is

river oyster
#

What make org.spigotmc.minecraft-server.jar in maven local?
I've tried BuildTools and Spigot maven install but either didn't make it.

eternal oxide
#

minecraft-server.jar is not a spigot product

tardy delta
#

you either get the minecraft-server.jar (vanilla server) via the minecraft launcher or you get the spigot server jar via buildtools

midnight shore
#

Just a question what’s CLASS::new ?

tardy delta
#

a supplier

#

or a runnable

#

Supplier<MyClass> s = MyClass::new

#
new Supplier() {
  @Override MyClass get() {
    return new MyClass();
  }
}
#

discord hates me lol

crisp steeple
#
  • you can do @SupressWarnings(β€œunchecked”) or whatever it’s called
tardy delta
#

i've never heard of the Generic<T> class

twilit roost
#

BungeeCord
How to get Offline Player without using Mojang API ?

eternal oxide
#

There is no such thing as an OfflinePlayer in Bungeecord

twilit roost
#

Ye I found that
But is there some option to get somehow from Servers under Proxy those players?

tacit drift
#

Have a plugin on the spigot server

eternal oxide
#

You could use PMC to query each server

twilit roost
#

ok imma try

#

thx

eternal oxide
#

Whats the reason for this? It sounds like you are viewing things backwards

bold copper
#

hi, please tell me if there is a method in Spigot that returns a list of the names of all players on the server?

tardy delta
#

nope

eternal oxide
#

Bukkit.getOnlinePlayers()

crisp steeple
tacit drift
#

get list of all online players, go thru it and store names in another list

#

no actual method just for that

tardy delta
#

Set<String> playernames = Bukkit.getOnlinePlayers().stream().map(Player::getDisplayName).collect(Collectors.toSet())

quaint mantle
#

any ways to set custom texture?

#

also hi forutenn

tardy delta
#

idk if theres a Player::getName

quaint mantle
#

and elgarl

tardy delta
#

hi

tacit drift
fallow violet
#

it is

eternal oxide
#

probably `Bukkit.getOnlinePlayers().stream().map()...
Fourteen beet me to it

tacit drift
#

DisplayName is a nick pretty much

tardy delta
#

ha

quaint mantle
#

how do I send a message?

bold copper
fallow violet
twilit roost
tardy delta
#

i would say keep track of the joining and leaving players and add their name in a collection

quaint mantle
fallow violet
#

?

tardy delta
#

@fallow violet ur very fluffy uwu

fallow violet
#

thanks

tacit drift
twilit roost
#

It also contains moderation tools

tacit drift
#

And, the in game ranks are from a perms plugin right?

twilit roost
#

yes

quaint mantle
#
  public static ItemStack makeSkullItem(String displayname, String owner, int amount, String... lore) {
        ItemStack item = new ItemStack(Material.SKULL_ITEM, amount, (short) 3);
        SkullMeta meta = (SkullMeta) item.getItemMeta();
        meta.setOwner(owner);
        meta.setLore(Arrays.asList(lore));
        meta.setDisplayName(displayname);
        item.setItemMeta(meta);

        return item;
    }```
any way to add custom skull texture here?
quaint mantle
tacit drift
#

you don't need the actual player/offlineplayer every time to check their ranks

twilit roost
#

imma get it on Server Start

fallow violet
bold copper
#

I don't know yet how often it will be called

tacit drift
#

Yeah if it's for args it should be updated every time it's needed

tardy delta
#

i would keep track of all the player names of the server

quaint mantle
#

anyone help pls

tardy delta
#

and add/ remove when someone joins our leaves

fallow violet
quaint mantle
#

there is a cockroach under my leg

#

do I step on it

tardy delta
#

a what

quaint mantle
#

cockroach

fallow violet
tardy delta
#

dont want to translate that

quaint mantle
#

wat

fallow violet
tacit drift
quaint mantle
#

u havent seen a cockroach

#

?

bold copper
tacit drift
#

stop overcomplicating things

quaint mantle
#

how 2 add custom head textures

#

or skull textures

fallow violet
#

with a SkullMeta

#

You cast your ItemMeta to a SkullMeta and set the Owener

quaint mantle
#

like

#

no no

#

I give an id

#

thing

tacit drift
#

@twilit roost so, i've looked thru luckperms api, you can store user uuid in a database with their discord id and when needed, u can check their perms by creating a User object from their UUID

fallow violet
quaint mantle
#

there arent even videos about it

#

aaaa

quaint mantle
twilit roost
#

oooh
that would be helpfull
Please link

quaint mantle
#

texture id?

tacit drift
twilit roost
tacit drift
twilit roost
#

thx my man

#

I was starting to develope PMC

fallow violet
quaint mantle
#

tf

twilit roost
#

yes you can

#

imma send it

#

gimme a minute

fallow violet
#

oh no way

fallow violet
twilit roost
#
    public static ItemStack getCannonBall(){
        String url = TextureConfigManager.getConfig().getString("cannonBallTextureURL");
        ItemStack head = new ItemStack(Material.PLAYER_HEAD);
        if (url.isEmpty()) return head;

        SkullMeta skullMeta = (SkullMeta) head.getItemMeta();
        GameProfile profile = new GameProfile(UUID.randomUUID(), null);

        profile.getProperties().put("textures", new Property("textures", url));

        try {
            Method mtd = skullMeta.getClass().getDeclaredMethod("setProfile", GameProfile.class);
            mtd.setAccessible(true);
            mtd.invoke(skullMeta, profile);
        } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) {
            ex.printStackTrace();
        }

        head.setItemMeta(skullMeta);
        return head;
    }
#

this is what i used

#

replace url with url for the texture

fallow violet
#

its working?

twilit roost
#

yep

fallow violet
#

holy shit nice

quaint mantle
#

bro

#

idk how to explain

#

a

#

like

fallow violet
#

then i cannot help you

#

write in a full sentence please

twilit roost
#

^

quaint mantle
#

u use this "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDhiZWUyM2I1YzcyNmFlOGUzZDAyMWU4YjRmNzUyNTYxOWFiMTAyYTRlMDRiZTk4M2I2MTQxNDM0OWFhYWM2NyJ9fX0=:

#

to add

#

ikd

#

ASPAS

#

like

fallow violet
#

im more confused right now

quaint mantle
#

custom skull texture

#

dis video

#

thing

fallow violet
#

now we are getting soemthing

twilit roost
# tacit drift

it looks like it will work only for Spigot tho
so PMC will still come in handy

#

imma send website for u

fallow violet
#

so whats the problem? @quaint mantle

quaint mantle
#

how do I make that thing

#

like in the code

twilit roost
quaint mantle
#

my code is given above

fallow violet
#

the hash?

tacit drift
#

they do have a bungee plugin

#

you shouls go on their discord and ask

twilit roost
#

you should be able to upload custom texture

twilit roost
fallow violet
#

he literally explaing how

#

5:20

quaint mantle
#

5:20

fallow violet
#

5:10 actually

#

So whats the problem?

quaint mantle
#

ok

#

idk where to add it

fallow violet
#

oh

#

watch a bit more

#

da fuq?

quaint mantle
#

wat

fallow violet
#

watch the tutorial

#

so you know what to do

quaint mantle
#

I tried doing it

#

idk

fallow violet
#

Bro

#

He is explaining everything

#

Just watch it and understand it

quiet ice
fallow violet
#

^

quaint mantle
#

AND THE ENITRE CODE JUST COMIITED DIE

quiet ice
#

?jd-s

undone axleBOT
quaint mantle
#

but

fallow violet
#

no but

quaint mantle
#

I want only the head thing

#

wait

#

can I do String

#

I forgot

fallow violet
#

huh?

#

You are so confusing bro

quaint mantle
#

String Preofix

fallow violet
#

idk just do it

quaint mantle
#

can I use this

#
 public static ItemStack makeSkullItem(String displayname, String owner, int amount, String... lore) {
        ItemStack item = new ItemStack(Material.SKULL_ITEM, amount, (short) 3);
        SkullMeta meta = (SkullMeta) item.getItemMeta();
        String idTag;
        String prefix = ""
        meta.setOwner(owner);
        meta.setLore(Arrays.asList(lore));
        meta.setDisplayName(displayname);
        item.setItemMeta(meta);```
#

and yes

#

there is a } brloe

#

below

#

forgot to enter it

fallow violet
#

okay?

quiet ice
#

that is not how you do it

quaint mantle
#

will this work?

#

ah

quiet ice
#

okay

quaint mantle
#

wat

quiet ice
#

Use the player profile API if you are using 1.17

river oracle
#

Uhm display name lol

quiet ice
#

And if you are using 1.12, get the fuck out

quaint mantle
fallow violet
quaint mantle
#

wait

river oracle
quiet ice
quaint mantle
#

HEHEHHEHEH

river oracle
#

Bruh good luck

tardy delta
#

lmao

quiet ice
#

No support given given that you NEED to use NMS with these versions

quaint mantle
#

thanks

quiet ice
#

Protip: Use mojang's GameProfile API

quaint mantle
#

no no

#

I just

#

nvm

quiet ice
#

There is not but, you need to use it

quaint mantle
#

but tho

#

I wanted

#

not a player head texture

#

a mob texture

#

entity

fallow violet
#

okay dude. Can you write in one sentence what do you want and whats the problem?

quaint mantle
#

a custom mob head texture

fallow violet
#

do you mean as a skul?

quaint mantle
#

not a player head thing

river oracle
#

There are prob skins online you can 7se the base64 idk if it works in 1.8 tho so that's a use problem

river oracle
#

Yea just find a skin and use the base64

fallow violet
#

make a skull and then put it on the mob

fallow violet
quaint mantle
#

how tho

#

any tuts

river oracle
#

Idk I don't use 1.8 that's a you problem

fallow violet
#

go on youtube maybe i cannot help with that

humble tulip
#

what version was pdc added?

quaint mantle
#

I tried

chrome beacon
river oracle
tardy delta
#

1.14?

#

oh

humble tulip
#

ok ty

fallow violet
#

what is pdc xd

tardy delta
#

?pdc

fallow violet
#

ah i know that

quaint mantle
#

the entire time

#

πŸ”«

fallow violet
#

xd

#

he is stalking us

quaint mantle
#

meta.setOwner(owner);

#

wat does this do

fallow violet
#

you can set the owner of the skull to get the player head texture

quaint mantle
#

hm

river oracle
#

I'd reccomend using base64 string tho

quaint mantle
#

how

#

im nub

tardy delta
fallow violet
#

woah

#

stalker

fallow violet
#

the

#

tut

quaint mantle
#

am I the only one who has a phone

#

as a second mointor

#

?

fallow violet
#

nope?

quaint mantle
#

ok

fallow violet
#

i have my ipad as the 3 screen

quaint mantle
#

phone is different

#

from ipad

#

phone not expensive

#

ipad life savings

tacit drift
fallow violet
quaint mantle
#

for 13 hours

fallow violet
#

:>

quaint mantle
tacit drift
#

You know that

quaint mantle
#

my mom was about to disown me

tacit drift
#

there are

#

electronic disposal centers

quaint mantle
#

wat dat

fallow violet
tacit drift
#

and from there you can get old stuff

#

that people don't need

quaint mantle
#

I live in a village

#

with 1 fps brain and internet

eternal oxide
#

Don't go Apple and save yourself 70%

quaint mantle
#

wat

fallow violet
quaint mantle
#

ah

#

so even knuffeilger

#

is lurking

fallow violet
#

no

#

im writing active

chrome beacon
#

I'm always lurking :)

fallow violet
#

da fuqqq

quaint mantle
#

no one saw anything

#

πŸ”«

chrome beacon
#

Why'd you ghost ping him

fallow violet
#

stalker alert

faint harbor
#

Is there a way to remove the plugin namespace before a command for my plugin specifically

#

instead of having to disable it for the entire server

chrome beacon
#

Why do you need that

fallow violet
eternal oxide
#

If you are replacing an already existing command you can replace it in teh command map

#

Not recommended, but you can

faint harbor
#

Its just that my command matches the plugin name, and I've seen other plugins do it before

#

its mostly for asthetics

quaint mantle
#

are u a he

#

or a she

#

?

fallow violet
#

why?

quaint mantle
#

πŸ”«

fallow violet
#

o.o

quaint mantle
#

tell

fallow violet
#

I am a Boeing AH-64 Apache

dense falcon
#
    private static void InteractShop(Player plr, Action action, ItemStack item) {
        if (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) {
            Inventory ShopGUI = Bukkit.createInventory(null, 18, "Shop");

            ItemStack tnt_item = UtilsItem.createItem(Material.TNT, 1, "Explosion");
            tnt_item = UtilsItem.addItemFlag(ItemFlag.HIDE_ENCHANTS, tnt_item);
            tnt_item = UtilsItem.addEnchant(Enchantment.ARROW_DAMAGE, 1, tnt_item);

            ShopGUI.setItem(1, tnt_item);

            plr.openInventory(ShopGUI);
        }
    }

    public static void init(PlayerInteractEvent event) {
        Player plr = event.getPlayer();
        Action action = event.getAction();
        ItemStack item = event.getItem();

        if (item != null && item.getType() == Material.IRON_AXE) {
            InteractIronAxe1(plr, action, item);
        } else if (item != null && item.getType() == Material.DIAMOND_SWORD && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equalsIgnoreCase("Epee cheat")) {
            InteractEpeeCheat(plr, action, item);
        } else if (item != null && item.getType() == Material.CHEST && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equalsIgnoreCase("Shop")) {
            if (item instanceof ItemStack) {
                InteractShop(plr, action, item);
            }
        }
    }
``` How can I check if the chest was created with a plugin and no a normal craft?
quaint mantle
#

my brain is running at 2 fps

quaint mantle
fallow violet
#

ew

quaint mantle
#

u said that ho

#

tho

fallow violet
#

you will never get help from me again

quaint mantle
#

no

#

pls no

#

:sad:

#

hi earl

eternal oxide
#

Shh, no spam while there are active questions

quaint mantle
#

oh

#

ok

quaint mantle
fallow violet
#

no

eternal oxide
quaint mantle
#

@fallow violet why u like dis

#

D:

dense falcon
#

Like hide enchants?

chrome beacon
eternal oxide
#

ItemMeta is not persistent, so long as you are using it right away

#

else use PDC

dense falcon
#

PDC ?

chrome beacon
#

?pdc

eternal oxide
#

?pdc

quaint mantle
#

tf is pdc

quaint mantle
#

bro im a boomer

tardy delta
#

lmao

dense falcon
#

Ah.

#

But, how can I check it?

eternal oxide
#

the same as setting it

#

you check to see if your flag in there

faint harbor
# eternal oxide Explain better

Tab complete shows /plugin:command and /command because the plugin name is similar to the command. It is possible to disable this for the whole server, but I would like to do it for my plugin only. The plugin will be used on a private server, so I don't particularly care about convention.

tardy delta
#

i sent you a link how to use the event api yesterday

eternal oxide
#

When placed a Chest also has a TileState so it also has a PDC. you can transfer that to the block once placed

dense falcon
eternal oxide