#help-development

1 messages ยท Page 2066 of 1

tall dragon
#

but the player is

#

and the player get damaged

#

not the block

pale pendant
#

oh, in the current file it makes a error (which is the main plugin java class) but in the listener it doesnt make an error

grim ice
#

a player is an entity

#

lol

pale pendant
#

its this

#

i need to add org.bukkit.plugin.PluginManager?

tall dragon
#

no?

pale pendant
#

oh

tall dragon
#

it should work fine if your listener class implements Listener

#

and the second parameter extends JavaPlugin

craggy lichen
#

how do I check if damage cause/damager is sweet berry bush then

pale pendant
tall dragon
#

well ur registering in ur main class right?

pale pendant
#

yes

tall dragon
#

so just use this like you already are

#

that should work

pale pendant
#

alright

#

also it is registered in the main class

tall dragon
visual tide
hardy crystal
#
[INFO] ------------< org.golde.bukkit.corpsereborn:CorposeReborn >-------------
[INFO] Building corpose reborn 3.0 BETA 1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ CorposeReborn ---
[INFO] Deleting C:\Users\manfr\Desktop\intellij idea\corpose reborn\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ CorposeReborn ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ CorposeReborn ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 68 source files to C:\Users\manfr\Desktop\intellij idea\corpose reborn\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/manfr/Desktop/intellij idea/corpose reborn/src/main/java/org/golde/bukkit/corpsereborn/nms/nmsclasses/NMSCorpses_v1_18_R2.java:[61,61] cannot access net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo.PlayerInfoData
  bad class file: C:\Users\manfr\.m2\repository\org\spigotmc\spigot\1.16.5-R0.1-SNAPSHOT\spigot-1.16.5-R0.1-SNAPSHOT.jar(/net/minecraft/server/v1_16_R3/PacketPlayOutPlayerInfo$PlayerInfoData.class)
    bad RuntimeInvisibleParameterAnnotations attribute: PlayerInfoData(com.mojang.authlib.GameProfile,int,net.minecraft.server.v1_16_R3.EnumGamemode,net.minecraft.server.v1_16_R3.IChatBaseComponent)
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------```
#

Pls help me

pale pendant
tall dragon
pale pendant
#

what supposed do i needed to do?

#

beacuse it is registered and its making the same

tall dragon
#

?paste

undone axleBOT
tender shard
sacred mountain
#

is there a difference between

public record MyListener(MyPlugin plugin) implements Listener {}

and

public class MyListener implements Listener {
  private final MyPlugin plugin;
  public MyListener(MyPlugin plugin) {
    this.plugin = plugin;
  }
}```
pale pendant
tall dragon
#

yea

tender shard
#

that's just

#

disgusting

tall dragon
sacred mountain
#

i havent changed it

tender shard
pale pendant
#

oh yeah intellij added it i think

tall dragon
#

well thats bad

sacred mountain
#

i dont even know how they work lo

tender shard
tall dragon
sacred mountain
#

thats why i asked here

tender shard
sacred mountain
#

o

pale pendant
tall dragon
#

:)

tender shard
#

furry, don't make your listeners records
alanek, only extend javaplugin once
lol

sacred mountain
#

stop calling me furry i stg

tender shard
#

no

tall dragon
#

. @tender shard maybe u know dis?

tender shard
#

full stacktrace pls ๐Ÿ™‚

tall dragon
# tender shard full stacktrace pls ๐Ÿ™‚
Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.acentramc.clans.ClanSystem.<init>(ClanSystem.java:39)
    at com.acentramc.clans.Bootstrap.main(Bootstrap.java:11)
Caused by: java.lang.IllegalArgumentException
    at com.google.gson.internal.$Gson$Preconditions.checkArgument($Gson$Preconditions.java:46)
    at com.google.gson.GsonBuilder.registerTypeAdapter(GsonBuilder.java:526)
    at com.acentramc.clans.util.GlobalGson.<clinit>(GlobalGson.java:17)
    ... 2 more
#

its not a plugin btw

#

standalone application

tender shard
#

what's your Gson version?

quaint mantle
#
public class BanInventoryListener implements Listener {

    @EventHandler
    public void onMenuClick(InventoryClickEvent e) {

        Player player = (Player) e.getWhoClicked();

        if (e.getView().getTitle().equalsIgnoreCase(ChatColor.BLUE + "Player List")){

            if(e.getCurrentItem() == null) {
                return;
            }

            if (e.getCurrentItem().getType() == Material.PLAYER_HEAD){

                Player whoToBan = BanGUI.getPlugin().getServer().getPlayerExact(ChatColor.stripColor(e.getCurrentItem().getItemMeta().getDisplayName()));

                if(whoToBan == null) {
                    return;
                }

                BanMenuUtils.openPlayerMenu(player, whoToBan);
            }

        } else if(e.getView().getTitle().equalsIgnoreCase("Ban This Player")){
            switch(e.getCurrentItem().getType()){
                case BARRIER:
                    BanMenuUtils.openBanMenu(player);
                    break;
                case WOODEN_AXE:
                    //Get name
                    String name = e.getClickedInventory().getItem(4).getItemMeta().getDisplayName();
                    player.getServer().getBanList(BanList.Type.NAME).addBan(ChatColor.stripColor(name), "Banned by A Moderator.", null, null);
                    player.sendMessage(ChatColor.GREEN + "Banned Player");
                    break;
            }
        }
        e.setCancelled(true);
    }


}
``` this code doesnt throw any errors but it doesnt work
tall dragon
tender shard
tall dragon
#

is it outdated again? xd

tender shard
#

you pass a .class (Class object) to the second argument of registerTypeAdapter

#

but it should be an instance of the class that deserializes your object

#

e.g.
.registerTypeAdapter(String.class, new MyStringDeserializer())

tall dragon
#

omfg

#

ur right

#

im so stupidddd

tender shard
#

lol it can happen

tall dragon
#

i have been cracking my head on this for 2hours

tender shard
#

lol

#

but you also decided to ping me, so you got that going ๐Ÿ˜„

#

(tbh I only googled registertypeadapter illegalargumentexceptiona and read the first stackoverflow answer lmao)

tall dragon
#

i was desperate YEP

plush gulch
#

I want to have a custom snowball which does something when it hits entities and that works fine, but I have to check if its my custom snowball which hit the entity by checking the main hand of the player who threw it, which doesn't work if it's the last one or they switch hands before it damages the entity.

Any other way to check wether the snowball hitting the entity is my own custom one?

tall dragon
#

well programming is bassicaly just being a professional googler some people say

tender shard
#

that's at least part of it

#

everyone who says otherwise is just too vain to admit it

tall dragon
#

agreed

vocal cloud
#

There's two types of programmers those that google when they need it and liars

tender shard
#

exactly

#

oh there's a third kind

#

those that google everything and only copy paste

vocal cloud
#

That's a script kiddy

tender shard
#

I mean copy paste is totally fine, if you unterstand what you copy

plush gulch
#

guys don't spam please I want my question answered

tall dragon
#

sowwy

vocal cloud
#

Write custom data to the PDC

tender shard
deft forum
#

Hi!
i'm working on a multiverse core plugin
and i'm have trouble by stopping the server and starting again.
because it forgot all of the worlds made by the plugin
(they are still in the folder)
(im using WorldCreator)

tender shard
# plush gulch ok, thanks

basically I'd do sth like this

@EventHandler
    public void onSnow(ProjectileLaunchEvent event) {
        Player player = (Player) event.getEntity().getShooter(); // Check before casting, ofc
        if(!isMyCustomSnowball(player.getInventory().getItemInMainHand())) return;
        event.getEntity().getPersistentDataContainer().set(new NamespacedKey(myPlugin,"this is my custom snowball lol"), PersistentDataType.BYTE, (byte) 1);
    }
#

then you can later check for this PDC tag

tender shard
#

you will definitely not need a database, just use a yaml file

deft forum
#

okay

#

then how do i load it?

deft forum
vocal cloud
#

The name of the folder so you can easily grab it

deft forum
#

but how do i load it!?

vocal cloud
#

Good question

tender shard
tender shard
deft forum
#

the world

tender shard
#

Bukkit.createWorld

#

just pass the same name again

deft forum
#

what

tender shard
#

Bukkit.createWorld

Creates or loads a world with the given name using the specified options.

#

682 ๐Ÿ˜›

deft forum
#

jeez

#

how can you code with light theme?

young knoll
#

Them newlines

tender shard
#

by typing

deft forum
#

oh
i understand xd

pale pendant
#

i have another problem when the server tries to load the plugin

tender shard
#

EventHandler methods obviously only take exactly ONE event

#

and not an event and a player

deft forum
#

you have something wrong with events

tender shard
#

you have to get the player from the event

young knoll
#

You know

pale pendant
#

oh, how?

young knoll
#

Back in my day dark theme didnโ€™t exist

tender shard
# pale pendant i have another problem when the server tries to load the plugin
    @EventHandler
    public void onEdwardSnowden(ProjectileHitEvent event) {
        if(event.getEntity().getPersistentDataContainer().has(new NamespacedKey(myPlugin, "this is my custom edward snowden ball lol"), PersistentDataType.BYTE)) {
            // This is my custom Edward Snowden ball
        }
    }

this is correct ^

    @EventHandler
    public void onEdwardSnowden(ProjectileHitEvent event, Player player) {
        if(event.getEntity().getPersistentDataContainer().has(new NamespacedKey(myPlugin, "this is my custom edward snowden ball lol"), PersistentDataType.BYTE)) {
            // This is my custom Edward Snowden ball
        }
    }

this is not good ^

vocal cloud
#

When you're squinting from a hangover light theme becomes dark theme

pale pendant
#

oh alright

#

if its PlayerQuitEvent pqe i need to do Player player = pqe.getPlayer();?

#

beacuse i have it like that

pale pendant
#

oh wait

tender shard
#

just call your event "event"

#

and not "pqe" lol

pale pendant
#

its from another listener

#

yeah didnt notice

tender shard
#

yes but "pqe" is also a bit weird ๐Ÿ˜„

#

just go for "event" and done

pale pendant
#

pqe is for "player quit event"

#

first letters from the words

tender shard
#

I know

vocal cloud
#

It's better to just name it event. You know what method it's in and what it's full name is

tender shard
#

This is how da real pros do it

    public void onEvent(Event event) {
        if(event instanceof PlayerJoinEvent pje) {
            // do PlayerJoinEventStuff
        } else if(event instanceof PlayerQuitEvent pqe) {
            // do PlayerQuitEventStuff
        } else if ...
    }```
vocal cloud
#

Man I think it was JDA I used to do that back in 1.0 days

tender shard
#

lol

#

I don't know how it used to work 5 years ago, I only know that today JDA uses by overriding methods per event

sonic cosmos
hardy crystal
#

?paste

undone axleBOT
hardy crystal
tender shard
#

configurationSection.getKeys(boolean)

hardy crystal
#

pls help me

tender shard
sonic cosmos
tender shard
vocal cloud
tender shard
pale pendant
tender shard
young knoll
#

Youโ€™d have to get the shooter of the bottle

sonic cosmos
tender shard
#

get the entity, then get the thrower

pale pendant
#

yeah thats why

tender shard
sonic cosmos
pale pendant
#

but idk how to get the entity then the thrower

tender shard
hardy crystal
tender shard
#

use getKeys(false)

#

getKeys(true) returns this:

  • ironSword.slot
  • ironSword.type
    etc
sonic cosmos
#

a

tender shard
#

getKeys(false) returns this:
ironSword
diamondSword

quaint mantle
#

How do I choose the right jdk version in .bat?
I have 3 different versions of jdk installed

sonic cosmos
#

thanks!

tender shard
#

e.g. C:\Program Files\Java\jdk1.8\bin\java.exe ...

quaint mantle
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.

quaint mantle
#

@royal oxide OFF
chcp 1251 > nul
Title Paper
C:\Program Files\Java\jdk-16.0.2\bin -Dfile.encoding=cp1251 -Xmx1G -jar Paper-1.16.5.jar

tender shard
#

and what exactly "not worked"?

#

you have a space in Program and Files

#

also

#

you only provided the path to the bin folder

quaint mantle
#

They won 't start at all

young knoll
#

You need the path to the executable, not just the bin

tender shard
#

you obviously have to provide a path to the java.exe file

young knoll
#

And I believe you need to use โ€˜ โ€˜ if you have a space

quaint mantle
#

Okay

#

Thanks

quaint mantle
#

C:\Program Files\Java\jdk-16.0.2\bin\java.exe?

tender shard
#

"C:\Program Files\myjava\bin\java.exe" -jar myjar.jar

tender shard
quaint mantle
#

not worked(

hardy crystal
#

this is my plugin

quaint mantle
#

A

hardy crystal
#

i can use it?

tender shard
#

yes

#

you can use it

#

you must use it

quaint mantle
#

Yes, it worked, thank you very much

hardy crystal
#

ah ok

tender shard
#

you must it use it to access this weird PlayerInfoPacket class

#

idk why but javac has problems with that class

undone axleBOT
hardy crystal
tender shard
#

basically update the version of plexus compiler in the pom

pale pendant
#

how do i get the entity when i have a expbottleevent event?

tender shard
#

what entity?

#

the xp bottle?

wild nexus
#

Hi, i need help, i search a way to block a craft of an item if the player doesn't have a permission but i can't get the player with the event PrepareItemCraftEvent

tender shard
#

get the inventory

#

then get the viewers

#

it'll only return one viewer

#

and that's the player

pale pendant
wild nexus
#

Viewer is always return the player ?

pale pendant
#

actually

tender shard
pale pendant
#

yeah

deft forum
tender shard
#

that's fine

#

but you can also

noble lantern
#

wait

tender shard
#

do something like

noble lantern
#

global thats a reserved java keyword

#

iirc

tender shard
#

String[] groups = {"owner","dev",...}

#

then loop over it

pale pendant
#

getEntityType?

#

or..

tender shard
#

yes but you don't have to write everything twice

tender shard
#

just checked, global is not a keyword

noble lantern
pale pendant
#

getEntityType? or what?

tender shard
#

XP bottle is a "projectile"

#

so

pale pendant
#

oh

tender shard
#

getThrower() on the XP bottle

young knoll
#

getShooter()*

tender shard
#

oh

#

yes

#

sorry

#

getShooter it is

#

getThrower is for Items

wild nexus
pale pendant
#

nothing isnt assigned

#

beacuse it makes red

pale pendant
#

Cannot resolve method 'getShooter' in 'ExpBottleEvent'

noble lantern
#

not the event

pale pendant
#

oh yeah-

hardy crystal
pale pendant
#

get entity then get shooter?

tender shard
#

yes, as I already explained

pale pendant
#

i dont know how tho

tender shard
#

?learnjava

undone axleBOT
hardy crystal
tender shard
# pale pendant i dont know how tho

for real, I explained it to you in detail

@EventHandler
    public void onXpBottle(ExpBottleEvent event) {
        Player thrower = (Player) event.getEntity().getShooter();
    }
#

obviously check before casting

hardy crystal
tender shard
#

do you have "lombok" as dependency in your pom.xml?

pale pendant
#

i just searched up random stuff on google and found this

pale pendant
#

to use

hardy crystal
#

?paste

undone axleBOT
hardy crystal
maiden thicket
#

whats plexus-compiler-eclipse

tender shard
tender shard
pale pendant
#

yeah but diffrent way

tender shard
#

no

young knoll
#

Now check and cast ProjectileShooter to player

tender shard
#

for real, learn java, this is just a waste of my time

pale pendant
#

alright

maiden thicket
#

u have ur dependencies in ur plugins it seems

hardy crystal
#

how can i resolve

#

is very strange

tender shard
#

send the FULL maven error log pls

#

click the uppermost thing there

hardy crystal
#

yes yes

tender shard
#

then paste the full log

hardy crystal
deft forum
tender shard
wild nexus
tender shard
hardy crystal
#

for my server

deft forum
#

mfnalex how do i set the world to server?

hardy crystal
#

i basicaly doesn't use nms

tender shard
deft forum
#

i made what you said

#

config

#

yml

tender shard
wild nexus
tender shard
deft forum
#

you know you told me how to recover back the worlds

#

i'm done with saving the names into a yml file

tender shard
#

what does your yaml look like

deft forum
#
asd: 0
hello: 0
xd: 0

๐Ÿ˜„

tender shard
#

why 0?

deft forum
#

idk

tender shard
#
worlds:
- asd
- hello
- xd
#

then getConfig().getStringList("worlds");

deft forum
#

how do i set it as a string list?

deft forum
tender shard
#

List<String> list = new ArrayList<>();
list.add("asd");
list.add("hello");
getConfig().set("worlds",list);

deft forum
#

oh yes

#

thanks

hardy crystal
tender shard
#

run buildtools.jar --rev 1.18.2 --remapped

#

the other error is fixed now as it seems

hardy crystal
tender shard
#

run the first command in that post

tender shard
#

so, please read the above blog post

#

you can ignore all the pom.xml stuff in that post

#

just run the first command from that blog post

tender shard
#

that won't do anything

#

you have to let maven handle your dependencies

#

just

#

RUn

#

the

#

command

deft forum
#

mfnalex how do i add it to the server

#

i made it with arraylists

hardy crystal
#

ah ok

vivid cave
#

Hello, I want to extract the HEAD 2d image (from front) of a player's minecraft skin image;
I could find the image thanks to PlayerProfile.textures,although i'm unsure where is the head in all that parts; is there maybe an easier way?

#

or i guess i should crop the image to a specific area (to extract only the head from front)?
I know there is two types of skin: slim & normal, where should i crop the 8x8 area representing the head? and i guess i should also extract the hat layer and put it on top?

hardy crystal
#

yes

#

YES

#

i finaly fix it

tender shard
hardy crystal
# tender shard by running the buildtools command I've been sending to you three times? :p

deleting this: <plugin> <groupId>net.md-5</groupId> <artifactId>specialsource-maven-plugin</artifactId> <version>1.2.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-obf</id> <configuration> <srgIn>org.spigotmc:minecraft-server:1.18-R2.1-SNAPSHOT:txt:maps-mojang</srgIn> <reverse>true</reverse> <remappedDependencies>org.spigotmc:spigot:1.18-R2.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies> <remappedArtifactAttached>true</remappedArtifactAttached> <remappedClassifierName>remapped-obf</remappedClassifierName> </configuration> </execution> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-spigot</id> <configuration> <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile> <srgIn>org.spigotmc:minecraft-server:1.18-R2.1-SNAPSHOT:csrg:maps-spigot</srgIn> <remappedDependencies>org.spigotmc:spigot:1.18-R2.1-SNAPSHOT:jar:remapped-obf</remappedDependencies> </configuration> </execution> </executions> </plugin>

quaint mantle
#

can i detect get off the horse?

#

yes

#

how?

#

VehicleExitEvent

hardy crystal
#

?paste

undone axleBOT
quaint mantle
#

thank you

hardy crystal
quaint mantle
#

what version is your server?

hardy crystal
#

1.18.2

quaint mantle
#

is CorpseReborn your plugin?

hardy crystal
quaint mantle
hardy crystal
#

I download it from GitHub, is open source

quaint mantle
#

alright

#

I'll try update it for you if you'd like

#

I get off my horse and cancel the event. When I hold the shift, I may not be on a horse. It shouldn't work like that. Canceling the SneakEvent doesn't work.

#

are there alternatives?

hardy crystal
tender shard
#

this won't help you at all

#

now your whole NMS stuff won't work anymore

hardy crystal
#

@tender shard

tender shard
#

no, it will only break compatibility with 1.18.2

#

the error you have is simply because the plugin doesn't support 1.16.5 at all

quaint mantle
#
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        manager.addPacketListener(new PacketAdapter(plugin, PacketType.Play.Server.PLAYER_INFO) {

            @Override
            public void onPacketSending(PacketEvent e) {
                try {
                    if (e.getPacket().getPlayerInfoAction().read(0) != EnumWrappers.PlayerInfoAction.ADD_PLAYER)
                        return;
                } catch (Exception ex) {
                    return;
                }

                e.getPacket().getPlayerInfoDataLists().write(0, new ArrayList<>());
            }
        });
hardy crystal
#

To update

quaint mantle
#

Error

#

manager is null

tender shard
#

it seems like CorpseReborn only supports latest 1.18

tender shard
quaint mantle
hardy crystal
tender shard
#

there's an import to 1.16.4 / 1.16.5 classes

#

and obviously a 1.18.2 server doesn't have any classes for 1.16.4 stuff

tender shard
quaint mantle
hardy crystal
tender shard
#

I don't know then

quaint mantle
#
 public Packets(Plugin plugin) {
        ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        manager.addPacketListener(new PacketAdapter(plugin, PacketType.Play.Server.PLAYER_INFO) {

            @Override
            public void onPacketSending(PacketEvent e) {
                try {
                    if (e.getPacket().getPlayerInfoAction().read(0) != EnumWrappers.PlayerInfoAction.ADD_PLAYER)
                        return;
                } catch (Exception ex) {
                    return;
                }

                e.getPacket().getPlayerInfoDataLists().write(0, new ArrayList<>());
            }
        });
    }
tender shard
#

sorry I can't help, maybe ask on ProtocolLib's discord if they have any

torn shuttle
#

got a question, I'm trying to set up remote debugging for intellij but I am supposed to be building this with gradle, when I just hit the build (not gradle) button it tells me that some classes have changed and prompts me to reload classes and then immediately says hot swap failed; I know there's some limitations with hot swapping but I am just adding a console message to an existing method here

tender shard
#

oh wait

#

send your whole plugin.yml pls @quaint mantle

#

you might have "cycling" dependencies

quaint mantle
#

This worked for a very long time on version 1.12.2

#
name: AuthProtect
version: '${project.version}'
main: konghure.authprotect.AuthProtect
api-version: 1.16
softdepend: [ ProtocolLib ]
wet breach
torn shuttle
tender shard
vivid cave
#

Retrieving skin of a player

torn shuttle
#

when I build without changes it tells me that everything is up-to-date

quaint mantle
#

I found more of this

#

I had this:

#

<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.8.0</
</dependency>

tender shard
#

I know your problem

#

you shaded protocollib into your plugin

wet breach
#

really strange then that the hotswap failed. The only thing I can think of is that because strings are immutable that whatever class was trying to be swapped out was being used at the time

quaint mantle
#

They said to add this

tender shard
#

add <scope>provided</scope> to your dependency of protocollib

quaint mantle
#
<dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>4.8.0</version>
            <scope>provided</scope>
        </dependency>
tender shard
#

yes

#

that'll fix it

quaint mantle
#

This doesn't work either(

tender shard
#

are you 100% sure? check if your .jar file contains protocollib

#

if yes, you fucked up

#

if no, sorry i don't know

quaint mantle
#

I checked before adding

tender shard
#

they only create an instance of their packet listener class in onenable when getPlugin("ProtocolLib") doesn't return null, and they have protocollib as soft-dep

torn shuttle
tender shard
#

so it looks good to me

#

only thing I can think of is that they somehow accidently shaded protocollib

quaint mantle
#

java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "manager" is null

wet breach
# torn shuttle this issue has always stopped me from using the debugger and I do feel like I've...

I don't use the debugger a lot myself, but that is because most of the time I don't have a reason for it as I usually know what is going on. However with your hotswap the only thing that comes to mind is that however that class you are trying to hotswap was designed it doesn't allow it to do so easily without causing all kinds of problems and it could be due to how its linked to other stuff.

quaint mantle
#

latest

torn shuttle
#

honestly I just resent not being able to use the debugger when I can't find where code execution stops and I just keep adding debug messages

wet breach
#

lol

torn shuttle
#

otherwise I don't really have a use for it

wet breach
#

Well, in this case the debugger might help but it would probably only confirm in that it can't be hotswapped without destroying other object instances that are derive from it

torn shuttle
#

I would pay JetBrains $1000 if they create a hotkey to quickly dump debug messages at possible code execution stopping points

quaint mantle
#

What do you mean?

wet breach
#

Doesn't JetBrains have a debugger you can use?

torn shuttle
#

like a hotkey to toggle that on and off

#

that's what I'm trying to use

wet breach
#

I was pretty sure their debugger you can watch everything execute

#

as it executes

ivory sleet
#

ye it has

quaint mantle
#

hi conc โค๏ธ

ivory sleet
#

hello :3

quaint mantle
#

manager?

#

Okay

torn shuttle
#

that sort of warps all the way back around to not manageable unfortunately

#

I'm blessed with one of those issues that seem to be arbitrary and time-based

wet breach
#

then sounds more like you need a profiler

#

or need to dump the heap at those times

torn shuttle
#

what I need is code jesus to exorcise the evil code bugs from my codebase

#

it's tricky, ultimately I need to find a way to replicate the issue in the first place, I think I got a good hint earlier from one of my testers so I was about to start testing it just wanted to see if I could hotswap some debug messages while I was at it

wet breach
#

you could do so, but it depends on the class really

#

if its a base class for many things, odds are no you won't be able to

torn shuttle
#

it really wasn't, hell the code runs on a timer that is based on an action so I was sort of hoping to get away with it

wet breach
#

ah that could be it then, the timer code is probably what prevents it from being hotswapped

torn shuttle
#

not a repeating task a delayed one

wet breach
#

once a timer task is queued in the JVM, hotswapping isn't going to be possible without throwing all kinds of NPE's in the scheduler

torn shuttle
#

yeah it shouldn't schedule until I did an action but eh I guess I'll take a look at this later

wet breach
#

well that is the only thing that would prevent it from what you are saying

#

because once you hotswap once it is scheduled, the instance the scheduler has is no longer valid and there is nothing to tell the scheduler that ahead of time

torn shuttle
#

I can tell nothing was schedules because it wasn't the only debug message on there

#

but I need to keep on trucking or I will genuinely never fix this issue

quaint mantle
#

.

#
 private static ProtocolManager pm;
#
public static ProtocolManager getManager() {
        return pm;
    }
#
AuthProtect.getManager().addPacketListener(new PacketAdapter(plugin, PacketType.Play.Server.PLAYER_INFO) {
#

getManager() is null

fossil lily
#

Whats the maven import for ProtocolWrapper?

west oxide
#

what is the event to check if player moves item in their inventory

west oxide
fossil lily
#

Search it

west oxide
#

i couldnt find

west oxide
fossil lily
west oxide
#

so i assumed its the wrong one :/

fossil lily
west oxide
fossil lily
#

got it

west oxide
#

but for that one

#

it glitches and can get more items

fossil lily
#

Go in survival

#

It only does that in creative

west oxide
# fossil lily

ok i found out its this one but you need to add
player.updateInventory();;
if you cancel the event

#

after canceling it

#

to fix

fossil lily
#

Is it possible to set a player to be the damage cause of damage caused by the plugin?

fossil lily
#

Try it in survival

west oxide
#

in survival

fossil lily
#

oki

frigid rock
#

does anybody know why "item" is null? java @EventHandler public void onJoin(PlayerJoinEvent e){ for(ItemStack item : e.getPlayer().getInventory().getContents()){ if(item.getType().name().endsWith("_AXE")){ new Enchant(item, EnchantAbility.Enchants.DEFAULT); } } }

young knoll
#

Because they donโ€™t have an item in every slot

frigid rock
#

so how can i fix that?

young knoll
#

Check for null?

exotic jetty
#
ItemStack itemStack = new ItemStack(Material.GOLD_BLOCK);
        if (balance_int == 1) {
            e.getPlayer().getInventory().addItem(itemStack);
            balance_int = balance_int-1;
        }

        ItemMeta meta = itemStack.getItemMeta();

        meta.setDisplayName("balance");

        itemStack.setItemMeta(meta);

if i do this ill get an gold block but its name isnt balance. why?

young knoll
#

Add the item after you edit the meta

exotic jetty
#

oh ofc ๐Ÿคฆ

#

thanks

frigid rock
exotic jetty
#
@EventHandler
 public void onMove(PlayerMoveEvent e) {
ItemStack itemStack = new ItemStack(Material.GOLD_BLOCK);


        ItemMeta meta = itemStack.getItemMeta();

        meta.setDisplayName(MyFirstPlugin.balance.toString());
        meta.setLore(Arrays.asList("line 1", "line2"));

        itemStack.setItemMeta(meta);
        if (balance_int == 1) {
            e.getPlayer().getInventory().addItem(itemStack);
            balance_int = balance_int-1;
        }
}

file name: MyFirstPlugin

public static Integer balance;

error: Could not pass event PlayerMoveEvent to firstplugintest v1 org.bukkit.event.EventException: null why does it print this?

olive lance
#

anyone familiar with the point to point protocol ?

undone axleBOT
west oxide
#

wouldnt this throw an error if the player is offline ?

supple thistle
#

Hey, I want to split my world into 42x42 squares. Each square should have an ID. I did that too! But now I want a 15 block wide space between each square. How do I do that? I calculate the squares like this:

public static String getID(Location location){
        // Welt in 100x100 block groรŸe quadrate aufteilen
        int x = (int) (location.getX() / 42);
        int z = (int) (location.getZ() / 42);
        return x + ";" + z;
    }```
fossil lily
#

Velocity vs Waterfall?

#

What are the differences?

grim ice
quaint mantle
#

Why does my plugin work on spigot and not paper?

grim ice
#

oh he said it

#

already

#

ok

exotic jetty
#

lol

waxen plinth
grim ice
#

Bukkit#getPlayer(...) != null //hes online

quaint mantle
waxen plinth
#

Again, that tells me almost nothing

#

What is the expected behavior? What is returning null? Can you share some code?

#

We're not mind readers

#

Use a paste link please

quaint mantle
#

i put in some debug stuff

waxen plinth
#

?paste

undone axleBOT
waxen plinth
#

Delete your code block and paste your code in there

west oxide
waxen plinth
#

Thank you

west oxide
#

how can i send a player to a different server using spigot ?

waxen plinth
#

Now what is returning null

west oxide
woeful crescent
#

What sound is played when a splash potion breaks?

quaint mantle
waxen plinth
#

Please don't use the phrase "works" or "doesn't work"

#

Because it explains nothing about the behavior

#

I'm guessing you mean that in spigot, getCurrentItem returns null when the item is empty

#

Whereas in paper it returns an item with the type air

grim ice
#

@west oxide

waxen plinth
#

You already have a guard clause in your first conditional

#

Line 12

#

It will return if the item is null

woeful crescent
waxen plinth
#

But there's no such check in the first else-if, for "Ban This Player"

muted sand
#

how do shulker boxes save inventory data?
is it just saved in the pdc of the container or whatever?

quaint mantle
#

yes but the plugin doesnt return null when i tried it on spigot

waxen plinth
#

So if you go to that branch there's no null check

quaint mantle
#

just on paper it does

waxen plinth
#

That's just an implementation detail

#

You need to properly check that the item isn't empty

#

You get the type of the item either way

#

Why don't you just add a single if at the very top outside of any of the other branches that will return if the item is null?

#

As in, move the if statement currently at line 12 to before line 6

quaint mantle
#

ok now the code gets to the 3rd println

#

so whoToBan is null

eternal needle
#

Hi, i get this line wrong

            e.getPlayer().teleport(frozenplayers.get(e.getPlayer()));```

i get so i can't have e.getPlayer in the same line way and how do i fix it tag me
waxen plinth
#

What

quaint mantle
waxen plinth
#

Player whoToBan = BanGUI.getPlugin().getServer().getPlayerExact(ChatColor.stripColor(e.getCurrentItem().getItemMeta().getDisplayName()));

#

A lot is going on in this line

#

Split it up and add debug output for the name

#

It could be trying to get an offline player

quaint mantle
#

well im testing it on myself and im online so its not getting an offline plauer

quaint mantle
desert musk
#
            ItemStack item = event.getPlayer().getItemInUse();
            assert item != null;
            if (item.getType().equals(Material.NAME_TAG)) {
                    if (item.getItemMeta() == null)
                        return;
                    event.setCancelled(true);
                    if (!Objects.equals(CustomConfig.get().getString("nests." + nestID + ".members." + player.getUniqueId() + "role"), "leader")) {
                        player.sendMessage(ChatColor.DARK_RED + "You must be the owner to rename a Nest");
                        return;
                    }
                    String name = item.getItemMeta().getDisplayName();
                    setName(nestID,name);
                    player.sendMessage(ChatColor.DARK_GREEN + "Renamed nest");
                    player.getInventory().getItemInMainHand().setAmount(player.getInventory().getItemInMainHand().getAmount()-1);
                    return;
                }```

`item` is always null, why?
#

i'm trying to retrieve the item that a player is right clicking with

#

in a PlayerInteractAtEntity event

waxen plinth
#

?jd

waxen plinth
#

Do event.getPlayer().getInventory().getItemInMainHand()

visual tide
#

is there a way to remove an entity in the tick the method is run?

#

because entity.remove() only applies on the enxt tick

waxen plinth
#

Could always teleport the entity somewhere distant

waxen plinth
quaint mantle
waxen plinth
#

I said to add debug output for that, so yes

#

But use a variable

#

Don't duplicate the code

visual tide
#

welp ig then i gotta use nms and make it die

ocean carbon
#

can i get a server i just need to starte?

quaint mantle
visual tide
#

it calls bukkit's .remove iirc

waxen plinth
#

Would teleporting them somewhere distant not work

visual tide
#

uhm

#

so it despawns?

waxen plinth
#

No

#

Yeah exactly

#

So it appears to die that tick

#

But it would still be removed the following tick

visual tide
#

but that wouldnt solve the problem

#

xy moment lmao
I want to remove some entities in onDisable

waxen plinth
#

you've heard of pinkeye

#

๐Ÿ˜ท

#

You haven't heard of pinkeye?

visual tide
#

sunburn

waxen plinth
#

Auto-generating getters and setters makes you weak

young knoll
#

Smol brain: Lombok
Normal brain: Auto-generate
Big brain: Manually typing them out
Galaxy brain: Just making everything public

west oxide
#

i need one for spigot

grim ice
#
public void sendPlayerToServer(Player player, String server) {
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(b);

        try {
            out.writeUTF("Connect");
            out.writeUTF(server);
        } catch (Exception e) {
                                      player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&fThere was an problem connecting to " + server + "!"));
            return;
        }

        player.sendPluginMessage(Main.getInstance(), "BungeeCord", b.toByteArray());
    }
}```
#

@west oxide

#

thats to send a player to a server thats connected with the current one

#

with Bungee

#

you cant send the player to a server thats not connected with the current one with bungee

quaint mantle
#

how do you make a custom plugin logger?

#

i got this message

[16:22:27 WARN]: Nag author(s): '[Axure]' of 'BanGUI' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger)
young knoll
#

It does tell you exactly what to do

quaint mantle
#

JavaPlugin#getLogger

#

getLogger().info() i tried this

young knoll
#

Well that is the way

quaint mantle
#

still sends the message

chrome beacon
#

Did you remove your sys out

young knoll
#

yes

quaint mantle
#

its not getting my actual name

waxen plinth
#

There you go

#

But again, please don't ping me

quaint mantle
#

sorry i just replied to you since you told me what to do

waxen plinth
#

You can disable pinging in your reply

devout vale
#

Iโ€™m looking for someone to commission a plug-in for me.

waxen plinth
#

?services

undone axleBOT
quaint mantle
devout vale
#

Thanks

grim ice
devout vale
#

Sure

#

DM me

sacred mountain
#

I'm trying to create a custom chat room, but this isnt working, any ideas?

my config layout:

testchannel:
  format: "blah"

code in the asyncplayerchatevent

YamlDocument customChannels = YamlDocument.create(new File(plugin.getDataFolder(), "customchannels.yml"), Objects.requireNonNull(plugin.getResource("customchannels.yml")),
                            GeneralSettings.DEFAULT, LoaderSettings.builder().setAutoUpdate(true).build(), DumperSettings.DEFAULT, UpdaterSettings.builder().setAutoSave(true).setVersioning(new Pattern(Segment.range(1, Integer.MAX_VALUE), Segment.literal("."), Segment.range(0, 10)), "file-version").build());
                    List<Object> keys = List.of(customChannels.getKeys());
                    if (keys.contains(e.getPlayer().getPersistentDataContainer().get(key, PersistentDataType.STRING))) {
                        String k = e.getPlayer().getPersistentDataContainer().get(key, PersistentDataType.STRING);
                        for (Player player : Bukkit.getOnlinePlayers()) {
                            if (player.hasPermission("chatchannels.see." + e.getPlayer().getPersistentDataContainer().get(key, PersistentDataType.STRING))) {
                                player.sendMessage(Replace.rep(customChannels.getString(k + ".format"), "%player%", e.getPlayer().getDisplayName(), "%message%", e.getMessage(), "%coordinates%", LocationUtils.convert(e.getPlayer().getLocation()), "%world%", e.getPlayer().getWorld().getName(), "%blocks%", String.valueOf(MathUtils.round(MathUtils.calculateDistance3D(e.getPlayer().getLocation(), player.getLocation()), 2))));
                            }
                        }
                    }```
forest relic
#

bruh i give up

#

i followed a forum post

#

but for some reason

#

my commands still don't show up

west oxide
#

how do i go trough all of these to get "minecraft" and "spigot"?

        minecraft:
            name: "&d&DisplayName"
        spigot:
            name: "&d&DisplayName"
            ```
undone axleBOT
forest relic
#

do you need the GiveItems class as well?

#

^ is the GiveItems class

sacred mountain
#

those are the routes i guess

#

config.getString(route)

forest relic
#

o oke

supple thistle
#

Hey, I want to split my world into 42x42 squares. Each square should have an ID. I did that too! But now I want a 15 block wide space between each square. How do I do that? I calculate the squares like this:

public static String getID(Location location){
        // Welt in 100x100 block groรŸe quadrate aufteilen
        int x = (int) (location.getX() / 42);
        int z = (int) (location.getZ() / 42);
        return x + ";" + z;
    }```
forest relic
#

still doesn't work

#

it just says unknown command

#

no

#

do i need to restart the server, im currently using plugman

#

but its so much more convinent

#

xd

#

whats that?

#

also can i stop my server from loading all dimensions everytime i restart it

#

r

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.

forest relic
#

oh hey i restarted my server and now it works!

crisp steeple
#

theres no real way to understand what a problem is if you dont have some basic idea of whats causing it

sacred mountain
grim ice
#

also

#

are you performing your code with Bukkit.getScheduler().runTask()?

#

if youre not, then do it

supple thistle
#

How can I split a world into squares with paths in between? Each square should have an ID

eternal needle
tall dragon
eternal needle
#

yes, but i don't want to do it. I am trying to do so players don,t be able to move afte some one in staff have done /freee (playername)

forest relic
#

hey can i kind of launch all entitys away

#

without creating an explosion

tall dragon
#

yes

#

apply velocity to them

forest relic
#

so is player.setVelocity

tall dragon
#

yea, so apply velocity in the direction u want

forest relic
#

going to change it based on their current movement?

eternal needle
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.

tall dragon
eternal night
#

please just use this ^

#

a teleport inside the player move is a pretty not good idea

forest relic
#

slowness would make more sense

#

then you could apply blindness as well

eternal needle
tall dragon
tall dragon
delicate cargo
#

trying to make it when a player has mined a block it becomes bedrock and then returns to normal again, however my code is not working. here is my code:

owner.getWorld().getBlockAt(miningLocation).setType(Material.BEDROCK);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin)Main.instance, (Runnable)new Runnable() {
    @Override
    public void run() {
        owner.getWorld().getBlockAt(miningLocation).setType(miningMaterial);
    }
}, 100L);
tall dragon
desert musk
delicate cargo
#

it doesnt set it to bedrock, just keeps it

eternal needle
#

yes

delicate cargo
#

wait

tall dragon
#

have 1 runnable

delicate cargo
#

orrrrrr

eternal needle
#

it did not work

delicate cargo
#

a list

#

with dictionaries

delicate cargo
#

the location, time left and block to set

tall dragon
#

yea

#

and then 1 runnable

#

that loops over them

delicate cargo
#

yeah

#

which i already have

eternal needle
#

e.getPlayer().teleport(frozenplayers.get(e.getPlayer()));

this is what my friend coded but not working

eternal night
tall dragon
#

stop doing frozenplayers.get

#

thats not needed

#

that makes no sense

#

yea

eternal night
tall dragon
#

best use what lynx said

#

for best performance

desert musk
#

or 7 in this ig

tall dragon
#

well probably because the nest does not exist

eternal needle
#

that does not work eather

undone axleBOT
eternal needle
sterile token
#

Do you recommend calling async events on spigot listeners?

tall dragon
#

its the same???

delicate cargo
#

is it possible to have a dictionary which accepts strings as keys and locations, materials and longs as values?

sterile token
#

...

delicate cargo
delicate cargo
#

pyramid of periods

#

anyway

#

is it possible to have a dictionary with multiple types as values?

#

i really hope it is as it would be a shame to have to create multiple dictionaries

sterile token
delicate cargo
#

what?

eternal needle
#

i can stile move

delicate cargo
#

so, is it possible

sage dragon
#

Hey,

I made a plugin which places structure evenly spaced between each other.

My current way to space them, is by going through every single structure and check if the distance is high enough.

Problem is... At some point this is extremely slow and lags out the whole server.

Does anyone know a better way?

crimson scarab
#

anyway to differniate from a monster combusting from the sunlight or any other source

quaint mantle
#
p.setLevel(100);
p.setExp(1);


p.setLevel(p.getLevel() - 1);
p.setExp(p.getExp() - 0.01F);
#

100 seconds

#

How can the number be changed and so that exp changes as it should

#

Here the school of experience and the level are reduced

#

Both go up to 0

#

Scheduler

undone axleBOT
quaint mantle
#

no

#

It works

#

I want to make a number through which the player will kick

#
p.setLevel(100);
            p.setExp(1);
            task = Bukkit.getScheduler().runTaskTimer(AuthProtect.getPlugin(), () -> {
                if (p.getLevel() < 1) {
                    p.sendMessage("kick");
                } else {
                    p.setLevel(p.getLevel() - 1);
                    p.setExp(p.getExp() - 0.01F);
                }
            }, 30L, 20L);
echo basalt
quaint mantle
#

yes

sacred mountain
lavish hemlock
#

Oh fuck

oak mica
#

how can i make a 5 * 5 inventory

hexed hatch
#

Not possible

oak mica
#

bru

hexed hatch
#

Not in a clean way, that is

oak mica
#

i mean i dont care about clean

kind hatch
#

You could block out the spaces in a 9*6.

oak mica
#

its a personal project

quaint mantle
hexed hatch
#

It'd have to be a 9x6

quaint mantle
#

Workbench

hexed hatch
#

Then you just lock out the spots you don't want used

oak mica
#

im tyna createa a inventory for a bingo that has 25 possbilityis

#

hm

#

so ig i mean 9 * 9

oak mica
kind hatch
#

That's not possible either.

quaint mantle
#

Not possible

hexed hatch
kind hatch
#

There are only a limited number of GUI sizes that you can leverage.

hexed hatch
#

There's really only one way to do it

eternal night
#

6*5 it and block all non-possible slots till you have a 5x5

#

ยฏ_(ใƒ„)_/ยฏ

oak mica
eternal night
#

ooh

#

sorry

#

6*9

oak mica
#

ahhhhhhhhhhhh

eternal night
#

just create the max inventory

kind hatch
#

You can have any 9 x 1-6 inventories. You can use the 3x3 inventories for workbenches, droppers, etc. You can also use the 5x1 from hoppers.

oak mica
#

which is?

eternal night
#

6*9

oak mica
#

ew

eternal night
#

see how like, hypixel does it on skyblock etc

oak mica
#

ye

quaint mantle
#

Who can help me?

kind hatch
#

What's your issue?

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#
p.setLevel(100);
            p.setExp(1);
            task = Bukkit.getScheduler().runTaskTimer(AuthProtect.getPlugin(), () -> {
                if (p.getLevel() < 1) {
                    p.sendMessage("kick");
                } else {
                    p.setLevel(p.getLevel() - 1);
                    p.setExp(p.getExp() - 0.01F);
                }
            }, 30L, 20L);
kind hatch
#

What's the problem here? Gonna need an explanation.

quaint mantle
#

I want to make sure I can drive seconds through the config

sacred mountain
#

just made my first ever plugin that i actually semi finished

#

first resource at least

#

yeah

quaint mantle
kind hatch
#

What specifically? The interval at which the runnable runs? The experience to decrement? The delay?

quaint mantle
#

experience

#

The scale and experience are reduced to 0 and then the player kicks

kind hatch
#

Ok, then create a section in your config. Then grab the value using ConfigurationSection#get("path.to.your.value") and use it as needed.

quaint mantle
#

I need to reduce both the experience and the level

#

Up to 0 smoothly

kind hatch
#

.-. This is your project. How would I know?

#

Well if you need it to go smoothly, then you'll need to use some math.

quaint mantle
#

I'm asking how do I do this

quaint mantle
solar sable
#

guys why is my recipes isnt loading?

quaint mantle
#

I've written everything

kind hatch
solar sable
#

I have like 4 recipes and none of them is working

solar sable
#

do I need to put something in main class?

quaint mantle
#

I can't send screenshots here

solar sable
#

yeah I already put that

#

but its still not working for any of it

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.

quasi flint
#

Is there a way for the Client to See, If a Block is a Fake Block or Not?

solar sable
#

?paste

undone axleBOT
kind hatch
solar sable
#
package me.amxyargaming.testing.recipes;

import me.amxyargaming.testing.Testing;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;

public class OpPickaxe {

    private final Testing plugin;

    public OpPickaxe(Testing testing) {this.plugin = testing;}

    public void DiamondRecipe() {

        ItemStack i = new ItemStack(Material.DIAMOND_PICKAXE, 1);

        ItemMeta meta = i.getItemMeta();

        meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&cSuper Work &bPickaxe"));


        meta.addEnchant(Enchantment.LOOT_BONUS_BLOCKS, 10, true);
        meta.addEnchant(Enchantment.DIG_SPEED, 7, true);

        i.setItemMeta(meta);


        NamespacedKey key = new NamespacedKey(plugin, "super_work_pickaxe");

        ShapedRecipe recipe = new ShapedRecipe(key, i);

        recipe.shape(
                "DPD",
                " O ",
                " O "
        );

        recipe.setIngredient('D', Material.DIAMOND_BLOCK);
        recipe.setIngredient('P', Material.DIAMOND_PICKAXE);
        recipe.setIngredient('O', Material.OBSIDIAN);

        Bukkit.addRecipe(recipe);
    }
}
``` can I just send it like this
kind hatch
#

Please use a ?paste.

#

?paste

undone axleBOT
sacred mountain
#

@onyx fjord lol i have no idea how to make a dev api.

solar sable
onyx fjord
#

lmao

onyx fjord
#

add src

sacred mountain
# onyx fjord lmao

would be interested though, something like a ChatChannels#createChannel() ? is that what you mean

#

okay the source is questionable

onyx fjord
#

Player#switchChanngel for example

sacred mountain
#

i don't know how to hook intellij to github

onyx fjord
#

hm?

sacred mountain
#

never tried

#

how do i upload source to git

onyx fjord
#

just make a repo in the project folder

#

i personally use github desktop

sacred mountain
onyx fjord
#

if u need fancy stuff then gitkraken

kind hatch
#

VCS ---> Github

sacred mountain
#

still no clue how to do that

#

this?

solar sable
#

why is this not registering

#

oh

onyx fjord
sacred mountain
#

lmao

solar sable
#

then how do I call it?

sacred mountain
kind hatch
solar sable
#

it used to be fine before but now its all just broken

onyx fjord
#

u have githuv desktop @sacred mountain ?

sacred mountain
#

shouldi download it

onyx fjord
#

download it or use cli if u prefer

#

but i guess you dont prefer cli

solar sable
#

OpPickaxe.DiamondRecipe(); like this?

#

in main class

#

oh

onyx fjord
#

@sacred mountain Custom-made channels will not tab-complete. any particular reason why? i might help with that aswell

eternal needle
solar sable
#

hold on let me try

#

im kinda blurry rn

sacred mountain
#

i'm using redlib bbtw

quaint mantle
#

@waxen plinth

sacred mountain
#

it's still called abilityname woops

quaint mantle
#

is it registered?

sacred mountain
#

ok @onyx fjord i have git desktop

kind hatch
eternal needle
quaint mantle
onyx fjord
#

ctrl + n @sacred mountain

solar sable
#

sorry what does this mean?

sacred mountain
eternal needle
amber palm
#

Hello Guys. I want to get out of the config the members of every Guild to check if the player is in a Guild. I do this with :

Set<String> Guildsearch2 = Guildconfig.get().getConfigurationSection("Guilds" + Guildsearch + ".members").getKeys(false);
This shoud get me from every guild the members.
but i have a java.lang.NullPointerException: . How do i fix that?

kind hatch
solar sable
#
new OpPickaxe(this);
        OpPickaxe.DiamondRecipe();
``` now good?
waxen plinth
solar sable
#

oh wait

#

ohhh i see

#

I get it now

#

thank you

sacred mountain
onyx fjord
#

ig time to learn redlib

waxen plinth
sacred mountain
#

I live in 2 different places, can the local path be changed in future?

waxen plinth
#

You tab complete using that array

#

So of course it's not showing the tab completions

sacred mountain
onyx fjord
kind hatch
# eternal needle Huh?

You said that you were cancelling the event. That statement doesn't match up with the code you provided.

sacred mountain
#

ok ive created the rep

#

what now

onyx fjord
#

u should be able to upload it to github

visual tide
#

is it possible to remove entities in onDisable? entity#remove() wont work since it only applies on the next tick

sacred mountain
#

i've never used github

onyx fjord
#

in this, tell me what third button says

sacred mountain
#

could we go to dms instead

onyx fjord
#

for you

#

yeah sure

solar sable
#

@last temple is this now correct?

OpPickaxe op = new OpPickaxe(this);
        OpPickaxe.DiamondRecipe();
        ChainmailArmor ca = new ChainmailArmor(this);
        ChainmailArmor.ChainmailRecipe();
        TotemOfUndying tod = new TotemOfUndying(this);
        TotemOfUndying.TOD();
        EnchantedFoods ef = new EnchantedFoods(this);
        EnchantedFoods.EChickenRecipe();
kind hatch
#

It's not.

#

The method DiamondRecipe is not static.

#

So he can't call OpPickaxe.DiamondRecipe();

solar sable
#

hm yes agreed

solar sable
visual tide
#
  • naming conventions, please name your methods with camelCase
desert musk
#

ok i'm incredibly confused about using damageables, how the hell do i set the durability of an item?

        ItemStack item = new ItemStack(Material.WOODEN_AXE);
        ItemMeta meta = item.getItemMeta();
        item.setDurability((short) 3);
        meta.addEnchant(Enchantment.VANISHING_CURSE,1, true);
        item.setItemMeta(meta);
        respawnItems.add(item);```
solar sable
#

i already made it all static lol

kind hatch
#

You don't need to though. ๐Ÿ˜› You just need to learn the language.

solar sable
#

i actually do want to use the var, how do i redo this static

kind hatch
visual tide
#

*abuse of static is bad

kind hatch
#

Facts. There are plenty of valid use cases for the static keyword.

#

Utility methods are a big one.

solar sable
#

ok i got it fixed lol

#
OpPickaxe op = new OpPickaxe(this);
        op.DiamondRecipe();
        ChainmailArmor ca = new ChainmailArmor(this);
        ca.ChainmailRecipe();
        TotemOfUndying tod = new TotemOfUndying(this);
        tod.TOD();
        EnchantedFoods ef = new EnchantedFoods(this);
        ef.EChickenRecipe();
#

ez pz

#

why would I do that?

kind hatch
#

You could also clean up your code by creating a method for registering the recipies.

public void registerRecipies() {
  OpPickaxe op = new OpPickaxe();
  op.registerDiamondRecipe();
  op.registerChainmailRecipe();
  op.registerChickenRecipe();
}
visual tide
solar sable
#

but I like cases in every names

kind hatch
solar sable
#

Cooked Chicken
Emerald Block

#

it seems nice to me

#

:D

kind hatch
#

If everyone is on the same page, it reduces confusion.

solar sable
#

well because that's unneunnecessary

eternal needle
lavish hemlock
visual tide
#

methods should be camelCase
fields should be camelCase
classes should be PascalCase
enums should be SCREAMING_SNAKE_CASE

lavish hemlock
#

It's Called Title Case And It's Fucking Terrible

desert musk
#

why is it so impossibly hard to set the durability of a new item

solar sable
#

Who Ever Speaks Like This Is Definitely Using A Phone

lavish hemlock
solar sable
#

XD

kind hatch
visual tide
#

also if you publish code that doesnt abide by naming conventions its not gonna look very professional

lofty zephyr
#

Hi so I'm having some issues with this plugin called ajqueue, and I asked the dev of the plugin and he said this, "ajQueue simply tells bungeecord to send the player. Bungeecord handles actually sending the player. We know ajQueue is telling bungeecord to send the player, so any issue after that would be either bungee or the target server"

visual tide
kind hatch
visual tide
#

hm, interesting

solar sable
#

ok next question im asking is