#help-development

1 messages · Page 1578 of 1

minor garnet
#

Offline

#

Itd because u dont specift the set

granite stirrup
#

public static Set<Entity> projectiles = new HashSet<Entity>(); or something idk

minor garnet
#

set = new ArrayList<>

#

Wait

eternal night
#

its a Set tho xD

#

idk was right

granite beacon
#

I'm so dumb

minor garnet
#

Ah right

ivory sleet
#

HashSet<Entity> 😬

minor garnet
#

Why you are returning a boleen when u set or remove ?

granite stirrup
granite beacon
granite beacon
minor garnet
#

No

#

Its becauee in jsvs 5

eternal night
#

I mean just has the weird chance of actually just being a memory leak

minor garnet
#

Iavs 5 do u need specify in the hashset the type of value

granite beacon
#

eyy it works, thanks guys :)

#

small mistake on my end 😅

eternal night
#

if you are just trying to check if your snowball is, lets say, a custom snowball or smth

#

use pdc instead

#

these sets are only really useful if you need to iterate over the existing snowballs or have a bunch of data to assign

granite beacon
#

I'm trying to add trails to the snowballs

minor garnet
#

But

eternal night
#

okay yeah, set seems good for that

minor garnet
#

Bad english sorry

granite beacon
#

scheduleSyncRepeatingTask and a loop of the set

eternal night
#

oh, why sync if you are just sending particles

#

they can live fully off the main thread (particles that is)

granite beacon
#

what would it be then?

chilly reef
#

the EntityDamageEvent.DamageCause works but the getEntityType() uses the default message

granite beacon
#

isn't that depreciated?

ivory sleet
#

That one is deprecated for sure

eternal night
#

or well BukkitRunnable alternative

#

which I still don't get why

ivory sleet
#

Because it takes a BukkitRunnable lol

eternal night
#

waut

#

fuck

#

I wanted the one with Consumer<BukkitTask>

ivory sleet
#

I assume you meant the other one lmao

eternal night
#

give me a sec

ivory sleet
#

😌

granite beacon
#

Wait confused

granite beacon
#

so which one should I use?

eternal night
#

perfection

#

last one

minor garnet
#

I never used consumer

granite beacon
#

doesn't that one require a period?

eternal night
#

a period ?

minor garnet
#

Thr fiest long is a delat to ststt

eternal night
#

just plug 0 there

minor garnet
#

Start, the last long is the period

#

1 tick = 50 ms

granite beacon
#

Also for the snowball land I could just use entity damage right? that way it clear them if they land in the void

minor garnet
#

So async can run a custom thread too ?

ivory sleet
#

It will execute the runnable on a cached thread pool

minor garnet
#

Without being in the spigot main thread

#

Ah

ivory sleet
#

Or in one rather

#

I believe it still gets ticked like usual, just the execution is different

dense pulsar
#

is the PlayerQuitEvent going to run before the player quits or after

ivory sleet
#

After

#

How would it know when to run before

#

Cant predict that pretty sure

dense pulsar
#

idk like when they click quit it runs and then they quit fo real

granite stirrup
dense pulsar
#

not client side though

#

so

#

shut up 😦

ivory sleet
#

Not exactly when they click but like as soon as the server gets to know about that

ivory sleet
#

You could randomly dispatch an ALT F4

granite stirrup
#

well yeah but the quit button

ivory sleet
#

Fair

granite stirrup
#

and also what if they override the alt f4 key

ivory sleet
#

Maybe someone decides to kick their pc such that it results in malfunctioning

unreal quartz
ivory sleet
granite stirrup
ivory sleet
#

Hopefully that shouldn’t happen lol

unreal quartz
#

can always hire people and send them out with a button to go and find and stare through your players bedroom windows to see if they are about to quit, then press the button so it transmits that so the server knows

ivory sleet
granite stirrup
#

cuz people are shit at they job

unreal quartz
#

nah

#

create jobs for the economy

#

see

#

solving two problems at once

rapid whale
#

Its been a long time since I've updated my plugins. Which spigot version should I be adding as an external dependency? For the most backward compatibility

granite stirrup
#

yes

#

version-R0.1-SNAPSHOT

#

for maven ```<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>```

rapid whale
#

@granite stirrup so I should be using the latest spigot version from now on? back in 1.15.2 I was using 1.13.2 as an external dependency to maintain backward compatibility

granite stirrup
#

no

#

you use the one for your version

#

but if you want you can use the 1.17 api

#

but make sure you specify api-version

#

and dont use 1.17 specific api things

rapid whale
#

ahhh right in the plugin.yml

granite stirrup
#

ye

#

but api-version doesnt exist in 1.12 btw

#

it came out in 1.13

rapid whale
#

Thanks. Yeah the reason why I asked cus I had bug reports for my plugin but only in 1.17.1, works in 1.16.2. So I thought maybe something in 1.17 api introduced a breaking change

#

haha yeah, I was still around to 1.15.2 so I have been using that

#

thanks again~

granite stirrup
#

if your using nms 1.17 changed it a bit

#

maybe that could be why its broken

rapid whale
#

No nms, only pure API. All about having 1 version that a last foreverrrrr haha

granite stirrup
#

hmm weird

#

not much of the api changed tho

#

but there was new additions

rapid whale
#

I'm going to investigate now, but had something to do with plugin making creative flying an issue. (Of the of spells in the plugin toggles flight mode, so will have to see if anything changed there)

dense pulsar
#

Does anyone have an example of using the worldedit API

#

I just want to do //replace lmao

granite stirrup
dense pulsar
#

I've skimmed through that before, it seems like I just need to loop over every block in a WE selection and replace them

#

Why even use the API if thats how you do it

granite stirrup
#

¯_(ツ)_/¯

#

theres other useful things

reef wind
#

yeah WE has a lot more than just blocks in an area

dense pulsar
#

lame

prisma needle
#

what do you mean by "complete it every time"? :)

normal coral
#

How would I start out learning how to create plugins?

sage swift
#

?learnjava

undone axleBOT
normal coral
#

Thx

sage swift
reef wind
#

He needs to know Java first tho if he doesn’t

normal coral
#

He sent some Java things

reef wind
#

Yeah, go for that first.

normal coral
#

Ok

granite beacon
#

how can I fix this error that occurs when I itirate thru this hashset?

[20:06:50 WARN]: [LearningSpigot] Task #29487 for LearningSpigot v1.0-SNAPSHOT generated an exception
java.util.ConcurrentModificationException: null``

This the where the error throws

public class snowBallEffect implements Runnable {

    public static Set<Entity> projectiles = new HashSet<Entity>();

    public void run() {
        if (projectiles != null){
            projectiles.removeIf(Objects::isNull);
            for (Entity projectile : (projectiles)) {
                if (projectile != null){
                    if (projectile.getLocation().getY() > 0) projectile.getWorld().spawnParticle(Particle.HEART, projectile.getLocation(), 5, 0,0,0);
                    else {
                        projectiles.remove(projectile);
                        projectile.remove();
                    }
                }
            }
        }
    }

    public static boolean addProjectile(Entity e){
        projectiles.add(e);
        return true;
    }

    public static boolean removeProjectile(Entity p){
        projectiles.remove(p);
        return true;
    }
}
regal lake
#

@granite beacon
Don't remove stuff from the Set (projectiles) while looping through the set...

granite beacon
regal lake
#

Yes

granite beacon
# regal lake Yes

Gotcha, wouldn't that come at performance issues since it's on a 2 tick timer?

#

Or nothing important enough care about

regal lake
#

If you remove it within the for loop or after the for loop should not matter, but it always depends on the size of the set i guess 😄

granite beacon
regal lake
#

ConcurrentModificationException just means you try to modify the Set/List/what ever while your looping through it, so you HAVE to remove it after 😄

exotic scroll
#

how to delay a method?

young knoll
#

Use an iterator rather than a second set

dense pulsar
#
for (int x = edgeMin.getBlockX(); x <= edgeMax.getBlockX(); x++) {
            for (int y = edgeMin.getBlockX(); y <= edgeMax.getBlockX(); y++) {
                for (int z = edgeMin.getBlockX(); z <= edgeMax.getBlockX(); z++) {
                    Block block = new Location(world, x, y, z).getBlock();
                    if (block.getType() == Material.AIR
                            || block.getType() == Material.FIRE
                            || block.getType() == Material.TNT) {

                        int rand = new Random().nextInt(100);

                        if (rand == 1) {
                            block.setType(Material.DIAMOND_BLOCK);
                        } else if (rand == 2) {
                            block.setType(Material.EMERALD_BLOCK);
                        } else if (rand == 3) {
                            block.setType(Material.IRON_BLOCK);
                        } else if (rand < 14) {
                            block.setType(Material.COBBLESTONE);
                        } else if (rand < 35) {
                            block.setType(Material.NETHERRACK);
                        } else {
                            block.setType(Material.STONE);
                        }
                    }
                }
            }
        }
#

LOL

#

no world edit api needed

#

the equivalent of //replace fire,0,tnt 60%stone,27%netherrack,10%cobblestone,1%diamond_block,1%emerald_block,1%iron_block

torn oyster
#

i think

#

someone is bypassing my proxy

#

but idk how

#

i have bungeeguard

#

the ip is 127.0.0.1

#

people i know

#

are joining then immediately every 10s

#

on the dot

#

10s

#

like

#

my friends account

#

is being used for this

#

bungeecord: true

#

offline mode is true

#

3 people at the same time

sage swift
#

why are you sending this in the wrong channel and in 10 messages

torn oyster
#

oh

#

wait

quaint mantle
#

thats a localhost ip lol

torn oyster
#

yes

quaint mantle
#

bruh

torn oyster
#

but then nobody can join without bungeecord

quaint mantle
#

what does that even mean

quaint mantle
#

bungeecord's not a client

#

idk what you mean

torn oyster
#

yes

quaint mantle
#

i cant help im sorry

onyx cradle
#

i think he means that bungeecord is supposed to act as a proxy to his other servers, but they are joining without going through bungeecord

quaint mantle
#

LUL

torn oyster
#

i made it pretty clear

quaint mantle
#

misconfigured configurations i see

torn oyster
#

nope

quaint mantle
onyx cradle
#

make sure all your servers are in offline mode

torn oyster
#

they are

onyx cradle
#

idk then thats as far as my bungeecord knowledge goes lol

quaint mantle
#

is bungeecord: true in all of them?

torn oyster
#

yes

quaint mantle
#

they shouldnt be able to bypass this at all

#

unless you have misconfigured something

torn oyster
#

i have not

quaint mantle
#

triple-check your configurations

#

all of them

torn oyster
#

i have

quaint mantle
#

ok

#

triple-check again

torn oyster
#

i have like

quaint mantle
#

did you check your config.yml in your Bungeecord proxy

torn oyster
#

yes

quaint mantle
#

ok ok so let me get this right

#

someone with the IP 120.0.0.1, is bypassing your Bungeecord proxy?

#

or did i get that wrong

torn oyster
#

no

onyx cradle
#

he is saying that the ip is set to 127.0.0.1 in the config

torn oyster
#

yes

quaint mantle
#

why

#

set it to your server's IP

torn oyster
#

no

quaint mantle
#

the actual IP

torn oyster
#

people can bypass the proxy then

#

so easy

quaint mantle
#

what

#

bro

onyx cradle
#

is bungeecord: true set in your spigot.yml

quaint mantle
#

127.0.0.1 is your localhost IP

torn oyster
#

yes

torn oyster
wraith lichen
quaint mantle
torn oyster
#

dude without 127.0.0.1 people can join without joining through bungeecord

quaint mantle
torn oyster
#

i learned that the hard way

wraith lichen
torn oyster
#

i havem't

#

i literally checked

quaint mantle
wraith lichen
#

Cause I have it where no one can bypass my hub except for staff

quaint mantle
#

i dont even run Bungeecord

onyx cradle
#

ok so i just put bungeecord: true in spigot.yml and i cant even join my own server (thats all i changed)

onyx cradle
#

so you either dont have that set to true, or you might have ip forwarding set to true in your bungeecord config (Although IP forwarding might be unrelated)

quaint mantle
#

are you running Bungeecord???

#

oh

#

oh

#

nvm

wraith lichen
#

Bungee cord you have a proxy for it to work

quaint mantle
#

@torn oyster

torn oyster
#

what

torn oyster
#

otherwise nobody can join

quaint mantle
#

wtffffff

torn oyster
#

bro

quaint mantle
#

thats not how that works

torn oyster
#

do you even know what it does

onyx cradle
#

no hes right

quaint mantle
#

is he?

onyx cradle
#

yes

quaint mantle
#

did Bungeecord change

torn oyster
#

ip foward

quaint mantle
#

odd i thought IP forwarding didn't allow users to join

torn oyster
#

it is another security measure

quaint mantle
sage swift
#

you used getBlockX for x y and z @dense pulsar

#

lol

onyx cradle
torn oyster
#

i already have that

#

lol

#

fully set up

quaint mantle
#

then you misconfigured something

#

i've said this once, and i'll continue saying it

torn oyster
#

i haven't

quaint mantle
#

check EVERY configuration

torn oyster
#

i literally checked

#

all configs

quaint mantle
#

again

torn oyster
#

that relate to bungee

quaint mantle
dense pulsar
#

LOL

torn oyster
#

i've done it 3 times

quaint mantle
#

then you misconfigured something.

sage swift
#

what a surprise

quaint mantle
dense pulsar
quaint mantle
#

gg

dense pulsar
#

I'm going to make this work

sage swift
#

Hi going to make this work, I'm gecko

dense pulsar
#

My hatred of the WE api overpowers the bad code

onyx cradle
exotic scroll
#

How do you delay a task being run?

#

Any help would be appreciated

hasty prawn
#

?scheduling

undone axleBOT
sharp bough
#

is it possible to use a dependency is a local way between the plugins in the plugin folder?

#

im trying to recreate vault with a few other details i want, but this will only be used in a local way

#

i have no idea how to face this problem

onyx cradle
#

Do you mean use a plugin as a dependency without shading?

sharp bough
# onyx cradle Do you mean use a plugin as a dependency without shading?

yea idk tbh, i want to have 1 plugin (take vault as an example) that we are gonna call secondVault, i want to do the things vault allows like, vault.getBalance, vault.getBank, etc, but i want to do it with my own plugin, do i have to shade it and make it a dependency even tho its a local plugin?

#

or a sql database

#

that other plugins can acces

quaint mantle
#

Sick! I finally got it working @chrome beacon

onyx cradle
#

no, if you just put the plugin jar in your plugins folder, it will be accessible from any other plugin

#

the only thing to be aware of is that if you try to access the "secondVault" api and it isnt actually in the plugins folder a class not found error will be thrown

#

also you have to make sure that you have it as a dependency in maven/gradle but you dont shade it. In gradle you do that by just using compileOnly, im not sure about maven

sharp bough
#

yea lets assume both plugins are in the same plugin folder , both working properly

#

what should i use to acces it?

sharp bough
#

when i run package it doesnt shade it right?

onyx cradle
#

You can access it directly from java code. It's exactly the same as how you access Bukkit code. You (usually) dont shade bukkit directly into your plugin, but you can still access all Bukkit classes because the server already has it

#

If you are using Maven then I can't really help you much with shading, since I pretty much just use gradle. I believe that maven requires a plugin to shade and it wont do it by default though

unreal quartz
#

why are you shading it

sharp bough
#

like an import or smth?

unreal quartz
#

just install it locally

sharp bough
#

how is this called so i can google it?

onyx cradle
#

You still have to import everything, just like you would with bukkit code

unreal quartz
#

and you can add it as a dependency

onyx cradle
#

Sadly I cant really help you set up the dependency since it sounds like you are using maven and i havent used maven since in years, you might have to turn to google for that unless someone else here can help you

sharp bough
#

k thx

short shale
#

someone knows how i can do that in java?:
reveal player from all players

sage swift
#

lol what

short shale
#

I took an example of how I would do this in skript

#

but i have to do this in java

spring river
#

What's reveal in skript ?

short shale
#

reveal player from all players

sage swift
#

skript

spring river
#

What do reveal operator do ?

unreal quartz
#

reveals them

#

silly

sage swift
#

what

spring river
#

Ok for me reveal is an uhc scénario x)

onyx cradle
#

probably just sets them to be visible/invisible. You can do that with LivingEntity.setInvisible()

short shale
#

oh, thx 🙂

#

i just got an idea of ​​how to do

spring river
#

Or you can try something like that

for(Player player: Bukkit.getOnlinePlayers()) { 			player.hidePlayer(plugin.getInstance(), p); 			player.showPlayer(plugin.getInstance(), p); 		}```
winged token
#

hey so how do i get protected land on my mc 1.17 server w/ my friends

unreal quartz
#

u ask them really nicely to not touch anything

sage swift
#

wrong channel

winged token
#

mbmb

winged token
quaint mantle
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.block.Block.getLocation()" because the return value of "org.bukkit.event.player.PlayerInteractEvent.getClickedBlock()" is null
        at com.ankledev.nectar.serverevent.Server.onInteract(Server.java:188) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor5.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.jar:git-Paper-79]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:538) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:501) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:496) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:492) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleAnimate(ServerGamePacketListenerImpl.java:2223) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundSwingPacket.handle(ServerboundSwingPacket.java:25) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundSwingPacket.handle(ServerboundSwingPacket.java:7) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:36) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1340) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.MinecraftServer.shouldRun(MinecraftServer.java:193) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1319) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1312) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1273) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1184) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[patched_1.17.jar:git-Paper-79]        at java.lang.Thread.run(Thread.java:831) [?:?]
#

any idea why thats happening

sage swift
#

player clicked air

#

there is no clicked block

#

check the event is a click block event

quaint mantle
#

yeah, i have an if statement to see if the block is null

#

should i rather check if its Material.AIR?

onyx cradle
#

if you checked if getClickedBlock() is null then you cant get a null pointer exception (unless you checked it but just ignored it)

quaint mantle
#

im 99% sure im doing the booleans right

#

like, every other boolean runs

sage swift
#
Action action = event.getAction();
if (action != Action.RIGHT_CLICK_BLOCK && action != Action.LEFT_CLICK_BLOCK) return;```
onyx cradle
#

show your code

quaint mantle
#
    @EventHandler
    public void onInteract(PlayerInteractEvent e){
        if(e.getClickedBlock() != null || Main.getInstance().isVanished(e.getPlayer()) || Main.getInstance().isInSpawn(e.getClickedBlock().getLocation())){
            e.setCancelled(true);
        }
    }
#

OH

#

that's || or

#

🤦‍♂️

#

i configured something wrongly.

sage swift
#

isInSpawn lol

quaint mantle
#

should be (check if null) && or || or

quaint mantle
#

what else should i do for isInSpawn

#

its just checking coordinates lol

maiden thicket
#

check if they're in between 2 points

#

if x is <= # and y <= # and z <= # and x >= and y >= # and z >= #

#

then in spawn

quaint mantle
#

yeah thats what isInSpawn does

#

theres multiple events that has isInSpawn, its supposed to be so i can just change it easily

bright jasper
#

Hey i just wanna know

#

Has colors for spigot always supported hex codes?

hexed hatch
#

Nope, it was added 1.16

proud basin
#

no

bright jasper
#

support for § has always existed before spigot right?

hexed hatch
#

Hex color functionality didn't exist since 1.16

#

Yes that has always existed

bright jasper
#

alright by 1.16 you mean 1.16 spigot or 1.16 minecraft

#

since i know §x is the prefix for hex

hexed hatch
#

Both

bright jasper
#

but it works in vanilla MC too ?

proud basin
#

Yeah the §

hexed hatch
#

No that's new, since 1.16 Minecraft

#

It won't work in anything before 1.16

bright jasper
#

Thanks, thats all i wanted to know. Im trying to make my plugin support spigot, fabric, all the things by making it agnostic so as of right now i have things like PlatformPlayer and PlatformPlugin and PluginContext and such but I was just making sure i wouldnt need to do some bullshit like ColorProcessor implementations

#

i was under the impression § was a spigot/bukkit thing and not a MC thing

hexed hatch
#

I'm pretty sure it's a Minecraft thing

bright jasper
#

Yep, just wanted to confirm. Thanks

rapid whale
#

Quick confirmation, trying to run BuildTools to make 1.17.1 with Java 17. Is it correct that there is a hard limitation that 1.17 version can only be created with Java 16?

dense geyser
#

How would I go about stopping entities from despawning?

winged anvil
#

?pate

#

?paste

undone axleBOT
winged anvil
#

Im getting a "Could not initialize class a" error inside of this class. Specifically the updateSign(); method or these variables. String world = Bukkit.getWorld("manhunt").toString(); Block b = Objects.requireNonNull(Bukkit.getServer().getWorld(world)).getBlockAt(0,66,2); Sign sign = (Sign)b.getState(); https://paste.md-5.net/akudoqawan.java

#

I feel like its something to do with my World and my block

hasty prawn
winged anvil
#

I tried deleting the updateSign() method along with the variables and it ran properly.

hasty prawn
#

What is a?

winged anvil
#

i just needed it that way i can access that instance across my whole project

#

not sure if theres a better way to do that

hasty prawn
#

Are you sure the a class is included in your JAR?

winged anvil
#

yeah

#

i fixed it

#

not sure how

hasty prawn
winged anvil
#

but i removed the 3 variables i had and did something different and it worked ??

#

i used World world = Bukkit.getWorld("manhunt"); Block b = world.getBlockAt(0, 66, 2); Sign sign = (Sign) b.getState(); instead

hearty mulch
#

how do i run command like a datapack i want to run this stuff on startup

scoreboard objectives add Level dummy {"text":"Level","bold": true, "color": "#ff5e5e"} scoreboard objectives add XP dummy {"text":"XP","bold": true, "color": "#5edaff"} scoreboard objectives setdisplay sidebar Level scoreboard players add @a Level 0 scoreboard players add @a XP 0 scoreboard objectives add Speed dummy scoreboard objectives add Health dummy scoreboard objectives add Damage dummy scoreboard objectives add Atkspeed dummy scoreboard objectives add Armor dummy scoreboard players add @a Armor 0 scoreboard players add @a Atkspeed 0 scoreboard players add @a Damage 0 scoreboard players add @a Health 0 scoreboard players add @a Speed 0

quaint mantle
#

ok

#

im still having issues

#
[13:02:56 ERROR]: Could not pass event PlayerInteractEvent to Nectar v1.0
java.lang.NullPointerException: Cannot invoke "org.bukkit.block.Block.getType()" because the return value of "org.bukkit.event.player.PlayerInteractEvent.getClickedBlock()" is null
        at com.ankledev.nectar.serverevent.Server.onInteract(Server.java:196) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor7.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.jar:git-Paper-79]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:538) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:501) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:496) ~[patched_1.17.jar:git-Paper-79]
        at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:492) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleAnimate(ServerGamePacketListenerImpl.java:2223) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundSwingPacket.handle(ServerboundSwingPacket.java:25) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundSwingPacket.handle(ServerboundSwingPacket.java:7) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:36) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1340) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.MinecraftServer.shouldRun(MinecraftServer.java:193) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1319) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1312) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1273) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1184) ~[patched_1.17.jar:git-Paper-79]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[patched_1.17.jar:git-Paper-79]
        at java.lang.Thread.run(Thread.java:831) [?:?]
undone axleBOT
quaint mantle
sharp bough
#

try to not send massive texts please

sharp bough
#

thank you

#

its also easier for us to read

#

clicked block is null

quaint mantle
#

yeah......

#

i check if its null

sharp bough
#

send code

quaint mantle
#

even before i added to check if its Material.AIR, which i just removed

#

it'd send rthe error

quaint mantle
#

wait

#

thats outdated

#
    @EventHandler
    public void onInteract(PlayerInteractEvent e){
        if(e.getClickedBlock() != null && Main.getInstance().isVanished(e.getPlayer()) || Main.getInstance().isInSpawn(e.getClickedBlock().getLocation())){
            e.setCancelled(true);
        }
    }
    
#

and then before the && i had another || e.getClickedBlock().getType()

#

although with that code it'll still send the rror

#

if im reading this right

limber dust
#

do a return if it is null

quaint mantle
#

im checking if the block is null, and IF the player's vanished, OR the block is in spawn

limber dust
#

if(object is null) return

quaint mantle
limber dust
#

since you have it check a && then if the player isn't in vanish it will still run the or

#

which getlocation can't do if its null to begin with

quaint mantle
#

yeah

limber dust
#

2, the error says getType

#

not getLocation

#

so is it the same code or different?

sharp bough
quaint mantle
sharp bough
#

cuz what you send gets an error in the getType

#

but theres no getType in this one

limber dust
#

^

hearty mulch
#

how do i run command like a datapack

sharp bough
limber dust
sharp bough
#

this way you know whats returning true

#

and whats not

quaint mantle
#
    @EventHandler
    public void onInteract(PlayerInteractEvent e){
        if(e.getClickedBlock() != null || e.getClickedBlock().getType() != Material.AIR && Main.getInstance().isVanished(e.getPlayer()) || Main.getInstance().isInSpawn(e.getClickedBlock().getLocation())){
            e.setCancelled(true);
        }
    }
sharp bough
limber dust
#

either one works

sharp bough
#

yup

hearty mulch
#

i want to run this stuff on startup

scoreboard objectives add Level dummy {"text":"Level","bold": true, "color": "#ff5e5e"}
scoreboard objectives add XP dummy {"text":"XP","bold": true, "color": "#5edaff"}
scoreboard objectives setdisplay sidebar Level
scoreboard players add @a Level 0
scoreboard players add @a XP 0
scoreboard objectives add Speed dummy
scoreboard objectives add Health dummy
scoreboard objectives add Damage dummy
scoreboard objectives add Atkspeed dummy
scoreboard objectives add Armor dummy
scoreboard players add @a Armor 0
scoreboard players add @a Atkspeed 0
scoreboard players add @a Damage 0
scoreboard players add @a Health 0
scoreboard players add @a Speed 0

sharp bough
#

and add the ( )

#

for the conditoin

#

s

quaint mantle
#

its just easier

undone axleBOT
sharp bough
quaint mantle
#

it works

robust crypt
#

?snipe

limber dust
#

no offence but that if statement is awful

quaint mantle
robust crypt
#

ur sentence is awful

hearty mulch
winged anvil
#

Sentence.

limber dust
#

i know

quaint mantle
robust crypt
#

^^^^ my name

quaint mantle
#

idk you sry

robust crypt
#

me neither

hearty mulch
sharp bough
#

thats a bit cleaner

quaint mantle
robust crypt
sharp bough
quaint mantle
#

nah use onLoad

#

ServerLoadEvent

#

thats when i run all of my scoreboard stuff

robust crypt
#

ye can someone tell me how to change the 0 of the the scoreboard (below name) to something like 69

quaint mantle
#

thats an objective below the name, yes?

robust crypt
#

ye

quaint mantle
#

set the value of the objective

#

yeah

hearty mulch
#

so i just can put that in my onEnable or onload and it will work when my plugin starts

robust crypt
#

doesnt work

quaint mantle
robust crypt
quaint mantle
hollow bluff
#

can you show some code?

quaint mantle
#

send code

#

yeah

#

oh hey Hinx

robust crypt
# hollow bluff can you show some code?
    private Scoreboard createScoreboard(String Ewen_Is_Fat_XD) {
        final Scoreboard scoreboard = Bukkit.getScoreboardManager()
                .getNewScoreboard();
        final Objective objective = scoreboard.registerNewObjective(
                "test", "dummy",
                ChatColor.RED + "Ewen_Is_Fat_XD" + ChatColor.RESET + " 0");
        objective.setDisplaySlot(DisplaySlot.BELOW_NAME);
        objective.setDisplayName(ChatColor.RED + "Ewen_Is_Fat_XD" + ChatColor.RESET + " 0");
        return scoreboard;
#

so?

hollow bluff
#

First of all, change BELOW_NAME to SIDEBAR

hollow bluff
robust crypt
hollow bluff
#

No? You're making a scoreboard right?

robust crypt
#

ye

sharp bough
#

i want to share methods between plugins

#

wait you cant see shit

sage swift
#

did you compile the library on your device already

#

i believe you might need to for the dependency to work

sharp bough
#

hm no its not that

#

i cant use InfinityChatApi.setPlugin(this) either

#

its missing a link i cant find

maiden thicket
#

if it's your own library

#

make sure you compiled it with maven

#

in the first place

#

and the group, artifact, and version are exactly what you put

sharp bough
sharp bough
maiden thicket
#

u can try that maybe

#

also make sure u reload ur pom.xml

#

on ur other project

maiden thicket
sharp bough
#

with that?

#

it looks ugly

#

lol

maiden thicket
#

oh

#

i build w mvn clean install

#

🤷🏾‍♂️

onyx cradle
#

@sharp bough Thats not going to work unless you have your api in a repository

#

Although if you're making an API for everyone to use, you probably want to publish it to a remote repository. jitpack.io makes this pretty simple.

sharp bough
#

nono

#

its just for me

onyx cradle
#

Then just using the local jar is fine, although a bit harder

quaint mantle
sharp bough
#

im downloading mvn

#

see if that works

#

and then install it

#

in my local repostory

hollow bluff
onyx cradle
#

anyone know what event is called when a hopper picks up an item

quaint mantle
onyx cradle
#

ty

quaint mantle
sage swift
#

are you retarded

quaint mantle
#

but like

#

dont be rude??

sage swift
#

I answered his question right above

#

And he said thanks

quaint mantle
#

i didnt see that

#

im sorry

sage swift
#

and then you replied to it

quaint mantle
#

human error exists, we aren't perfect robots

onyx cradle
#

damn gecko chill dude

quaint mantle
#

yeah

#

i didnt understand BanePig's question 1000%, and didnt see that you had answered it

sharp bough
onyx cradle
#

actually i needed InventoryMoveItemEvent too

sharp bough
#

im getting this error

quaint mantle
sharp bough
#

and i dont fully understand what it is or how to know what it is

#

lol

quaint mantle
onyx cradle
#

is infinity chat api your api

sage swift
#

that's not even java

onyx cradle
#

its maven, which is used in java development

sage swift
#

but don't respond to a question if you have nothing to contribute and just want to say "idk"

quaint mantle
#

dude

#

you need to chill

sage swift
#

?paste your pom, lucas

undone axleBOT
sharp bough
#

its in the plugins folder

onyx cradle
sharp bough
#

error line 88+

onyx cradle
#

oh i just noticed you included to cli args

#

well for installing the plugin you got an access denied error

#

just make sure you're not running the server while using that

#

and then mvn -e just does nothing

rapid whale
#

Hmm did World.generateTree break? Work in 1.16.5 but cant get it working in 1.17.1

sharp bough
# onyx cradle well for installing the plugin you got an access denied error

and the goal is correct,

No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install,

analog inlet
#

Do anybody knows what packets should send when player join the world

sage swift
analog inlet
#

thx

onyx cradle
# sharp bough im not

well its hard to say why you're getting an access denied error then, maybe try running as admin

sharp bough
#

i have no idea whats wrong

onyx cradle
#

wdym this one is an admin?

sharp bough
#

maybe theinstall:install-file is wrong?

sharp bough
onyx cradle
#

if you run as admin you should start in C:\Windows\system32

sharp bough
#

cuz it says <plugin-prefix>:<goal>

onyx cradle
#

did you change dir?

sharp bough
#

no i runed it as admin and im in sys32

#

everything should be fine

onyx cradle
#

did you still get an access denied error

sharp bough
#

yea

onyx cradle
#

then there must be some program already using the jar file

sharp bough
onyx cradle
#

Are you able to delete the jar file? (You can just restore it Ctrl+Z after)

sharp bough
#

the intellij maybe?

#

yea

#

just fine

#

at the same dir as the one in the cmd

onyx cradle
#

hm

sharp bough
#

wait let me change the dir

onyx cradle
#

try including the full file path

#

with the .jar at the end of -Dfile

sharp bough
#

C:\Windows\System32>mvn install:install-file -Dfile=C:\Users\LucasUser\Desktop\Server\plugins -DgroupId=me.paradis -DartifactId=InfinityChatApi -Dversion=1.0-SNAPSHOT -Dpackaging=jar

rapid whale
sharp bough
onyx cradle
#

i think you forgot the version after

#

like InfinityChatApi-1.0-SNAPSHOT.jar

#

i think it was

sharp bough
#

OGM

#

lov u pig

#

let me test it

onyx cradle
#

👍

sharp bough
#

😩 😩 😩

#

so nice

onyx cradle
#

does that mean it works

sharp bough
#

idk xd

#

im gonna test it now

#

but at least it can find it

onyx cradle
#

will probably work then

sharp bough
#

it does

#

thats such a nice way of going to bed

#

i should of have gone to bed like 5 hours ago

#

lmao

#

aight gn

#

and thx

onyx cradle
#

gn and np

analog inlet
#

Why there is only one packet was sent

analog inlet
granite stirrup
analog inlet
granite stirrup
#

You might need to add a little delay

analog inlet
#

this code works in 1.16.5

#

when i upgrade to 1.17 it can't works

granite stirrup
#

¯\_(ツ)_/¯

analog inlet
#

and also the removeLimit didn't execute

granite stirrup
#

I mean in 1.17 they made all the fields in nms packets final

#

Pretty sure

analog inlet
#

i didn't modify anything

#

i just catch the packets and send them after player login

granite stirrup
#

What's packets =

analog inlet
granite stirrup
#

Check?

analog inlet
granite stirrup
#

Idk

#

What do you think this is

sour loom
#

i created a function to add scoreboard to players, but it doesn't work and i saw no errors in the sv console. is it changed? cause IDE says manager.getNewScoreboard(); MayProduceNullException

private static void ScoreHandler(Player player){
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        Scoreboard board = manager.getNewScoreboard();
        Objective objective = board.registerNewObjective("Main","",ChatColor.GOLD+"/-"+ChatColor.GREEN+"ATMOS"+ChatColor.GOLD+"-/");
        Score spacer1 = objective.getScore(" ");
        Score onlineCount = objective.getScore(ChatColor.GREEN+"-Online :"+ChatColor.RED+String.format(" %d", player.getServer().getOnlinePlayers().toArray().length));
        Score spacer2 = objective.getScore(" ");
        Score icName = objective.getScore(ChatColor.GREEN+"-Your IC Name :"+ChatColor.RED+String.format("%s",player.getDisplayName()));
        spacer1.setScore(1);
        onlineCount.setScore(2);
        spacer2.setScore(3);
        icName.setScore(4);
        player.setScoreboard(board);
    }
#
@EventHandler
private static void onPlayerJoin(PlayerJoinEvent e){
        Player p = e.getPlayer();
        ScoreHandler(p);
}```
mystic sky
#

^^

    @EventHandler
    public void Join(AsyncPlayerPreLoginEvent event) {
        new BukkitRunnable() {
            @Override
            public void run() {

                if (Bukkit.getPlayer(event.getUniqueId()) ==null ) {
                    return;
                }
                Player player = Bukkit.getPlayer(event.getUniqueId());
                scoreboard scoreboard = new scoreboard(player);
                scoreboard.setLobbyBoard();

            }
        }.runTaskLater(Main.getInstance(),20);
    }
}
outer sorrel
#

what would Path.of be for 1.8?

ivory sleet
#

Paths.get exist I believe

timid kraken
#

Is it possible to show the server resource pack agreement screen even after the user has declined it once?

outer sorrel
#

thanks

timid kraken
#

But the problem with this is

#

After the player declines once they dint get the option to agree again

eternal oxide
#

Correct. You can't override the client setting

timid kraken
#

So basically if they decline once then nothing can be done about it?

#

Not even giving them the option again?

eternal oxide
#

They have to change the setting their end

timid kraken
#

And where would they do that?

eternal oxide
#

No clue, its in the settings/options on the client somewhere

timid kraken
#

Hmm ok thanks

eternal oxide
#

You could send them a nag message is all

#

use the setResourcePack method and monitor the PlayerResourcePackStatusEvent

summer scroll
#

Basically click the server on the server list, and click edit.

#

There is Server Resource Pack option, and there is 3 option which is Enabled, Disabled, and Prompt.

sour loom
#

how can i remove < and > in the mc's chat?

granite stirrup
#

Essentials chat

#

Or you could make your own thing

sour loom
#

and i need the essential main thing too right?

#

cause im using vault rn

granite stirrup
#

Ye

torn shuttle
#

how can I view the javadocs of previous spigot versions?

granite stirrup
#

You cant

ivory sleet
#

You can

granite stirrup
ivory sleet
#

Yeah not officially

torn shuttle
#

god damn it

#

I knew something changed

#

the world types changed with 1.17

#

thanks

granite stirrup
#

Lol

sullen marlin
#

no they didnt

granite stirrup
#

😂

torn shuttle
#

wait no

#

damn it

#

I was looking at a lookalike class from the search

granite stirrup
#

Magmaguy loved your choco song

#

It's epic

quartz plume
#

can someone help me i want to show the guild name in chat i used this format '&b[{guild}&b]&r{DISPLAYNAME}&7:&r {MESSAGE}' but it just says [{guild}] in chat anyone know which format i need to use

quartz plume
#

Essentials chat

granite stirrup
#

Well {guild} isn't a placeholder

#

Do you have placeholderapi?

quartz plume
#

I was looking for a placeholder format in my guild plugin but evrything i copyd dint work or do i need to make a placeholder for that in placeholderapi

granite stirrup
quartz plume
#

Ok thnx

granite stirrup
#

That's the only way I know

#

Since essentials chat doesn't support placeholder plugins and it doesn't have custom placeholders

torn shuttle
drowsy helm
#

thats what it looks like

#

what are you doing on line 15?

torn shuttle
#

this

setValidWorldTypes(new ArrayList<>(Arrays.asList(World.Environment.NORMAL, World.Environment.CUSTOM)));
#

it's only happening for one dude so far and I can't replicate it

drowsy helm
#

Id assume that stack would come up if it was changed to something else

torn shuttle
#

?

drowsy helm
#

2 seconds

#

I want to see something

torn shuttle
#

it's weird because it creates the class just fine and it runs the previous field just fine

#

just seems to hang up here

drowsy helm
#

is this a moving to 1.17 problem

#

or unrelated

torn shuttle
#

probably unrelated, my test environments are on 1.17 right now but were 1.16.5 when I first made this feature, it worked on both just fine

#

never seen it happen before

#

also depending on the order in which reflections are accessing this package it might not even be the first instance of this field getting set with these values

granite stirrup
#

Custom config.java:56?

torn shuttle
#
 /**
     * Initializes all configurations and stores them in a static list for later access
     */
    public CustomConfig(String path, String packageName) {
        this.path = path;

        //Set defaults through reflections by getting everything that extends specific CustomConfigFields within specific package scopes
        Reflections reflections = new Reflections(packageName, new SubTypesScanner(false));

        Set<Class> classSet = new HashSet<>(reflections.getSubTypesOf(CustomSpawnConfigFields.class));
        classSet.forEach(aClass -> {
            try {
                customConfigFieldsArrayList.add((CustomConfigFields) aClass.newInstance());

the cutoff is where it errors

granite stirrup
#

Is the person using your plugin still getting the error

drowsy helm
#

That is really strange

torn shuttle
#

I suspect this might straight up be a corrupted download

granite stirrup
#

Or his config is fucked up

drowsy helm
#

so you cant recreate this bug yourself

granite stirrup
#

Ask him to send his config

drowsy helm
#

as in plugin config?

torn shuttle
#

it's not his config

drowsy helm
#

dont think config would effect it on this level

torn shuttle
#

he just got it to work with me modifying stuff that didn't need to be modified

drowsy helm
#

is he using a modified server jar?

torn shuttle
#

i.e. declaring the environment array separately, filtering custom envs by version and running it

#

looks like it's paper? he is 200 versions behind but the version I just sent seems to work

drowsy helm
#

The only thing that i could think of is its a heavily modified server jar that messes with that enum

torn shuttle
#

yeah I might have to chalk this up either to a bad dl or a bad paper version

drowsy helm
#

i would see no other reason

torn shuttle
#

yeah I thought the code was relatively solid myself

#

and it was seemingly tested by quite a few servers ahead of time, really weird stuff

#

yeah about ~60 servers are reporting in with it working just fine, hrm

tepid monolith
#

Any idea why does this piece of code not work correctly?

#

"/kill" works

drowsy helm
#

are you getting a stack trace

tepid monolith
#

"/kill <sender>" works

#

but "/kill <target>" doesnt work

#

and says internal error

drowsy helm
#

send the error pls

ivory sleet
#

Use getPlayer ftr

#

Probably more suitable for you

drowsy helm
#

i still dont get the diff between getPlayer and getPlayerExact?

tepid monolith
tepid monolith
drowsy helm
#

npe for set health

#

but not send message

#

interesting

#

you can compare player == target. if they are the same it will be the same object

#

instead of comparing names

tepid monolith
#

hm

#

lemme try

tepid monolith
#

but why was it causing the issue for "else if" one

#

sounds weird

granite stirrup
drowsy helm
#

and else if(target instanceof Player) will always be true

#

target is Player in the first place

tepid monolith
drowsy helm
#

yeah ik that, but that way wont work

tepid monolith
drowsy helm
#

.isOnline()

tepid monolith
drowsy helm
#

not sure if the getPlayerExact will return null if they are offline though

tepid monolith
#

true?

drowsy helm
#

yep

tepid monolith
#

but isOnline looks better to me

#

thanks

#

and btw

#

i have another issue

#

im trying to disable the death message

#

whenever they execute that command

drowsy helm
#

just for that event?

tepid monolith
#

do i have to create a playerdeathevent?

drowsy helm
#

or in general

tepid monolith
#

only for that command

#

event should only work once that command is executed

drowsy helm
#

hmm let me think

tepid monolith
#

and value it true once the command is executed

drowsy helm
#

you could add the player to a list when the command is executed, check on the death event if they are in it then stop the message

#

but thats inefficient

torn shuttle
#

guys I solved the murder mystery

drowsy helm
#

ou please tell

torn shuttle
#

the reflections weren't working because of a bugged paper release

drowsy helm
#

yeah knew it had to be the server jar

torn shuttle
#

no one ever suspects the maid huh

drowsy helm
#

was it just the one release or is it a persisting issue

torn shuttle
#

what a fun round of clue we just had

torn shuttle
#

alright same time next hour

tepid monolith
#

this is how i prevented the deathmessage in an example

torn shuttle
#

just one release

#

whichever one is exactly 200 versions ago for 1.16.5

drowsy helm
tepid monolith
#

that looks kind of fair to me

#

what else could help it

drowsy helm
#
private final List<UUID> deathList = new ArrayList<>();
@EventHandler
    public void onDeath(PlayerDeathEvent event){
        UUID uuid = event.getPlayer().getUniqueId();
        if(deathList.contains(uuid){
            event.setDeathMessage("");
            deathList.remove(uuid)
        }
    }
#

would be a bit better

#

then add their uuid in the command

tepid monolith
reef wind
undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

tepid monolith
#

im not a professional at coding and im learning java beside with plugin development

drowsy helm
#

ill give you a hint

#

deathList.add(uuid)

tepid monolith
#

oh

reef wind
tepid monolith
regal lake
#

I currently try to create my first BungeeCord/Waterfall Plugin.
Right now i try to add a command with TabCompletion.
The command itself works fine but the TabCompletion don't work and the method onTabComplete don't even will be called.
I tried to search for that, but all i found is implementing the TabExecutor interface (which i do) and registering the command class (which i also do and which works, because the command itself works propper).

My minimal code: https://paste.md-5.net/lerisayefa.java
Does anybody has a idea ?

drowsy helm
#

you need to setTabCompleter

regal lake
#

How, i also thought that but i don't found it for BungeeCord.

drowsy helm
#

thats for spigot

#

but should be same for bungee

regal lake
#

No its not 😄

drowsy helm
#

damn

#

lemme see

tepid monolith
#

is that how it works?

#

oh i had to get the target's UUID

#

i guess

drowsy helm
#

yep

tepid monolith
drowsy helm
#

get Entity ig

#

cast it to player

tepid monolith
#

im so new to this it would be appreciated if u could help

regal lake
#

Learn the basis, casting stuff is quite easy.
Just search on google how to cast.

#

@drowsy helm do you found anything ?

drowsy helm
gritty urchin
#

How do I get a chunk from x and z position?

drowsy helm
#

Block.getChunk() or Location.getChunk()

gritty urchin
#

Thanks

drowsy helm
#
public void registerCommand(BaseCommand command) {
        command.onRegister(this);
        for (Map.Entry<String, RootCommand> entry : command.registeredCommands.entrySet()) {
            String commandName = entry.getKey().toLowerCase(Locale.ENGLISH);
            BungeeRootCommand bungeeCommand = (BungeeRootCommand) entry.getValue();
            if (!bungeeCommand.isRegistered) {
                this.plugin.getProxy().getPluginManager().registerCommand(this.plugin, bungeeCommand);
            }
            bungeeCommand.isRegistered = true;
            registeredCommands.put(commandName, bungeeCommand);
        }
    }
regal lake
#

They also use the registerCommand method, which i also use.

drowsy helm
#

so the event is not being called at all right

regal lake
#

So they do the same as i do :/

drowsy helm
#

yeah that is strange

#

its not being called right

#

the event

#

or have you not tested it

regal lake
#

The method onTabComplete will not be called.

drowsy helm
#

yeah honestly im puzzled

#

youve test printed something aswell right

regal lake
#

Yes, tested it with System.out.println("onTabComplete");

drowsy helm
#

hmm

#

only other possibility is its not registering at all?

#

have you made sure teh command itself executes

regal lake
#

Yes, i also wrote it in my first message btw 😄

#

The command itself works fine.

quaint mantle
regal lake
#

@drowsy helm found the problem... the command is called /msg.
If i rename it to e.g. /msgTest it works fine, so it seems you can't use /msg as command ?..
Quite strange..

odd falcon
#

Hello, i am currently having issue with something
basicly i am trying send a packet (? extends DefiendPacket) in bungeecord but when i try to send it using proxiedPlayer.unSafe().sendPacket(packed);
it throws error
io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: Cannot get ID for packet class net.glomc.proxy.plugins.proxyplugin.packets.PositionPacket in phase GAME with direction TO_CLIENT
from what i understand it seems class isn't registered in the CODEC so how i can register it? since all classes for protocol in bungee are all private.

drowsy helm
#

ah probably conflicting command

regal lake
#

So BungeeCord already have a /msg command, as this is the only command right now 😄

drowsy helm
quaint mantle
#

ok i will try that

drowsy helm
#

and how are you sure they are not registered?

quaint mantle
#

thx it worked

burnt current
#

Hey, I'm having problems connecting my plugin to a MySQL DataSource and I don't understand all the tutorials because somehow everything is never shown. Can someone help me step by step to connect my project with a MySQL datasource to my MySQL database?

quaint mantle
#

PlayerItemDamageEvent works on armor?

quaint mantle
#

?learnjava

undone axleBOT
quaint mantle
#

that's all for you

#

maybe stackoverflow can help you too.

crude sleet
#

Can i use spigot 1.17.1 plugins on 1.17?

quaint mantle
crude sleet
unreal quartz
quaint mantle
#

it is

tacit drift
#

Can I detect when a plugin sends a message to a player?

opal juniper
#

Why?

tacit drift
#

I want to make a command to mute a plugin's messages

#

factions chat

#

I could modify it but i want to know what my options are :))

opal juniper
#

idk if you can

tepid monolith
#

why does the enchantment not work

#

im using 1.8.8 paper server if makes any sense

#

uhh nvm just had to set the item there below the enchantments line...

vocal mirage
#

Hello !
I'm trying to debug a plugin but i'm blocked.

I try to store data in an arraylist, but i have a java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 error.

Nevertheless, when I try to print the two values stored in the arraylist, i have good values.

Can you help me ?

Thanks

sturdy patrol
#

remove the index

#

you should be able to just write data.add(faction)

gritty urchin
#

Anyone know how to send fake chunk packets to players using ProtocolLib?

vocal mirage
gritty urchin
sturdy patrol
#

lemme check the dock for you...

alpine radish
#

what's difference between BlockCanBuildEvent and BlockPlaceEvent?
I checked javadocs but couldn't found useful thing

sturdy patrol
vocal mirage
smoky oak
#
ItemStack cost = new ItemStack(Material.AMETHYST_SHARD);
cost.setAmount(8);
i.remove(cost);
player.updateInventory();```
This does NOT remove the items from the inventory unless the item stack has the exact right size. How can i remove a number of items from the inventory without knowing the inventory myself?
#

also why the hell does it WORK if i specify a number higher than the item can have?

#

*be stacked to

quaint mantle
#

Wouldn’t it just be easier to modify the itemstack in their inventory and remove 8 from the count?

smoky oak
#

i would prefer not to inflate the code. The documentation makes it look like that would work

#

the thing is

#
i.contains(Material.AMETHYST_SHARD,<number here>)``` works even if the item stack is not the exact size
#

2nd problem is that its likely i need to remove more than one stack at some point

gritty urchin
#

Is there any way to tell when a player loads a specific chunk or can see it?

alpine radish
#

check docs to find what you are looking for

#

probably removeItem will work for you

maiden briar
smoky oak
#

it's probably 1-4 then counting up in your inventory

maiden briar
smoky oak
#

*0-3

maiden briar
#

It is 0 - 4 indeed

alpine radish
#

it will take maximum of 5 minutes

maiden briar
#

I am lazy 😄

alpine radish
#

and will give the best solutions

maiden briar
#

Yes true

alpine radish
#

only few minutes bro

alpine radish
#

and after that you can contribute spigot's wiki

maiden briar
#

Haha yep

#

Btw how to contribute?

jade haven
#

How can I make mobs from spawners appear during the day with plugins?

smoky oak
#

keep track of spawners then tag em with a sceduler that spawns stuff

#

alternatively overwrite the spawning attempt event and make it always spawn, but i dont know if thats a thing

fallow holly
#

Hello. I thought of running a small Discord bot connection inside a plugin to help make some things a lot easier for us.

Is this a good working idea, or could/does that interfere with the server process somehow?

quaint mantle
fallow holly
#

Haha, well. Guess it's okay then. Thanks

quaint mantle
#

Ye, it’s fine

gritty urchin
#

How would I calculate the chunk data byte array for a chunk filled with just air?

twilit vector
#

Hey guys,
I am trying to make a plugin for 'Tag'
Can someone suggest a tutorial which I can watch to become better at making plugins since I am a beginner.
Thank you! 🙂

alpine radish
#

tag?

#

nametag?

twilit vector
#

Maybe some tutorial you watched to become a pro

#

No no

#

the game of tag

#

where you tag other ppl

alpine radish
#

huh?

#

is it a minigame on hypixel etc?

twilit vector
#

i have cracked mc so dunno

quaint mantle
twilit vector
quaint mantle
twilit vector
alpine radish
#

"guides are boring" then sit and take a look with wall

twilit vector
#

😅

quaint mantle
twilit vector
#

I find reading very boring