#help-development

1 messages Β· Page 270 of 1

sterile axle
#

But I'd need to pull out my IDE to test that

quaint mantle
#

im a test something

#

Solved i guess lol

sterile axle
#

Did that work?

quaint mantle
#

ye

#

Thx

sterile axle
#

Nice

quaint mantle
#

only thing that makes no sense tho is that if u add it under it for some reason

#

idk why but it ladders it weirdly,

#

like let me explain

sterile axle
#

Scoreboards in MC are in general no fun to work with so yeah, I believe it

quaint mantle
#
lines:
  - "&lLine 1: &r%player_name%"
  - "&lLine 2: &r%player_health% hearts"
  - "&7Line 3: &c%player_name%"
  - "&fno"
  - "&cBalance: &6%vault_eco_balance_commas%"

Then for some reason its inverse,

#

So its like balance no line 3 2 1.

#

is there a way to like change that so its like how it is in the config?

#

tbh ig it aint the worst

sterile axle
#

I think it auto orders it, but there should be a way for it to not do that...

#

Oh.

#

It will order by the score.

#

So yeah, it's probably in reverse order of your config.

#

Since your score is being set to i.

#

So, I guess you can make your for loop go in reverse, lol.

quaint mantle
#

hm

sterile axle
#

start at i = lines.size, go until i = 0, decrement each time

quaint mantle
#

tell me if this might work:

for (i < lines.size(); int i = 0; i--) {

I forgot how to remove 1 from the loop...

sterile axle
#

for (int i = lines.size() - 1; i >=0; i--)

#

should be

#

i think

quaint mantle
#

here let me tell u what happens

#

nope

#

didn't work

sterile axle
#

whats your updated loop look like

quaint mantle
#

for (int i = lines.size() - 1; i >=0; i--) {

#

Then the rest of the code obviously,

#
String text = PlaceholderAPI.setPlaceholders(player, lines.get(i));

            objective.getScore(ChatColor.translateAlternateColorCodes('&', text)).setScore(i);
#

thats all thats in the loop is those 2 lines

sterile axle
#

which part didn't work, does it order the same way as before or something

quaint mantle
#

it still is inverse from how it would be in the config

sterile axle
#

damn scoreboards suck

#

yeah im not sure sorry, maybe someone else will know about ordering

quaint mantle
#

they suck to an extent

#

alr well ty for ur help none the less tho

quaint mantle
#

I got an AI to make this scoreboard plugin for me because i was lazy...

sterile axle
#

lol

glossy venture
#

what does the overlay do

sullen marlin
#

Action bar I think. Also why would you use packets for chat

twin venture
#

hi , i am thinking of making a kit system for my plugin

i was thinking of doing a kit per file (json) , and inside each kit file there is
1- kit name
2- items[]
3- permission

my question is , what else i must add to a kit system?

#

i just need ideas .. if possible

sullen marlin
#

why json

#

why not yaml

tacit drift
#

tbh, i would use json too if yaml wasn't pretty much enforced πŸ’€

#

better structured overall

tender shard
#

yeah because admins love editing file like these

{

"List of Cars" : [
{
"car registration number":"011",
"car name":"Civic",
"owner of car":"Zaim Khan",
"model number":"xyz",
"price":"20 lacs",
"color":"black"
},
{
"car registration number":"012",
"car name":"Mehran",
"owner of car":"Sara Khan",
"model number":"xyzasd21",
"price":"10 lacs",
"color":"white"
},
{
"car registration number":"013",
"car name":"Cultus",
"owner of car":"Taimur Ali",
"model number":"xy12z",
"price":"15 lacs",
"color":"grey"
}
]
}
#

yaml is so much better for humans

vocal mirage
#

Both of them are loaded as /pl shows that they’re enabled and that I can execute some of their commands

rotund ravine
#

In your plugin

#

That it is enabled

white root
#

yaml is overrated, lets all collectively agree to switch to HOCON

#

😎

jagged monolith
#

All are overrated. Use normal txt files

tacit drift
#

i store my data in straight raw binary

tacit drift
tacit drift
#
{
  "List of Cars":[
    {
      "car registration number":"011",
      "car name":"Civic",
      "owner of car":"Zaim Khan",
      "model number":"xyz",
      "price":"20 lacs",
      "color":"black"
    },
    {
      "car registration number":"012",
      "car name":"Mehran",
      "owner of car":"Sara Khan",
      "model number":"xyzasd21",
      "price":"10 lacs",
      "color":"white"
    },
    {
      "car registration number":"013",
      "car name":"Cultus",
      "owner of car":"Taimur Ali",
      "model number":"xy12z",
      "price":"15 lacs",
      "color":"grey"
    }
  ]
}

but this is very easy to understand, also won't get a mind fucking error cause I have an extra space somewhere or somehow a wierd invisible character next to spaces so it would throw errors πŸ’€

pine forge
#

Is there a way to retexture an arrow to a shulker bullet using a resource pack and/or a plugin?

vocal mirage
humble tulip
humble tulip
ivory sleet
rotund ravine
tacit drift
#

Any idea on matching slots machine patterns? πŸ‘€

#

5 reels, 3 lines

tardy delta
#

imagine calling getServer() instead of calling everything on the Bukkit class

#

couldnt be me

wet breach
obsidian drift
#

ClientboundPlayerInfoPacket doesn't exist anymore in 1.19.3...

#

Does anyone know what the replacement is?

wet breach
#

I am pretty sure it still does

obsidian drift
#

ClientboundPlayerInfoUpdatePacket is a thing now

#

I'll use that

wet breach
#

Player info exists in 1.19.3 as per that link

#

So not sure what makes you think it stopped existing

obsidian drift
#

PlayerInfo still exists, the class doesn't though

tender shard
#

you miss one quote and everyone dies

#

or a comma

#

also the weird difference between [ and {

#

don't tell me that admins know the difference between { and [

#

because they don't

jagged monolith
tender shard
#

no, yaml doesn't need quotes in 99% of cases

jagged monolith
#

It's still very funky with syntax though. Yaml Syntax errors are very common

tardy delta
tender shard
soft viper
#

what channel does bungeecord use to answer requests?

tender shard
#

what requests?

soft viper
#

for requests like getServer

#

or Connect

tender shard
#

the channel is called "BungeeCord"

icy beacon
#

not sure if this is the right place to ask, but how do i broadcast messages from minecraft to discord? i've already got a bot set up and i've been looking for ways to execute it. what i want is not just plain messages (could've done that a long time ago easily), but creating fake user profiles for discord (see attachments). i've taken a look at this (https://github.com/VampireChicken12/Minecraft-Discord-Chat-Bridge) code and apparently it's done with webhooks, but i do not know typescript so i could barely read the code, so if anyone has any tips i'd greatly appreciate it

GitHub

Contribute to VampireChicken12/Minecraft-Discord-Chat-Bridge development by creating an account on GitHub.

soft viper
tardy delta
#

isnt typescript js with types?

icy beacon
#

i really do not know, javascript is not my field of expertise either haha

tardy delta
#

yet youre using it

icy beacon
#

no i am not?..

tender shard
tardy delta
#

isnt index.ts a typescript file?

icy beacon
#

please read my message again

#

this isn't my code

tardy delta
#

ah whatever

icy beacon
#

this is just an example of what i want to do but i do not know where to start

#

and with a plugin

#

it has come to my attention that it's done with webhooks

tender shard
icy beacon
#

which i'll probably have to study for this

#

how do i broadcast messages from minecraft to discord

#

and then i elaborate

tender shard
#

just spin up JDA

icy beacon
#

i already have it

tender shard
#

then listen to the PlayerChatEvent and send a message into discord?

icy beacon
#

what i want is not just plain messages (could've done that a long time ago easily), but creating fake user profiles for discord (see attachments)

tender shard
quartz bloom
#

-edited-

icy beacon
#

not yet, i was going to study webhooks, but i was just asking if you got any tips for this

tardy delta
#

670 forks lol

tender shard
rough drift
#

^

#

or their help discord if they have one

quartz bloom
#

They don’t .-.

rough drift
#

L

#

better

tender shard
#

well it's a paid plugin

#

if they don't reply, just give it one star lol

icy beacon
#

time to decomp the plugin and fix the bugs yourself πŸ™‚

#

will probably take another couple months

quartz bloom
#

Just a spigotmc automated dm and him saying use nuvotifier

rough drift
#

Then

#

Use that

quartz bloom
#

That’s what I was using first :/

#

same issue

tender shard
#

seems like a jerk move

vocal mirage
tender shard
#

I love IJ's spring boot project wizard

rotund ravine
tardy delta
#

Bukkit.getPluginManager().isPluginEnabled(String) is a thing

vocal mirage
tender shard
#

I hate GUIs so extremely much

#

also why is there no combobox

#

oh I found it

#

what a weird sorting syste

#

now I hate GUIs even more

#

jetbrains doesn't know how their own IDE works

#

ugh and there is literally no up-to-date docs for the GUI designer to be found ANYWHERE, so I now have to watch a huge ass youtube where someone with a bad indian accent explains how to click a button

tardy delta
#

ahaha

tender shard
#

for real, intellij gets worse with every update

#

changing Enum#toString() to int? Please tell me how you would perform such magic, IJ

#

ah yes, thanks for this working quick fix. It helped me so much. IJ totally worth 599€

tardy delta
#
public int getMajor() {
  return Integer.valueOf(name().substring(2).toLowerCase());
}```
tender shard
#

oh there's another bad joke in IntelliJ

#

doesn't matter which wizard you use, you can always easily change the maven group id

#

unless you want to create a normal maven project

#

then it's hidden under "Advanced Settings" that you have to open manually first

#

great job, whoever thought of this, deserves to hit their toe somewhere

vestal moat
#

quick question, how can i use color codes in logging?

eternal oxide
#

don't, it's annoying

vestal moat
#

can you just tell me how

#

its so ugly without colors

eternal night
#

On spigot you should be able to just throw them at the logger

vestal moat
#

well it strips the colors

tardy delta
#

use Bukkit.getConsoleSender()

vestal moat
#

according to craftbukkit source code it also strips color

#

also it doesn't support other levels

#

can i use ANSI?

tender shard
#

that way plugin developers cannot spam your console with useless colors, and everything stays clean and tidy

#

the console should only have 3 colors

#

normal one for info, yellow for warn, and red for error

vestal moat
#

well i think colors make it look better, besides the fact it should be only 3 colors

fathom carbon
#

is there a way to modify the world render with spigot api? im trying to create a plugin that adds custom blocks to the world but struggling to find a solution

tender shard
vestal moat
#

i don't understand how PAPI does colored logs

#

it is stripped for my plugin

eternal oxide
#

colours in the log only looks "better" whilst in console. 99% of logs are read as files and then colours spam the crap out of them making them very unreadable

eternal oxide
#

?jd-s

undone axleBOT
vestal moat
tender shard
#

noone, in the history of anything, ever looked at their console and then said "Oh, I am so glad that this plugin printed 20 lines of ascii art in fancy colors when it was enabled. How could I ever live without this again"

eternal oxide
vestal moat
#

idk bro lots of plugins do colors which is what makes console less boring to look at

fathom carbon
tender shard
#

imagine being bored so you look at your console and then you are not bored anymore because you saw some colors

#

wtf

vestal moat
tender shard
vestal moat
#

i managed to do it on a project tho, it should be implemented

fathom carbon
#

alright

wet breach
vestal moat
#

papermc does this perfectly, messages are colored in console and not in logs

tender shard
#

although I fucking hate the idea of having colors in console, because it's useless and stupid, please send an example of a plugin that can do it on spigot, then we can easily see how they do it

vestal moat
#

well... no plugin seem to do it on spigot without crappy logs

eternal oxide
#

I have no issue with a coloured console, only in the logs.

tender shard
#

wrong reply

#

why the heck is it not possible to remove the "reply" from a message

vestal moat
#

hm, maybe ill not care about colors its not a big deal

wet breach
#

well, you can technically already do it with plugins for spigot, it just requires more from the developer in order to do it

green prism
#

how can I use kyori components as Item displayName in spigot?

wet breach
twilit roost
#

even tho I have annotations; it still returns the default variable

tender shard
#

doesn't work for me

#

it only works for the latest message

wet breach
twilit roost
#

ESC will do the job

glossy venture
wet breach
#

hmmm, could have sworn it being possible to remove replies from your messages

twilit roost
wet breach
#

wonder if it was a feature and then they removed it

tender shard
#

wait

#

now I cannot even remove it from the latest msg

#

huh

#

I swear I was able to remove it from latest message like 2 minutes ago lmao wtf

wet breach
#

yeah discord being weird, think they might have accidentally removed that feature

rotund jolt
#

anyone know if/how it's possible

tardy delta
#

load all player data manually

eternal oxide
#

If they are online, yes

#

Players have one Inventory across all worlds

lilac dagger
#

how do i send potion effect packets per player?

misty ingot
#
    @Override
    public String onRequest(OfflinePlayer player, String params) {
        if (params.equals("hearts")) {
            return String.valueOf(HealthHelper.getHeartsShort(player));
        } else if (params.equals("isdeathbanned")) {
            return DeathbanHelper.checkDeathbanShort(player) ? "true" : "false";
        } else if (params.equals("deathbans")) {
            return String.valueOf(DeathbanHelper.getDeathbanAmount(player));
        }
        return null;
    }

the placeholders return NOTHING
they dont return null, they dont return a value
they return nothing at all
with no errors
also makes me time out

rotund jolt
eternal oxide
#

there is no "other world" files

#

per player ONE inventory

rotund jolt
rotund jolt
misty ingot
#

which is only used if its the default world

rotund jolt
#

ik, and im trying to see if I can access them in anyway

misty ingot
#

n o p e

eternal oxide
#

ALL worlds use ONE inventory. There is no per world inventory system in Spigot

rotund jolt
#

not get told that other world files dont have inventory data stored

misty ingot
#

if you want players to have multiple inventories for diff worlds just use a per world inventory plugin or use a database to store inventories in your plugin

rotund jolt
#

thank you

rotund jolt
#

and I wanted to see if I could read the inventory for the world they join and save it to allow it to have the data of other inventories

lilac dagger
#

how to remove a potion effect using packets?

#

do you guys know any way?

rotund jolt
lilac dagger
#

from a player

lilac dagger
#

let's say the player is invisible using an invisibility potion, i want another player to be able to see the said player as without

onyx fjord
#

is anyone aware why gradle demands a dependency even tho an other dependency provides it (its shaded inside)?

#

or not the dependency itself, but rather it's repo

terse ocean
#

thats the line of code:
player.setDisplayName(ChatColor.translateAlternateColorCodes('&',"&8[&4Hunter&8] "+player.getName()+"&f"));

why does it say hunter hunter???

#

fixed it!

toxic sorrel
#

Is there a way to determine the protocol version of a backend server that a player is on? I'm aware of the getPendingConnection, but that returns the clients version I believe(correct me if i'm wrong)

tender shard
#

anyone got any clue about Velocity? I have no clue on how to use the conditionals in an assignment properly.

#

Also I need to to remove everything after the second dot from a string, e.g. 1.19.2 -> 1.19

#

but no clue how D:

#

from what I know, I can just write java methods that I can use in velocity, but - erm - where do I put them lmao

#

I'm writing a maven archetype btw

lilac dagger
#

how to make players transparent per player?

#

or how to remove the invisibility potion per player

tender shard
#

you gotta send packets I guess

#

these fucking docs only say "the java code" but they nowhere explain WHERE this "java code" is supposed to be located or anything

final monolith
#

BuildTools 1.8 is broken?

Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.8/minecraft_server.1.8.jar

tardy delta
#

isnt 1.8 down?

tender shard
chrome beacon
#

also don't use 1.8.... at least use 1.8.8 πŸ™ƒ

tender shard
#

and with "1.8.8", Olivo means "1.19.3"

chrome beacon
#

True

tender shard
#

i hate velocity / VTL so much

#

WHY IS THERE NO PROPER DOCUMENTATION ABOUT IT

lilac dagger
tender shard
#

which packet did you send

final monolith
wet breach
#

in this manner you would be free to use the api to make players visible or invisible of your choosing

echo basalt
lilac dagger
#

i don't wanna modify the player's one

echo basalt
#

Nms or protocollib?

wet breach
#

that should give you some clues/ideas in how to do it

torn basalt
#
[23:17:38 INFO]: [TownyWebhooks] Enabling TownyWebhooks v0.0.1
[23:17:38 WARN]: [TownyWebhooks] The plugin is deactivated because you left the webhook-url blank in the config file...
[23:17:38 INFO]: [TownyWebhooks] Disabling TownyWebhooks v0.0.1
[23:17:38 ERROR]: Error occurred while enabling TownyWebhooks v0.0.1 (Is it up to date?)
java.lang.IllegalStateException: zip file closed
        at java.util.zip.ZipFile.ensureOpen(ZipFile.java:831) ~[?:?]
        at java.util.zip.ZipFile.getEntry(ZipFile.java:330) ~[?:?]
        at java.util.jar.JarFile.getEntry(JarFile.java:518) ~[?:?]
        at java.util.jar.JarFile.getJarEntry(JarFile.java:473) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:167) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:119) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at com.tr.denizusta.townywebhooks.Main.onEnable(Main.java:50) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:599) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]

Hello πŸ‘‹,

How can i fix zip file closed error there is my code:
https://github.com/FoudreStudios/TownyWebhooks/blob/main/src/main/java/com/tr/denizusta/townywebhooks/Main.java

If webhhok-url is empty, its disabling it self and giving this error in embed

sage dragon
#

1.19.3 doesn't seem to have the PacketPlayOutPlayerInfo anymore, what is being used instead?

tender shard
#

?switchmappings

tender shard
hazy parrot
torn basalt
torn basalt
misty ingot
#

see what I replied to

tender shard
#

oh god, another life steal plugin? aren't there already like 1928 existing ones?

misty ingot
#

yes

#

another lifesteal plugin

tender shard
#

I never understood the idea behind it anyway, I mean - doesn't it make strong players even stronger, and weak players even weaker?

misty ingot
#

well I am going to add custom items and stuff to it to make it more exciting

#

and better than the "usual" lifesteal experience

#

also I am working on a unique gamemode which will require a lot of time and dedication but I think I can do it

#

note: I have never played lifesteal

tender shard
#

me neither, but it always sounded like the shittiest idea ever lol

misty ingot
#

well people like it

echo basalt
misty ingot
#

according to the github wiki

#

I am correct

#

and you are wrong

#

however in reality it is the inverse

tender shard
#

wdym

misty ingot
#

the papi github wiki

#

chuPAPImunanyo

tender shard
#

what exactly is the issue

torn basalt
# misty ingot ``` @Override public String onRequest(OfflinePlayer player, String param...
public String onRequest(OfflinePlayer offlinePlayer, String identifier) {
    if (offlinePlayer == null) {
        return "";
    } else if (!offlinePlayer.isOnline()) {
        return "";
    } else {
        Player player = offlinePlayer.getPlayer();
        switch (identifier.toLowerCase()) {
            case "hearts":
                return String.valueOf(HealthHelper.getHeartsShort(player));
            case "isdeathbanned":
                return DeathbanHelper.checkDeathbanShort(player) ? "true" : "false";
            case "deathbans":
                return String.valueOf(DeathbanHelper.getDeathbanAmount(player));
        }
    }
}
#

here you go

tender shard
#

please use java code blocks

torn basalt
#

didnt tried

tender shard
#

thx

torn basalt
#

np

misty ingot
misty ingot
#

and yes I am a valid player than you for asking

echo basalt
#

if they time you out

#

it's a different issue

misty ingot
#

they also dont give me an answer

echo basalt
#

you're probably running IO / database stuff in the main thread

#

yes, placeholders may be run on the main thread

tender shard
misty ingot
tender shard
#

I did, couldnt find it

torn basalt
echo basalt
#

wonky

torn basalt
#

oh okay

misty ingot
echo basalt
#

I cba regarding your issue

echo basalt
misty ingot
#

I checked

#

many

#

many

#

times

tender shard
#

also is the identifier correct?

misty ingot
#

I am using the correct identifier

#

I am going to test @torn basalt 's code now

misty ingot
#

@torn basalt thanks, it works

tender shard
misty ingot
#

a temporary end to my torment

torn basalt
#

wait i take look

#

yes its

torn basalt
misty ingot
#
    public static Integer getDeathbanAmount(OfflinePlayer target) {
        CompletableFuture<Integer> amount = new CompletableFuture<>();
        Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
            try {
                PreparedStatement statement = null;

                // get deathban amount
                statement = plugin.getConnection()
                        .prepareStatement("SELECT COUNT(*) AS AMOUNT FROM deathban_history WHERE UUID = ?");
                statement.setString(1, target.getUniqueId().toString());
                ResultSet resultSet = statement.executeQuery();
                if (resultSet.next()) {
                    amount.complete(resultSet.getInt("AMOUNT"));
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        });
        return amount.join();
    }

this method is still causing my server to crash

#

(called when placeholder used)

rotund ravine
#

@misty ingot return a completeablefuture instead of an Integer

misty ingot
#

ok

rotund ravine
#

Try redownloading the jar @misty ingot

#

oh wrong tag

#

@torn basalt *

torn basalt
#

No @rotund ravine

#
[19:46:49 INFO]: [TownyWebhooks] Enabling TownyWebhooks v0.0.1
[19:46:49 ERROR]: [TownyWebhooks] The plugin is deactivated because you left the webhook-url blank in the config file...
[19:46:49 INFO]: [TownyWebhooks] Disabling TownyWebhooks v0.0.1
[19:46:49 ERROR]: Error occurred while enabling TownyWebhooks v0.0.1 (Is it up to date?)
java.lang.IllegalStateException: zip file closed
        at java.util.zip.ZipFile.ensureOpen(ZipFile.java:831) ~[?:?]
        at java.util.zip.ZipFile.getEntry(ZipFile.java:330) ~[?:?]
        at java.util.jar.JarFile.getEntry(JarFile.java:518) ~[?:?]
        at java.util.jar.JarFile.getJarEntry(JarFile.java:473) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:167) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:119) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at com.tr.denizusta.townywebhooks.Main.onEnable(Main.java:102) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:599) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
remote swallow
#

Have you tried adding a webhook url to it and see if you still get the error

torn basalt
opal juniper
#

yo @echo basalt nerd

#

you got some ideas for my plugin

#

the idea behind it is like a proc gen cloud island plugin

#

so far i have implemented raining

#

was wondering about structures on top?

dry forum
#

whats the best way to go about setting like 300-1000+ blocks without causing lag

remote swallow
#

Instead of using thjs

#

This

lethal knoll
#

Question, is it safe to store a LivingEntity in an array to fetch it afterwards? Or should I use the UUID and bukkit to fetch by the ID again?

torn basalt
remote swallow
#

I mean the Bukkit.getPlugin....

torn basalt
#

oh

remote swallow
#

Then using that to disable your own plugin not this

opal juniper
dry forum
#

is it on spigot or smthn?

opal juniper
#

yeah

torn basalt
#

Bukkit.getPluginManager().disablePlugin(this);

remote swallow
#

Yes

torn basalt
# remote swallow Yes
[20:04:09 INFO]: [TownyWebhooks] Enabling TownyWebhooks v0.0.1
[20:04:09 ERROR]: [TownyWebhooks] The plugin is deactivated because you left the webhook-url blank in the config file...
[20:04:09 INFO]: [TownyWebhooks] Disabling TownyWebhooks v0.0.1
[20:04:09 ERROR]: Error occurred while enabling TownyWebhooks v0.0.1 (Is it up to date?)
java.lang.IllegalStateException: zip file closed
        at java.util.zip.ZipFile.ensureOpen(ZipFile.java:831) ~[?:?]
        at java.util.zip.ZipFile.getEntry(ZipFile.java:330) ~[?:?]
        at java.util.jar.JarFile.getEntry(JarFile.java:518) ~[?:?]
        at java.util.jar.JarFile.getJarEntry(JarFile.java:473) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:167) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:119) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at com.tr.denizusta.townywebhooks.Main.onEnable(Main.java:102) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:599) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:833) [?:?]
#

same error

vapid grove
#

Any way to hide commands?
Example: A player in chat types "/vi" and something called "/viewinv" pops up

#

How would I prevent that?

mint oracle
#

-Hi, here I can request a dev?

hazy parrot
#

?services

undone axleBOT
rotund ravine
mint oracle
mint oracle
vapid grove
#

sorry i must have gotten sidetracked

mint oracle
#

20 posts?

#

where I can post ?

remote swallow
torn basalt
#

if i just do null its work?

#
        if (getConfig().getString("webhook-url").equals("") || getConfig().getString("webhook-url").equals(null)) {
            getLogger().severe("The plugin is deactivated because you left the webhook-url blank in the config file...");
            Bukkit.getPluginManager().disablePlugin(this);
        }
```to```
        if (getConfig().getString("webhook-url") == null) {
            getLogger().severe("The plugin is deactivated because you left the webhook-url blank in the config file...");
            Bukkit.getPluginManager().disablePlugin(this);
        }
#

ty

frank kettle
#

Hey, everytime a player dies in the server, it seems like they stay "alive" for an extra second and I believe it's because on the PlayerDeathEvent on my plugin I have a code to send a discord webhook message on a channel to inform that the player died(since its a webhook it takes some time).

Is there a way to make some code on player death but not influenciate the ingame death itself("lag" the death from happening)? I want to reduce this lag, not that it matters much since the players die anyways, but it's kinda annoying and in the long run want to fix it.

balmy valve
#

Is there anyway to prevent another plug-in from messing with the entities of my own plug-in?

rotund ravine
frank kettle
#

I fixed it by sending the message when the player respawns instead. when dying it stores their death message and then sends when respawning.

frank kettle
tardy delta
#

bruh what

tardy delta
#

?scheduling

undone axleBOT
tardy delta
#

bruh Double[]::new works but not with primitives

elfin atlas
tardy delta
#

\πŸ’€

chrome beacon
#

Double[]::new uwu

tardy delta
#

ok multiple arguments finally seem to work

#

it ignores others but i should probably fix that

#

the code is horrible tho

#

where is operator overloading in java

river oracle
#

I feel so stupid right now why tf am I gett a null return from Material#getMaterial here?

        final Material material = Material.getMaterial(section.getString("material"));
        if (material == null) {
            throw new IllegalArgumentException(
                    "Invalid material for background item: " + section.getString("material"));
        }

it throws the exception java.lang.IllegalArgumentException: Invalid material for background item: GRAY_STAINED_GLASS_PANE last time I checked GRAY_STAINED_GLASS_PANE is still an item lol

tardy delta
#

isnt it Material#matchMaterial?

river oracle
#

is it?

#

let me check docs again quick

#

?jd-s

undone axleBOT
river oracle
#

I'm honestly dead confused

remote swallow
#

they do 2 different things

river oracle
#

so it is match? I wonder why getMaterial worked on my last project

remote swallow
#

magic prob

river oracle
#

I'm just gonna go back and not touch it

#

so the black magic continues working

remote swallow
#

it wont work now

river oracle
#

it does indeed still work

#

don't ask me how

remote swallow
#

frick

river oracle
#

ok it still won't work

#

I'm confused as fuck man

#

I don't get it 😭

late sonnet
#

in what version are you try this?
exists the enum for this?

river oracle
#

I'm on 1.17.1 (comission please don't kill me)

late sonnet
#

or if the string has spaces or any

river oracle
#

so it should definitly exists

remote swallow
#

fuck 1.17

#

i hope it goes and dies

river oracle
#

again for the 3000th time so I am still like confused

#

im trying to change the enum value to something else now

#

okay what the fuck

late sonnet
#

only for test try using this directly with the enum.. like Material.GRAY_STAINED_GLASS_PANE.name() and pass this to the method
or... get the material for item in hand and test

river oracle
#

yeah musta been an invisible character

#

wait there is def an invisible character no way

late sonnet
#

then you need validate this... clear invalid characters

river oracle
#

okay figured it out πŸ‘πŸ½

#

it was indeed an invisible character somehow

zealous osprey
#

I always wonder when people talk about that, how do they get into the code to begin with?

river oracle
#

probably was copilot in this case

#

I just deleted the line and retyped it and it worked again

eternal oxide
#

Proof the bot copy pastes

tranquil dome
#

I am listening to AsyncPlayerChatEvent and want to get the exact text that is sent in chat (line 3 in image). My current code looks like this:

    @EventHandler
    fun onAsyncPlayerChat(event: AsyncPlayerChatEvent) {
        val player = event.player

        player.sendMessage(event.format) // Line 1 in image

        player.sendMessage(event.message) // Line 2 in image
    }

Neither the format nor the message returns what I want it to return, which is &r<&4Doorkeeper&r> t. Does anyone know how I could obtain this?

elfin atlas
ivory sleet
#

event.format = ...
event.message = ...

tranquil dome
#

I don't want to change the message, I want to get the formatted message

ivory sleet
#

ah

tranquil dome
#

I need the contents of the entire message, so player name, prefix and all + the color codes in it

ivory sleet
#

String.format(format,player.name,message) iirc should give u that

tranquil dome
ivory sleet
#

if the format includes it

nimble hill
#

How do i check if a block was exploded by something like a a Creeper, or Tnt?
Im trying to deny all damage and movement sources in a specific location. (Block Location)

Im using : To handle hands, Pistons

    @EventHandler(priority = EventPriority.HIGHEST)
    public void on(BlockBreakEvent e) {
        if (activeBlocks.contains(e.getBlock())) {
            e.setCancelled(true);
        }
    }

    //prevent piston from moving blocks // Dupe fix
    @EventHandler(priority = EventPriority.HIGHEST)
    public void on(BlockPistonExtendEvent e) {
        if (e.isCancelled()) {
            return;
        }
        e.getBlocks().forEach(b -> {
            if (activeBlocks.contains(b)) {
                Adapt.verbose("Cancelled Piston Extend on Adaptation Foundation Block");
                e.setCancelled(true);
            }
        });
    }

    //prevent piston from pulling blocks // Dupe fix
    @EventHandler(priority = EventPriority.HIGHEST)
    public void on(BlockPistonRetractEvent e) {
        if (e.isCancelled()) {
            return;
        }
        e.getBlocks().forEach(b -> {
            if (activeBlocks.contains(b)) {
                Adapt.verbose("Cancelled Piston Retract on Adaptation Foundation Block");
                e.setCancelled(true);
            }
        });
    }

Bit in the event that TNT blows up, what do i Check for? as BlockExplodeEvent is not it

ivory sleet
#

but else assuming you use essentials, then it might be better to listen to their chat event

nimble hill
#

Dont tell me i need to like do a raycast or generate a sphere around tnt

#

because thats annoying

tranquil dome
#

I am using essentials, but I want it to work with any chat plugin. DeluxeChat is another one for example.

ivory sleet
#

yes, but with dchat u'd just have to listen to their event if you wanna support it properly

chrome beacon
#

BlockExplodeEvent is for when a block explodes such as a bed in the nether. TNT becomes an entity before exploding

nimble hill
#

that gives a blocklist right?

#

and i can just crossref those

chrome beacon
#

Yeah

nimble hill
#

lemmecheck, and thank you

edgy cobalt
#

Can anyone help me make an event that checks if an item is in the players inventory?

chrome beacon
#

Probably

#

?ask

undone axleBOT
#

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

edgy cobalt
#

Is this the wrong channel?

river oracle
#

no dude we aren't gonna spoon feed you code

#

go figure it out yourself and ask more specific questions

edgy cobalt
#

Thats why I said help

#

I wanted to know if anyone wasnt busy

river oracle
#

dude just ask

ivory sleet
#

what do u have right now?

tranquil dome
ivory sleet
#

thats problematic

#

because AsyncPlayerChatEvent for instance does not give a fuck about prefixes, suffixes and so on sadly

tranquil dome
#

Is there any other event I can listen to that does?

ivory sleet
#

well, paper has some events, but idk if its easier there, and that would remove spigot support also, otherwise no, I believe you have to do it case by case which... yes is a bit annoying

#

one way would be to hook into vault

#

and use its chat, eco and perm api to determine certain data that is added by external plugins

#

namely prefixes, suffixes and ranks

#

tho should be mentioned vault does not provide an event afaik

tranquil dome
#

I guess that is a way to get a player's prefix and such, but sadly won't provide the exact formatted message. I'll have a look at what paper has to offer tho.

rotund ravine
#

@tranquil dome It should be in the format. AsyncPlayerChatEvent #format

hushed spindle
#

is there a way to prevent a BlockCookEvent from producing an item without cancelling the event? setting result to null doesn't work since the parameter has the NotNull annotation and causes an assertionerror

tranquil dome
hazy parrot
hushed spindle
#

i need to replace the drop of a campfire cook but since the event lacks details on the recipe actually being cooked i have to determine this manually, and there are also no details on which campfire "slot" is currently being used so i have to use a delayed task to compare before and after

#

if i cancel the event i cant compare a before and after

rotund ravine
tranquil dome
#

That's how the message is formatted without colors

rotund ravine
#

Does your chat plugin not change it?

#

Or is your chatplugin canceling it and sending their own messages.

tranquil dome
#

In this case I would want something like &r<&4%1$s&r> %2$s. &r being white and &4 being red

rotund ravine
tranquil dome
#

I am just trying to get the message. My plugin is not setting or doing anything with the chat

tranquil dome
hushed spindle
#

im guessing its a mojang issue

rotund ravine
hushed spindle
#

they probably just didnt consider it much since a block cook event is usually just needed for furnaces but then they added basically a quadrafurnace

tranquil dome
rotund ravine
#

let me jsut test

#

@tranquil dome whcih server software are you using

tranquil dome
#

paper 1.16

#

Also using 1.16 spigot api

torn basalt
#

Someone know how to use BoostedYAML?

hushed spindle
#

ah figured out how to do the campfire stuff, you can determine which slot has been cooked by looking at the CampFire's cook times and total cook times

tranquil dome
rotund ravine
tranquil dome
#

The problem, my format does not include anything like 'Β§' to replace with '&' in the first place.

        player.sendMessage(event.format.replace('Β§', '&'))
rotund ravine
#

I ran this on stock spigot 1.16

#

eh nah

tranquil dome
#

It's what is displayed in that image

rotund ravine
#

He wants to do the opposite

#

@tranquil dome Not entirely sure what is happening on your end. Seems weird.

#

What does you config in essentialschat say

tranquil dome
#

This outputs the message in color also

        player.sendMessage(String.format(event.format, player.displayName, event.message))
rotund ravine
#

@tranquil dome

#

Do you even have essentialschat

#

Ignore zaken

#

He hasn't read the whole issue.

tranquil dome
#

ess chat is built in

rotund ravine
#

It is not

tranquil dome
#

maven

rotund ravine
#

Do you have essentials chat @tranquil dome ?

#

If not htat is why you format does not change

tranquil dome
#

I do not have ess chat, just EssentialsX

rotund ravine
#

the color is simply essentials setting the display name to &4name&r

#

Then the format will just be standard

tranquil dome
#

That makes sense

rotund ravine
#

The color is coming form the displayname

tranquil dome
#

So how would I then de-translate the displayname?

rotund ravine
#

Yeah

#

Remember there is such a thing as /nick etc.

tranquil dome
#

That changes the display name right?

rotund ravine
#

yes

tranquil dome
#

that's fine tho, as that is what eventually will be displayed in chat too

#

actually, not guaranteed

#

either way, do you know how I can de-translate it?

rotund ravine
#

this.player.displayName.replace(ChatColor.COLOR_CHAR + "","&")

dry bison
#

hello

#

can i ask for problems with spigot plugins

undone axleBOT
#

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

dry bison
#

like im having issues with them

#

im not

#

i just have a issue with a plugin

#

alr

#

thanks

tranquil dome
#

Now another question. I want to not only listen to player chat messages, but also listen to messages that are broadcasted to players by other plugins (or the server itself). An example of this is essentials sending a message &a&l[+] &fDoorkeeper &7joined or a player getting an achievement. What event should I use to listen to these, because BroadcastMessageEvent does not seem to be fired.

rotund ravine
#

For join it's PlayerJoinEvent

#

there is a message in there too

undone axleBOT
tranquil dome
#

Well, join was used as an example. There's also plugins that broadcast messages themselves. For example: Player just sold something on the auction house for $100

terse ocean
#

pluginManager.getPlugin().getConfig().getStringList("Warlock players").clear();

isnt that supposed to clear the Warlock players list from the config.yml file??

#

k thx

#

will do

#

ok i will save it

#

thx

#

pluginManager.getPlugin().saveConfig();

i wrote this and it still doesnt work

#

still sgows my name there

#

wdym change the path?

#

ok but if i want to remove the player that runs a command then i dont want to clear the path

#

ok will try and if i need help ill ask

#

pluginManager.getPlugin().getConfig().getStringList("Warlock players").remove(player.getName());
pluginManager.getPlugin().saveConfig();

but sholdnt that work?

obtuse dirge
#

i'm reading a text file and sending its contents to the player. if there's a line break, a CR symbol is inserted (i assume because of CRLF?) how can I get rid of it?

File motdFile = new File(plg.getDataFolder(), "info.txt");
String motd = Files.readString(Paths.get(motdFile.getAbsolutePath()));
String toSend = ChatColorFormatter.FormatToChatColors(motd);
e.getPlayer().sendMessage(toSend);

this is what i'm working with right now

tranquil dome
obtuse dirge
tranquil dome
#

np

rotund ravine
#

It's to get the format in a way he is used to see it.

vivid skiff
#

Im getting this error

And i don't know how to fix it in line 7 of the main class LXAntiBild is public final class LXAntiBuild extends JavaPlugin {

undone axleBOT
vivid skiff
#

And how can i do the same this as the instance but without it'

#

?

undone axleBOT
river oracle
#

Me gusta singleton pattern (I like , don't kill me optic)

#

It's actually no me guata πŸ€“

dry forum
sterile token
#

Which is better than pastebin

dry forum
#

ok

tender shard
#

who cares lmao

#

pastebin, md5 pastebin, ...

#

it's the same

tardy delta
#

md5 looks hotter \😏

tender shard
#

true

#

but the best is still mine

remote swallow
#

ours is haste bin

tender shard
#

it has @onyx fjord's turtle in mine

remote swallow
#

urslooks weird

#

too much info

tender shard
#

you look weird

remote swallow
#

no

#

you do

#

dye your haira gain

#

hair again

sterile token
#

What the best option for calling player off hand? So they cant use it

tender shard
#

but soon it's gonna be pink or green

remote swallow
#

dye it again

sterile token
#

Which would be the best option for cancelling the off hand usage? (Second one which appeared on 1.9+)

eternal oxide
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
sterile token
#

Why? Did you had had issues?

#

oh okay, that why it wasnt being called πŸ€¦β€β™‚οΈ

river oracle
#

use InventoryClickEvent :P

sterile token
#

Im 100% idiot that i didnt CTRL + click over the class to see the decompile

sterile token
river oracle
river oracle
#

you can do anything with it its the most powerful inventory even thats called afaik

onyx fjord
terse raven
#

How do i make a mob always walk towards the nearest LivingEntity?

river oracle
onyx fjord
#

i mean what the bot is saying

sterile token
#

I need to disable any posibility of "off hand/second hand usage", that why im opened to suggestion

river oracle
remote swallow
#

you still can

#

theres no point of {} on that

#

its pointless

onyx fjord
#

you'd only want {} if you put some logic before that return;

#

wdym no

river oracle
#

zacken

#

you don't need the {}

remote swallow
#

you dont

river oracle
#

it okay I know its shocking

onyx fjord
#

literally

if (event.getHand() != EquipmentSlot.HAND) return;
// If it is hand this code will execute
river oracle
#

It also just looks shit imho

onyx fjord
#

i wouldnt wanna look at Gsit code with {} if statements everywhere

remote swallow
#

yeah but why

sterile token
#

And whats the diff?

#

πŸ€”

remote swallow
#

why are you returning then

#

forgot about that

#

its too late

onyx fjord
#

❀️

#

until you have 50 returning points that is 100 lines saved for a class

fossil falcon
#

is there an event or a way to detect when the ender dragon sprays its dragon breath while perched? I want to replace it with a different area effect cloud

onyx fjord
#

150 -> 50

echo basalt
#

and mess with the entity navigation

onyx fjord
#

they do indeed matter

#

why isnt everyone making one-file plugins then

#

πŸ€”

#

ides will fuck up

tender shard
#

yeah all IDEs are fine except eclipse

remote swallow
#

ahem

#

@worldly ingot

onyx fjord
#

i prefer to have my syntax colored tho

terse raven
onyx fjord
#

most IDEs refuse to work after certain limit of lines

#

because of performance issues

#

its not hard to reach that tho

#

also even below its still a performance hit

tender shard
remote swallow
#

can you try not to deafen me in future pls

onyx fjord
#

what ide

remote swallow
tender shard
#

intelliJ sucks, but it's still the best

#

every other IDE sucks even more

remote swallow
#

intellij has some things i dont enjoy but its better than eclipse

tender shard
#

everything is better than eclipse

remote swallow
#

havent touched netbeans and i refuse to

tender shard
#

netbeans is a joke too

sterile token
eternal oxide
#

Eclipse is love ❀️

remote swallow
#

eclipse is poop

onyx fjord
#

at least eclipse is somewhat lightweight

tender shard
eternal oxide
#

or have a brain

tender shard
#

that's eclipse's favorite quick fix

#

"method XYZ cannot be resolved? Let's just cast it to something totally unrelated"

onyx fjord
#

yeah because its that simple πŸ‘

eternal oxide
#

I can't remember the last time I use any quick fix/suggestion

remote swallow
#

we are making spide

onyx fjord
#

sure bro

tender shard
remote swallow
#

OUR HOUSE

tender shard
#

IN THE MIDDLE OF OUR STREET

river oracle
remote swallow
#

have you heard baggy trousers

river oracle
#

just use vscode

tender shard
#

and then, 4 years later, I installed it again to check it out

remote swallow
#

i had it on my pc before i swapped to ssd

tender shard
#

turned out it's still shit

remote swallow
#

i dont have it anymore

#

my pc runs better

#

i blame my pc being slow on hdd on eclipse

#

boom

#

eclipse is bad

tender shard
#

wtf is wrong with itunes

remote swallow
#

use spotx

tender shard
#

audio software is not supposed to play things >= 0.0 DB lmao

long oracle
#

my friend is making a item caps plugin, he has made it where you can only have a certain amount in a stack but the SMP owner wants it where you can only have 1 stack in your inventory and it wont let you hold more than 1 stack, is that possible and how?
cuz he cant figure it out and apariantly lifesteal has it so he needs help

tender shard
#

or be a real chad, download .ogg files and play them using a DAW like cubase lmao

remote swallow
#

you can only have X items in a stack not 64

onyx fjord
#

i download music

#

the real way

remote swallow
long oracle
# tender shard wtf is an "item caps plugin"

the most items you can hold of a item, so like gaps only let you hold 24 gaps in a stack and pearls only let you hold 8 in a stack, but they want it where you can only hold 1 stack though

tender shard
#

wtf is a "gap"

long oracle
#

golden apple

remote swallow
#

golden apple

tender shard
#

lmao

#

"gap"

remote swallow
#

listen to item pickup, inv click and inventory drag and item swap event

tardy delta
#

sounds like css

tender shard
#

do you also say "dpick" instead of diamond pickaxe

remote swallow
#

check if there inv already contains that block

tardy delta
#

grid-gap: 10px

long oracle
#

some call it gapple some call it gap

long oracle
tender shard
#

yes

long oracle
#

lol

remote swallow
#

totally

long oracle
#

thats not true

remote swallow
#

no one will give you the entire code for it

long oracle
#

ye

#

well

#

he needs a general idea of what to do bassically

#

he cant find it out

remote swallow
#

that what the general idea is

long oracle
#

he needs help

remote swallow
#

listen to events

#

loop over the inventory

#

check if it matches

#

if it does cancel the event

long oracle
#

what events? can you send me lik to send him?

remote swallow
#

sure give me a sec

tender shard
#

EntityPickupItemEvent

#

InventoryClickEvent

#

probably 5 other ones as well

hazy parrot
#

Why just dont your friend joins this server, i think it will be easier

long oracle
#

alr, I sent him those, he said "ooooooo" so Im asuming he figured out something

remote swallow
tender shard
hazy parrot
#

may be the case ig

tender shard
#

I also got banned from paper's discord

#

so I guess they can use their weird "hangar" system on their own lol

#

noone's gonna use it anyway

long oracle
#

alr, I told him to join

mint oracle
#

Hi, is possible to convert a fabric mod to forgge mod? Im no the owner of the mod

remote swallow
#

wrong place to ask

#

we do plugins not mods

tender shard
#

both fabric and forge are upper shit

long oracle
#

this is spigot not forge or fabric lol

tender shard
#

we are here in a place where we fancy a nice across-version API

#

instead of weird mixins that break on every new update

quaint mantle
#

Can you help me

tender shard
#

no

quaint mantle
#

lol

tender shard
#

you didnt ask any question

quaint mantle
#

ok

#

o

mint oracle
tender shard
#

noone can help you if you don't even ask anything

#

?ask

undone axleBOT
#

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

quaint mantle
#

I'm trying to make a plug-in where you can only have a certain amount of one item in your inventory can I do that

tender shard
#

and what should happen when a user attempts to picks up a similar item nonetheless?

quaint mantle
#

I tried making the plug-in but it didn't work at all

onyx fjord
#

send code

tender shard
#

listen to EntityPickupItemEvent, then check the already existing amount of items in their inv. If it's too much, just cancel that event

quaint mantle
#

ok

remote swallow
#

you have other events to listen to as well

tender shard
#

which ones?

remote swallow
#

the inv ones

tender shard
#

oh yeah if they take it out of a chest or sth

#

right

onyx fjord
#

id also honestly setup a task to check just to be sure

#

so they cant exploit

tender shard
#

and then?

#

why not do it right in the first place

quaint mantle
#

idk

#

it's still at work

remote swallow
#

what doesnt work

#

?paste your code and errors

undone axleBOT
remote swallow
#

if any

quaint mantle
#

no like I don't know where to put it exactly

remote swallow
#

you make the events

#

loop over the inventory

#

check if it matches the event item

tender shard
quaint mantle
#

public final class IDK extends JavaPlugin {
@NotNull
public static HandlerList getHandlerList()

This is what i got

remote swallow
#

have you ever made a plugin before

tender shard
#

doesnt seem so

chrome beacon
#

Do you know Java?

quaint mantle
#

no lol

tender shard
#

?learnjava

undone axleBOT
remote swallow
#

learn java then start to make plugins

quaint mantle
chrome beacon
#

?event-api

undone axleBOT
tender shard
#

you gotta be at least a bit proficient in java before you start doing plugins

#

no need to know everything, but at least the basics

quiet ice
#

To be fair the handler list is a piece of magic that is hard to grasp for anyone that has never worked all too much in java world

main dew
#

Hi I thinking how in spigot source I can add method from plugin (if I add method to source spigot I get error ClassNotFound)

fading spindle
#

in EntityDamgeEvent is there a method that gives us the person/entity that caused the damage

remote swallow
undone axleBOT
remote swallow
fading spindle
remote swallow
#

thought there might, guess i was wrong

fading spindle
#

there is getlastdamagecause

tender shard
#

I've never really touched it, so not sure

quiet ice
#

There is more to it

#

And the fact that the method and field need to exist are purely arbitrary, which is my point

tender shard
#

which field? the handlerlist one?

#

that one doesn't have to exist

#

there has to be one static and one non-static method

#

getHandlers() and getHandlerList() or sth

#

but yeah that alone is weird

#

one should be enough lol

rotund ravine
#

It's not that hard to understand

tardy delta
#

seriously wondering why this man is using StrictMath and not math \😒

eternal night
#

gotta save those method calls

tender shard
#

because I for myself cannot understand it

tardy delta
#

and still it manages to be sometimes faster than my parser

tardy delta
#

that stuff is literally hardcoded lol

river oracle
#

whats wrong with StrictMath never used it before

tardy delta
tender shard
tardy delta
#

im not even able to insert custom functions \😒

tender shard
#

StrictMath basically just makes sure that you get the same results on different platforms IIRC

tardy delta
#

its native

#

Math calls get inlined whenever they get hot enough iirc

sterile token
#

Have you heard about that Netflix found an issue related with processors cache which affect JVM?

tardy delta
#

like wtf?

tardy delta
#

i should be reading newspapers to know all that stuff

river oracle
#

this lines up so well its super satisfying

            <relocation>
              <pattern>com.jeff_media.customblockdata</pattern>
              <shadedPattern>sh.miles.customblockdata</shadedPattern>
            </relocation>
fading spindle
#
    @EventHandler
    public void damagee(EntityDamageEvent ede){
        if(ede.getEntity().getLastDamageCause().getEntity() instanceof  Player){
            Player player = (Player) ede.getEntity().getLastDamageCause().getEntity();
            if(playerclass.containsKey(player.getName())){

                if(((customPlayerAttributes)playerclass.get(player.getName())).getPlayerclass().equals("ARCHER")){
ede.setDamage(ede.getDamage() * 2);

                }

            }

        }

``` I'm trying to make it so certain people can deal more damage with bows and this is what ive tried but it doesn't work anyone know why
undone axleBOT
#

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

sterile token
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

sterile token
#

Wrong command sorry tho

#
  1. I would suggest calling ede, as event, which is the proper convention i would use
  2. Why playerclass? I should recommend reading java conventions
  3. I would never use player name as key
fading spindle
quaint mantle
#

This is what i got

sterile token
#

Mainly coding a faction plugin !πŸ€”

quaint mantle
#

package coolmod.idk;

import org.bukkit.Material;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;

public class Cool implements Listener {
public void PlayerEventListener(PlayerPickupItemEvent event){
if(event.getPlayer().getItemInHand().getType()== Material.GOLDEN_APPLE){
if(!(event.getPlayer().getItemInHand().getAmount() <= 24)){
ItemStack item = event.getPlayer().getItemInHand();
item.setAmount(24);
}else{return;}
}else{return;}

    if(event.getPlayer().getItemInHand().getType()== Material.ENDER_PEARL){
        if(!(event.getPlayer().getItemInHand().getAmount() <= 8)){
            ItemStack item = event.getPlayer().getItemInHand();
            item.setAmount(8);
        }else{return;}
    }else{return;}
}

}

undone axleBOT
#

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

drowsy helm
#

please format your code

#

i can barely read that

sterile token
#

No problem explanation, no code format 😬

fading spindle
undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
sterile token
fading spindle
sterile token
#

In your case you are using a Map, where the key is the player name?

fading spindle
#

yea

sterile token
#

okay

fading spindle
#

and i'm wrapping the player class with a custom one

quaint mantle
sterile token
quaint mantle
remote swallow
#

?codeblocks

sterile token
remote swallow
#

read

#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
sterile token
fading spindle
drowsy helm
#

what everyones been talking about lol

quaint mantle
#

oooo

tender shard
quaint mantle
#
package coolmod.idk;

import org.bukkit.Material;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;

public class Cool implements Listener {
    public void PlayerEventListener(PlayerPickupItemEvent event){
        if(event.getPlayer().getItemInHand().getType()== Material.GOLDEN_APPLE){
            if(!(event.getPlayer().getItemInHand().getAmount() <= 24)){
                ItemStack item = event.getPlayer().getItemInHand();
                item.setAmount(24);
            }else{return;}
        }else{return;}

        if(event.getPlayer().getItemInHand().getType()== Material.ENDER_PEARL){
            if(!(event.getPlayer().getItemInHand().getAmount() <= 8)){
                ItemStack item = event.getPlayer().getItemInHand();
                item.setAmount(8);
            }else{return;}
        }else{return;}
    }
}```
fading spindle
remote swallow
#

at the start

tender shard
remote swallow
#

you need 3 ` then type java

#

then 3 ` at the end

tender shard
#
package coolmod.idk;

import org.bukkit.Material;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;

public class Cool implements Listener {
    public void PlayerEventListener(PlayerPickupItemEvent event){
        if(event.getPlayer().getItemInHand().getType()== Material.GOLDEN_APPLE){
            if(!(event.getPlayer().getItemInHand().getAmount() <= 24)){
                ItemStack item = event.getPlayer().getItemInHand();
                item.setAmount(24);
            }else{return;}
        }else{return;}

        if(event.getPlayer().getItemInHand().getType()== Material.ENDER_PEARL){
            if(!(event.getPlayer().getItemInHand().getAmount() <= 8)){
                ItemStack item = event.getPlayer().getItemInHand();
                item.setAmount(8);
            }else{return;}
        }else{return;}
    }
}
remote swallow
#

yay

quaint mantle
#

yes

drowsy helm
#

there are probably like 5 or 6 different events you will have to listen to

tender shard
#

yeah

remote swallow
#

^^

tender shard
#

InventoryClickEvent

#

EntityPickupItemEvent

remote swallow
#

InventoryDragEvent

tender shard
#

InventoryDragEvent

remote swallow
tender shard
#

I'd do it sth like this:

#
private void preventStuff(InventoryEvent stuff) {
  // Do your stuff;
}

@EventHandler
public void onClickEvent(InventoryClickEvent event) {
  preventStuff(event);
}

@EventHandler
public void onDragEvent(InventoryDragEvent event) {
  preventStuff(event);
}

.......
quaint mantle
#

so

tender shard
#

although "preventStuff" shouldn't take an event, but rather everything you need from that event, e.g. the entity and stuff

quaint mantle
#

so how can i do this and th for all the help

sterile token
quaint mantle
#

esy

#

yes

sterile token
#

Because its not worth to help someone with a ibrary which havent learnt atleast the lang where he is coding

#

ahh ok - sorry man

tender shard
#

you are probably better off paying someone to code this for you

#

check my bio πŸ˜›

sterile token
# quaint mantle see

1.5) Listening to events

To listen to any given event in your listener class, you must create a method with the org.bukkit.event.EventHandler annotation attached and the event is specified by the type in the method's argument. The method may be named whatever you wish. Example:

public class ExampleListener implements Listener {
  
  @EventHandler
  public void onPlayerJoin(PlayerJoinEvent event) {

  }
}```

> Taken from spigot events wiki - https://www.spigotmc.org/wiki/using-the-event-api/
tender shard
#

?events

#

?listener

#

?event

#

hm

#

there's some bot command for sure

sterile token
#

yeah there is

#

?eventapi

undone axleBOT
tender shard
#

?eventapi

undone axleBOT
tender shard
#

yeah

sterile token
#

hahaha bro we are connected

tender shard
#

for the longest time

#

/billy joel

#

?billyjoel

#

@quaint mantle we need a ?billyjoel command that sends a random billy joel song

remote swallow
#

no we dont

tender shard
#

we do