#help-development

1 messages Β· Page 62 of 1

flint coyote
#

you can just put it in resources

#

and call saveDefaultConfig()

cold tartan
flint coyote
#

Yeah I was unsure if you just worded it differently

cold tartan
#

Np

flint coyote
#

does the targetEvent fire before breeding?

#

Because there certainly isn't a seperate one for "target before breeding". You can however achieve it with the right if conditions

cold tartan
#

Yeah I'll do that

onyx fjord
#

so umm i used my last brain cell, i get this error: https://paste.md-5.net/vukukaxawe.cs

With this code:

        try {
            @SuppressWarnings("unchecked")
            Class<? extends Event> clazz = (Class<? extends Event>) Class.forName("com.github.sirblobman.combatlogx.api.event.PlayerTagEvent");
            getServer().getPluginManager().registerEvent(clazz,
                    new Listener() {},
                    EventPriority.NORMAL,
                    new EventExecutor().execute(new Listener() {}, clazz),
                    this);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

what am i doing wrong?

flint coyote
#

uhm what are you trying to do?

#

Can't you just create a new instance of "PlayerTagEvent" without the Class.forName()?

onyx fjord
#

im tryna listen to the class above (the string)

#

yes i can

crimson scarab
#

ok i fixed my previous issue, how can make it so that when the arrow hits a block the task ends

onyx fjord
#

but i want it to work universally, for any plugin

crimson scarab
#

will i need to store all the tasks in a hashmap with their entity ids

#

and cancel if that reoccurs in projectile hit event

onyx fjord
#

(config defines what events are listened to, what i put is just an example for debugging

flint coyote
#

ah I see

ornate patio
#

thanks

onyx fjord
#

woo looks like it registered

flint coyote
#

what did you change? :D

onyx fjord
#

instead of inline listener i made inline event executor and custom listener

#

basically i swapped them

flint coyote
#

I see. Yeah that looks cleaner aswell

onyx fjord
#

next thing is to make it do something XD

#

i have no idea how my listener class should look like

flint coyote
#

depends on your usecase I guess

ornate patio
#

wait one small issue though

#

if I were to host the twitch bot on the server

#

how would I keep the credentials to the twitch app confidential

flint coyote
#

huh? Why wouldn't they be by default?
Unless someone can access your server/code

#

With access I don't mean play on it but access the files and plugins

ornate patio
#

don't i have to log in to my bot from the server

#

I'm trying to host the twitch bot on the server that the plugin is loaded on- wouldn't that mean I would have to store the twitch app credentials in the plugin itself?

flint coyote
#

Yes that's exactly what it means

#

Or in a database

#

and the plugin can retrieve it from there

#

but then the plugin has the DB credentials - so same thing pretty much

ornate patio
#

but doesn't that mean anyone do anything with the bot

#

they just decompile the jar

#

or read the database

flint coyote
#

Who is "anyone"?

ornate patio
#

anyone who downloads the plugin

#

would just be able to decompile it and look for the app id and secret

flint coyote
#

ohhh it's supposed to be a public plugin

ornate patio
#

yeah

#

i prob shoulda mentioned that earlier

flint coyote
#

In that case you have to have a server urself

#

And basically they tell your server what to do via the plugin

wet breach
#

you make it a configurable thing in the config.yml for people to put their credentials, you wouldn't code the credentials into the program itself

ornate patio
#

damn

flint coyote
#

and your server holds the credentials and handles the bot

#

on the brighter side: You don't have to update the plugin on every server but you can just add functionality on your own server

ornate patio
#

I have a twitch app

#

which I plan to send messages to twitch chat with

#

unless you're saying have the user use their own token

#

and make the bot chat through their account

flint coyote
#

If you want to use your credentials there is no way around having your own server

wet breach
#

you could make such things if you wanted

ornate patio
#

ive seen a beat saber mod do this

#

you just log in with your twitch account

wet breach
#

mod is not the same thing as a plugin

ornate patio
#

and then the bot chats through your twitch account

ornate patio
#

different game

#

point is that they use the owner's twitch token

wet breach
#

and different concept of providing functionality as well

flint coyote
ornate patio
#

it'll look weird but i'm fine with that

wet breach
ornate patio
#

yes thats what im thinking to do

wet breach
#

conversation api in spigot exists

ornate patio
#

i have barely any experience with the twitch api though so wish me luck

wet breach
#

you can allow players to put their own tokens in, and then encrypt them in the file

flint coyote
#

Encrypting them doesn't make much sense when the plugin has access to the key that is needed to decrypt. So unless they enter it every time you can save on the encryption part

ornate patio
#

Yeah good point

flint coyote
#

It would keep people with no coding knowledge from getting the token. But not anybody else

ornate patio
#

i can just store the token in a separate file

#

And put a fat warning saying do not share this with anyone

oblique geyser
#

Can I restrict that tnt cannot destroy some area?

flint coyote
ornate patio
flint coyote
#

That's only partly true since there's other bots that request a token for an input

#

So those are already coded :p

glossy scroll
#

new EventExecutor.execute is void...

#

how were you even able to compile that?

#

@onyx fjord make a method that has Listener and Event as its parameters

#

and then use a method lambda

#

i.e.

#
public void myThing(Listener listener, Event event) {
    // do thing with event
}```
#

and then

#
        try {
            Class<? extends Event> clazz = (Class<? extends Event>) Class.forName("com.github.sirblobman.combatlogx.api.event.PlayerTagEvent");
            getServer().getPluginManager().registerEvent(clazz,
                    new Listener() {},
                    EventPriority.NORMAL,
                    this::myThing,
                    this);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }```
chrome beacon
#

CombatLogX API spotted πŸ‘€

glossy scroll
#

whats your current code snippet, just curious? @onyx fjord

onyx fjord
chrome beacon
#

Why are you using it like that?

onyx fjord
onyx fjord
#

my plugin will be able to hook on any plugin without me coding a hook

#

with simple config

glossy scroll
#

well...

#

with extremely limited functionality

onyx fjord
#

itll only have to dispatch a command

chrome beacon
#

Just move things to a new class_

onyx fjord
#

ill have hooks made by me + this as Plan B so nobody has to wait

#
  • i can say my plugin supports around 100 thousand plugins πŸ˜‚
glossy scroll
#

yea just remember

onyx fjord
#

what do you guys think about my approach?

glossy scroll
#

this is all youll have access to

#

as soon as you want to do anything more complex

#

it will be a headache

onyx fjord
#

ill just do it like this, user will have to specify other stuff in the config

#

like umm

#

idk we'll see

glossy scroll
#

cuz also like

onyx fjord
glossy scroll
#

HandlerList contains a list of all the registered listeners and their priorities

#

so when you ΓΉse callEvent

onyx fjord
#

am i at least able to get player from event ? (if one exists)

glossy scroll
#

it knows exactly which EventExecutors to use

glossy scroll
boreal sparrow
#

This doesn't cancel damage to a Minecart, any idea why?

@EventHandler
public static void onAttack(EntityDamageByEntityEvent event){
  if(event.getEntity() instanceof Minecart){
    event.setCancelled(true);
}
glossy scroll
#

you could do something like

#
if (event instanceof PlayerEvent playerEvent) {
    Player player = playerEvent.getPlayer
}```
onyx fjord
#

helpful πŸ˜„

onyx fjord
#

thats all i need bro

glossy scroll
#

but i mean

#

thats unreliable

#

cuz if that doesnt extend PlayerEvent

#

it wont work

boreal sparrow
onyx fjord
#

what if i do event.getPlayer()? (assuming player exists)

glossy scroll
#

getPlayer doesn't exist in Event...

onyx fjord
#

because i can just add config field telling server owner to decide if event has a player

#

ouch

glossy scroll
#

like i just told you

#

?jd-s

undone axleBOT
glossy scroll
#

you have 3 methods to work with

onyx fjord
#

i wonder how kiteboard accesses all methods

glossy scroll
#

unless you cast it

#

reflection probably

onyx fjord
#

a lot of effort right?

glossy scroll
#

i mean its

#

getClass().getDeclaredMethods()

#

gives you all the methods

#

then method.invoke(event) will invoke it (if it doesnt require params ofc)

onyx fjord
#

mhm

glossy scroll
#

im still confused as to why you need this functionality

#

because the user would need to know the source code of the plugins they want to use

#

and events should be for API access only

onyx fjord
#

Β―_(ツ)_/Β―

#

thank you for the help

#

ill play around with it tomorrow

#

glad at least the concept works

boreal sparrow
#
if (player.getWorld().getBlockAt(x, y - 1, z).getType() == Material.GOLD_BLOCK) {
}

How do I ensure the code only executes once?

#

(ie. the player can keep standing on the block, but it doesn't execute again)

glossy scroll
#

you would need to keep track of which players stepped on which blocks

boreal sparrow
#

Ok, but I do know that there is only one block of that type per world

#

And I only want it to execute in that world

flint coyote
#

Please elaborate. I'm unsure whether I understood that right

#

only in one world, only once per block and there is only one block?

boreal sparrow
#

I think I can just use a variable to set something like "allow" to false once a player steps on the block

flint coyote
#

yeah you can use a Map

boreal sparrow
#

ye

crimson scarab
#

wanna hear a really wierd bug guys

flint coyote
#

this one?

crimson scarab
#

nah i resolved it now lol

#

event.getEntity().setVelocity(event.getEntity().getVelocity().add(new Vector(0, 5, 0)));
event.getEntity().setBounce(true);

#

why does this not work

obsidian drift
#

Who at mojang made it so light blocks make a sound when walked over 😦

#

Any possible way I could fix this?

blissful wagon
#

there is any way to install data pack in entire server? instead of specific world , or any plugin like skript but in minecraft datapack language

vocal cloud
#

Don't use a data pack use a plugin reee

shy wolf
#

does any one know how to make a TNTPrimed explosion bigger?

crimson scarab
#

use spawnexplosion

#

then set power float

ancient plank
#

reminder that after a certain size with explosions, the only thing that increases is the length/amount of shockwaves

young knoll
#

Mojang also capped them recently

ancient plank
#

wildin

#

jokes on them I made my own inefficient explosion method

near kite
#

@true mural

#

@true mural

#

respond to my dms

#

πŸ”ͺ

true mural
flint coyote
near kite
#

πŸ”ͺ πŸ”ͺ πŸ”ͺ πŸ”ͺ πŸ”ͺ πŸ”ͺ πŸ”ͺ πŸ”ͺ πŸ”ͺ

quiet ice
#

you shouldn't overdo it however

oblique geyser
#

What is the best way to create a world from a template?

flint coyote
#

Define "template"

oblique geyser
#

another world

onyx fjord
#

They probably mean a generator?

flint coyote
#

you wanna copy it?

oblique geyser
#

yes

onyx fjord
#

Oh

#

Use the same seed then

oblique geyser
#

with everything

#

I tryed copying the files and everything but need 9 seconds to do it

onyx fjord
#

What's your goal

flint coyote
#

I mean yeah it depends on the files size

#

but you can copy async

oblique geyser
#

I have one map for my minigame, and want to create instances of this game

flint coyote
#

Why don't you copy the map beforehand

quiet ice
#

You could load the world fully into memory and use a custom world manager for the rest

flint coyote
#

and store what was broken - then reset those blocks?

#

but copying a small minigame map shouldn't take 9 sec

quiet ice
#

But uh, that is a LOT of work if you haven't done anything like that before it

onyx fjord
#

If it's a minigame, maybe make empty world and paste schematic?

oblique geyser
#

no I never worked with worlds and spigot before

oblique geyser
onyx fjord
#

Copying entire world is expensive

flint coyote
#

Are the minigames on seperate servers or is it one server with multiple worlds?

oblique geyser
#

one server with multiple worlds

onyx fjord
flint coyote
#

you could disable the world save

#

and unload it after the game

#

then load it again

#

that might work

oblique geyser
#

when u unload the server save the world

onyx fjord
#

Hypixel made slime world manager afaik

oblique geyser
#

I didnt find the way to disable it

flint coyote
#

Not if you disable autosave

onyx fjord
#

You could use that

oblique geyser
#

I did

onyx fjord
#

And?

oblique geyser
#

I mean I disabled autosave but it doesnt work

onyx fjord
#

Oh

oblique geyser
#

I'll check slime wolrd manager

onyx fjord
flint coyote
#

unless multiple hundred thousand blocks change

coarse finch
#

how long should it take for jenkins to start

#

cause its been starting for like 10 minutes now

onyx fjord
worldly ingot
#

Like 5 seconds ;p

#

If it's taking 10 minutes to start, you've got some issues

flint coyote
onyx fjord
#

Copying region files?

#

That seems cheap

coarse finch
onyx fjord
#

Few dozen megs in worst scenario

coarse finch
#
Building dependency tree... Done
Reading state information... Done
jenkins is already the newest version (2.363).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up jenkins (2.363) ...
Job for jenkins.service failed because a timeout was exceeded.
See "systemctl status jenkins.service" and "journalctl -xe" for details.
invoke-rc.d: initscript jenkins, action "start" failed.
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)
     Active: activating (start) since Sun 2022-08-14 22:06:03 BST; 11ms ago
   Main PID: 45769 (jenkins)
      Tasks: 1 (limit: 780)
        CPU: 2ms
     CGroup: /system.slice/jenkins.service
             └─45769 /bin/sh /usr/bin/jenkins

Aug 14 22:06:03 raspberrypi systemd[1]: Starting Jenkins Continuous Integration Server...
dpkg: error processing package jenkins (--configure):
 installed jenkins package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)```
vocal cloud
#

Jenkins should be at most a minute if your computer is a potato. Read the logs

flint coyote
coarse finch
vocal cloud
#

Well you can check the journal like it recommends

flint coyote
#

but checking which region files changed and only copying those again also seems like a good way

oblique geyser
#

I think Ill choose the schematic

#

and do it async

coarse finch
oblique geyser
#

do u have any example or smth to look at it?

vocal cloud
coarse finch
#

org.codehaus.groovy.vmplugin.v7.Java7$1 did the accessing

vocal cloud
#

I asked for the full error not snippets

coarse finch
#

thats the entire journal

#

jenkins is also maxing the cpu when trying to start

carmine nacelle
#

yea its a ras pi

coarse finch
#

ima try to reinstall jenkins

vocal cloud
#

Make sure the version it's installing is up to date and idek if Jenkins is supported on the pi

coarse finch
#

it should be

vocal cloud
#

Yeah, that should work then

quaint mantle
coarse finch
#

supposedly it should start instantly

#

hmm

#

its marked as not fully installed

idle loom
#

What has Material.MONSTER_EGG been changed to, I'm trying to check for spawn eggs not a specific one

quiet ice
#

most materials have been split up in 1.13 for good reason

quaint mantle
quiet ice
quaint mantle
#

geol you are stupid.

idle loom
quiet ice
#

while yes that is the answer, but it is not what they really want

quaint mantle
#

fuming?

idle loom
quiet ice
#

?jd-s

undone axleBOT
idle loom
#

;-;

quiet ice
flint coyote
#

Does that work for all types that got grouped now? Fences? Wood types?

#

Because usually I string compare their enum. I wonder if there's a better way for all of those

quiet ice
#

A must-have when the material rewrite comes

flint coyote
#

How to check for those tags?

#

ah isTagged. nvm

night torrent
#

does anyone know how to give players screen effects like what you see when their spectating a mob like a creeper/spider/enderman?

night torrent
#

or any screen tint?

#

is something like that even possible?

lost matrix
#

Not without a resourcepack. All you can do is use the effects available like pumpkins and the frost effect.

night torrent
#

ah, ok. thanks

#

im working on a night vision plugin, is there anything that you think would work to make a green like effect?

lost matrix
#

Nope

#

Not without resourcepacks

night torrent
#

what about the nausea overlay? I know they recently implemented a green vingette if you have distortion disabled

lost matrix
#

Thats client side

kind hatch
night torrent
#

makes sense. if i were to use resource packs how would i toggle overlays?

spark tide
#

Is this discord used for protocol lib questions?

night torrent
#

any spigot related questions

#

so yes

tender shard
#

?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!

obsidian drift
#

How can I change a players name through NMS?

#

I might be able to edit GameProfile actually

eternal oxide
#

You have to create a fake profile and apply it

night torrent
#

how do i change the dye color of a leather item using ItemStack?

#

ive tried using itemmeta and adjusting the material but i cant find much

#

oh wait, just found a solution using LeatherItemMeta

#

*LeatherArmorMeta

river oracle
#

forgot the exact cast

worldly ingot
#

LeatherArmorMeta

#

Close

river oracle
#

damn :( so close my memory was just slightly off

torn shuttle
#

man serializing and deserializing items is a cursed endeavor

river oracle
#

need that pdc

torn shuttle
#

I did that too in several different ways in several different plugins according to the needs

#

but uh now I want the most generic one possible and I am dealing with that specifically

drowsy helm
#

base64 ftw

#

or byte blob

tranquil viper
#

can you put attributes onto a piece of paper to make it strong like a netherite helmet?

tender shard
#

sure

tender shard
compact haven
#

mfnalex ❀️ buoobuoo

spark tide
#

I have a ProtocolLib related issue

#
[19:08:09 WARN]: Exception in thread "pool-7-thread-1" FieldAccessException: Field index 1 is out of bounds for length 1
[19:08:09 WARN]:     at ProtocolLib (1).jar//com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49)
[19:08:09 WARN]:     at ProtocolLib (1).jar//com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:289)
[19:08:09 WARN]:     at andonia-shadow.jar//me.gleeming.tabey.packets.PacketTeam.sendPacket(PacketTeam.java:62)
[19:08:09 WARN]:     at andonia-shadow.jar//me.gleeming.tabey.Tabey.lambda$onJoin$3(Tabey.java:54)
[19:08:09 WARN]:     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[19:08:09 WARN]:     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[19:08:09 WARN]:     at java.base/java.lang.Thread.run(Thread.java:833)
tender shard
spark tide
#
    public void sendPacket(Player player, ProtocolManager protocol) throws InvocationTargetException {
        var packet = new PacketContainer(PacketType.Play.Server.SCOREBOARD_TEAM);
        packet.getStrings().write(0, teamData.name);
        packet.getIntegers().write(1,action);
//        Add/Remove from team
        if (action == 3 || action == 4) {
            packet.getIntegers().write(9, teamData.players.size());
            packet.getStringArrays().write(10, (String[]) teamData.players.toArray());
            return;
        }
//        create team/anything else
        packet.getChatComponents().write(7, WrappedChatComponent.fromJson(String.format("{\"text\":\"\"%s\"\"}\"",teamData.getPrefix())));
        packet.getChatComponents().write(8, WrappedChatComponent.fromJson(String.format("{\"text\":\"\"%s\"\"}\"",teamData.getSuffix())));
        packet.getIntegers().write(9, teamData.players.size());
        packet.getStringArrays().write(10, (String[]) teamData.players.toArray());
        protocol.sendServerPacket(player, packet);
    }```
#

what am I doing wrong?

tender shard
#

I cant help exactly with this problem, but why don't you just send the packet directly using NMS?

#

that way you know exactly what arguments are needed instead of doing weird stuff like "getIntegers().write(1,action)"

#

protocollib is like 12 times more complicated than just using the packets directly imho

spark tide
#

NMS?

tender shard
#

yes

#

"vanilla code"

#

you dont need protocollib to send packets

#

you can just use the NMS classes

#

e.g. net.minecraft.network.protocol.ClientboundScoreboardPacket (just an example packet name, I dont know exactly how its called)

#

hello mr magma

torn shuttle
#

I guess there are no silver bullets but anyone know what the most generic and likely to work itemstack serialization process is? I'm using base 64 rn but it doesn't seem to like chests and potions already

tender shard
#

ItemStack implements ConfigurationSerializable already, what's wrong with that? You need it to be a string, I guess?

#

wdym with "it doesnt like chests and potions"?

spark tide
torn shuttle
#

seems to error when I do those

spark tide
#

thats why I was asking about protocol lib

tender shard
torn shuttle
#

works just fine with book enchants

tender shard
#

I serialize itemstacks like this ^

torn shuttle
#

that's the one I adapted

tender shard
#

hm and what exactly is the error you're getting?

torn shuttle
#

?paste

undone axleBOT
torn shuttle
tender shard
#

yeah

#

show your code pls

#

either your desirliaztion code (sorry, cant type properly today lol) is bugged, or you don't have a valid base64 string in the first place

torn shuttle
#

yeah I guess that would be the case hm

dusk flicker
#

i read betterstructures as betterstuff

#

guess im tired

torn shuttle
#

ngl I'm a bit dead rn

#

I've not managed to spend more than 20 continuous minutes without a support request today and that was the least of it

tender shard
#

hm okay sooo

#

you're using Base64Coder

#

I just used java's builtin base64 stuff

#

but that probably is not he problem

#

try to use the builin java base64 encoder

torn shuttle
#

I mean it does work for enchanted books is the thing that throws me off

tender shard
#

can you show one of those base64 strings that breaks it?

#

?paste that please

undone axleBOT
torn shuttle
#

potion is broken (last entry)

#

enchanted book is working

tender shard
#

erm wait wait wait

torn shuttle
#

ignore the first one

#

that's an alt format

tender shard
#

what is that

#

why do you do "serialized=..."

torn shuttle
#

if it has material it's a simple item, if it has serialized it's a headache

tender shard
#

seems like a dirty workaround πŸ˜› does it work if you simply copy/paste my exact code?

#

because the potion thing is definitely valid base64

torn shuttle
#

so the reader would be in the wrong here

tender shard
#

oh wait

#

wtf

#

no

#

found the problem

torn shuttle
#

?

tender shard
#

why do you add stuff behind the base64 string?

torn shuttle
#

generation settings but they're not decoded

tender shard
#

the amount part shouldnt be there

torn shuttle
#

at least shouldn't be

tender shard
#

are you sure? how are you reading it? print out the string that's passed to your decode method

iron glade
#

If I want to save the data folder path to a string would it be

String folderPath = plugin.getDataFolder().getPath();```
or getAbsolutePath() ?
tender shard
#

I mean, your error clearly says "length of the string isnt a multiple of four" so I guess you accidentally pass more than just the plain base64

tender shard
#

getPath is a "local" path

#

e.g. it could be ./plugins/MyPlugin

iron glade
#

ahh I understand

tender shard
#

getAbsolutePath would be /home/minecraft/myserver/plugins/MyPlugin

iron glade
#

got it

#

thanks

tender shard
#

np

torn shuttle
#

oh damn it

#

I truncated it too early

#

yeah

tender shard
#

you should consider using a proper formatting thing for your stuff πŸ˜›

torn shuttle
#

wdym this is my totes legit certified to work most times format

tender shard
#

e.g.

myitem1:
  base64: asdasdasd...
  amount: 1
  chance: 1
  info: POTION
torn shuttle
#

eh but that's really annoying to make into a list

tender shard
#

why?

torn shuttle
#

requires whitespace formatting and stuff

tender shard
#

hm I dont really understand what you mean

#

I mean you're using FileConfiguration right? You can just get each item's ConfigurationSection inndividually

torn shuttle
#

I mean for users, adding whole new entries is not as immediately accessible and tends to cause confusion which I then have to spend time clearing up

tender shard
#

that's true but users obviously also don't add base64 strings manually, I guess πŸ˜„

torn shuttle
#

yeah but they will probably add/edit the simple ones

#

well not probably, they are doing it

tender shard
#

hm yeah

#

but you got it working now right?

torn shuttle
#

uh

#

ngl things would go much faster if I wasn't falling asleep at the wheel

#

ye totally works

#

thanks for the help!

umbral hawk
#

why maven spigot artifact doesn't exists anymore?

#

i need to use nms and craftbukkit

buoyant viper
#

?nms

#

?1.17

undone axleBOT
buoyant viper
#

wtf is it

#

oh right

#

?bootstrap @umbral hawk

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

buoyant viper
#

ok mightve been wrong cmd but

#

u need to use remapped in buildtools

umbral hawk
#

😠

tender shard
buoyant viper
#

so like java -jar BuildTools.jar --rev 1.19 --remapped [mojang]?

tender shard
#

HANNNAH IS HERE

idle loom
#

does anyone know what permissions Minimessage uses for the like
colors

buoyant viper
#

im Gone

idle loom
tender shard
#

no

#

minimessage doesnt interfer with the server at all

#

well, it does, but not "on its own"

#

idk how to explain it lol

tender shard
idle loom
#

well I can use the colors but if I remove perms from myself I can

buoyant viper
#

i thought mm is just a library for coloring text

idle loom
#

and it messes with my chat format cause certain people cant

tender shard
#

are you developing a plugin?

buoyant viper
#

not actual colored chat

idle loom
tender shard
#

and you are using minimessage to parse messages?

kind hatch
# tender shard idk how to explain it lol

MiniMessage is a library that plugins depend on. It simply formats chat colors.
If you wish to extend that functionality or modify it a little bit, you would make another plugin that makes use of it.

idle loom
kind hatch
#

That's how I would explain it anyways.

tender shard
# idle loom I believe so

you don't. disable all other plugins and you'll see that mininmessage doesnt do anything on its own

#

if you just write "<red>test" in chat, you'll see that it will NOT print "test" in red, ubt it will actually just show "<red>text" in chat

#

minimessage doesn't use any "permission" system

worldly ingot
#

I mean it's not even a plugin afaik

tender shard
#

it isn't, yeah

#

it's just a library / basically a wrapper for NMS components

idle loom
tender shard
waxen plinth
#

I'm making really good progress on my command library, it's got two styles it can be used in

#

The new one is the builder

idle loom
waxen plinth
tender shard
#

one sec

buoyant viper
#

when the message is miniature

#

idk i use translateAlternateColorCodes

tender shard
idle loom
tender shard
#

they explain perfectly fine how to use MM

buoyant viper
#

Msg.java

#

;(

tender shard
#

yeah

#

a Msg

buoyant viper
#

metal solid gear

tender shard
#

public static void

buoyant viper
#

what konami game is that

tender shard
#

yes

#

the left one

ancient plank
#

I don't like shorthand in code

#

Personal preference

tender shard
#

do you prefer longhand?

ancient plank
#

Hm

tender shard
#

lol

buoyant viper
#

Message.java >

tender shard
#

hannah switched sides again, I see

buoyant viper
#

im literaly bi

tender shard
#

bi or pan?

buoyant viper
#

yes

tender shard
#

yoghurt

buoyant viper
#

yogheal

tender shard
#

pudding'nt

quaint mantle
#

mcdonald

buoyant viper
#

borger kong

tender shard
#

mcdonalds has better fries, but burgerking has better burgers

buoyant viper
#

yeah

ancient plank
#

conditionally gay

#

As a wise man once said

tender shard
#

it's not gay if you add a //NOHOMO comment

buoyant viper
#

gay if u take me out to dinner

quaint mantle
ancient plank
tender shard
#

how the turntables

buoyant viper
#

// TODO: NOHOMO

buoyant viper
#

it will be hetero eventually

quaint mantle
#

assert !dick.action(Action.SUCK).isWithHomoIntent();

tender shard
#

fun fact: sea horses dont have any gender

buoyant viper
#

theyre just trans idk

tender shard
#

yeah but they have it builtin biologically

#

two sea horses can always mate and get children

#

like in MC

tender shard
#

JDABuilder.withIntents(...)

quaint mantle
#

assert !dick.action(Action.SUCK).intents().contains(IntentBuilder.SEXUAL_INTENT.withModifier(Modifier.HOMOSEXUAL).build());

tender shard
#

wait

buoyant viper
#

Intents.WITH_MOTHER

tender shard
#

dick.action(Action.SUCK)

#

does that mean that this dick sucks another dick?

#

if so: interesting concept

#

btw why does the gas station in carpendale not sell any yams

buoyant viper
#

ActionBuilder.SUCK.withModifier(Modifier.SLOPPY)

quaint mantle
quaint mantle
buoyant viper
#

why would a gas station sell yam

quaint mantle
tender shard
#

season 2 episode 12 IIRC

buoyant viper
#

never watched it

#

never will

tender shard
#

Thats your fucking problem

#

Best series ever

buoyant viper
#

too corny for me

quaint mantle
tender shard
#

corny?

#

i have to get a translator for "corny"

quaint mantle
#

trying to be funny, making it unfunny

tender shard
#

hm it's actually the opposite imho

#

but yeah you do you πŸ˜—

quaint mantle
#

idk its hard to translate corny

tender shard
#

yeah in german it has like 10 different meanings

#

shit

#

wrong copy paste

quaint mantle
#

cornΒ·y
/ˈkΓ΄rnΔ“/
trite, banal, or mawkishly sentimental.

tender shard
#

corny has like 10 german words lol

quaint mantle
#

i dont know what none of those first 3 words mean

#

trite banal mawkishly

tender shard
#

first one is like "cheesy"

quaint mantle
#

ye that

tender shard
#

second one is "overly weird"

#

third one is also cheesy

#

fourth means "deprecated" so ugh

#

and the sixth or so is "rich in grains" lol

quaint mantle
#

@slender coral ign

slender coral
#

shrimpzo is gay

quaint mantle
#

chad

#

shit i cant even play

#

my headphones are broke

slender coral
tender shard
slender coral
#

my friend

tender shard
#

is he cute?

quaint mantle
#

are you gonna fucking add me

tender shard
#

adding you?

#

I sometimes think about blocking you

quaint mantle
#

😦

#

im talking to marcel

tender shard
#

but then I remember that you got ?ban perms

quaint mantle
#

damn right i do

tender shard
#

and then I pretend to be your friend

quaint mantle
#

smart move

tender shard
#

🧠

drowsy helm
#

should ClientboundAddEntityPacket be sent to players in a radius or can it just be sent globally and client will handle it?

glossy scroll
#

send globally

#

the client controls rendering

#

actually tho

#

you will need to resend it if the player is not within a radius

drowsy helm
#

yeah sweet

#

fuck that sounds like alotta sqrt checks

glossy scroll
#

uhh not really

#

if distanceSqr < radius * radius

drowsy helm
#

ah yeah forgot about that one

iron glade
#

Anyone happens to know how to add a day suffix to SimpleDateFormats? like 15th, 3rd, 2nd, etc

vocal cloud
drowsy helm
#

Am i dumb or does location#getChunk load the chunk?

worldly ingot
#

It should load the chunk, yes

drowsy helm
#

any quick way to get whether the chunk is loaded through location

#

or do i have to manually get the chunk coord and check through world

worldly ingot
#

Yeah you'd have to check World#isChunkLoaded(x, z)

iron glade
#

I'm currently trying to make some experience with streams, would this be a good replacement for the method?

    public Warp getWarpByName(String name) {
        
        for (Warp warp : this.warpStorage) {
            if (warp.getName().equals(name)) {
                return warp;
            }
        }
        return null;

    }```
```java
    public Warp getWarpByName(String name) {

        return this.warpStorage.stream()
                .filter(warp -> warp.getName().equals(name))
                .findAny()
                .orElse(null);

    }```
latent bone
#

I'm currently making a simple VillagerTradeEvent (for spigot) and this works, but I want to know how to detect the count of the output they got from the trade by shift clicking, since this only works if you click once, and get one item. (I know how to detect ShiftClick, i'm just wondering how can I find how much items they got and how can i call event for each one)

public final class VillagerTradeListener implements Listener {
    @EventHandler
    public void onVillagerTrade(InventoryClickEvent event) {
        if (event.getClickedInventory() instanceof MerchantInventory villagerMerchantInventory) {
            Integer slotClick = event.getSlot();
            ItemStack slotItem = villagerMerchantInventory.getItem(slotClick);
            MerchantRecipe villagerMerchantRecipe = villagerMerchantInventory.getSelectedRecipe();
            if (slotClick != 2){return;}
            if (slotItem != null || slotItem.getType() != Material.AIR){
                Merchant entity = villagerMerchantInventory.getMerchant();
                TradeEvent villagerTradeEvent = new TradeEvent(
                        (Player) entity.getTrader(),
                        entity,
                        villagerMerchantInventory,
                        villagerMerchantRecipe,
                        slotItem,
                        slotClick,
                        villagerMerchantRecipe.getAdjustedIngredient1(),
                        villagerMerchantRecipe.getMaxUses(),
                        villagerMerchantRecipe.getVillagerExperience()
                );
                Bukkit.getServer().getPluginManager().callEvent(villagerTradeEvent);
                if (villagerTradeEvent.isCancelled()){ event.setCancelled(true); }
            }
        }
    }
}```
waxen plinth
#

But also no

#

You should just use a HashMap πŸ₯²

#

Map<String, Warp>

waxen plinth
#

So for example if they have 64 emeralds in the slot and it costs 5 emeralds for 8 sticks, it's (64 / 5) * 8

#

= 96

#

(Integer division)

latent bone
waxen plinth
#

I know what you're asking

#

Did you even read my reply

#

Because I told you the solution and you then just restated the question

#

I'm not sure how advisable it is to call potentially hundreds of events for a single click, you should consider a different approach

quaint mantle
#

Hey, so I'm looking for a way to make it when an anvil falls then it gets removed. I've tried

@EventHandler
void onDamage(EntityDamageEvent event) {
    if (event.getEntityType() == EntityType.FALLING_BLOCK && event.getCause() == DamageCause.FALLING_BLOCK)
        event.getEntity().remove();
}

but it only works when an anvil is damaged so most of the time it does nothing. And I've tried

    @EventHandler
    public void onBlockChange(EntityChangeBlockEvent event){
        if(event.getBlock() == Material.ANVIL.createBlockData()) {
            Location l = event.getBlock().getLocation();
            World w = event.getBlock().getWorld();
            w.setBlockData(l, Material.AIR.createBlockData());
        }
    }

which I didn't except to work but yea. Anyone know how to do this?

waxen plinth
#

You're doing == on BlockData

#

Wait no

#

You're doing Block == BlockData

#

Which will always be false

quaint mantle
#

Wait for the second one right?

waxen plinth
#

Do e.getBlock().getType().toString().contains("ANVIL");

waxen plinth
quaint mantle
#

So

    @EventHandler
    public void onBlockChange(EntityChangeBlockEvent event){
        if(event.getBlock() == event.getBlock().getType().toString().contains("ANVIL")()) {
            Location l = event.getBlock().getLocation();
            World w = event.getBlock().getWorld();
            w.setBlockData(l, Material.AIR.createBlockData());
        }
    }
#

Right?

glacial sphinx
#

Hello. I have a question. Normaly how long is going to take to approve a premium resoure?

waxen plinth
#

3 years

waxen plinth
glacial sphinx
#

xD DAM

waxen plinth
#

Get rid of the == and everything before it except the if

quaint mantle
#

Oh right ok

waxen plinth
#

An learn how == works in java please

#

Because you're using it very wrong

quaint mantle
#

Alright

waxen plinth
#

You also have an extra () you don't need at the end

quaint mantle
#

Yea saw that

#

Alright thanks I'll test it out!

boreal sparrow
#

Very noob question here:

List<Player> players = new ArrayList<>(world.getPlayers());
Player hunter = players.remove(new Random().nextInt(players.size()));
Player hunter1 = players.remove(new Random().nextInt(players.size())); 

Does that guarantee that hunter and hunter1 will never be the same player?

drowsy helm
#

yes

#

pretty smart way of doing it ngl

latent bone
grizzled oasis
#

Hi im having an issues on compile

            for(var player : e.getPlayer().getServer().getOnlinePlayers()) {
                e.getPlayer().hidePlayer(player);
                player.hidePlayer(e.getPlayer());
            }

The line is the first one and the error is "cannot find symbol"

#

yes but they are correct

visual tide
#

Player will be fine

grizzled oasis
#

Im using intelliJ idea

visual tide
#

wont usually impact javac

grizzled oasis
#

not fixed

visual tide
#

are you sure your event is called e and not event or smth

grizzled oasis
#

i switched from java 11 to 8

grizzled oasis
visual tide
#

oh

#

The car

#

Var

#

var don’t exist in java8

grizzled oasis
#

ah

#

and what i can use?

visual tide
#

The actual type of player

#

Which I assume is Player

grizzled oasis
#

for(Player player : e.getPlayer().getServer().getOnlinePlayers()) this would be finally fixed?

#

and working?

visual tide
#

yea but try it

grizzled oasis
#

that's for sure

#

ok it worked on build

#

now i will try it thanks for the help

boreal sparrow
#
for (Player hunter : world.getPlayers()) {
//hunter.Do a thing
}

Will that execute on all the players in that world? Or should I use Bukkit.getOnlinePlayers?

crude charm
#

online is all on server

boreal sparrow
#

Oh yea, forgot about that thanks!

#

But this is weird:

for (Player hunter : Dinohunters) {

hunter.sendMessage(ChatColor.RED + "You Are A Hunter!\nTry to shoot the runners dead before they make it!");

Dinohunters always has 2 entries. But the two hunters both receive two messages instead of one?

crude charm
#

What is "Dinohunters"

that doesn't look to be how you make an enhanced loop

boreal sparrow
#

Dinohunters is the variable that contains this

#

List<Player> players = new ArrayList<>(world.getPlayers());
Player hunter = players.remove(new Random().nextInt(players.size()));
Player hunter1 = players.remove(new Random().nextInt(players.size()));

#

So it picks 2 "hunters" that cannot be the same

undone axleBOT
crude charm
#

Yeah

#

I'm so lost

boreal sparrow
#

yea sorry I suck at explaining

#

ill paste it

crude charm
#

Don't name a class "Methods"

boreal sparrow
#

I know its bad practice

crude charm
#

Also what is the issue?

crude charm
iron glade
#

What do you guys think would be a good visual indicator that a text is hoverable?

crude charm
#

?di

undone axleBOT
boreal sparrow
#

sure

crude charm
#

Also rename ur setHunter method

#

having the name of the world is very misleading

#

it sounds like it should set a player as the hunter

#

^^^

#

Also use lombok for setters / getters

boreal sparrow
#

oh

crude charm
#

^ but still saves like 1000 lines when you want to make one for like 10 vars

boreal sparrow
#

oh sorry

#

yea but I dont see why

tame elm
#

I need to code a plugin where I get items broken by water, how can I listen to that event?

echo basalt
#

ThreadLocalRandom πŸ‘€

boreal sparrow
#

I mean is it caused by this?
Methods obj = new Methods();

iron glade
#
Methods obj = new Methods();``` you're calling this in the event, which means it's called as often as this event occurs
tame elm
boreal sparrow
#

oh, its in the worldChange event

#

doesnt that mean that it will execute the numbers of players changed worlds?

#

like if there were three players, it would execute 3 times?

iron glade
#

you're creating a new Methods every time that event occurs

#

If he teleports 2 players twice, etc

boreal sparrow
undone axleBOT
iron glade
#

^

#

also have a look at naming conventions

ivory sleet
#

put the object into a class variable rather than a local method-scoped variable

boreal sparrow
#

wdym?

iron glade
#

^instead of creating one more it every time you need it

boreal sparrow
#

thats so big brain

#

thanks

ivory sleet
#

one way to think about it is that variables are basically ropes or boxes that contain or hold objects

#

so when people talk about caching, usually it involves some type of variable that hold on to some object so the jvm doesnt garbage collect it

boreal sparrow
#

My friend also receives two

#

yea

#

ill do that main class thing

#

πŸ€”

#

ill test the onEnable one first

#

But how would I allow other classes to access thisvariable

#

without creating a new object to access the variable and starting it all over again

#

yea di seems complex but ill try it

iron glade
cedar yoke
#

is there a way to disable chat reporting ?

ivory sleet
#

convert all messages to system ones

iron glade
#

If that's not enough to get it working for him idk :D

boreal sparrow
#

thanks so much!

cedar yoke
iron glade
#

But you should really change the class' name (Methods)

boreal sparrow
#

yea, main class

boreal sparrow
#

oh no

#

"com.sinden.runnervshunter.RunnerVSHunter.getMethods()" because "this.plugin" is null

#

error code or code

#
public class StartGame implements Listener {

    private final RunnerVSHunter plugin; //main class

    public StartGame(RunnerVSHunter plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onChangeWorld(final PlayerChangedWorldEvent event) {
        Player player = event.getPlayer();
        if (this.plugin.getMethods().isWorldType(player.getWorld().getName()) && !player.getWorld().getName().equals("RunnerVsHunterhub")) {
            int count = this.plugin.getMethods().getPlayerCount(player.getWorld().getName());
        }
    }
#

wdym?

lost matrix
#

Show your main class

boreal sparrow
#

oh yea xd

#

here

lost matrix
#

Why?

boreal sparrow
#
//Main class
private Methods method;

@Override
    public void onEnable(){
        getServer().getPluginManager().registerEvents(new StartGame(this), this);
        method = new Methods();
    }

    public Methods getMethods() {
        return this.method;
    }
lost matrix
#

PlayerChangedWorldEvent is called after the player already changed the world

lost matrix
boreal sparrow
#

wait i have some other stuff that i think is really bad

#
public class StartGame implements Listener {

    private final RunnerVSHunter plugin; //main class

    public StartGame(RunnerVSHunter plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onChangeWorld(final PlayerChangedWorldEvent event) {
        Player player = event.getPlayer();
        if (this.plugin etc.){
          //stuff
          if(this.plugin){ //I can't use this.plugin here, how do I fix that
            
          }
        }
            
        
    }
lost matrix
boreal sparrow
#

Its says cannot resolve symbol plugin

#

no missing

#

checked

#

if it matters: this is in a runnable

lost matrix
#

Because what youve sent wont compile for several reasons

boreal sparrow
#

runnable isnt for delay

#

yea

lost matrix
#

Nothing here is in a runnable. Show the actual code.

#

smh

boreal sparrow
#

yea ok dumb move

#

but the whole class?

#

its really large

lost matrix
#

And if its inside an anonymous class scope then you need to use

StartGame.this.plugin
boreal sparrow
#

wow

lost matrix
#

This should work

boreal sparrow
#

that workedc

#

thanks so much

echo basalt
#

7smile7

#

you got any basic prometheus integration tutorial or code?

#

I'd like to setup some graphs πŸ‘€ but I'm low-iq

lost matrix
#

Prometheus? You mean Graphana?

echo basalt
#

graphana graphs the output of prometheus so yeah

#

prometheus is the actual database / gathering program

lost matrix
#

Thats quite specifc XD nope i dont have a tutorial for that.
But you can do either polling or webhooks. Shouldnt be too hard.

echo basalt
#

my man

#

it took me 2 hours to setup mysql on a machine

lost matrix
#

Isnt there a plugin that exposes metric endpoints or something.
I swear ive seen it in the last few weeks.

echo basalt
#

metrics

#

or Plan

#

but plan doesn't go that deep

lost matrix
#

But i think you are mostly on your own with this...

echo basalt
#

well

#

I'll learn this day n nite

echo basalt
#

🀝 this is great

quaint mantle
#

^ anyone can help pls?

echo basalt
#

why are you trying to set legacy data on a new plugin

quaint mantle
#

wym?

echo basalt
#

setData(byte) is a legacy method

#

pre-1.13

quaint mantle
#

then what do I do?

#

OH

#

so it does not work for 1.16.5?

echo basalt
#

not really no

quaint mantle
#

?

echo basalt
#

Yeah

quaint mantle
#

thanks brother

wind dune
#

The SpigotApi uses the GPL license. As far as I know the GPL license forces me to use GPL im my project. Does it apply to plugins using the SpigotApi as well?
Edit: sentence structure

echo basalt
#

in theory yes but in practice no

wind dune
#

So in theory every plugin has to be open source?

echo basalt
#

in theory

wind dune
#

And why only in theory? Do I run into any danger if I publish a library with the SpigotApi and license it under MIT?

echo basalt
#

No

#

I say in theory because in practice no one enforces it

wind dune
#

But someone could enforce it?

eternal oxide
#

Never going to happen, unless you do somethign shady

obsidian drift
#

What is the remapped packet for destroying an entity?

#

Oh it might just be ClientboundRemoveEntitiesPacket

wind dune
#

Okay thanks. πŸ™‚
Sounds like I am safe.

vital sandal
#

after i send the packet

#

player skin got updated but he cant interact with the world

#

until /kill

onyx fjord
#

can i redo class deletion in ij? πŸ’€

eternal oxide
#

you can;t simply change teh skin

frosty tinsel
#

And CTRL+Z

echo basalt
#

I wonder if we can make an npc that mimics player movement

#

so we can fuck with it

#

and change skin without bugging

eternal oxide
#

yes, but it takes a few packets

#

?paste

undone axleBOT
eternal oxide
obsidian drift
#

Anyone know how I can change a players Minecraft name internally through packets?

vital sandal
#

setdisplayname ?

obsidian drift
#

I think it's a bit more complicated than that

eternal oxide
#

You can;t change their name. Theres setDisplayName but changing the name above their head, look at teh paste above

obsidian drift
#

Ah okay. Thanks

eternal oxide
#

they will still chat with their proper name, but it will show the altered name

obsidian drift
#

Is it worth using packets for a sidebar? Or should I just use bukkit scoreboards

eternal oxide
#

API

#

always API if you can

obsidian drift
#
import com.palmergames.multiversion.utils.NMSUtils;

What does this import come from?

eternal oxide
#

sec, thats my util method to avoid Bukkit version specific imports.

obsidian drift
#

Thanks

quaint mantle
echo basalt
#

Β―_(ツ)_/Β―

#

you gotta use the BlockState and BlockData api to do what you want

onyx fjord
chrome beacon
#

There can only be one scoreboard at a time

boreal sparrow
#

If I start a bukkit runnable, with a value being true, but while the runnable is counting down, the value changes to false, how would I instantly cancel the runnable?

#

because I think cancel(); only checks once or something?

wet breach
shadow zinc
#

Would making my CommandManager a singleton be frowned upon?

#

I'm not going to, I'm just wondering

drowsy helm
#

you say counting down, do you mean a runTaskLater?

boreal sparrow
#

yea

#

when exactly would the runnable cancel if i did

run(){
    if(this){
        cancel();
    }
}//runtasklater
shadow zinc
#

What is the difference between scope compile and provided?

boreal sparrow
#

but the other code only executes when the runnable has counted down?

drowsy helm
drowsy helm
shadow zinc
#

ffs, I said in my documentation you provide the lib and now anyone who tried it probably got an error

boreal sparrow
#

im trying to check if there are enough players in a world

#

what if there is, the runnable counts down, but as the runnable is counting down the player leaves

shadow zinc
#

or does that shade plugin handle the compile scope?

drowsy helm
drowsy helm
#

all shade does it move the dependency into your runtime jar

shadow zinc
#

but the compile scope shades it?

drowsy helm
#

compile scope just means it available throughout the compilation stage

shadow zinc
#

so it shows the shade plugin that it needs to be shaded?

#

maven doesn't shade it automatically?

drowsy helm
#

it does

#

all you need to know for shade is, provided doesnt shade

#

compile is the default scope

shadow zinc
#

one final question for the minute, do I shade lombok?

drowsy helm
#

no

#

it generates the code on runtime

shadow zinc
#

its included in spigot?

drowsy helm
#

lombok is more of an ide hack than anything

#

you dont need it for runtime

shadow zinc
#

right, so provided?

chrome beacon
#

You use the main scoreboard

drowsy helm
#

yeah

shadow zinc
#

thanks

chrome beacon
#

Now use that scoreboard for tablist as well

#

Wdym?

#

You can't do anything about that

shadow zinc
drowsy helm
#

apache?

#

i think spigot has it already

#

i might be wrong

shadow zinc
#

Because when I didn't shade it I got a no class def

drowsy helm
#

yeah probably then

chrome beacon
#

A player can only be in one team at a time. Make sure you don't have two teams

shadow zinc
#

maybe I need the apache dependency tho? are they different?

#
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
            <scope>compile</scope>
        </dependency>```
#

thats what I'm using

drowsy helm
shadow zinc
chrome beacon
#

Again make sure you don't have two teams

#

I see no check for the player team

#

That's not checking if a player is in a team

#

Setting the player team or player scoreboard will override the existing ones

#

A player can only be in one team at a time

#

Use the same team

#

And same scoreboard

coral oyster
#

hi, in my plugin I want it so that players cannot drop items in a specific world so I came up with this:

    @EventHandler
    public void ItemDropEvent (PlayerDropItemEvent event) {
        Player p = event.getPlayer();
        if (p.getWorld().equals("world")) {
            event.setCancelled(true);
        }
    }

but players can still drop items in this world. to confirm that the event is actually getting cancelled, I did this:

    @EventHandler
    public void ItemDropEvent (PlayerDropItemEvent event) {        event.setCancelled(true);
    }

and indeed it does prevent players from dropping items. why can't the first method work though?

tall dragon
#

yea World is not a String

lofty zephyr
#

Hi, looking for help on creating a big shop plugin (Will explain more in DMS, if someone is willing to help out) (Payment is included)

undone axleBOT
coral oyster
#

aha! thank you!

boreal sparrow
#

if I want to clear an array, do I just set it to null?

#

didnt think it mattered, but its a list

#

is there a difference for clearing them?

#

no way

#

bruh

#

XD i am blind thanks so much

#

na, is a runnable fine?

#

ok thanks

tender shard
#

like the IDE would mark this yellow saying "world can never equal a string"

#

no idea why everyone ignores this warning

tall dragon
tender shard
#

i want my baby back baby back baby back

#

chiliiii's baby back riiiibs

tardy delta
#

Mye daddy

grim ice
#

im dead bored

quiet ice
#

Does anyone know any half-decent XML parsers that are kinda like the org.json:json artifact but for XML? Java's built-in one sucks ass

solid cargo
#

is SpawnReason.NATURAL in CreatureSpawnEvent triggered whenever the "world" spawns an entity when it likes to?

chrome beacon
quiet ice
# chrome beacon What's wrong with the builtin one?

Basically I am forced to do things such as

        Element versioning = (Element) metadata.getElementsByTagName("versioning").item(0);
        Element versions = null;
        for (Node node : new IterableNodeList(versioning.getChildNodes())) {
            if (node instanceof Element element) {
                if (element.getTagName().toLowerCase(Locale.ROOT).equals("versions")) {
                    versions = element;

Which uhm could be semantically be improved by a bit

#

It's especially stupid that .getElementsByTagName walks the entire tree - so it will even return elements that have the given tag name that are children of children of the element

quiet ice
lofty zephyr
#

Hi, where can you create a post on spigotmc?

shadow zinc
#

forums

quiet ice
#

?howtocreateathread

#

damn it

shadow zinc
#

?domagicyouwizard

shadow zinc
#

Assuming its development related

dusk flicker
#

?howtomakeathread

quiet ice
#

?howtopostathread

undone axleBOT
dusk flicker
#

ofc it's post

lofty zephyr
chrome beacon
#

It's to prevent bots

lofty zephyr
#

Am I allowed to create spam ports to get access?

lofty zephyr
sturdy frigate
#

To shade or not to shade. How do I figure that out when building plugins?

tardy delta
#

When it's a library you probably have to shade it

#

When you're depending on a plugin not

#

Atleast when that plugin is on the server

eternal oxide
#

If its included with Spigot = no shade

sturdy frigate
#

Oo, what if the dependency has spigot api as a dependency?

tardy delta
#

βœ“

young knoll
#

Or if it’s another plugin who’s api you are using

sturdy frigate
#

Does it count as a library or a plugin?

#

(assuming the library is only using spigot api for implementing things, without plugin.yml and whatnot)

tardy delta
#

Uhh spigot API is provided as the server

sturdy frigate
#

Mhm okay, that means I wouldn't need to shade it right

#

What if the dependency has other* dependent libraries apart from the spigot-api and it needs them to function?

eternal oxide
#

You don;t worry about other plugins/libs dependencies

#

thats for them to take care of

#

or the server owner

sturdy frigate
#

Yeah, well, I'm trying to make a utility/commons package to use across my plugins, and I suppose that part is what I'm trying to figure out

eternal oxide
#

You only worry about what you specifically rely on

sturdy frigate
# eternal oxide You only worry about what you specifically rely on

So this is my situation:

Some Plugin - spigot 1.19_R1
            - utilityPkg 1.0_SNAPSHOT

utilityPkg - spigot-api 1.19_R1
           - collection_commons
           - lombok
           - reflections

I reckon I don't need to shade in spigot 1.19_R1 because its provided as the server, but I'll have to shade in utilityPkg right? It's not a maven dependency, it's just a jar I made.

But do i need to rely on an urber jar of utilityPkg or the normal jar will be fine?

quiet ice
#

You can always exclude dependencies from maven artifacts

#
        <dependency>
            <groupId>com.palmergames.bukkit.towny</groupId>
            <artifactId>towny</artifactId>
            <version>0.98.1.0</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <!-- We don't want to harm our dependency tree with transitive dependencies-->
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Would be an example for that

sturdy frigate
tender shard
#

how to get banned from spigot within a day