#help-development

1 messages ยท Page 1740 of 1

eternal oxide
#

player.hasPermission

austere harbor
#

There is a plugin that makes that every 1h that the player is online it will summon a command like give player diamond 1? Like a playing reward

wispy plume
#

is it possible to make silent lava?

waxen plinth
#

You probably imported the wrong Vector

#

java.util.Vector

#

Make sure you've imported bukkit Vector and not that one

misty current
#

^

last ledge
round elbow
#

so currently I am saving HashMaps through serializer
how can I determine how many saved hashmaps have the same key?

// this is inside of a class i just copied the code i wanted to show
public HashMap read = null;
            try {
                FileInputStream fileInput = new FileInputStream(Settings.file);
                ObjectInputStream objectInput = new ObjectInputStream(fileInput);
                read = (HashMap) objectInput.readObject();
                objectInput.close();
                fileInput.close();
            }
            catch (IOException | ClassNotFoundException obj1) {
                obj1.printStackTrace();
            }
#

could it work like a loop?

waxen plinth
#

What?

#

There's a lot wrong with this

round elbow
#

uhh what is wrong

waxen plinth
#

You're not parameterizing the HashMap

#

It should be HashMap<K, V> where K and V are two types

round elbow
#

ye i realised ima do that

#

yeee

waxen plinth
#

Also why are you serializing it that way

round elbow
#

is there another way to serialize?

waxen plinth
#

There are many ways to serialize

#

Depending on what you're storing, it may make sense to use config, json, or sql

round elbow
#

config and json are two HUMAN-READABLE SHIT
i am making waypoints plugin
and i dont want anyone that is an admin sees every single player's waypoint locations and stuff

#

that is why im using serializer
and json is human-readable too

eternal oxide
#

serializing will not hide it

round elbow
#

well what can i use

#

because idk how to use a database

eternal oxide
#

if you want to hide it from prying eyes just use sqlite

#

theres tutorials on using sqlite with spigot

round elbow
#

hmm

tardy delta
#

how do i check if this exists?

eternal oxide
#

notepad

tardy delta
#

null

#

and btw remove that new String[]

#

return null

#

let the server handle it

#

smh how do i save something to config like [uuid1, uuid2, etc]

#

class org.bukkit.craftbukkit.v1_16_R3.inventory.CraftMetaItem cannot be cast to class org.bukkit.inventory.meta.SkullMeta

acoustic pendant
#

Hey! i have some questions about custom events...

public class HealthStat extends Event {


    double getMana;

    private static final HandlerList HANDLERS = new HandlerList();

    //private double getMana;


    public void currentMana(double getMana) {
        this.getMana = getMana;
    }

    @Override
    public HandlerList getHandlers(){
        return HANDLERS;
    }

    public static HandlerList getHandlerList() {
        return HANDLERS;
    }

    public double getMana(){
        return this.getMana;
    }```


I have this code, how can i do to do that the custom events do what ever i want?
tardy delta
#

you have to listen for events

#

so first throw that event

acoustic pendant
#

btw, how do ppl do to get this colors?

#
@override
#

oh

#

true

#

ty

#

you can add scale to an armorstand?

waxen plinth
#

You can save string lists directly to config

#

If you have a List<UUID>

#

You can convert it to a List<String> like this

#
List<UUID> uuids; //assume this is populated
List<String> strings = uuids.stream().map(UUID::toString).collect(Collectors.toList());```
#

Then you can just save that list directly to config

tardy delta
#

oh thanks

acoustic pendant
tulip owl
#

why do commands not work? i have this in my main class

@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        // /color
        if (command.getName().equalsIgnoreCase("color")) {
            if (sender instanceof Player) {
                Player p = (Player) sender;

                p.sendMessage(ChatColor.RED + "====================================");
                p.sendMessage(ChatColor.WHITE + "&0 = " + ChatColor.BLACK + "Black"+     ChatColor.WHITE + "&1 = " + ChatColor.BLACK + "Dark Blue");
                p.sendMessage(ChatColor.WHITE + "&2 = " + ChatColor.DARK_GREEN + "Dark Green"+     ChatColor.WHITE + "&3 = " + ChatColor.DARK_AQUA + "Dark Aqua");
                p.sendMessage(ChatColor.WHITE + "&4 = " + ChatColor.DARK_RED + "Dark Red"+     ChatColor.WHITE + "&5 = " + ChatColor.DARK_PURPLE + "Dark Purple");
                p.sendMessage(ChatColor.WHITE + "&6 = " + ChatColor.GOLD + "Gold"+     ChatColor.WHITE + "&7 = " + ChatColor.GRAY + "Gray");
                p.sendMessage(ChatColor.WHITE + "&8 = " + ChatColor.DARK_GRAY + "Dark Gray"+     ChatColor.WHITE + "&9 = " + ChatColor.BLUE + "Blue");
                p.sendMessage(ChatColor.WHITE + "&a = " + ChatColor.GREEN + "Green"+     ChatColor.WHITE + "&b = " + ChatColor.AQUA + "Aqua");
                p.sendMessage(ChatColor.WHITE + "&c = " + ChatColor.RED + "Red"+     ChatColor.WHITE + "&d = " + ChatColor.LIGHT_PURPLE + "Light Purple");
                p.sendMessage(ChatColor.WHITE + "&e = " + ChatColor.YELLOW + "Yellow"+     ChatColor.WHITE + "&f = " + ChatColor.WHITE + "White");
                p.sendMessage(ChatColor.RED + "====================================");
            }
        }
        return true;
    }
#

discord has tabbed is strangely but this isn't python so it should be fine

tardy delta
#

did you register it

tulip owl
#

yep

ivory sleet
#

Why do you compare the name with color

tulip owl
#

oh wait i did'nt ๐Ÿคฆโ€โ™‚๏ธ i used the command from the video not mine

#

but should'nt it still work if it's unregistered?

ivory sleet
#

no

acoustic pendant
#

btw, i should user player instead of p

ivory sleet
#

If you unregister it (idk why you even would do that) then it obv doesnโ€™t work anymore

acoustic pendant
#

i'm noob so don't trust at all

tulip owl
#

you're talking about plugin.yml right?

ivory sleet
#

plugin.yml cannot unregister commands

wind dune
#

Help with Annotations

ivory sleet
#

Only register them in a way

ivory sleet
acoustic pendant
#

๐Ÿ˜„

ivory sleet
#

The name of a variable should be explanatory to the scope it lives in

tulip owl
ivory sleet
#

Uh well

#

Here take a look

tulip owl
#

ty

ivory sleet
#

I advice self teaching so yeah ๐Ÿ˜…

tulip owl
#

yep i self taught myself python

ivory sleet
#

Thatโ€™s good

#

Although python is quite different from Java

tulip owl
#

yep

#
this.getCommand("color").setExecutor(new CommandKit());

would i do this? as intellaJ is complaning about CommandKit())

ivory sleet
#

What does it complain about

acoustic pendant
#

why this?

ivory sleet
#

Because it marks the variable as an instance variable/field

#

Itโ€™s more readable if you for instance read the source on GitHub or what not

acoustic pendant
#

but he is not registering a command?

ivory sleet
#

He setup his command instance

#

And for that assuming you use the api, youโ€™d need to grab the plugin command by the super method getCommand(name)

#

In which using this keyword before is arguably better, it wonโ€™t hurt performance anyways

tulip owl
#

oh now i see how i did it before. i used a different class for the commands

regal moat
#

How can I check if two entites collided

acoustic pendant
#

Is there any way to apply scale to a armorstand?

eternal night
#

seems like you are trying to cast something to a skull that isn't

young thicket
#

I'm new to java, how can I print /join2 to all players on the server with the /join command?

#

I only know how to write to the person who wrote it

#
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;

            player.performCommand("join2");
        }
young knoll
#

Loop bukkit.getOnlinePlayers

sharp bough
young thicket
#

@swift sparrow thank you, it works

acoustic pendant
#

but for sending a join something, won't be better doing an event?

#

(i don't know what are you doing so maybe i'm bad)

storm chasm
#

hello i have a question please

young knoll
#

?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. Create a thread in case the help channel you are using is already in use!

storm chasm
#

wow

#

Is there a plugin that allows to custom the vanilla structures?

acoustic pendant
#

well

#

maybe seach in the spigot page should be better

#

"custom vanilla structures"

storm chasm
#

A plugin that works well pls

acoustic pendant
#

and something will appear ig

opal sluice
#

Hi, does someone know how to remove the hikariCp connection messages in the console ?

regal moat
#

How can I get the entities a slime split into?

acoustic pendant
#

what's that?

storm chasm
#

Ok I'll change my question if it's ok. How can I customize the vanilla structures?

acoustic pendant
#

with plugins xD

storm chasm
#

Lol only plugins?

acoustic pendant
#

hmm

#

and mods?

storm chasm
#

No mods :(

#

Normal server so

acoustic pendant
#

so i think the only way is plugins

storm chasm
#

It's probably the easiest thing to do but me and my friend really took a long moment trying to

storm chasm
young knoll
#

You can modify some of them with datapacks

acoustic pendant
#

oh true

storm chasm
#

I also searched datapacks but nothing

acoustic pendant
#

hmm

#

so there aren't more expansions for minecraft

#

and by default i think there is no way

#

so just mods?

storm chasm
#

I mean datapacks and plugins are ok for me but idk how to make them for custom structures

lunar plover
#

hey fellas, I could use help from someone more knowledgeable with looking for a somewhat specific kind of plugin if that's alright

#

I'm trying to get my hands on something to stop shulker boxes being put into chests but I'm coming up dry on anything recent

#

that or making it with like skript but I'm not that familiar lol

acoustic pendant
#

well, you can do a plugin that if u try to click a shulker box in a chest menu it cancells

#

i think

storm chasm
#

adri do you think you could help me making a plugin for that

lunar plover
#

I guess I'll look into it

#

making one myself that is, I'm not that good

tardy delta
#

๐ŸŽƒ

vocal cloud
barren nacelle
#

Can anyone help with this

untold rover
#

how can I get the ItemStack from a Projectile?

tepid cargo
#

how do you save information after a server reset? (besides mySQL)

onyx shale
#

yml also works

#

or pdc if you want to be a madman..

tepid cargo
#

ah, so just create a yml file for the plugin and read/write to it?

opal sluice
#

Does someone has a proper hikari cp tutorial to follow ?

onyx shale
#

such as minigames details are saved in config files

#

like arenas/games/signs

tall dragon
#

Json is pretty popular for storage as well, as serializing stuff is really easy with it

onyx shale
#

its merely tad bit faster but annoying to work with

tall dragon
#

I disagree

#

For settings. Sure, but for storing data i think its more pleasant to work with

onyx shale
#

if you know how to work with parents,childs yeah not hard but for someone new like him its just a pain for no benefit

tall dragon
#

U really dont need to know alot about that, just use gson to serialize/deserialize objects, pretty much everything is done for you

ivory sleet
pastel stag
#

do you have to initialize something like this public class ToggleBlockInfo implements Listener, CommandExecutor { private Main plugin; private SQLLogger sqlLogger; public ToggleBlockInfo(Main plugin , SQLLogger sqlLogger){ this.plugin = plugin; this.sqlLogger = sqlLogger; plugin.getCommand("winfo").setExecutor(this); }

differently in main class?

warped sage
#

Cast it to whatever it is like AbstractArrow

ivory sleet
#

its quite solid

warped sage
#

then use getItemStack()

untold rover
#

there is no getItemStack

pastel stag
#

getting an error that is telling me the getCommand is returning null

ivory sleet
#

Johni its not possible

#

well it is

#

but not through just an api method

ivory sleet
#

cause I believe normal mc doesnt even save thew stack

#

thats for arrow tho

warped sage
#

which is what I said, cast it to whatever it is first

#

depends on what you want to do

untold rover
ivory sleet
#

that too

warped sage
#

it's the same in spigot

untold rover
#

there is no such method in spigot

ivory sleet
#

anyways he might not even be working with AbstractArrow or any of its derivatives

untold rover
#

its a normal Arrow

#

just with a displayname

#

so to rephrase it, I need to be able to get the displayname of the Arrow projectile

ivory sleet
#

You can in principle store the itemstack through pdc when the projectile is spawned

untold rover
#

do you have an example how to do it properly? never really used pdc

onyx shale
#

?pdc

stone sinew
#

Is a switch of instance possible? (An example would help)
Like instead of

if(Object instanceof Object1)
if(Object instanceof Object2)
```You would do
```java
switch(objectinstance)
case Object1
case Object2
```?
onyx shale
#

hmmm not sure how java will react

#

it might throw an error for improper type

warped sage
#

you could switch on getClass()

#

not too clean though

stone sinew
warped sage
#

and getClass() isn't exactly the same as instanceof

stone sinew
untold rover
#

and how do I put an ItemStack inside the PDC?

warped sage
onyx shale
#

class name

#

also this hmm

#

Java currently has a draft to support this. See here. The syntax looks like this

switch (obj) {
    case Integer i: handleI(i); break;
    case Byte b:    handleB(b); break;
    case Long l:    handleL(l); break;
    case Double d:  handleD(d); break;
    case String s:  handleS(s); break
    default:        handle(obj);
}
stone sinew
ivory sleet
#

Class#isAssignableFrom and Class#isInstance both exist

#

though Class::isInstance just checks instanceof in principle

onyx shale
#

cant fully say what happens to non-primitives tho

untold rover
onyx shale
#

didnt i gave the command for that?

#

?pdc

ivory sleet
lost matrix
stone sinew
#
private void addTag(net.minecraft.world.item.ItemStack item, Map<String, Object> tags) {
    NBTTagCompound compound = getNBTTag(item);
        
    tags.entrySet().forEach(entry -> {
        String key = entry.getKey();
        Object value = entry.getValue();

        switch(value) {
        case <InstanceofString>: compound.setString(String.valueOf(value)); break;
        }
    });
}
```So basically I want to do this.
golden turret
#

hello, how do i get the size of the result string when calling Graphics#drawString("My string", x, z) from awt

#

context: i want it to be in the center

lost matrix
#

Wait a BiConsumer might not be enough here...

stone sinew
lost matrix
stone sinew
#

and the main set method is NBTBase

barren nacelle
#

?Paste

#

?paste

undone axleBOT
barren nacelle
#

So I was making a command that would add a player to an arrayList if the player was on an array list they wouldn't be able to throw entitys
but it didn't work can anyone figure out why? https://paste.md-5.net/veruxuzaxu.java

lost matrix
# stone sinew Compound has different set methods. Thats why I was taking the switch route.

Oh god this does not look healthy...

  private interface TernaryConsumer<T, K, V> {
    void accept(T t, K k, V v);
  }

  private final Map<Class<?>, TernaryConsumer<NBTTagCompound, String, Object>> applianceMap = new HashMap<>() {{
    this.put(String.class, YourClass::applyString);
    this.put(Integer.class, YourClass::applyInt);
  }};

  private static void applyString(final NBTTagCompound compound, final String key, final Object value) {
    compound.setString(key, (String) value);
  }

  private static void applyInt(final NBTTagCompound compound, final String key, final Object value) {
    compound.setInt(key, (Integer) value);
  }

  private void addTag(final net.minecraft.world.item.ItemStack item, final Map<String, Object> tags) {
    final NBTTagCompound compound = getNBTTag(item);

    tags.forEach((key, value) -> {
      final Class<?> valueClass = value.getClass();
      final TernaryConsumer<NBTTagCompound, String, Object> applier = this.applianceMap.get(valueClass);
      if (applier == null) {
        throw new UnsupportedOperationException("The value type " + valueClass + " is not supported.");
      } else {
        applier.accept(compound, key, value);
      }
    });
  }
stone sinew
lost matrix
#

But at least its really fast ๐Ÿ˜„

stone sinew
#
private void addTag(net.minecraft.world.item.ItemStack item, Map<String, Object> tags) {
    NBTTagCompound compound = getNBTTag(item);
    
    tags.entrySet().forEach(entry -> {
        String key = entry.getKey();
        Object value = entry.getValue();
        
        if(value instanceof String)
            compound.setString(key, (String) value);
        if(value instanceof Integer)
            compound.setInt(key, (Integer) value);
        if(value instanceof Double)
            compound.setDouble(key, (Double) value);
        if(value instanceof Float)
            compound.setDouble(key, (Float) value);
        if(value instanceof Short)
            compound.setShort(key, (Short) value);
        if(value instanceof Long)
            compound.setLong(key, (Long) value);
        if(value instanceof Boolean)
            compound.setBoolean(key, (Boolean) value);
        if(value instanceof Byte)
            compound.setByte(key, (Byte) value);
    });
    item.setTag(compound);
}
barren nacelle
barren nacelle
tall dragon
#

Theres a listener too

#

To block the throwing shit

stone sinew
barren nacelle
#

Oh ok

#

?paste

undone axleBOT
barren nacelle
chrome beacon
#

Did you forget to add the command to the plugin.yml

barren nacelle
quaint mantle
#

anyone familiar with using the hex chat colors? i want to make it so its (color 1) T (color 2) e (color 3) s (color 4) t where color=hex code

onyx fjord
#

@quaint mantle mini message is a cool API for that stuff

barren nacelle
opal sluice
#

Does someone know how to remove the loggings messages from HikariCP ?

pastel stag
#

Can someone explain to me the proper way of initializing this in Main.java, the way i'm using is giving me an error saying getCommand is null

    private Main plugin;
    private SQLLogger sqlLogger;
    public ToggleBlockInfo(Main plugin , SQLLogger sqlLogger){
        this.plugin = plugin;
        this.sqlLogger = sqlLogger;
        plugin.getCommand("winfo").setExecutor(this);
    }```
quaint mantle
onyx fjord
#

You want that?

quaint mantle
#

if that helps get u a better understanding

#

yea

onyx fjord
#

Yeah mini can do that

quaint mantle
#

ah

onyx fjord
#

With gradient tag

#

Idk how it looks in code

#

They have examples tho

quaint mantle
#

yeah i guess im looking to make my own way of doing it so it can adapt easily to our code

barren nacelle
onyx fjord
quaint mantle
#

oh shit

#

looks good

#

thanks

onyx fjord
#

Np

#

@quaint mantle
MiniMessage.get().parse(String)
I guess

pastel stag
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.n0grief.WatchBlock.Main.getCommand(String)" is null
        at com.n0grief.WatchBlock.ToggleMethods.ToggleBlockInfo.<init>(ToggleBlockInfo.java:26) ~[watchblock.jar:?]
        at com.n0grief.WatchBlock.Main.onEnable(Main.java:72) ~[watchblock.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Paper-266]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Paper-266]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Paper-266]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:535) ~[patched_1.17.1.jar:git-Paper-266]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:449) ~[patched_1.17.1.jar:git-Paper-266]
        at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:725) ~[patched_1.17.1.jar:git-Paper-266]
        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) ~[patched_1.17.1.jar:git-Paper-266]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1212) ~[patched_1.17.1.jar:git-Paper-266]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-266]
        at java.lang.Thread.run(Thread.java:833) [?:?]
[10:00:04 INFO]: [WatchBlock] Disabling WatchBlock v1.0.9```
opal juniper
#

Ok

onyx fjord
#

Aaaa

#

?paste

undone axleBOT
opal juniper
#

its not in the plugin.yml

quaint mantle
#

Also, while you're at it, update your server, it's ~80 builds out of date

opal juniper
#

hey noah NM_peepoWave

#

uptodate builds are cringe

pastel stag
#

there's an issue with the way that i am initializing the class i believe, not able to do it the same way i have in the past

opal juniper
#

?paste your plugin.yml

undone axleBOT
quaint mantle
#

^ pretend this is an external emoji, they are booster only for some reason here

opal juniper
#

Yeah lol , i know 7smile7 was having an issue with that - idk why

pastel stag
opal juniper
#

yep

#

winfo

#

its indent is screwed

#

its technically a value of wblockdebugger

#

so it never gets spotted

#

?main and a main moment too

pastel stag
#

shit sec

barren nacelle
#

?paste

undone axleBOT
untold rover
quaint mantle
#

Can't you just serialize the itemstack to bytes and then deserialize it when reading?

eternal oxide
#

an ItemStack is probably too much data to be storing in a PDC

#

unless its a permanent storage

young knoll
#

I mean, that is basically how shulker boxes work

alpine urchin
#

and the bytes to a string ๐Ÿ˜ฏ

#

then vice versa

barren nacelle
round elbow
#

I think the better way of doing this is separating the event listener in a different class
or at least that is the way i do it
also

commands:
  egg:
    usage: /<command>
    description: insert shit here lmao use ur imagination

use this in your yml ^^

unkempt peak
#

Wait are you trying to make a command or event?

#

Also nice sysout lol

quaint mantle
#

sorry for necroposring tho

unkempt peak
#
  1. That's not how you register commands you need to set the commands executor it's not an event
glossy venture
barren nacelle
unkempt peak
unkempt peak
glossy venture
#

You need to get the command as a PluginCommand using JavaPlugin.getCommand(String) and then set an executor using PluginCommand.setExecutor(CommandExecutor)

glossy venture
#

and dont forget to add the command to your plugin.yml

quaint mantle
#

getCommand("cmd").setExecutor(new CmdExecutor());

unkempt peak
#

Also make sure you use org.bukkit import for chatcolor because I noticed you where import the bungee one.

#

And remove the empty constructor it's not necessary

glossy venture
#

why doesnt bukkit chatcolor have the of method

#

or the one that allows for custom colors

unkempt peak
#

valueOf?

glossy venture
#

whatever its called

round elbow
#

guys so i have a question

unkempt peak
#

Or translateAlternateColorCodes?

unkempt peak
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. Create a thread in case the help channel you are using is already in use!

unkempt peak
#

Oh idk I don't use bungee

alpine urchin
#

convert java color class to bukkit equivalent?

glossy venture
#

yeah

#

bukkit ChatColor doesnt have that

round elbow
#
        getCommand("setHomesOptions").setExecutor(new AdminCommand());
        getCommand("setHome").setExecutor(new PlayersCommands());
commands:
  setHomesOptions:
    usage: /<command>
    description: Edit settings for SetHomes Plugin
  setHome:
    usage: /<command>
    description: Make a home

this is how i register my commands
but for some weird ass reason

#

doesn't get suggested when i try to do / in game chat

glossy venture
#

check if ur plugin is loaded using /plugins

#

first

round elbow
#

Ye its loaded
i can type the command manually and use it
but it just does not get suggested

#

even after reloading

#

or restarting the server

glossy venture
#

ooh

unkempt peak
#

The args aren't suggested or the command itself?

round elbow
#

this happened with all my plugins

round elbow
glossy venture
#

maybe its if ur not using api-version: 1.16 in plugin.yml

unkempt peak
#

Do the commands work if typed?

round elbow
#
main: com.rephrasing.sethomes.HomePlugin
api-version: 1.17
glossy venture
#

oh

round elbow
#

what is special about 1.16 huh

#

1.17 newer

unkempt peak
#

Nothing that doesn't matter

glossy venture
#

i have no clue

#

maybe its a bug

#

are you using an unstable version?

round elbow
#

well im using the latest paper jar

#

on my server

#

wdym by unstable

glossy venture
#

is it a release version

round elbow
#

u mean experimental jar?

glossy venture
#

yeh

round elbow
#

ye its a release

glossy venture
#

so not experimental

round elbow
#

no, not using experimental ones

#

no no

glossy venture
#

idk

#

does it work if u type /<pluginName>:<commandName>

barren nacelle
round elbow
glossy venture
#

what the hell

#

probably a bug ngl

#

maybe suggest it as an issue or something

#

to paper

round elbow
#

and the thing is
when i try to google that shit
it never gives results
not even random results, just complete none

round elbow
unkempt peak
round elbow
#

this is my onEnable

#

if you were curious

glossy venture
barren nacelle
unkempt peak
#

helping keylesstravis

barren nacelle
#

๐Ÿ™‚

#

?paste

undone axleBOT
dull sparrow
#

Anyone know the distance in minecraft coords of the nametag above entity/players ?

#

I can't find it on google

rocky panther
#

hey

#

im new

#

how do I code my own jar

#

any videos ?

rigid wyvern
rocky panther
#

looked everywhere

rigid wyvern
# rocky panther looked everywhere

Intellij (Make sure you download the community edition!)
https://www.jetbrains.com/idea/

Java 8 JDK (You have to make a free Oracle account to download the JDK)
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

Feel free to ask in the comments or drop a message in my discord server and I will be glad to help!

Please L...

โ–ถ Play video
rocky panther
#

...

#

Im talking about jar

#

like how to make like a custom spigot

barren nacelle
#

?paste

undone axleBOT
glossy venture
#

of spigot

rocky panther
#

ye

glossy venture
#

just fork their github

#

and edit the code

#

and build the jar

rocky panther
#

how do i make it

#

I can edit so water doesnt push tnt

#

and tnt

#

doesnt move when lighted

glossy venture
#

i dont know

rocky panther
#

minecraft_tnt_merge

unkempt peak
#

But you still need to learn Java along with that

#

?learnjava

undone axleBOT
unkempt peak
#

You should really learn the basics of Java before you even think about plugins

rocky panther
#

kk

pastel stag
noble lantern
#

hey yall what we doing today

unkempt peak
noble lantern
#

was asking that as in like what are yall working on today/who needs help kind of way should of worded it better

unkempt peak
#

Ah ok no problem just don't want to fill this channel with random discussion

#

Also sorry if i sound like a mod lol I just find it really annoying when I'm trying to help people or ask a question and it gets drowned out by people talking about random stuff

vestal matrix
#

is it possible to set the color of a beacon to RGB colors? or just the default mc colors?

unkempt peak
#

It might be possible with nms packets

#

Because you can combine glass colors

vestal matrix
#

wdym by combine? do you mean putting glass ontop of another?

opal sluice
#

Is anyone familiar with batch statements in sql ?

#

I would like to execute multiple statements in one query

#

with PrepareStatement#addBatch() and PrepareStatement#executeBatch()

#

But not sure on how to use the actual addBatch

vestal matrix
unkempt peak
#

Really? Huh I thought that was a thing maybe on bedrock idk

#

It's probably not possible then

vestal matrix
#

rip

pastel stag
#

anyone available to hop into a voice channel for a few to help me out

ivory sleet
#

sure

pastel stag
#

alright im in general-1

rancid pine
#

at org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity.teleport(CraftEntity.java:226) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at me.babario.HelloWorld.commands.Spawn.onCommand(Spawn.java:45) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
... 15 more

#

how do i see the rest of the errors?

echo basalt
#

1.8 ๐Ÿคฎ

rancid pine
#

because it says 15 more

rancid pine
echo basalt
#

those 15 more are irrelevant

rancid pine
#

oh

pastel stag
#

?paste

undone axleBOT
echo basalt
#

1.18 is about to come out and you're still on 1.8

#

the amount of versions plugins have to support honestly just make it not worth anymore

rancid pine
#

i love playing on servers with the newer versions but sometimes servers like hypixel are fun and thats in 1.8

noble lantern
#

i kinda already forgot how 1.8 api works got used to the 1.16+ api

rancid pine
#

i wanna make a server like that

noble lantern
echo basalt
#

Bit irrelevant to your case but you aren't moving forward by using a version older than your playerbase

rancid pine
#

hard*

noble lantern
#

and remove the attack cooldown, cancel sweeping attacks and anything else you dont like

#

You just wont be able to do block-hitting which is fine tbf

rancid pine
#

oo ok

#

yeah thats fine

noble lantern
#

You can make it where if someone right clicks they just bring up a shield, but make sure you store theyre offhand item beforehand and make sure they cant dupe shield

rancid pine
#

how do i do stuff like remove the attack cooldown

#

is there a method?

noble lantern
#

I cant exactly remember how i did it

rancid pine
#

ok i will tysm

echo basalt
#

oldcombatmechanics handles all that

rancid pine
echo basalt
#

nah it's a plugin

rancid pine
#

ahh ok awesome

noble lantern
#

Ah yeah forgot about that plugin

echo basalt
#

except replace 5 versions with 10

rancid pine
#

ok ill read it rn thanks

#

dang it can even get hacked

#

yeah im switching to the newest version

quaint mantle
#

idk if im late or not but try
for(string idk : playerheadlore) metaplayer.setlore(idk)

#

oh wait

#

in the wiki it can use the list<string>

#

wait

#

but it is deprecated

#

this isn't deprecate

young knoll
#

Thatโ€™s paper

quaint mantle
#

it's time to run

noble lantern
#

wait SpigotAPI still uses strings instead of Components?

#

Not saying its a bad thing

ivory sleet
#

necessarily not

#

well it hasnt deprecated string methods as opposed to paper

noble lantern
#

Ohh so Component will still work accross the 2 alright then i was kinda saying oh shit over and over in my head cause my whole plugin uses them on PaperLib lmao

ivory sleet
#

Oh no, spigot uses bungee chat api, whilst paper uses adventure

young knoll
#

Donโ€™t think spigot has component methods for a lot of stuff yet

noble lantern
ivory sleet
#

yeah

#

most likely a NCDFE will yield

noble lantern
#

daaaaang

#

thats sad now i gotta make the plugin use 2 different libs

#

Would there be an easy way to support both versions inside one plugin by chance? Or would i have to make 2 seperate forks?

#

I mean changing the Component import would be easy just a simple ctrl + f search and replace tbf

young knoll
#

The easiest way is to support spigot

#

Paper is still API compatible for now

noble lantern
#

Yeah but only way i can see doing that is one of two ways

Either creating a "spigot" branch on my github and replacing the Component import

Or revert to using strings which i dont really wanna do necesarily

ivory sleet
#

burchard you could shade in adventure

#

and adventure bukkit platform

#

if you want to use it

#

Then you'd in principle use BukkitAudiences::create

#

and pass that around to send messages and whatnot

young knoll
#

What is the difference between adventure and minimessage

ivory sleet
#

adventure is a text library, minimessage is just a formatting library isnt it

noble lantern
ivory sleet
#

yeah

#

or use smtng like slimjar and download the dependency at runtime

young knoll
#

Iโ€™m thinking of using minimessage

ivory sleet
#

if you want to save size that is

young knoll
#

Having people type rgb color codes in the config sounds terrible

noble lantern
young knoll
#

If adventure is on maven central you can use the spigot dependency system

#

Isnโ€™t gson already in spigot

noble lantern
#

I wouldnt be concerned if the plugin was 5ish mb in size as it is a large plugin

noble lantern
ivory sleet
#

anyways gson is kinda ded

noble lantern
#

I mean latest commit was 7 days ago so i dont necesarily thing its dead

#

Pluss the class serialization for parsing json makes things so much easier

noble lantern
ivory sleet
#

well

#

moshi is much better

noble lantern
#

intresting ill have to look into it i have never heard of Moshi before

It would be hard to convert as of right now as my whole entire plugin is based around Gson support currently (Adding mysql support is gonna be hell)

#

also like how the entire lib for moshi is much smaller

#

My current project is like 337kb in size which really isnt much but im always wanting to make my plugins smaller in download/storage size even if its a few kb

ivory sleet
#

hmm

#

yeah

#

I really don't care about size as long as it isn't unreasonable, from my point of view the design and architecture should take precedence.

noble lantern
#

Yeah i wouldnt really care if a plugin is a few MB in size, especially after i add in mysql/mongo support its gonna reach a few MB in size

I would say the entire structure/design of my current project is pretty well done but idk i selt taught myself everything i know about java and this is one of the largest projects im doing right now

ivory sleet
#

yeah, tho as said you could ofc try out runtime dependencies

#

where you download them at runtime and load the classes

noble lantern
#

Wouldnt downloading at runtime though increase startup time significantly? Or would it be negligable

drowsy helm
#

in most cases its not that significant

#

plus if implemented properly it should cache, so obviously not every startup would require you to dl the dependencies

ivory sleet
#

wel you'd cache it

#

so its kinda a one time slowdown

noble lantern
#

What would be the proper way to implement it? Just setting mavens scope to runtime would be enough or is it a bit more complicated than that?

#

If thats not the proper way ill google it up

ivory sleet
drowsy helm
#

I've seen a few libraries for it, can't remember names off the top of my head. I don't use it much

noble lantern
# ivory sleet https://github.com/slimjar/slimjar

ty ill definatly take a look into that soon enough once i add in other libraries

I do want to split my code apart and make a seperate library jar for things like storage/config read & writing, playerdata classes, particles/animation and whatnot and keep the plugin strictly to events and commands but that's a lot to split apart currently, and having a slimjar would seem really usefull for that

drowsy helm
#

try not to spread it too thin

noble lantern
#

Yeah i definatly wouldnt do that, having a thing like

ExternalAPI#savePlayerData(Type.MySQL, data)

Or

ExternalAPI#createAura(data) would deem pretty useful

As currently this entire plugin has its own API but its kinda just crammed into one plugin and just feels messy working with 50+ different classes all in one project

#

ill definatly need to do some refactoring as well because right now a lot of this junk is reptative or just not readable very easily to outside sources

drowsy helm
#

My biggest mistake when working with large projects was spreading my projects too thin, Then its a huge pain to make sure you have correct dependencies, versioning etc etc

#

yeah refactoring is always good, spend a day or two just refactoring your project, it usually doesn't take ah uge amount of time

#

i refactored one of my 14k LOC projcets in < 3days

quaint mantle
#

oh

noble lantern
#

Oh yeah definatly, i would think maybe shoving all dependencies into the API jar and importing it that way would be a nice way of doing things

drowsy helm
#

pog

quaint mantle
#

uhh i thought heart day

noble lantern
drowsy helm
#

if you don't mind me asking what is the project?

noble lantern
drowsy helm
#

yeah i just finished the whole series a few months ago

noble lantern
#

Its basically that but as a minecraft plugin

drowsy helm
#

ou that would be interesting

#

keep us updated lol

noble lantern
#

So far i have a race selection, RPG system, and im working on Quests right now

#

Im so not looking forward to creating ki blasts though, cause i utter dogshit with using math

#

The projects in a link in my bio if you ever wanna look through it

drowsy helm
#

lmao sometimes its just a matter of throwing math at the compiler and see what works

noble lantern
#

Thats my plan

#

Took my a good like 20 mins to figure out a good defens formula LMAO

drowsy helm
#

oh yeah formulas like defense, exp etc take a while to fine tune

noble lantern
#

its simple but as of now it works with the custom mobs currently added

#

But i feel like later on ill need to making it better cause it just looks bleh

#

oh and there custom mobs added ^

#

They basically go my radius in each world, so the farther out you go the stronger they get

drowsy helm
#

ah right

#

Oh btw i would really recommend lombok for large projects like this

noble lantern
#

lombok?

#

hmm

drowsy helm
#

ever heard of it?

quaint mantle
#

this right? ^^

drowsy helm
#

yep

noble lantern
#

Never heard of it hm

quaint mantle
#

me too.

drowsy helm
#

let me show an example real quick

quaint mantle
#

๐Ÿฆˆ

noble lantern
#

im watching the video on theyre site rn

#

Ohhh so its line tabnine for nodejs?

drowsy helm
#
private int n;

public void setN(int val){
  this.n = val;
}

public void getN(){
  return this.n;
}```

becomes
```java
@Getter 
@Setter
private int n;```
#

it becomes super handy when you have say 20 manager classes with getter/setters

#

instead of having say 100-200 lines for getter setters

#

it becomes 20 lines

#

also has other functionality like a builder annotation for classes and some other features

noble lantern
#

I see ill definatly have to look at that

jade perch
#

I love lombok

#
@AllArgsConstructor
@Builder
@Data
@Jacksonized
public class HDLConfig {
    @Singular
    private Set<Repository> repositories;
    @Singular
    private Set<ResolvedDependency> dependencies;
}
drowsy helm
#

thats hot lmao

#

vs how many lines without lombok

noble lantern
#

Only thing is if i use lombok i need to be able to trigger cache updates when a method is called but tbf i can probably call that after the methods used

drowsy helm
#

oh my

noble lantern
#

I really need to refine this class maybe i can make each getter/setter return a Savable/Cachable class and do something like setHealth().cache() so it does that for me

noble lantern
#

Would i be able to add in certain if clauses with lombok? EG:

drowsy helm
#

not that im aware of

drowsy helm
noble lantern
# drowsy helm sounds a bit convoluted tbh

Kinda is, its just that i would need to update the PlayerData thats in cache cause when things like this happen:

It would update theyre data in the HashMap that stores player data

noble lantern
jade perch
#

Lombok is strictly for boilerplate code

drowsy helm
#

^

#

its purpose is to reduce boilerplate

noble lantern
#

Yeah i 100% can add in lombok to things like this class here And remove all my getters and setters inside my PlayerData class here: that would shorten things down by a bunch

jade perch
#

I think lombok is something you should use from project start

#

if you already have it written out, it's just more work to undo it

quaint mantle
#

i have no idea why you guys put the word this. in

drowsy helm
quaint mantle
#

that is just boost the line 5 more words.

noble lantern
#

Everything in here is pretty modular i would just need to refactor the current code or just make my PlayerData extend PlayerCurrentData and it would be done pretty easily

#

I prefer using this whenever applicable

#

And final as well

drowsy helm
#

its negligible in most cases

#

same with people using final, i saw some dude who used final on every argument of every function

jade perch
#

Yeah it's mostly for readability not conciseness

drowsy helm
#

final is only really useful when making APIs

noble lantern
#

Yeah definatly but i feel it just makes things easier to read, so that way people who read the code know that that variable is in this class

drowsy helm
#

if you're writing your own code you should know what is immutable lol

noble lantern
#

That was on previous projects though

drowsy helm
#

this is only really useful in constructors or with clashing argument names

#

(or passing the class as an argument itself)

noble lantern
#

Yeah thats pretty much where its used is in constructors

EG when i pass plugin into a constructor it will be this.plugin = plugin

But i still referance it in later cases by this.plugin so i guess my first line in this statement is false

ivory sleet
#

this adds quite much readability

#

I even have my ide to complain if this can be added but isnโ€™t

noble lantern
#

Yeah it does make it a lot easier for me to read personally but it can also confuse people who contribute later on maybe

drowsy helm
#

I think it aids in readability in some scenarios but in say for example this.number = 1; it would be pretty useless

ivory sleet
#

Sure ides do a good job coloring local stuff vs instance stuff but on gh for instance

#

Not at all

#

We now for sure know itโ€™s an instance variable

noble lantern
#

But i doubt anyone will contribute to something large like this

My only people contribute to my Nodeactyl project

noble lantern
noble lantern
#

brb

ivory sleet
#

Indeed

drowsy helm
#

i sort of like it, but idk if its some sort of stockholm syndrome or something lmao

exotic scroll
#

how many players can play minecraft 1.17.1 server at the same time?

#

SOrry

#

wrong channel

noble lantern
#

at least 7 no more than 12 (if you get this joke nice)

noble lantern
young knoll
#

You mean like that

noble lantern
#

Also speaking of github, what would cause a project that hasnt been heavily advertised to get views and clones like this? Bots i assume?

noble lantern
young knoll
#

Settings > Appearance

ivory sleet
#

Someone might have just found it and then decided to share it with others

noble lantern
noble lantern
ivory sleet
#

Ye

noble lantern
#

Well thats nice to know people are using my dogwater code somewhere LMAO

ivory sleet
surreal cave
#

Spigot sendMessage() Skipping Lines

quaint mantle
#

pen pen

lusty cipher
last ledge
#

Spider spider = skeleton.getLocation().getWorld().spawn(skeleton.getLocation().add(0.5, 0, 0.5), Spider.class).setPassenger(EntityType.SKELETON);

#

error: incompatible types: org.bukkit.entity.EntityType cannot be converted to org.bukkit.entity.Entity

stone sinew
last ledge
#

error:

#

incompatible types: boolean cannot be converted to org.bukkit.entity.Spider

drowsy helm
#

set passenger returns a boolean

#

just spawn it then set passenger dont have to do it in one line

carmine nacelle
#

So how would I fire 3 arrows in the direction the player is facing with a space between them...?

#

so they look like multishot type stuff

#

I have it partially working but only in one direction..

quaint mantle
# last ledge error:

Frolic are u new to java?, if yes then I suggest u to learn the basics before coding a plugin, u will have a easier time, and using spigot doc

carmine nacelle
#

im adding 0.25 to the location's X for each arrow but i need a way to know if the X or Z should be changed

#

depending on facing direction.

quaint mantle
#

Making 2 arrows that have different rotation and velocity, pretty sure that's how multishot crossbow work

carmine nacelle
#

errrr..wot

surreal cave
#

Does anyone have any idea why my issue is even occuring

carmine nacelle
surreal cave
#

check the threads lol

surreal cave
#

welp... I cannot comeback from that one

last ledge
#

this should work?

quaint mantle
#

Read the doc

#

And think urself if it will work of not

last ledge
#

link

stone sinew
surreal cave
stone sinew
quaint mantle
#

I support that xD

surreal cave
stone sinew
surreal cave
#

if that is the case, why should I have to retype my issue

stone sinew
quaint mantle
stone sinew
#

Only slightly

surreal cave
manic furnace
#

Can somebody give me an exmaple how to listen to minecraft packets?

quaint mantle
surreal cave
quaint mantle
#

True lol

#

But u being too impatient

surreal cave
#

... still the syntax is correct

candid galleon
#

what are yall talking bout

quaint mantle
#

Before I start being toxic I will take my leave ๐Ÿ–๏ธ

pastel stag
#

getBlockFace().getModX() best method that exists in the api prove me otherwise

remote gazelle
#

what is src/test folder and how can i use that in plugin dev?

hearty solar
#

hello

#
@EventHandler
    public void onWorldChange(PlayerChangedWorldEvent event, Inventory inv) {
        currentWorld = event.getPlayer().getWorld();
        if(currentWorld.getName() == "bwlobby")
        {
            inv.clear();
        }
    }
#

is this ok?

#

i mean

#

uh

#

will the function get called with 2 argument?

#

or will only call the function with only 1 argument

#

nvm

#

i realize i can use event.getPlayer().getInventory().clear();

waxen plinth
#

Event listeners don't work like that

#

They only pass the event

#

And yeah you can get the inventory from the player

pastel stag
#

?paste

undone axleBOT
quaint mantle
#

@hearty solar

    
    @EventHandler
    public void onWorldChange(PlayerChangedWorldEvent e) {
        Player p = e.getPlayer();
        checkPWorld(p);
    }
    
    public void checkPWorld(Player p) {
        if (p.getWorld() == *your world* ) {
            p.getInventory().clear();
        }
    }```
#

you should learn java

pastel stag
#

anyone got a clue what makes else if(action == Action.RIGHT_CLICK_BLOCK){ player.sendMessage("1");
execute twice but
if(action == Action.LEFT_CLICK_BLOCK) {
only executes once?

quaint mantle
#

Pretty sure it's called for each hand

pastel stag
#

oh rly

#

but left click is only called for one hand?

quaint mantle
#

yeah

#

you can just check if e.getHand() == EquipmentSlot.HAND

pastel stag
#

hmmm

#

if im wanting this method to run regardless of what's in the person's hand or if its empty is there another way of getting around that weird behavior

quaint mantle
#

Does the event not fire if your hand is empty?

pastel stag
#

currently, it fires w/ empty and & block in hand

#

it fires 1 time w/ a block in hand and 2 times if naked hand

pastel stag
#

anyone got any ideas?

last ledge
#

i want whenever my skeleton moves, Vex spawns with it, but idk why its not working.


import io.papermc.paper.event.entity.EntityMoveEvent;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Skeleton;
import org.bukkit.event.Listener;

public class SkeletonEvent implements Listener {

    public void skelEvent(EntityMoveEvent event) {

        if (!(event.getEntity() instanceof Skeleton))
            return;
        Skeleton skeleton = (Skeleton) event.getEntity();
        if (!(event.getEntity().hasMetadata("SkeletonKing")))
            return;
        skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
    }
}```
stone sinew
#

Need a task checking its location

last ledge
#

ah

#

can you give me some examples

#

how do i do it

quaint mantle
#

LOL

#

you didnt see the import right?

last ledge
#

ya i see it

#

but now i am asking how do i spawn vex

#

when skeleton moves

quaint mantle
#

?


    @EventHandler
    public void onEntityMove(EntityMoveEvent e) {
        if (e.getEntity() instanceof Skeleton skeleton) {
            skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
        }
    }```
#

this is more easy to read man @last ledge

#

ur code is not cool.

quaint mantle
#

did you even check?

#

?learnjava

undone axleBOT
quaint mantle
#

check it

#

then tell me the result

#

after that if it works then just put another if to check its metadata like what you did

#

after u feel like u are pr0 enough for spigot

#

just go spigot javadocs

pastel stag
#

how to fire method for ONE hand using PlayerInteractEvent.getAction.RIGHT_CLICK_BLOCK?

last ledge
pastel stag
#

instead of firing once for each hand when no block in hand

last ledge
#

so what to do

quaint mantle
#

then remove the skeleton then use Skeleton skeleton = (Skeleton) e.getEntity();

#

as i used java 16

#

and it is way better to use java 16

last ledge
#
        public void onEntityMove (EntityMoveEvent event){
        Skeleton skeleton = (Skeleton) event.getEntity();
            if (event.getEntity() instanceof Skeleton skeleton) {
                skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
            }
        }
    }```
#

???

quaint mantle
#

remove the skeleton after event.getEntity() instanceof Skeleton

#

and put the Skeleton skeleton = (Skeleton) event.getEntity(); in the if statement

last ledge
#
        public void onEntityMove (EntityMoveEvent event){
        Skeleton skeleton = (Skeleton) event.getEntity();
            if (event.getEntity() instanceof Skeleton) {
                skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
            }
        }
    }```
quaint mantle
#

Do you even understand the code?

#

?learnjava @last ledge

undone axleBOT
pastel stag
#

anyone familiar w/ right clicks using PlayerInteractEvent

quaint mantle
pastel stag
last ledge
#

uh

pastel stag
#

Right click fires twice with naked hand, fires once when block held in hand on click

#

anyway to make it behave same way no matter naked hand/block hand

quaint mantle
#

array2 = arraylist or wat?

pastel stag
#

its part of a toggle

quaint mantle
#

Wait.

pastel stag
#

you just cant see the toggle portion

quaint mantle
#

you dont even know java i think

pastel stag
quaint mantle
#

Looks like I'm right

#

because ur code looks kinda disgusting...

pastel stag
#

OK... lol

quaint mantle
#

First of all

#

I will post the code here and tell you why

#

shiet.

#

it passed 2000 words.

#

hmmm

#

your code is really messy lol

#

instead of passing xyz world

#

why dont u just pass the location of it?

pastel stag
#

ive been coding for like a month...

#

because SQL integration

quaint mantle
pastel stag
#

needs to be passed 1 int at a time into sql query

#

cannot be Location object obv

quaint mantle
#

then after that

#

you can get the x y z world whenever u want

#

man

#

u dont know that?

#

LOL?

pastel stag
#

do you have any idea how to fix the problem i was actually presenting

#

or are you just here to flame people

#

cause if youre just here to flame people you should just fuck off

quaint mantle
pastel stag
#

Right click fires twice with naked hand, fires once when block held in hand on click
anyway to make it behave same way no matter naked hand/block hand

quaint mantle
#

ok that guy help u before is right

pastel stag
#

im aware it is firing once per hand

#

i was asking if there was a way to have it only fire once and ignore second hand

chrome beacon
#

Check the hand

quaint mantle
#

?pastes

#

?paste

undone axleBOT
quaint mantle
#

i think i reduce only 20 lines...

last ledge
quaint mantle
last ledge
#

its not possible

quaint mantle
#

just, put, that, line, in, the, if, block, code. maybe use the block code is easier for u to understand?

#

no, if he can't understand the word put in statement then he cant understand anything else.

quaint mantle
# last ledge ``` @EventHandler public void onEntityMove (EntityMoveEvent event){ ...
    @EventHandler
        public void onEntityMove (EntityMoveEvent event){
        Skeleton skeleton = (Skeleton) event.getEntity();
            if (event.getEntity() instanceof Skeleton) {
                skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
            }
        }
    }```
to ```java
    @EventHandler
        public void onEntityMove (EntityMoveEvent event){
            if (event.getEntity() instanceof Skeleton) {
                Skeleton skeleton = (Skeleton) event.getEntity();
                skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
            }
        }
    }```
#

that isn't difficult...

#

put the in if statement

#

i hope i will never spoonfeed anyone...

last ledge
#

doesnt work....

quaint mantle
last ledge
#

yes

#

getServer().getPluginManager().registerEvents(new SkeletonEvent(), this);

quaint mantle
#

wait

#

try create another fresh project

last ledge
#

this is fresh only

quaint mantle
#

ok i will test that.

#

i created brand new fresh project

last ledge
#

ok

bronze notch
#

Does anyone understand why I cannot pass an Array<ItemStack> to a function that accepts Array<ItemStack?> in Kotlin? I can't get to make the non-nullable array I have at the beginning nullable again without looping...

quaint mantle
#

it is ur fault not mine.

last ledge
#

leme send u my main class, if its correct

#

?paste

undone axleBOT
last ledge
quaint mantle
#

oh and that picture is somehow reveals my identity so i will remove it

last ledge
#

bruh

#

theres my main class

quaint mantle
#

I dont see anything sus

last ledge
#

import io.papermc.paper.event.entity.EntityMoveEvent;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Skeleton;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntitySpawnEvent;

public class SkeletonEvent implements Listener {
    @EventHandler
    public void onEntityMove (EntityMoveEvent event){
        if (event.getEntity() instanceof Skeleton) {
            Skeleton skeleton = (Skeleton) event.getEntity();
            skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
        }
    }
}```
#

here is full code

#

if anything is wrong

eternal night
#

Is your plugin enabled ๐Ÿ‘€

last ledge
#

bruh ofc yes

quaint mantle
#

the only thing is:
the ondisable isnt necessary to keep there
and i used constructor instead of the static instance :v
but 2 of them is just my personal idea, u can take it or not

#

and i dont see anything really sus with those 2

last ledge
#

so why isnt it working

#

r u sure that code is working?

quaint mantle
last ledge
#

cause someone above said EntityMoveEvent doesnt work

quaint mantle
#

yes of course will not work with spigot.

#

but if u used paper

#

then of course work.

last ledge
quaint mantle
#

ok. then nothing sus

#

do u really need me to give u the picture again

last ledge
#

help me solve my issue, i dont need picture

quaint mantle
#

so maybe can u give log?

#

or no log for the error

last ledge
#

no error

quaint mantle
#

then i have no idea why it dont work

last ledge
#

uh

#

if u pro cant figure out, how will i normie guy fix it

#

so i think i cant do it

quaint mantle
last ledge
#

me 2 weeks

quaint mantle
#

Hmm, I'l take a look one second.

last ledge
#

yus

lavish hemlock
#

array as Array<ItemStack?>

#

That is really weird though, nullable types should accept non-null values...

last ledge
#

i am using api version 1.13

#

will this work ?

lavish hemlock
#

Also don't ask people for help with Kotlin lol, most either hate or don't know the language, feel free to ping me instead.

quaint mantle
#

Is there an entitymoveevent in 1.13?

pine island
#

Server dosnt load but the plugin is there```package me.luminaexe.hardcorepurge;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.plugin.java.JavaPlugin;

public final class HardcorePurge extends JavaPlugin implements Listener{

@Override
public void onEnable() {
    // Plugin startup logic
    System.out.println("------------------------------------------------------------------------Hardcore purge was started Initialisation was success No problems were found--------------------------------------------------------------------------------");
    int x = 1;
    getServer().getPluginManager().registerEvents(this, this);
}

@EventHandler
public void onDeath(PlayerDeathEvent event) {
    //Even for Joining
    System.out.println("say A player has died L gg");

}

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

}

last ledge
undone axleBOT
lavish hemlock
#

Also the server itself doesn't load?

quaint mantle
#

So you need a vex to spawn on each skeleton?

#

Right?

#

@last ledge

lavish hemlock
#

Why would we need your plugin code then? You'd want help with the server files.

pine island
#

no the plugin dosnt just show up when i do pl

lavish hemlock
#

Did you put the plugin in the plugins folder?

pine island
#

yep

#

ofc

last ledge
#

i want exactly like that in skeleton

lavish hemlock
#

Is there a plugin.yml in your resources?

pine island
#

lemme check rq

quaint mantle
#

So the way you are doing it right now is that one vex spawns every time the skeleton moves a block (anywhere) which will cause ALOT of lag to your server.

pine island
#

where is it(im still new to plugins)

quaint mantle
#

like alot

quaint mantle
#

maybe he needs a code for delay it

lavish hemlock
quaint mantle
#

I will send you a better way one second.

#

i think the server i tested is now died.

last ledge
#

k

last ledge
quaint mantle
#

yeah it actually died.

quaint mantle
# last ledge k
    @EventHandler
    public void onEntityMove (EntityTargetLivingEntityEvent event){
        if (event.getEntity() instanceof Skeleton) {
            Skeleton skeleton = (Skeleton) event.getEntity();
            skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
        }
    }
}```
#

Here it only spawns when the skeleton targets an enemy

#

Also don't forget to register events in your main file.

quaint mantle
#

but

pine island
quaint mantle
#

but that can still kill the server

lavish hemlock
#

Copy and paste that plugin.yml here

pine island
quaint mantle
#

if someone decides to run around to trick the skeleton then the server will die anyway

quaint mantle
#

You could add a check to see if its targeting a player

quaint mantle
#

oh hm

#

i thought it would spam the event until the player out of range

#

lel

#

oh no, i think the target event is only called when it agros on a player

last ledge
#

it works now

#

but it only spawns 1 at a time

#

can i do like 5 at a time?

pine island
quaint mantle
#

for loop

quaint mantle
# last ledge can i do like 5 at a time?
    @EventHandler
    public void onEntityMove (EntityTarget event){
        if (event.getEntity() instanceof Skeleton) {
            Skeleton skeleton = (Skeleton) event.getEntity();
            skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
            skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
            skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
            skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
        skeleton.getWorld().spawnEntity(skeleton.getLocation(), EntityType.VEX);
        }
    }
}```
#

Just do this.

last ledge
#

ok

quaint mantle
#

for (int i = 0; i < 6; i++) spawn here

lavish hemlock
#

Yeah I saw it, the file looks good. Have you checked to see if your jar file contains it?

lavish hemlock
quaint mantle
#

uwu

#

and the meme just started again...

last ledge
#

amog us

quaint mantle
#

a smoke us

lavish hemlock
#

A jar file is just a zip file (no joke), so have you checked if the plugin.yml is in it? Spigot needs it to recognize your plugin soo if it can't that's really the only thing I can think of.

pine island
#

how do i check?

#

i do pythn lol

quaint mantle
#

jar file is a zip. no joking here dont sus me

#

maow is typing...

lavish hemlock
#

Well it is tho, it's literally the zip format but with an extra flag.

#

And also it's specified that jars must have manifests (META-INF/MANIFEST.MF)

quaint mantle
#

basic java moment