#help-development

1 messages · Page 58 of 1

dapper saddle
#

So super noob question (been out of the game for ~2-3 years now). Just redownloaded eclipse 2022, can add my old spigot-1.15.1.jar as an external jar and successfully import from it, but anything new (1.18+) that I build or find jars online for isn't recognized. I installed JDK 18 and am using that for the project. Rebuilt spigot+paper spigot several times with no luck. fresh installs all around - any help is appreciated

sturdy frigate
#

Oh hm, I wonder, can I change the weather state to stormy/rainy without the rain? It kinda gets foggy during a rain doesn't it

rough drift
desert frigate
#

What does that mean exactly?

rough drift
#

to fix that

Bukkit.getScheduler().runTaskLater(plugin, () -> {
  // get entities
});
undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

rough drift
sturdy frigate
rough drift
sturdy frigate
#

It's all the same, just a bunch of rain

rough drift
#

yeah

sturdy frigate
#

maybe snowy weather was the one?

rough drift
#

nope

sturdy frigate
#

Snowy is just rainy in a snow biome right

rough drift
#

yep

sturdy frigate
#

Ahh okay

#

Too bad I guess

rough drift
#

try the blindness/darkness effect?

sturdy frigate
#

:o interesting lemme see

#

Oh wow, darkness is really good, I wonder if i can change the color

#

Blindness just sorta blinds me

rough drift
#

you can't change darkness's color iirc

sturdy frigate
#

aw okay

#

Tough luck

#

Any way I can team up zombies A and B and make them fight btw?

rough drift
#

Yeah there was a way

rough drift
#

iirc summoning a snowball with the shooter as zombieA above zombieB's head, it will cause zombieB to get mad at zombieA

sturdy frigate
#

Was a way? :O

rough drift
#

I don't know if there is a better way in newer versions

sturdy frigate
#

Lol, can I just make them inherently mad at each other tho?

desert frigate
#

Would it also be possible to await event? Basically I want to wait till a user sends a message but making another event handler is a really pain and non effective way

crimson scarab
#

how can i double the damage dealt by tridents when thrown

sturdy frigate
desert frigate
rough drift
rough drift
sturdy frigate
#

Okayy take your time

rough drift
sturdy frigate
#

:o I see, is there a way to execute these commands through the plugin?

rough drift
#

if the plugin supports it

sturdy frigate
#

What do you mean?

#

I'm trying to make a plugin

rough drift
#

what plugin do you mean?

#

Ohhh

#

then yeah

#

Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "commandWithoutTheSlash")

#

that will execute as console

#

(you can also pass in a player instead of the console sender, so Bukkit.dispatchCommand(player, "commandWithoutTheSlash"), but in that case it's easier to run player.chat("/command"))

sturdy frigate
#

awesome thank you so much!

rough drift
#

No problem! :D

worldly ingot
#

Because the returned Map is the parameter index to the remaining ItemStack quantity. So every single one of those Maps will return a Map with a single entry where the key is zero, effectively overriding each other

#

Inventory#addItem() takes varargs of ItemStack. You can just pass them all into one call instead and it will resolve the issue

outer river
#

hello, i'm searching for a way to transform an args of my command (in my command class) into a timer (in my class bukkitrunnable class)
example: /potato tomato 50 -> args[1] = my timer = 50 sec

Can you help me pls ?

worldly ingot
#
this.dropMissingItems(player, inv.addItem(
    new ItemStack(Material.EMERALD_BLOCK, 64),
    new ItemStack(Material.GOLD_BLOCK, 64),
    new ItemStack(Material.IRON_BLOCK, 64),
    new ItemStack(Material.LAPIS_BLOCK, 32),
    new ItemStack(Material.DIAMOND_BLOCK, 4),
));```
#

This will work, trust me

#

o/

iron glade
outer river
#

i tried to save my timer into an arraylist<Integer> and call him in my timertask but it failed

dusk flicker
#

?colorcodes

#

damn

outer river
#

yeah exactly

dusk flicker
#

this

outer river
#

yup, saw it, just dont even fixed yet

iron glade
#

Why not just create a constructor taking an integer?

crimson scarab
#

what is the register command thing

#

line

#

yes

#

that is what i meant

outer river
crimson scarab
#

im i allowed to ask somebody to join my server i just need to test my command really quick

outer river
#

okok, but this only works if i put my command in my main right ?

#

ok i'll try see you in 1 min

sturdy frigate
#

Trying to work with NMS, when I try to add the spigot dependency in my plugin, i get this issue:
Dependency 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT' not found Do i need to add a specific source or something?

kind hatch
#

Did you run build tools with --compile craftbukkit?

sturdy frigate
#

Ah nope, I didn't

#

I just ran the bat file and ran the jar file

sturdy frigate
eternal oxide
kind hatch
#

Why not?

eternal oxide
#

CB is in Spigot, you just have to build Spigot is all

sturdy frigate
#

Oh wow wait I found an issue in the log

[WARNING] Failed to write tracking file C:\Users\User\.m2\repository\net\java\dev\jna\jna\5.10.0\jna-5.10.0.jar.lastUpdated
java.io.IOException: There is not enough space on the disk
    at java.io.RandomAccessFile.writeBytes (Native Method)```
eternal oxide
#

if you built spigot you don't even need a repo (other than local) to depend on spigot.

sturdy frigate
#

how many gigabytes is it supposed to need?

kind hatch
sturdy frigate
#

I literally had like 4-5 gbs free

sturdy frigate
eternal oxide
#

delete that porn, your drive will be empty 😉

eternal night
#

👀

ancient plank
#

Clear some space bro, it'll make ur computer faster

eternal night
#

getting your personal PC to that level of full on the drive is gonna get fun for you

sturdy frigate
#

right lemme see what i can remove

eternal night
#

1 TB of ssd is like 100$, just buy more 5Head

kind hatch
# sturdy frigate have 1.1 TB but kinda full

Hmmm, even with 5GB or remaining space, BuildTools only takes up like 1GB at most. However, at such little space remaining, I wouldn't be surprised if weird behavior like that just happens.

sturdy frigate
#

that's not a lot

eternal night
#

surprised your OS has not died yet

glossy lily
#

how does one create a custom block

eternal night
#

you don't really

glossy lily
#

i mean

#

lonedev pulled it off

ancient plank
#

Using the illusion of existence

eternal night
#

usually people take some specific iteration of like, mushroom blocks and retexture

#

or mob spawners, tho those get heavy

eternal night
#

mushroom block has a lot of unique block states

#

which each can have their own texture

#

so you reserve one of those, custom texture it

#

and go from there

glossy lily
#

how many

eternal night
#

eh I think 2^6

outer river
#

@last temple alright, i'm lost sir x)

glossy lily
eternal night
#

Yes that would be 2^6

glossy lily
#

any other options

#

i might need more than 64

outer river
#

oh ok, it remove the error, thx
and now, how i setup args[1] in my command class ?

eternal night
#

well can do the same with brown mushroom

#

to double your available space

#

beyond that, some entity fuckery

#

and using item custom model data

iron glade
#

^

#

Have a look into OOP @outer river , gonna make your life a lot easier

outer river
iron glade
outer river
#

something like this right ? @last temple @iron glade

#

okok, i test to load it

iron glade
#

Although I find that try catch kinda ugly

#

When I have stuff like that I tend to make a isInt(String input)method, as I'm probably gonna use it more than once

#

sure

#

but in some utility class

#

It's the same ofc, but just looks better in my eyes

#

Even more when u have to use it multiple times

outer river
#

holy molly, it works thx for all mates ! 🙂 @iron glade @last temple

#

btw, you know a good ytb channel for OOP ?

storm hawk
#

Hi I have a problem with gradle, when I build jar and use the plugin, I have a problem with HikariCP java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariConfig
It doesn't find HikariCP even though I put it in the build.gradle, any idea please?

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

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT'
    implementation 'com.zaxxer:HikariCP:5.0.1'
    implementation 'org.jetbrains:annotations:23.0.0'
}
eternal night
#

you need to shade it

#

when using gradle, use the shadow plugin

#

and relocate the dependency

#

their wiki should go over everything you need to know

storm hawk
#

Thanks, I'll check it out

#

Looks working fine, thanks

sonic cosmos
#

hi i made such a simple configuration filesystem with gson, how does it load configuration from ItemStack, get this error? I searched on the internet but nothing works https://paste.md-5.net/raw/fogawubezi

delicate lynx
#

why not use yaml

sonic cosmos
#

because json is more readeble and I got bored of yaml

#

so i want to try something new

kind hatch
#

json is more readable
In what world do you live in? JSON is nice and all, but it is far from the easiest readable language format.

sonic cosmos
#

thats my opinion ok?

dusk flicker
#

toml

dapper saddle
#

thanks @rough drift just got setup with intellij and i think its a good swap

undone ruin
#

I took a brake of 15 days from Spigot developing and now the server is not recognising my plugin in the plugins folder, I'm about 2 days trying to fix this but I ran out of ideas, could someone please help me? (is not the server 'cause downloaded plugins are working)

delicate lynx
#

provide a server log

kind hatch
#

Unless you changed something in your plugin, there is no reason it should stop working if it was working before. (Provided you are using the same server)

ivory sleet
undone ruin
tranquil viper
#

Anyone know a free place I can test my plugins without making my own local server

ivory sleet
#

Have a nice gradle/maven setup which provides a bootleg server env

#

(Else any free host would do?)

tranquil viper
#

can you link a free host?

ivory sleet
#

Altho they have a queue

#

But thats usually not a problem

tranquil viper
#

thanks

onyx fjord
#

What's chat header packet for

worldly ingot
#

Yes you can technically make a configuration out of it... but like... you're definitely using the wrong tool for the job

ivory sleet
#

The day when json becomes turing complete PES_SadGePray isforpray

blissful zenith
#

This is most probably a question with a dumb solution, but how can I use the string Currency as a value in these finals?

    String Currency = getConfig().getString("shop.currency");
    
    public final Material SHOP_CURRENCY_MATERIAL   = Material.Currency;
    public final XMaterial SHOP_CURRENCY_XMATERIAL = XMaterial.Currency;
delicate lynx
#

Material.valueOf()

#

the name has to be exact

blissful zenith
#

Thanks!

ivory sleet
#

Be aware it might throw

#

Assuming bad input was passed

worldly ingot
#

This is why matchMaterial is better

#

It also does some string processing and supports namespaces

#

Material.matchMaterial("mInEcRaFt:dIaMoNd SwOrD") will return Material.DIAMOND_SWORD

delicate lynx
#

I had no idea that exists

#

I need to use that lol

kind hatch
#

XMaterial has the #parseMaterial() method. Not sure if does namespacing, but it does work with strings.

tranquil viper
#
package xyz.praydev.utils;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.scheduler.BukkitRunnable;
import xyz.praydev.CustomTimer;

import java.util.Objects;

public class TimerManager extends BukkitRunnable {

    private final CustomTimer plugin = CustomTimer.plugin;
    long secLeft;

    public TimerManager(long seconds) {
        secLeft = seconds;
        plugin.setRunning(true);
    }


    @Override
    public void run() {
        if (secLeft == 0) {
            if (plugin.config.getString("completion.message") != null) {
                Bukkit.broadcastMessage(Objects.requireNonNull(plugin.config.getString(format("completion.message"))));
                plugin.setRunning(false);
                plugin.setTManager(null);
            }

            this.cancel();
        }
        secLeft--;
    }


    private String format(String s) {
        return ChatColor.translateAlternateColorCodes('&', s);
    }

    public long getRemainingSeconds() {
        return secLeft;
    }


}

I am running this task, but for some reason it takes like 3 seconds to run 1 second, anyone know what could be causing this? Maybe I need to run it async as rn I'm doing:

     tManager = new TimerManager(seconds);
     tManager.runTaskTimer(plugin, 0, seconds * 20);
#

Although other than that, I don't get why this would be happening unless maybe it's because I'm on a server.pro server lol

delicate lynx
#

so instead of each "run" being 1 second, it takes around 3 seconds instead?

tranquil viper
#

Yea it goes:
10...
3 seconds later*
9...

#

I tried with a simple task, just sysouting nothing special

#

I'm thinking its the host

kind hatch
#

What is your seconds variable set to? Because it's likely the issue.

worldly ingot
#

Yeah, your "runTaskTimer()" should be accepting 20, not seconds * 20

#

That's the interval of time between each run

kind hatch
#

What is your seconds variable set to? Because it's likely the issue.

worldly ingot
#

If you want to run a 10 second timer, you're going to be running a 10 second timer that goes down every 10 seconds ;p

iron glade
#

^

tranquil viper
#

seconds * 20, ie: 10 seconds * 20 = 200 ticks

worldly ingot
#

Yeah, your TimerManager constructor should accept seconds, and your runTaskTimer() should accept just 20

#

runTaskTimer will run indefinitely until you cancel it, but the two longs in that method are the delay and the interval

#

If there's a 200 tick interval between each call of run()...

#

This will work as you expect it to:

tManager = new TimerManager(seconds);
tManager.runTaskTimer(plugin, 0, 20);```
balmy valve
#

would this be spigot or build tools

#

ahh sorry for the ping

worldly ingot
#

Spigot, yeah

#

Ping is fine. idm

balmy valve
#

will do, and with a video for it cause its very uhm broken

#

it can be used to dupe items

#

or ig it just does as a side effect of the bug

sharp flare
#

Do u have a code to show for it

#

Wondering....

balmy valve
#

gonna make the issue which will have everything for it

#

ill send the link after its opened

worldly ingot
#

My favourite kind of issues Sunglasses

balmy valve
#

Would this be a minor issue i assume

worldly ingot
#

Yes

quaint mantle
#

if i unload a world do i have to create the world again and wait for the stuff to be loaded

quaint mantle
#

Bukkit.getServer().unloadWorld

#

no

#

unload

drowsy helm
#

so you want to load a world just to unload it again?

quaint mantle
#

well after the game is finished i want to reload the same map without any of the blocks broken from before the first game is finished

#

idk if that make sense

drowsy helm
#

use SWM

#

perfect for what you need

quaint mantle
#

thanks

drowsy helm
#

SlimeWorldManager*

quaint mantle
#

yee got it thanks

outer river
#

hello! i'm working on a command that will send a message if a player die, but only if command is typed before... (it contains a duration) so i added a boolean in my listener but actually, whatever i type the command or not, each player death send a message (like if boolean always set on true) i think its a beginner mistake but i dont find it, can you help me pls :

balmy valve
lost matrix
worldly ingot
balmy valve
#

yeah

outer river
#
public class krCommand implements CommandExecutor{
    
    
    
    
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        Player player = (Player) sender;
        if (cmd.getName().equalsIgnoreCase("kr") && args.length == 0) {
                player.sendMessage("§6/kr §f§o<reward> <duration> §8:arrow_right: §7define a reward wich will be given for each kill made by a player.");
        }    
        if (args.length == 2) {
            try {
                int timer = Integer.parseInt(args[1]);
                TimerTask chrono = new TimerTask(timer * 60);
                chrono.enableEvent();
                chrono.runTaskTimer(Main.getInstance(), 0, 20);
            }
            catch (NumberFormatException errornumber) {
                player.sendMessage("§c " + args[1] + " is not a number!");
            }
            

        }    
        else if (args.length == 1 || args.length >= 3) {
            player.sendMessage("§cWrong usage: /kr <reward> <duration>");
        }    
    
        return false;
    }
    
}```
worldly ingot
#

Server software definitely matters so ideally you'd get it replicated on Spigot at least

#

Perhaps it's just a Paper-exclusive bug

balmy valve
#

will do rq

outer river
#
public class Event implements Listener {
    
    @SuppressWarnings("unused")
    private boolean button;
    public Event(final boolean button) {
        this.button = button;
    }
    
    
    @EventHandler
    public void onKill(PlayerDeathEvent death) {
        if (button = true){
            System.out.println("true");
        }
        else if (button = false) {
            System.out.println("false");
            
        }
    }
    
}```
tranquil viper
#

kill instanceof Player is redundant

iron glade
#

@outer river

outer river
#
public class TimerTask extends BukkitRunnable {
    
    
    private int timer;
    public TimerTask(final int timer) {
        this.timer = timer;
        
    
    }
    
    private boolean back;
    Event state = new Event(back);
    public void enableEvent() {
        System.out.println("enable");
        back = true;
    }
    
    
    @Override
    public void run() {
        if (timer != 0) {
            
        }

        if (timer == 0) {
            System.out.println("end");
            back = false;
            cancel();
        }
        timer--;
    }

}
iron glade
#

not yet

#

java has to be green

#

press enter after java

outer river
iron glade
#

now :)

lost matrix
iron glade
#

@outer river

            Player kill = death.getEntity().getKiller();
            if (kill instanceof Player) {
                
            }```

wrong order here, do

```java
if(death.getEntity().geKiller() instanceof Player killer) {

//do stuff with the killer

}```
lost matrix
#

null is never an instancof anything

outer river
#

what i dont understand is, whatever is my button state in my listener, if player dies, message "true" will pop, like if button always set on true...

tranquil viper
#

is the button stored locally

outer river
#

button state is changed in my TimerTask class

lost matrix
iron glade
#
    private boolean back;
    Event state = new Event(back);```
#

you are creating an object with a boolean that has no value yet

#

Or does this default to false in this case?

outer river
#

i though if i dont put any = true/false after, it will be false by default

#

i guess i'm wrong

iron glade
#

No, I'm not sure about that

#

I think it indeed defaults to false

outer river
#

okok

iron glade
#

What exactly is this Event state?

outer river
#

i just want to get state of "back" and send it on my listener class

outer river
lost matrix
#

Ok but then your runnable has the wrong task. Its responsibility is updating a button state. Not decrementing a timer.

outer river
#

i just have to change boolean's class then ?

lost matrix
#

I cant give you an answer to this because you didnt elaborate on what you are trying to achieve. There is most probably
a better, overall approach.

tawdry python
#

What better way to check when the player is afk? X minutes doing nothing

kind hatch
lost matrix
# outer river hello! i'm working on a command that will send a message if a player die, but on...

Ok so you want to do this:

  1. A player uses a command
  2. After that, for a fixed period of time, you want certain death messages to appear
  3. After the time is over: The death messages no longer appear.

Then the solution is simple.
When the command is called: You save a timestamp + a duration.
When the death event is called: You check if the timestamp is in the past. If not -> Change the messages.

No need to use any runnables here.

#

And now to one of the most common questions asked on this discord: How do you get the timestamp to
both the command and the Listener?
You simply create a manager class, create one single instance in your onEnable and pass this instance to both
the listener and the command, through their constructor.

lost matrix
# outer river okok thx, i'll try to do this

This would be a skeletal start you could use.

public class DeathTimeManager {
  
  private long deathTimeEndStamp = 0;
  
  public boolean isDeathTimerActive() {
    return System.currentTimeMillis() < deathTimeEndStamp;
  }
  
  public void setDeathTimerActiveFor(long milliseconds) {
    deathTimeEndStamp = System.currentTimeMillis() + milliseconds;
  }
  
}
outer river
lost matrix
#

This would be a more sophisticated approach

public class DeathTimeManager {

  private static final Duration defaultDuration = Duration.ofSeconds(120);
  
  private Instant deathTimeEndStamp = Instant.now();

  public boolean isDeathTimerActive() {
    return Instant.now().isBefore(deathTimeEndStamp);
  }

  public void setDeathTimerActiveFor(Duration duration) {
    deathTimeEndStamp = Instant.now().plus(duration);
  }

  public void setDeathTimerActive() {
    this.setDeathTimerActiveFor(defaultDuration);
  }

}
lost matrix
outer river
#

okok, i take note thxxx

pseudo elbow
#

Can anyone suggest best plugin for custom enchants

drowsy helm
#

What do you guys reckon the best approach to an rpg-style spawning system is?

#

i was thinking have pre-defined regions with set spawn points, keeping track of each entity in there making sure they dont spawn over the cap

#

but idk if thats the best way of doing things

ancient plank
#

```

lost matrix
drowsy helm
#

yeah i was thinking of doing the same

#

i think anything more would be pretty taxing on the server

lost matrix
#

You could also have a number of spawn points each corresponding to a single spawner instance that decides how many mobs should be active

lost matrix
# drowsy helm yeah i was thinking of doing the same

You just need a smart way of preventing them to wander away.
The farther they wander off the higher the chance that they wander in the direction of their spawn point.
Then you need an aggro system. How far (or rather long) should they follow players. What should be done on aggro drop.
Then there is the problem of chunk unloading. Do you simply save the mob and try to find the spawner it belongs to when
the chunk is loaded again? Do you just remove it and let the spawner spawn one again?

drowsy helm
#

yeah need to do that in a way thats not too taxing

#

so far have ~13k loc and still 20tps

#

trying to keep it that way

balmy valve
undone ruin
#

Is there a way to change your source version (Java 11 to Java 8) from a IntelliJ project plugin?

quaint mantle
#

How to get all console output like discordsrv with bukkit/spigot api?

lost matrix
undone ruin
lost matrix
undone ruin
#

oh, thank you

lost matrix
#

Are you using maven?

undone ruin
#

yes

lost matrix
#

Then you need to change it in your pom.xml

#

I usually do it the explicit way by configuring the maven-compiler-plugin

    <properties>
        <java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

There is also a shorter way

<properties>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
</properties>
lost matrix
undone ruin
#

artifact

lost matrix
#

So you dont use maven?

#

Because this way you can just delete your pom because it does nothing

undone ruin
#

using maven changes something important?

lost matrix
#

Im guessing you are also adding jars manually to your project?

undone ruin
#

oh, sorry, my mistake, I use maven

lost matrix
#

How do you compile then?

undone ruin
#

you mean the way I import from maven?

#

sorry I'm new to java

lost matrix
# undone ruin you mean the way I import from maven?

If you are new to java then you should probably not tinker with maven.
And be sure to learn the basics because Spigot is not beginner friendly.

Here is a link that tells you how to create a simple spigot plugin in IntelliJ
without maven:
https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellij-idea/

I highly recommend you to setup a new clean project with this guide.

undone ruin
#

thank you for your advice

outer river
#
public class DeathTimeManager {
    
    public int timer;
    private final Duration duration = Duration.ofMinutes(timer);
    private Instant current = Instant.now();    
    
    public DeathTimeManager(final int timer) {
        this.timer = timer;
    }
    public DeathTimeManager() {
    }

    
    public boolean isEnable() {
        return Instant.now().isBefore(current);
      }
    
    public void setTimerFor(Duration duration) {
        current = Instant.now().plus(duration);
      }
    
    public void setDeathTimerActive() {
        this.setTimerFor(duration);
      }
}
#
public class Event implements Listener {
    DeathTimeManager instance = new DeathTimeManager();
    boolean isEnable = instance.isEnable();
    
    @EventHandler
    public void onKill(PlayerDeathEvent death) {
        
        if (isEnable == true) {
            System.out.println("true");
            Player kill = death.getEntity().getKiller();
            if (kill instanceof Player) {
                System.out.println("killer");
            }
            
        }
        else if (isEnable == false) {
            System.out.println("false");
            
        }
    }
    
}```
#

@lost matrix sorry to ping you again, i need you help one more time : when i execute my command, my event stay on false, idk where it comes from

balmy valve
iron glade
outer river
#

yeah, dw about that, i will delete this later

iron glade
#

Don't need to use == on booleans

outer river
#

hem, if i use only one, it set my event on true

iron glade
outer river
#

oh you right

#

wait i test

#

nop, still on false

iron glade
#

The code still does the same, it's just simplified

#

Shouldn't you have a per-player death counter?

outer river
#

yeah i'm dumd

iron glade
#

What exactly do you want to do, so I can better help you

river oracle
#

;\ that code seems faulty no matter what you want to do

outer river
#

i want to do a command wich willget a duration, and for the given duration, event(s) will happen(s)

iron glade
#

just add the player to a list and remove him after x seconds

#

and in the events check if the player is in the list

outer river
#

like i do : /kr qfdgsdfg 10
-> for 10 sec, if player dies, message will appear

iron glade
outer river
lost matrix
shadow zinc
#

Is there a consumer that doesn't have a pass value?

lost matrix
#
Runnable someAction = () -> System.out.println("Hi");
shadow zinc
#

Nice

#

And does that have a return type?

lost matrix
#

No

shadow zinc
#
    public LanguageManager setLanguageCode(Function<String, String> languageCode) {
        LanguageManager.languageChangeConsumer = languageCode;
        return this;
    }```
#

I need something like this

#

but without the first string

outer river
shadow zinc
#

because its irrelevant

lost matrix
shadow zinc
#

A supplier, got it, thank you

lost matrix
shadow zinc
#

its slowing down my compile times

lost matrix
shadow zinc
#

to like 6-10 minutes

lost matrix
shadow zinc
#

I think its anvilgui for me

lost matrix
#

Because you usually only need to access it once. And after that the dependency is in your local maven cache

#

Unless you change the version or depend on a snapshot

shadow zinc
#

wdym by depend on a snapshot?

#

hows that work?

lost matrix
#

If the version is tailed by -SNAPSHOT then you are depending on a snapshot version which gets pulled every time

shadow zinc
#

so yes its a snapshot

shadow zinc
#

shit

#

how so?

lost matrix
#

And also not even available to the public

shadow zinc
#

well it has been working for me for quite a while

#

what am I meant to use?

lost matrix
#

Run BuildTools with this minecraft version

#

And --remapped

#

If you use the special sources plugin

shadow zinc
#

Oh but I need it because I code on my school laptop and I cant run build tools

#

they blocked terminal

lost matrix
#

Is it a windows machine?

shadow zinc
#

yes

lost matrix
#

Well... can you create batch files?

shadow zinc
#

batch files are blocked

lost matrix
#

Can you install programs?

shadow zinc
#

you cant even open settings

shadow zinc
#

well you could if it doesn't need elevation

lost matrix
#

Hm. You could try using git bash. Anyways, there is not much you can do then.

wise mesa
#

why does bukkit have the static bukkit class instead of forcing everyone to use JavaPlugin#getServer()

#

seems kinda anti oop

#

is it just an old holdover that too many people use to do anything about?

shadow zinc
#

?

lost matrix
wise mesa
#

i guess

#

just seems better to have everyone use org.bukkit.Server

#

oh well

#

is there a benefit of either

shadow zinc
#

ping md5 and berate him if you want

#

(that was a joke)

wise mesa
#

this is much older than spigot

lost matrix
#

When using Bukkit you dont need to DI your JavaPlugin everywhere.

wise mesa
#

i guess

lost matrix
#

And there are quite a few questionable design decisions in Spigot. Thats just how
software ages over a decade.

wise mesa
#

of course

#

if you were making bukkit 10 years ago

lost matrix
#

And if it wasnt for years of legacy compatibility (looking at you 1.8) then spigot would be in a much better spot right now.

shadow zinc
#

I had no idea there was a standard for api development, hope my library doesn't look like a mangled dog

wise mesa
#

nevermind

#

bad question

#

you would change everything

#

I am happy with where spigot is going though

#

special source for mojang mappings

#

the server autodownloading maven central libraries

river oracle
wise mesa
#

instead of shading

lost matrix
wise mesa
#

but so many people still use it

river oracle
#

Honestly pvp isn't a good enough reason for 1.8 anymore

shadow zinc
#

wasn't 1.8 7 years ago?

lost matrix
river oracle
#

?1.8

undone axleBOT
shadow zinc
#

yeah 7 years

wise mesa
#

and most of those people are not hypixel with a large team of developers who can keep updating the software

#

so it really is a massive vulnerability

wise mesa
#

its still like a sizable chunk though it isn't no one

wise mesa
#

im happy to hop on 1.8 and play a bit of hypixel from time to time

lost matrix
#

If i had something to say when CVE-2021-44228 hit i would have left out 1.8 and cleansed it.

wise mesa
#

well

#

you know even then people would've still used it

#

although perhaps

lost matrix
#

There would probably be plugins then

wise mesa
#

maybe if spigot didn't release a patch for it

#

someone else would start a 1.8 based fork

#

that would actually be maintained and patched to keep security going

#

then we wouldn't have to deal with the 1.8 people

#

and they would stay safe

#

perfect society

lost matrix
#

If you fork 1.8 and actually maintain it then im not mad at you. But if you still write plugins and expect
anybody to help you with issues then im going to point you to old forum posts.

wise mesa
#

lol of course

#

when minecraft java 18

iron glade
#

how far do you guys go as of supporting versions?

wise mesa
#

i just want a guarantee all my users have simplewebserver

river oracle
#

java 18 isn't LTS iirc

wise mesa
river oracle
wise mesa
wise mesa
iron glade
#

I'm aiming on 1.17-1.19 currently

wise mesa
#

you'll definitely get help here with those versions

lost matrix
wise mesa
#

i was in fact wrong

#

ignore my incorrect comment

iron glade
#

Did something special happen in 1.16.5?

#

I have to be honest, besides creating plugins I'm not really playing MC myself

lost matrix
#

Quite a few things. But most of them are really only important for private servers.
Usually i write plugins for the latest version and if it works for older ones then thats just a "nice to have"

iron glade
#

Makes sense

lost matrix
river oracle
#

I've been pretty much only writing in 1.18.2 even after 1.19's release i've yet to move up to the new API

wise mesa
#

but whenever i make a server i just find myself writing plugins 😭

iron glade
#

Just today I got a comment on one of my projects saying
ThIs DoEsNt SuPpOrT 1.15?ß??ß

river oracle
wise mesa
#

and my friends always complain about me never playing

lost matrix
#

I only play modded versions. With machines and factories 😄

wise mesa
#

i don't know what happens

river oracle
iron glade
#

usually once a year or so some friends and I host a modded server and play on it for like 4 weeks

lost matrix
#

I have actually been building quite a bit last year too. Let me see if i got some screenshots.

river oracle
#

I'm playing project ozone 3 right now lol

iron glade
river oracle
#

I'm glad other clients exist because god I will never install the malware that is overwolf

quaint mantle
#

Is there a way to get all the output from the server? The Logger Handler doesn't fetch chats, etc. I've tried a lot, but it doesn't work

iron glade
#

Being a perfectionist is both a blessing and a curse

lost matrix
#

Well i didnt find much

quaint mantle
iron glade
#

dude there's totally a giant bridge missing

river oracle
iron glade
#

connecting those towers

river oracle
lost matrix
quaint mantle
river oracle
#

usually I just run that stuff externally and trail the latest.log I'm not sure if theres a better way 🤷‍♂️ probably

quaint mantle
#

I've been working on this issue since a few days ago....

river oracle
#

latest.log is real time

#

minus the short delay to write

#

I mean its not like the entire log is cached until the server goes down

#

it prints real time

#

given you properly listen for it

iron glade
#

oi

quaint mantle
#

Thank you. But plugins like discord srv are imported through Java and I will try it.

iron glade
#

what was that

quaint mantle
iron glade
#

ahh I understand

river oracle
#

oops wrong reply

iron glade
#

dw

wise mesa
#

should i really never use NamespacedKey(string, string)

#

like for example

river oracle
drowsy helm
#

is the pathfinder goal index the priority?

wise mesa
#

im making a system where multiple plugins can register custom items using namespaced keys

#

so if the player wants to give themselves the custom item

quaint mantle
wise mesa
#

it would be so much easier if i could just make a namespaced key using what they say and just get that from the hashmap instead of looping through the set in the hashmap

#

whadeva

#

is there perhaps a way to get the JavaPlugin with said namespace

#

or plugin interface or whatever

#

not neccessarily javaplugin

#

and then i could check if said namespace even exists like if there's even a plugin on the server that has that namespace

#

is the namespace of a plugin just said plugins name in all lowercase

echo granite
#

Is ConfigurationSerializable#registerclass really necessary? spigot's serialization works even without it

wise mesa
#

is there a way to do ItemMeta#setDisplayName without italics

echo granite
shadow zinc
#

does copy defaults work with comments?

wise mesa
shadow zinc
echo granite
wise mesa
#

no ky is right

#

i think you misunderstand what im doing

#

there's a function called setDisplayName

shadow zinc
#

If you want colour on there use the reset then apply colour

wise mesa
#

not a displayName variable that i can set

#

Ky is def right

echo granite
#

wtf

echo granite
wise mesa
#

when i put something inside ItemMeta#setDisplayName it isn't italic

#

set display name adds the italic

#

i have to put the reset its the only option

echo granite
#

oh -_-

#

I thought you were talking about removing the italic color code from a name, not vanilla's italic name

#

please elaborate next time

wise mesa
#

how can i make custom recipes unlockable in the crafting book?

#

does it happen automatically?

lost matrix
carmine nacelle
#
    @Override
    protected PathNavigation createNavigation(Level world) {
        final PathNavigation vanillaNav = super.createNavigation(world);
        FlyingPathNavigation navigationflying = new FlyingPathNavigation(this, world) {
            public boolean isStableDestination(BlockPos blockposition) {
                return vanillaNav.isStableDestination(blockposition) && blockposition.closerThan(blockposition, 32);
            }

            public void tick() {
                vanillaNav.tick();
            }
        };

        navigationflying.setCanOpenDoors(false);
        navigationflying.setCanFloat(false);
        navigationflying.setCanPassDoors(true);
        return navigationflying;
    }

Trying to make this so my NMS bee doesnt wander over 32 blocks away but when it collects pollen it breaks pathfinding entirely and floats until the end of eternity

lost matrix
carmine nacelle
#

Idk shit about pathfinding so

#

wait..

#

this is even weirder

#

if theres no flowers nearby when it spawns, it flies for a few seconds then completely stops all animations and everything

#

pathfinders suck :/

arctic moth
#

I have a few questions about recipes:

  1. How would I make it so when any of the required materials are obtained, it will add the recipe to the player's recipe book?
  1. Any way to make the recipe override vanilla recipes using the same material types in the same spots? (for example, iron block to 9 iron ingots but using ExactChoice to get custom ingots from custom blocks will instead just craft normal ingots)
#

Yes I had to put the formatting :D

lost matrix
#

When i get to writing the custom mobs on the project im currently working on i can probably help you. But this will def take some more weeks

carmine nacelle
#

@lost matrix Can you think of any other way to make them not wander more than a certain distance away...?

#

crap

#

@chrome beacon You were the one that gave me this example I think... got any other ideas?

arctic moth
carmine nacelle
#

I mean maybe but idk how.

arctic moth
#

Set the target block to a random place within 32 blocks or smth

lost matrix
arctic moth
#

When it goes out of range

carmine nacelle
#

currently if it goes out of range it finds a different hive

#

which is a huge issue

arctic moth
lost matrix
arctic moth
#

This was earlier, don't have pc access rn

#

Blocks to ingots was an ExactChoice with an itemstack that had custom name, pdc, etc.

#

Or I'm just stupid and changed a property of the block and used an old version of the itemstack

#

So that it mismatched

lost matrix
#

Im suspecting a mismatch in the choice or a wrong shape.

arctic moth
#

And b is the block

lost matrix
#

Then its probably a choice mismatch

arctic moth
#

Or I just forgot to move the jar to plugins folder

#

That happens a lot

arctic moth
#

Wait didn't someone make an api for that

carmine nacelle
#

yup

#

@tender shard

arctic moth
#

I think I've literally used that in the past

lost matrix
arctic moth
#

Thought as much

carmine nacelle
arctic moth
#

K

carmine nacelle
#

its amazing

arctic moth
lost matrix
arctic moth
#

I already have that imported lol

carmine nacelle
#

?

#

That adds an ItemStack PDC type

#

thought thats what is needed

arctic moth
carmine nacelle
#

yup

#

Or a List of itemstacks can be done with DataType.asList(DataType.ItemStack)

arctic moth
#

If ill use that already have the maven dependency anyways

#

*ig

#

And finally, how would I change a block's drop? #getDrops() and then clearing and adding a new item didn't work

quaint mantle
#

Could somebody help me with updating MySQL information

#

public void set_rank(Rank R){
        
        PreparedStatement STATEMENT = null;
        
        try{
            STATEMENT = Database.get().prepareStatement("UPDATE userinfo SET RANK = " + R.index() + " WHERE UUID=?");
            STATEMENT.setString(1, this.UID.toString());
            
            STATEMENT.executeUpdate();
        }
        catch(Exception e){ e.printStackTrace(); }
    }
#

I just want to make sure I'm doing this right, I got it from a tutorial online 😳

#

userinfo is the category.

carmine nacelle
arctic moth
carmine nacelle
#

then just set cancelled

#

well

#

u should be able to clear drops..?

lost matrix
quaint mantle
lost matrix
#

And STATEMENT should be statement

#

and set_rank should be setRank

quaint mantle
#

Thank you, I don't see a .setUniqueId() or .setUID, UUID, etc. in the PreparedStatement class

#

Should it be an Object, rather?

shadow zinc
lost matrix
quaint mantle
#

Have a blessed day

#

Should UUID remain a VARCHAR?

lost matrix
#

UUID should be a UUID type in your database

quaint mantle
#

Oh okay

lost matrix
#

Which DB are you using?

quaint mantle
#

phpMyAdmin...?

lost matrix
carmine nacelle
#

sqlite, mysql, mongo?

quaint mantle
#

OH, MySQL

minor vapor
lost matrix
quaint mantle
#

Many apologies - I'm not brushed up on databases

lost matrix
carmine nacelle
#

tf

#

I thought uuid was a mc only thing lmao

minor vapor
#

............

quaint mantle
#

Oh

minor vapor
#

lord have mercy

quaint mantle
#

😳

lost matrix
#

No UUID is something globally used. (In every language)
Its literally just a random 128bit number. Thats all.

carmine nacelle
#

ive never had a reason to look up uuid

quaint mantle
echo basalt
#

oh hi rainny

carmine nacelle
#

illusionnn

#

do u know pathfinder stuff

lost matrix
echo basalt
#

uhh

#

he's a lead dev at a network I work at

shadow zinc
minor vapor
lost matrix
echo basalt
shadow zinc
#

oof why is the bottom all the way over to the right

carmine nacelle
#

Trying to overwrite the pathfinder

    @Override
    protected PathNavigation createNavigation(Level world) {
        final PathNavigation vanillaNav = super.createNavigation(world);
        FlyingPathNavigation navigationflying = new FlyingPathNavigation(this, world) {
            public boolean isStableDestination(BlockPos blockposition) {
                return vanillaNav.isStableDestination(blockposition) && blockposition.closerThan(blockposition, 32);
            }

            public void tick() {
                vanillaNav.tick();
            }
        };

        navigationflying.setCanOpenDoors(false);
        navigationflying.setCanFloat(false);
        navigationflying.setCanPassDoors(true);
        return navigationflying;
    }
echo basalt
#

oh that fun stuff

carmine nacelle
#

This makes it only move if theres nearby flowers, and after it harvests it breaks

lost matrix
shadow zinc
#

Doesn't work for me

echo basalt
#

yeah so uhh

shadow zinc
#

I need to include it that way

echo basalt
#

you'd need to do some checks to check for flowers

#

and if the checks fail for ALL blocks, then return the super method

carmine nacelle
#

This is the default one


    protected PathNavigation createNavigation(Level world) {
        FlyingPathNavigation navigationflying = new FlyingPathNavigation(this, world) {
            public boolean isStableDestination(BlockPos blockposition) {
                return !this.level.getBlockState(blockposition.below()).isAir();
            }

            public void tick() {
                if (!Bee.this.beePollinateGoal.isPollinating()) {
                    super.tick();
                }

            }
        };
        navigationflying.setCanOpenDoors(false);
        navigationflying.setCanFloat(false);
        navigationflying.setCanPassDoors(true);
        return navigationflying;
    }
#

I was just trying to make it not go over 32 blocks away

echo basalt
#

Honestly when overriding pathfinders I just made my own class that extended GroundPathNavigation and rewrote most methods

shadow zinc
#

ffs you can't format for shit in spigot code fields

echo basalt
#

Went something like this

carmine nacelle
#

oh

#

How does it know what to do when idle or whatever though

lost matrix
shadow zinc
#

hows that?

#

with provided I guess

echo basalt
carmine nacelle
#

Then how were you setting the pathfinder to your custom class?

lost matrix
# shadow zinc hows that?

Looks good. I would also make sure that your documentation covers every feature of your plugin.
Or are those 3 lines enough?

shadow zinc
#

They are pretty much everything atm

echo basalt
carmine nacelle
#

😭

#

why is this so complicated

echo basalt
#

Because mojang

carmine nacelle
#

ugh

#

this is annoying.

echo basalt
#

I did this in a late night after drinking a few beers

#

I'm surprised it works

#

But be ready to waste like 3 hours

carmine nacelle
#

ive already wasted more than that 🤡 fml

minor vapor
#

no inv?

carmine nacelle
echo basalt
#

CustomPathfinderNormal

carmine nacelle
#

oh..

echo basalt
carmine nacelle
#

Well theres no tutorials on mojang maps

echo basalt
#

All obfuscated

carmine nacelle
#

Looks like bees also choose to drop and blacklist hives..

#

am i gonna have to set the hive location on every tick

#

💀

sturdy frigate
#
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>```
My installation of NMS doesn't have the entities classes under the name `server`, is this normal or did i do something wrong? I'm trying to create a new mob
#

can't send pictures? rip

carmine nacelle
#

gotta get the verified role

sturdy frigate
#

Ahhh

#

Do I have to use the classes under net.minecraft.world.entity.monster.Zombie;? The tutorials I've seen do not touch on mc 1.19 and they access the classes through net.minecraft.server.vx.xx.x.EntityZombie

boreal seal
#

import NMS classes

#

...

lost matrix
sturdy frigate
lost matrix
#

But you should

sturdy frigate
echo basalt
#

bruh

lost matrix
echo basalt
#

1.17+ doesn't use the v1_123_123 format

sturdy frigate
# lost matrix PS: Dont forget to set up the special sources plugin in maven

Yep I have thanks <plugin> <groupId>net.md-5</groupId> <artifactId>specialsource-maven-plugin</artifactId> <version>1.2.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-obf</id> <configuration> <srgIn>org.spigotmc:minecraft-server:1.19-R0.1-SNAPSHOT:txt:maps-mojang</srgIn> ...

carmine nacelle
#

@lost matrix Would it be a bad idea to set my bee's hive back to what I want every tick...

#

😓

#

only way I see this happening.

carmine nacelle
#

welp

sturdy frigate
boreal seal
#

guys i got an question which is about help-server

sturdy frigate
#

Is there documentation on this?

boreal seal
#

cloud anyone take a look at it

echo basalt
#

yessir

lost matrix
boreal seal
#

we have

sturdy frigate
boreal seal
#

but the people there are 2 digit iq apes.

echo basalt
boreal seal
#

and you guys probably never visit there

carmine nacelle
#

@echo basalt can u help in dms with pathfinders..

echo basalt
#

for a good reason

boreal seal
echo basalt
#

grr

#

I hate helping in dms

#

playing apex

boreal seal
carmine nacelle
#

ah

boreal seal
#

just google

#

and if he run into issue he should come back

carmine nacelle
#

just wanna be able to have a convo without 50 other ppl lol

echo basalt
#

threads are a thing

carmine nacelle
#

i mean yeah I guess

#

CustomBee - Pathfinders

#

anyone that can help.

shadow zinc
#

Any reason why someone would get this error on 1.17.1 but not 1.19?

sturdy frigate
#

Does anyone know a good opensourced plugin/tutorial/documentation to see how to do basic stuffs like packets, weather states and custom mobs with NMS 1.19?

boreal sparrow
#

I have this dumb method to check if a world (passed in as a string) is one of the worlds in the switch statement. Here's the code:

public class RunnerVSHunter extends JavaPlugin {

public boolean inWorld(String world){
        return switch (world) {
            case "RunnerVsHunterhub", "RunnerVsHunterMap1", "RunnerVsHunterMap2","RunnerVsHunterMap3", "World" -> true; 
            default -> false;
        };
    }

But when I call it in the same class, I get this:
Invalid method declaration; return type required

lost matrix
#

First of all: This should be a Set<String> on which you call contains() on.

lost matrix
boreal seal
#

why people use those ->

boreal sparrow
lost matrix
# boreal sparrow How so?

It might be caused by your weird switch statement which makes no sense.
It should be

        return switch (world) {
            case "RunnerVsHunterhub", "RunnerVsHunterMap1", "RunnerVsHunterMap2","RunnerVsHunterMap3", "World": yield true; 
            default: yield false;
        };
#

Anyways just remove that switch all together

boreal sparrow
#

Ok, but how should I identify worlds then?

lost matrix
#

First of all: This should be a Set<String> on which you call contains() on.

lost matrix
boreal sparrow
#

Still tho:
Invalid method declaration; return type required

lost matrix
boreal sparrow
#
public class RunnerVSHunter extends JavaPlugin {

private static final Set<String> hunterWorldNames = Set.of(
            "world1",
            "world2",
            "world3"
    );

    public boolean isHunterWorldName(String worldName) {
        return hunterWorldNames.contains(worldName);
    }

    if(isHunterWorldNames()){

    }
}
lost matrix
#

What is this random piece of code doing in your class file?

echo basalt
#

🤦

lost matrix
carmine nacelle
boreal sparrow
#

yea

boreal sparrow
lost matrix
boreal sparrow
#

yea but then why do i get that weird needs a return type

lost matrix
#

Those contexts are: initialisation, construction and class loading

boreal sparrow
#

it has been defined in my minds

lost matrix
#

You cant just write code in there. When do you expect this to execute?

boreal sparrow
#

true

#

but then

#

cant I like put this in an event?

#

in an if statement?

lost matrix
#

Sure you can

boreal sparrow
#

so (sorry I am so new to java), how could I execute this method in another class

lost matrix
#

Spigot is not beginner friendly. I would suggest learning the basics first before jumping into Spigot.

#

?learnjava

undone axleBOT
lost matrix
#

Here are some helpful links

boreal sparrow
#

thanks

#

oh yea thought it had to do with OOP, thanks for your help

sturdy frigate
#

How do I put on equipments on a custom mob in 1.19? like chestplate swords

sturdy frigate
lost matrix
scarlet breach
#

Whats spigot() from 1.16.5 in 1.17.1?

sturdy frigate
lost matrix
#

This method is called when zombies pickup items to determine if they can equip it

sturdy frigate
#

Ohhh I don't want it to pick anything up

lost matrix
sturdy frigate
#

Just want to put something on it when it spawns

lost matrix
scarlet breach
lost matrix
scarlet breach
sturdy frigate
#

Oh wow wait, I can't make an item stack from materials anymore?

lost matrix
lost matrix
scarlet breach
#

Player target = Bukkit.getPlayer(args[0]);

lost matrix
sturdy frigate
scarlet breach
#

i upgrade a 1.16.5 plugin to a 1.17.1 plugin

lost matrix
#

Because in 1.19 this method still exists

scarlet breach
lost matrix
# balmy valve Bump

Try cancelling the PlayerInteractAtEntityEvent instead and see if this helps

balmy valve
#

Cancelling both?

lost matrix
#

And if nothing helps then you need to use packets

balmy valve
#

Packets and me don’t get along so I hope cancelling the playerinteractatentity event works

#

What is the difference between both of them?

boreal sparrow
#

Hey, I have this event

public static void onMove(PlayerMoveEvent event) {
        Player player = event.getPlayer();
        RunnerVSHunter obj = new RunnerVSHunter();
}

It works fine, but when I create the object, it throws this:
org.bukkit.event.eventexception: null

balmy valve
lost matrix
lost matrix
balmy valve
lost matrix
lost matrix
ember crag
#

hey im trying to reload my plugins config using plugin.reloadConfig() but it isnt reloading anything

lost matrix
lost matrix
balmy valve
ember crag
#

thank you 🙏

boreal sparrow
#

OOOOOH

#

The OnEnable

lost matrix
balmy valve
#

How would I find that

#

I’m very much brand new to packets

balmy valve
#

Okay but how would I figure out what entity it’s being sent from

#

I get an entityID but no where seems to know how to use it

#

or should I save like a hashmap of an entity’s ID whenever it’s spawner to whatever I need to use and hope that the entity ID doesn’t change under any circumstances

#

Or like loop through existing mobs

#

It just feels so inefficient but yeah ig ill do that

lost matrix
#

nms has methods to get an entity by its id

#

ProtocolLib also provides util methods for that

balmy valve
#

It does?

#

Also looking at the Java docs I don’t see a interact packet in protocol lib

chrome beacon
balmy valve
#

Tho for whatever reason I can’t use the search in the protocollibs javadocs

chrome beacon
balmy valve
lost matrix
balmy valve
#

alr

shadow zinc
#

why am I getting this error?

#

java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils

#

must I shade it?

lost matrix
shadow zinc
#

so what do I do?

eternal oxide
#

Lang3 is now

shadow zinc
#

when I shade it do I need to relocate it?

#

or do I set scope to provided?

chrome beacon
#

Relocate it

shadow zinc
#

This is ridiculous

eternal oxide
#

add it to the libraries section of yoru plugin.yml

shadow zinc
#

I don't use libraries

slate mortar
#

i'd personally just add this to your pom:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.12.0</version>
    <scope>compile</scope>
</dependency>

that worked for me in past

sturdy frigate
#

Is there a way to enchant items without the sparkle?

#

So the items look un-enchanted to people

slate mortar
#

i don't think so

#

you can probably remove the glint in a server resourcepack, but afaik enchantment glint is completely handled by the clients

sturdy frigate
#

Ohh I see, no way even with packets and NMS?

slate mortar
#

wellllll

#

i dont use NMS

#

so idk about that

sturdy frigate
#

Ahh alright

shadow zinc
#

sharpness, increase damage

#

Fire aspect, set fire

slate mortar
#

that'd be an awful process

slate mortar
#

did you set the scope to compile?

shadow zinc
#

yes

slate mortar
#

did you build it with maven?

shadow zinc
#

yes

slate mortar
#

huh

#

that should normally add it right into the plugin's jar

shadow zinc
#
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
            <scope>compile</scope>
        </dependency>```
slate mortar
#

well

#

thatzs weird

shadow zinc
#

shade and relocate?

slate mortar
#

i mean

#

this is what i have my pom like:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>de.chloecdn</groupId>
    <artifactId>lobby</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>

    <name>Lobby</name>

    <properties>
        <java.version>18</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <url>https://chloecdn.de/</url>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <outputDirectory>C:\Users\Chloe\Documents\Localhost\Lobby Development\plugins</outputDirectory>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>de.chloecdn</groupId>
            <artifactId>cdnlib</artifactId>
            <version>1.6</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>
#

and it compiles my lib down the way into the jar perfectly fine

shadow zinc
#

want to see my pom?

sturdy frigate
slate mortar
#

i don't see any way why it wouldn't work tbh

shadow zinc
#

?paste

undone axleBOT
shadow zinc
slate mortar
#

but it'd require to take a look at the exact values of minecraft's own enchantments

#

and a lot of code lol

sturdy frigate
#

Oh dear, I see

shadow zinc
#

Oof, I don't envy you

sturdy frigate
#

Would just creating a custom item for this process work?

slate mortar
#

i mean

sturdy frigate
#

I just want them to be completely unbreakable (without looking like its enchanted)

shadow zinc
#

maybe?

slate mortar
#

enchantments essentially are just tags

sturdy frigate
#

Yeah?

slate mortar
sturdy frigate
slate mortar
#

basically

sturdy frigate
#

Interestinggg

slate mortar
#

it'll cancel the event, which also cancels the damage applied to the item

sturdy frigate
#

Oh okay, would it cancel the damage whoever is getting killed must take?

slate mortar
#

why would it do that

sturdy frigate
#

I'm just wondering :)

slate mortar
#

it's the PlayerDamageItemEvent, which is only called when a player damages an item (breaks a block with a pickaxe for example)

sturdy frigate
#

OH

#

I misread that

#

I was imagining it as a weapon

#

I suppose there has to be some event which checks on that

slate mortar
#

uh

#

you mean damage dealt to a player when he was hit by an entity/player?

#

if so, EntityDamageByEntityEvent i suppose

sturdy frigate
#

Yep, I'm arming a bunch of zombies with swords and I don't want it to break

#

oo okay I will check that out

shadow zinc
#

execuse me? [INFO] Excluding commons-io:commons-io:jar:2.11.0 from the shaded jar.

sturdy frigate
#

thanks cxlina!

slate mortar
#

sure

#

you can try to copy the most stuff from my pom above, and see if that fixes your issue

shadow zinc
#

in the process of

#

I think its due to me using the shade plugin?

#

If I wasn't using it maybe it would shade?

#

wait no

#

maybe include?

slate mortar
#

i mean, i use it as well

shadow zinc
#

but you don't use include

slate mortar
#

idk

shadow zinc
#

I'll just include it in my includes

rare flicker
#

is it possible to have colored tab completion?

shadow zinc
#

no

sturdy frigate
#

Can i replicate the "stare and me and you die" goal for endermen on zombies and the link?

shadow zinc
slate mortar
#

but it's kinda buggy

#

sometimes it shows the colorcodes instead of coloring the text

shadow zinc
#

Just use the action bar

slate mortar
#

ugh

rare flicker
#

i tried putting chatcolors through and although they render colored, the completion fills in the color char which is undesired... especially given it kicks you upon sending the command

slate mortar
#

yea

#

that was one of the bugs

rare flicker
#

that's like

#

idk

slate mortar
#

in the end: just don't color your tab-completion

scarlet breach
shadow zinc
#

Its better than a buggy tab completor

slate mortar
#

it can't be done without bugs

rare flicker
#

oh welp

slate mortar
shadow zinc
#

I saw it on a plugin

#

It wasn't my idea...

slate mortar
#

idk if it's possible to strip the text from color-codes as soon as you tab-it, so it doesn't apply into the text field

rare flicker
#

i actually would've considered it if i didnt have another plugin that uses it to display temperature

rare flicker
#

but the tab completeEvent doesnt have anything like that

scarlet breach
#

whats wrong? target is btw a Player

slate mortar
#

uhh

scarlet breach
#

in the 1.16.5 works

slate mortar
#

it exists for years now

#

weird

scarlet breach
#

i know xD

#

i upgrade a 1.16.5 plugin to 1.17.1

slate mortar
#

i shouldn't ask why you use 1.17

#

but why do you use 1.17

scarlet breach
#

my server is on on Java 17

shadow zinc
#

its the first version on java 17 isn't it?

rare flicker
#

16 iirc

scarlet breach
#

yes it is

slate mortar
#

no i mean