#help-archived

1 messages · Page 194 of 1

keen compass
#

SQLite doesn't require additional software

#

plugin setups the DB file for SQLite

sage summit
#

whats the best way to do it with yml or json files

keen compass
#

there isn't

#

if you go flat file route it isn't really going to matter which you choose

#

they will all equally perform the worse the same

#

So really it comes down to preference

#

But if you are dealing with large data, should either use SQLite or use a proper db server

#

as I said earlier SQLite doesn't require anything from the end user to setup

#

No different then what yaml requires of the end user. Only difference is SQLite is going to be more optimal then yaml or json

grim halo
sage summit
#

ok

grim halo
#

Is this a spigot thing. Couldnt find the functionality for this on bstats

keen compass
#

you can make custom graphs with bstats

quick arch
#

^

grim halo
#

That i know. But i alread got those statistics. I just want this exact representation of them that everybody on spigot seem to have.,

keen compass
grim halo
#

@keen compass I know how to use bstats and also how to gather custom data... i just wanted this dynamic representation of it.

#

This takes a while...

#

504...

quick turtle
#

How can I make a player invisible, make thei rnametag invisible, and make their armor invisible when they drink an invis pot, then 30 seconds later reset it. Also, if they are hit reset it

#

I know you need packets for all of that, but I don't know how to do them

grim halo
#

Isnt there just a method that hides players by now? If not ill show you an axample on how to do it with packets.

quick turtle
#

omg please do

#

the method that hides players only removes from tab and the player from what I know

#

I want them to stay on tab

#

armor, player, and nametag gone until they get hit or invispot runs out

grim halo
#

Player#hidePlayer(Plugin, Player)
This method just hides a player for another player.

quick turtle
#

Doesnt do what I want

grim halo
#

Oh he has to stay on the scoreboard?

quick turtle
#

Yes

grim halo
#

And and hidePlayer does everything except it also hides him on the scoreboard?

quick turtle
#

One second, i dont know the specifics but I know it hides them from scoreboard

#

Ill put the code in again

wise flame
#

I'm starting to work with NMS and I need a bit of a clarification
how do I replace a method in NMS with my own?

#

Sorry if I shouldn't ask about NMS in here lol

quick turtle
#

My bad it seems to do everything I want except it also removes them from the scoreboard @grim halo

grim halo
#

@wise flame Thats not that easy. You need to fork spigot and apply patches.
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/

#

Why do you want to edit NMS anyways?

wise flame
#

I don't want to edit NMS per se. I was wondering if I could change what a method in NMS returns or if I'd be better off using events.

#

It was mostly curiosity tbh

grim halo
#

If you change what a method in nms returns your server will most certainly break

wise flame
#

let's say NMS had a method that returns the string "hello"
I was basically asking if there's a way to override the method with my own to make it return "world" instead.
using NMS like this would be impractical in most cases, but it can't hurt to ask.

fleet crane
#

basically no, because spigot isn't a modding API

wise flame
#

fair enough

fleet crane
#

otherwise this is ultimately an xyproblem

#

?xy

worldly heathBOT
grim halo
#

Sure its possible. But every method in NMS has aspecific use case. If you change it, it will break.

wise flame
#

I don't actually have an issue kek
I was just wondering what limits there are to what I can do server-side.

quick turtle
#

7smile7 do u have an answer to my problem tho because u seemed like u were about to answer it

grim halo
#

Serverside there is not much of a limit for anything. It only gets hard if the client is involved.

#

@quick turtle Is the hidePlayer method not sufficient enought? It even prevents hacked clients from seeing the player

quick arch
#

Just send in a destroy and spawn player packet

quick turtle
#

No, this isnt for hacked clients or anything, it can not remove the player from the scoreboard

#

King that hides the held item pretty sure

quick arch
#

So you want the item to show?

quick turtle
#

yes

#

hypixel bedwars invis pot

quick arch
#

Then hide everything apart from the item

quick turtle
#

if i knew how i wouldve already ;(

quick arch
#

Requires 4 armor packets for the armor since you have to send them individually

#

I have it somewhere but I'm not on PC

#

😏

grim halo
#

If you want to do it with NMS you can use the PacketPlayOutEntityEquipment

quick arch
#

He's trying to make them be fully invisible apart from their held item

#

Nametag, player, armor invisible but tool is visible

grim halo
#

nametag and player are hidden through the potion effect

frigid ember
#

give them invisibility to hide player and nametag, use packets to remove armor

quick turtle
#

nametag isnt hidden with the potion effect

frigid ember
#

it isnt?

quick turtle
#

no?

quick arch
#

Pretty sure it is

grim halo
#

For sure it is

frigid ember
#

pretty sure it is

quick arch
#

You need to be in spectator to see it I think

grim halo
#

everything else wouldnt make any sense

quick arch
#

he's bad with packets

quick turtle
#

never used them before

#

so of courseim bad with them

frigid ember
#

NMS uh stuff

quick turtle
#

ILikeToCode I'm already using a scoreboard with teams and stuff so that would require adding the player ot another team which is impossible

#

ProtocolLib if possible

quick arch
#

Should've went into ProtocolLib 2 months after starting Spigot development

#

Kek

frigid ember
#

i have no idea how to use protocollib

#

idk if im just stupid

quick arch
#

I do but I'm not on PC

frigid ember
#

but nms makes more sense to me somehow

quick arch
#

That's the opposite for me

frigid ember
#

o

quick turtle
frigid ember
#

plus its one less jar the end user has to install

quick turtle
#

It doesnt hide the nametag

#

the nametag is still there

quick arch
#

I understand ProtocolLib, not nms

frigid ember
#

thats a custom nametag

quick turtle
#

Yeah

#

Im using scoreboards

quick arch
#

^^

quick turtle
quick arch
#

Yup

quick turtle
#

Multiple people can be on the same sb team as well

#

thats the issue lol

quick arch
#

Should've just done ProtocolLib stuff

frigid ember
#

isnt there a scoreboard rule that lets teammates see each others nametags but not ohter ppl?

quick turtle
#

FullPotato that would make both people invisible

#

I dont want to use scoreboard

frigid ember
#

hm

quick turtle
#

I dont want to touch it it was a living nightmare to get it to work

#

so packets is my only option here

quick arch
#

Do you want packet nametags

quick turtle
#

I know theres a way to do it I have code for it but it hides their skin as well when outside of invis

#
        ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(POBedwars.getInstance(), PacketType.Play.Server.PLAYER_INFO) {
            @Override
            public void onPacketSending(PacketEvent event) {
                if (event.getPacket().getPlayerInfoAction().read(0) != EnumWrappers.PlayerInfoAction.ADD_PLAYER) return;
                List<PlayerInfoData> newPlayerInfoDataList = new ArrayList<>();
                List<PlayerInfoData> playerInfoDataList = event.getPacket().getPlayerInfoDataLists().read(0);
                for (PlayerInfoData playerInfoData : playerInfoDataList) {
                    if (playerInfoData == null || playerInfoData.getProfile() == null || Bukkit.getPlayer(playerInfoData.getProfile().getUUID()) == null) { //Unknown Player
                        newPlayerInfoDataList.add(playerInfoData);
                        continue;
                    }
                    WrappedGameProfile profile = playerInfoData.getProfile();
                    profile = profile.withName(getNameToSend(profile.getUUID()));
                    PlayerInfoData newPlayerInfoData = new PlayerInfoData(profile, playerInfoData.getPing(), playerInfoData.getGameMode(), playerInfoData.getDisplayName());
                    newPlayerInfoDataList.add(newPlayerInfoData);
                }
                event.getPacket().getPlayerInfoDataLists().write(0, newPlayerInfoDataList);
            }
        });

someone gave me this

#

They didnt explain it tho so

quick arch
#

That spawns the player back in

quick turtle
#

No its whenever someone tries to get player info I think

quick arch
#

It's suppose to be used when there's a Destroy packet already initiated

quick turtle
#

No thats not a ENTITY SPAWN packet

#

alright

quick arch
#

That's used with the entity spawn packet

quick turtle
#

well idk because it worked

#

and it does work it just removes the skin

quick arch
#

Oh that's for the tablist

#

Adds a player to the tablist

quick turtle
#
    private void fakeRemoveArmor(UUID uuid) //Sends other players empty equipment packets of the specified player
    {
        Player player = Bukkit.getPlayer(uuid);
        if(player == null) return;
        for(EnumWrappers.ItemSlot slot : EnumWrappers.ItemSlot.values())
        {
            if(!hideSlots.contains(slot)) continue;
            PacketContainer packetContainer = new PacketContainer(PacketType.Play.Server.ENTITY_EQUIPMENT);
            packetContainer.getIntegers().write(0, player.getEntityId());
            packetContainer.getItemSlots().write(0, slot);
            for(Player onlinePlayer : player.getWorld().getPlayers())
            {
                if(onlinePlayer.getUniqueId().equals(uuid)) continue;
                try {
                    ProtocolLibrary.getProtocolManager().sendServerPacket(onlinePlayer, packetContainer);
                } catch (InvocationTargetException e) {
                    e.printStackTrace();
                }
            }
        }
    }
#

Now this

#

this doesnt wrk

#

but someone also posted this somewhere on github that got onto spigotmc

quick arch
#

noice

quick turtle
#

no it doesnt work

#

not noice

quick arch
#

This is unreadable on mobile 😉

#

Oh I think I understand why it doesn't work

quick turtle
#

why

quick arch
#

The item isn't set.

quick turtle
#

w

#

what

quick arch
#

Actually looks like it's set 🤔

#

No the item isn't set

#

The slot type and entity are set, not the item

#

Rip mobile

quick turtle
#

Wouldnt it assume nothing tho?

quick arch
#

That's not the wrapper, no

#

The wrapper has default values already iirc

#

This is 1.8.8?

#

I don't know anything about that version

#

ProtocolLib changed stuff after 1.12

#

That's from the 1.15.2 wrapper

#

No idea if it's correct for 1.8.8

fallen field
#

hey guys

#

is it possible to make a {enchants} placeholder so that I can set where the enchants go under the item lore?

#

It kinda looks bad like this

quick turtle
#

You would need to use ItemFlag.HIDE_ENCHANTS

#

and manually reconstruct them in the lore

fallen field
#

Oh, reconstruct them?

quick turtle
#

Like

quick turtle
#

Loop all enchants, get the name u usually use (enchantment.name() or whatever returns some bs like DAMAGE_ALL), get th elevel, then add a line in the lore with the good name + the level

#

like u need to hide the enchants and then add a fake enchant as the lore

fallen field
#

I'll tell all that to my Dev lmAO

#

I don't know shit about coding lol

#

or maybe.. do you know a plugin which does that already?

quick turtle
#

No? I dont really use other plugins e.e

fallen field
#

ah, I see. You code everything yourself.

quick turtle
#

Well I dont reinvent the wheel

fallen field
#

A dev with morale 😂

quick turtle
#

I use worldguard and worldedit, vault, luckperms

fallen field
#

Ah okay.

quick turtle
#

but yeah everything else is custom pretty much

#

best of luck :D

fallen field
#

thanks! 😄

high mantle
#

does onBlockBreak() fire when the client breaks something (even if it doesn't actually break on the server thanks to plugins like worldguard/essentials), or does it fire only when the block is actually broken on the server

torn robin
#

where do you see onBlockBreak

high mantle
#

oop hold up

#

"org.bukkit.event.block.BlockBreakEvent"

#

1am brain is failing me

torn robin
#

well it can be cancelled

#

so yes it gets called even when its cancelled by plugins like WorldGuard

#

you can set listener priority accordingly to actually check if the block was broken

#

there's also of course BlockPlaceEvent

high mantle
#

maybe if, once the event fires, i attempt to grab the block at the specific location within the very method, and if its not air then i'll know it isn't broken?

#

would that work?

#

lemme check'

torn robin
#

just check isCancelled

sleek ivy
#

I must be doing something wrong, I'm building a hover text component but it's just showing on hover for anything in the entire message. I want it to only show for the word example not everything ```
TextComponent example = new TextComponent("example");
example.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("example hover")));

return new ComponentBuilder(example).append("other text");

torn robin
#

set the format

#

append(Component, FormatRetention)

sleek ivy
#

ok thanks, it works

high mantle
#

wow

#

that was a lot simpler than i thought

#

spigot api epic

#

thx msws

daring oracle
#

Is there a way to download 1.16.2 Spigot already or no? Because I've seen some plugins on spigot supporting 1.16.2 and I wasn't able to find a build for it...

high mantle
#

1.16.2 already came out?

#

jeez. um. i highly doubt that but props to spigot devs if they actually could pull off that kind of insane update speed.

daring oracle
#

It didn't as a release, but you can play it as a snapshot. It has the piglin brutes which I really need. I'm confused because I saw a few plugins that support 1.16.2 on the spigot, but there is no 1.16.2 available yet.

timber thorn
#

This might be a stupid question but if I were to compile my plugins using jdk 11 but sticking to java8 features, will the servers need to run on jdk to load the plugin?

marsh hawk
#

can I 'unregister' a listener. I assume gc wont pick it up because it is referenced internally?

marsh hawk
#

awesome, thanks

timber thorn
#

and there is also

marsh hawk
#

I've always used PluginManager to register my listeners, and there was no method for unregistering, just confused me lol

grim halo
#

@timber thorn If you compile with Java 11, the server has to run using java 11. The class files get a sort of class version.

timber thorn
#

I suspected that would be the case, thank you...

marsh hawk
#

I'm using this method

    public void unregisterListener(Listener... listeners) {
        for(Listener l : listeners)
        {
            HandlerList.unregisterAll(l);    
        }
    }
    ``` 
in my main class
```cs
    @EventHandler
    public void closeEvent(InventoryCloseEvent e) {
        HytheCraft.getInstance().unregisterListener(this);
    }``` and this in my second and it's still not unregistering? The method stacks each time a new class is made
grim halo
#

This kind of looks like a xy problem... Why do you want to unregister Listeners?

marsh hawk
#

I create a new instance of the inventory Class each time the player clicks on an item, its for a satchel/backpack.

timber thorn
#

@timber thorn If you compile with Java 11, the server has to run using java 11. The class files get a sort of class version.
@grim halo Would you recommend me sticking to J8 or should I upgrade? I personally don't see any benefits as the code changes are not significant enough for me to switch and I'm afraid the number of people using J8 is still too big to warrant alienating them from the plugin....

marsh hawk
#

The listener is the only reference keeping the class from being picked up by garbage collector

grim halo
#

Looks like ´>85% of mc servers still run on java 8 even tho java 11 is default for linux by now...

marsh hawk
#

All my machines run j8

grim halo
#

I think ill start supporting java 11 from now on.
Compile all my updates for java 11 and tell the ppl to update.

timber thorn
#

So I do it this way:

When I want to start listening to the events of the listener (in my case via a command, in the execute(...) method):

Bukkit.getServer().getPluginManager().registerEvents(<Listener Object>, <My Plugin Object>);

And when I want to stop listening (in the on inventory close event handler):

HandlerList.unregisterAll(<Listener Object>);
grim halo
#

@marsh hawk registering/unregistering listeners on runtime is rly bad as the complete handler list has to be rebaked.
Depending on the amount of plugin this could just straight up freeze the server for half a second

timber thorn
#

@marsh hawk registering/unregistering listeners on runtime is rly bad as the complete handler list has to be rebaked.
Depending on the amount of plugin this could just straight up freeze the server for half a second
@grim halo When I was testing this exact thing I found that ignoring the event was consuming more resources than unregistering the listener...

#

Depends on the listener and the events it listens to I guess. Not every event occurs equally often.

#

I think ill start supporting java 11 from now on.
Compile all my updates for java 11 and tell the ppl to update.
@grim halo Why?

grim halo
#

Checking for a boolean literally takes nanoseconds. Calling the method only a few micros.
Unless you are listening for the PlayerMoveEvent unregistering listeners is obsolete

#

Even then... probably <0.02% server tick with 100 players

#

@marsh hawk You should not try to actively encounter the garbage collector like this.
What exactly do you want to get collected and why.

#

@grim halo Why?
@timber thorn Because then i can use new features actively in my public plugins. Also every version of Java improves its performance.
especially those of streams. (Which are far from optimal in J8)

marsh hawk
#

hmm

#

yeah i would think having a method waiting there is more taxing then rebaking?

grim halo
#

I dont understand that sentence...

#

What do you mean by waiting there?

marsh hawk
#

like having an if statement that just returns

#

would be more taxing

#

but im not sure

grim halo
#

More taxing than...

marsh hawk
#

the handler list rebaking

grim halo
#

Sry i need more context. I still think this a xy problem

#

?xy

worldly heathBOT
grim halo
#

Rebaking the handler list could literally freeze your server for 1 or 2 ticks...

marsh hawk
#

Guess ill have to redo my inventory system. Currently have a new listener for each instance of an inventory

timber thorn
#

Rebaking the handler list could literally freeze your server for 1 or 2 ticks...
@grim halo I have never experienced this but I think I will do some more tests now that you insist on this being the case. You've made me worry 🙃

grim halo
#

If you need a Listener in your plugin you register one single instance at the beginning.

#

Spigot gets listener method references via reflection. (They are cached but still) Its a bad idea to have a ton of Listener instances registered.

bitter cobalt
#

Is Papermc Is Spigot?

marsh hawk
#

its a fork of spigot

#

Hm alright

timber thorn
#

Does anybody know what a maven archiver is or does?

quick turtle
#

[04:11:00 ERROR]: Could not pass event PlayerItemConsumeEvent to POBedwars v1.0
com.comphenix.protocol.reflect.FieldAccessException: No field with type net.mine
craft.server.v1_16_R1.ItemStack exists in class PacketPlayOutEntityEquipment.

#

anyone have any idea why it does that

marsh hawk
#

my only idea is not 1.16 server?

tiny dagger
#

wouldn't it be easier to do it without protocollib? 🤔

quick turtle
#

It is protocollib

#

oh

tiny dagger
#

especially since that site represent client side

quick turtle
#

idk

#

Im using paperspigot which for some reason doesnt have packets ? in the maven lol

#

PacketPlayOut... is not a class so

marsh hawk
#

ask their discord lol

tiny dagger
#

they have lol

#

it's in server/cache

#

the file patched

marsh hawk
#

its a runtime issue though

#

it should be able to find the field

high mantle
#

Trying to check if a player already has any instances of oak signs with a specific display name, and if so, removing all instances of it from their inventory before adding a brand new one. This works fine in the hotbar, but in the rest of their inventory it sends an internal error exception.

Code:

HashMap<Integer, ? extends ItemStack> items = inv.all(Material.OAK_SIGN);
if (!items.isEmpty()) {
  for (int i = 0; i < items.size(); i++) {
    ItemStack item = items.get(i);
    if (item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "[BedWars] " + ChatColor.DARK_GREEN + "Lobby Maker"))
      inv.removeItem(item);
  }
}
tiny dagger
#

don't you think there are enough bedwars plugins?

quick turtle
#

DragoToday at 4:24 AM
yea, those packets arent in the api

marsh hawk
#

lmao

quick turtle
#

this is for private use

#

completely private and personal

#

oh

#

wait

#

u mean pumpkin

#

were both making bedwars

#

👀

high mantle
#

don't you think you should encourage people to make their own works instead of ripping off other's?

rare prairie
#

item.getItemMeta() can be null

vernal spruce
#

[04:11:00 ERROR]: Could not pass event PlayerItemConsumeEvent to POBedwars v1.0
com.comphenix.protocol.reflect.FieldAccessException: No field with type net.mine
craft.server.v1_16_R1.ItemStack exists in class PacketPlayOutEntityEquipment.
@quick turtle Also keep in mind

#

there is ItemStack and there is Item

#

theyr not the same

quick turtle
#

wdym

vernal spruce
quick turtle
#

ik im using ItemStack

#

ok say I wanted to just use packetplayout and stuff

#

how do I get it there

#

im currently using paper but ill change it if i can make this easier

high mantle
#

well its not item.getItemMeta() that's becoming null, I just performed a check for that

rare prairie
#

which line is 68?

high mantle
#

its even removing the item from my hotbar if its there, but as soon as it comes to finding that metadata in my extra inventory, it gives that error

rare prairie
#

Maybe because what you trying to remove from inventory is not exists or the type is air?

high mantle
#

item.getItemMeta()

quick turtle
#

What do I need toget PacketPlayOut.. to work

high mantle
#

so i guess I need to check if item is null first

rare prairie
#

ItemStack#hasItemMeta

#

yep

high mantle
#

thanks

timber thorn
#

Are you guys using IntelliJ, Eclipse or something else as your IDEs?

fleet crane
#

netbeans

tiny dagger
#

notepad

#

and paint sometimes

mellow wave
#

Paint ide

high mantle
#

Eclipse

mellow wave
#

I'm actually using Intellij...

toxic moat
#

Hey, question guys...is there a way to set a saddle onto a strider? They don't have a setSaddle method like Pigs or Horses do.

tiny dagger
#

if it doesn't have a method

#

then those entities don't support one

#

simple as that

#

you can ride them

toxic moat
#

Except Striders can be equipped with them.

#

And have to be in order to ride them

tiny dagger
#

probabily forgotten then

#

check nms

timber thorn
#

I'm actually using Intellij...
@mellow wave Do you run the server from within IntelliJ as well? With hotswapping perhaps?

mellow wave
#

I don't have hotswapping enabled I usually just compile everything to a jar and replace it

vernal spruce
#

Except Striders can be equipped with them.
@toxic moat What you mean

toxic moat
#

Striders have to be equipped with a saddle, similar to a pig, for you to ride them.

vernal spruce
#

they literally implement

fleet crane
#

yeah theres literally Strider.setSaddle(true)

toxic moat
#

Yet that comes up red

fleet crane
#

are you up to date

vernal spruce
timber thorn
#

I don't have hotswapping enabled I usually just compile everything to a jar and replace it
@mellow wave Can I PM you real quick? I kinda need help with transitioning from Eclipse to IntelliJ

toxic moat
#

I'm rerunning the checks for it now. I thought I was so we'll see if it was just Intellij being weird.

mellow wave
#

Sure

rare prairie
#

@mellow wave Can I PM you real quick? I kinda need help with transitioning from Eclipse to IntelliJ
use google

toxic moat
#

Yeah, that was it. Intellij didn't pull the jar fully. Sorry about the bother guys!

rare prairie
#

use ms paint

grand current
#

does anyone know how to test if the player in an onPlayerRenameItem event has a certain permission?
my listener:

package com.delight.anvilcolorrename;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.PrepareAnvilEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class AnvilColorRenameListener implements Listener {
    
    //Constructor
    public AnvilColorRenameListener(Main plugin) {
        
    }

    //EventHandler
    @EventHandler
    public void onPlayerRenameItem(PrepareAnvilEvent event){
        if (event.getPlayer().hasPermission("AnvilColorRename.use")) {
            if(event.getResult() != null && event.getResult().hasItemMeta() && event.getInventory().getRenameText() != ""){
                ItemStack result = event.getResult();
                ItemMeta resultMeta = result.getItemMeta();
                String nameColored = ChatColor.translateAlternateColorCodes('&', event.getInventory().getRenameText());
                resultMeta.setDisplayName(nameColored);
                result.setItemMeta(resultMeta);
            }
            }// if(!event.hasPermission("AnvilColorRename.use")) {
//                event.sendMessage("You can not use color codes in an anvil!");
//            }
    }
//}

mellow wave
#

You already did it

fleet crane
#

you literally already do?

grand current
#

it throws an error tho

#

The method getPlayer() is undefined for the type PrepareAnvilEvent

mellow wave
#

That's for another reason send the error

#

oh

#

You have to get the viewers

grand current
#

how do i do that

mellow wave
#

.getViewers()

grand current
#

instead of getPlayer()?

mellow wave
#

No because now you have a list instead of a single player

zealous yoke
#

Are you guys using IntelliJ, Eclipse or something else as your IDEs?
@timber thorn Vim, theres nothing better than it

grand current
#

where do i have to put the .getViewers() then?

tiny dagger
#

in a for loop

mellow wave
#

um maybe you should look in to java before doing things

tiny dagger
#

for (Player viewer : getViewers) {
}

#

it's probabily a HumanEntity

mellow wave
#

^^

#

It's a HumanEntity

quick turtle
#

my code is so inconsistent I have for loops and #forEach mixed

grand current
#

thanks

tiny dagger
#

doesn't matter that much itz

quick turtle
#

ik it's just weird lol

tiny dagger
#

as long as it's not streams

zealous yoke
#

streams are not that bad if you use them properly

tiny dagger
#

still

#

i think i had better control working directly

native frost
#

Hullo, I'm trying to make a simple sit plugin using invisible armor stands but for some reason the clean-up code (the one in charge of removing the armor stands when no one is on it anymore) keeps tossing an occasional error on the live server.

Here's what the clean-up code is: https://paste.md-5.net/evatotetof.cs

The error that's being thrown is java.util.ConcurrentModificationException, and is caught by the first try. I'm not sure how to replicate it on the test server I'm using since the error doesn't pop up there, only on the live server

timber thorn
#

@timber thorn Vim, theres nothing better than it
@zealous yoke Kill me now

zealous yoke
#

I mean, Intellij is very cool and its code completion is great

#

But Vim is such powerful and people dont know that

timber thorn
#

Anybody got any experience with ANTLR in IntelliJ? Before the obligatory "use google" answer comes: I did, could not find my problem on google, let alone a solution...

daring oracle
#

is there a way/plugin for disabling increasing the repair price?

#

like in experience on an anvil

zealous yoke
#

Yea I recently found some

#

I think I looked for "spigot disable too expensive" on google

marsh hawk
#

you guys reckon its a bad idea to hardcode permissions for my own server?

native frost
#

If I'm not mistaken that would be modifying the RepairCost of an item data to 0

wraith thicket
native frost
#

Repairable.setRepairCost​(int cost)

#

on a sidenote. Anyone got an answer for my prob .w.?

wraith thicket
#

It's not like I linked to the javadocs of exactly that above your message...

#

As for your issue, you'd be better of printing the stacktrace of the exception - that way you'll know what's causing it

marsh hawk
#

@native frost keep a cache of items you want to delete then delete after the while loop, you can't modify a collection while iterating over it

native frost
#

How do I do that with the iterator then? Or am I supposed to make a different thing to do that?

limber summit
#

what is this error guys?

grim halo
#

@native frost You have two options.

  1. Use an iterator and remove while iterating.
  2. Create a new collection where you add elements that should be removed and use the bulk removeAll method to remove them after you are done looping.
tiny dagger
#

or

#

removeIf

#

which does what is on 1

#

but clearer

wraith thicket
#

The thing is, they are using Iterator#remove from what I can see in the code

native frost
#

1 is what (I assume at least) I've already been doing in the code (https://paste.md-5.net/evatotetof.cs) It throws the ConcurrentModificationError though
Will try 2 and see if that works

grim halo
#

Yeah true. So 3 options. Its basically 1

wraith thicket
#

That's why I said printing out the actual stacktrace will be helpful

grim halo
#

Try what Fr33styler suggested if you dont need to do anything while iterating

#

Also cramming everything into a try catch is bad

native frost
#

i printed out the stacktrace but the error keeps throwing on line 17 or 27, which doesn't tell me much. plus it has no errors in the test server I'm using it on but it occasionally throws the error on the live server (with other players on)

as noted will try fr33styler's suggestion (and 2) and see if that fixes anything

wraith thicket
#

Since the Iterator#remove method shouldn't be causing a concurrent modification exception, I'm pretty sure there's something else that's modifying the map while you iterate over it.

#

And that's probably hidden somewhere within your other methods.

grim halo
#

Removing something from an entry set iterator. Have never done this but it seems wrong...

wraith thicket
#

Javadocs indicates it would throw the UnsupportedOperationException if the operation was unsupported

native frost
#

yeah that's what got me stumped. no other code modifies that (except for the initial armor stand spawner. which adds to the list)

#

i'll get a copy of that code. in case that is the cause of the problem, not the clean up code

wraith thicket
#

You're not itearting over the map in an ansyc thread, are you?

native frost
grim halo
#

Its not a thread at all

#

But you can start async threads with it

native frost
#

thus my confusion. it works, but for some reason, on occasion, ConcurrentModificationError. Trace only leads back to the itr.remove(); (which doesn't explain much)

hmm, is a BukkitRunnable async? because that's where the clean up code fires from

wraith thicket
#

You can use a BukkitRunnable to run an async task

grim halo
#

If its only occasionally then you are probably accessing the map async while iterating

wraith thicket
#

It depends on which method you use. The methods that run a task asynchronously have either "async" or "asynchronous" in their names

grim halo
#

Where do you access the chaircombo?

wraith thicket
#

He's shown that he does so in the command executor and this cleanup code, which would suggest the cleanup code is running asynchronously

native frost
#

chaircombo is accessed only twice: in the clean up code, and the spawning code (2nd link and 1st link respectively)

wraith thicket
#

What calls the cleanup code exactly?

native frost
#

A BukkitScheduler which runs a BukkitRunnable, will provide that code now. 1 sec

#

instance at the last line is just the plugin instance

grim halo
#

0 tick delay.

#

first long is initial delay second one is repeated delay

#

For the beginning change that to 1.

wraith thicket
#

The delay will be changed to 1 tick interally

tacit trellis
grim halo
#

Not sure why this line is there BukkitScheduler scheduler = getServer().getScheduler();
But its obsolete

native frost
#

o i forgot to remove that. before using BukkitRunnable I was using the BukkitScheduler (specifically scheduler.scheduleSyncRepeatingTask)

grim halo
#

This does not look like it should cause a concurrent modification exception... Is this just ran in your onEnable

native frost
#

yes

#

wait only the clean up code is in onEnable, the code that adds the armor stand is in a different class because it uses a command to activate it

grim halo
#

Also make sure that one iter.remove() gets not called after another iter.remove() before iter.next() as this will cause an IllegalStateException to be thrown

wraith thicket
#

Yes, but still not the concurrent modification exception they claim to have seen

grim halo
#

Yes but i cant find anything wrong here...

wraith thicket
#

Neither can I.

native frost
#

aye, it's a very strange error :V

grim halo
#

@native frost Could you search your whole project for "async" and see if it hits something? XD

wraith thicket
#

And for chaircombo in case you've accidentally used it elsewhere

native frost
#

no instances of async. Will see if chaircombo is accessed anywhere else though

wraith thicket
#

If those 2 places are the only places the map gets modified, then the only possibility that I can see is that they get run on different threads, but I don't really see how this would happen

native frost
#

only 2 other cases:

  • at the complete start of the plugin (right after the extends JavaPlugin bit) where it's created, and
  • onDisable, but I doubt that will do anything given well, the error only pops up when the server is live and not shutting down
grim halo
#

Do you have a getter for the map?

wraith thicket
#

The map has public access it seems - but it's possible it has both

grim halo
#

Ah i see in the command class...

wraith thicket
#

Although searching for the chaircombo variable should have also showed the getter if one existed

grim halo
#

hm..

native frost
#

i don't know what a getter is lol

wraith thicket
#

One vague problem I could see is if some other plugin was asynchronously iterating over entities while you're removing the armor stand

#

But that seems like a stretch, really

grim halo
#

And the line in question is on of the itr.remove(); lines?

native frost
#

actually that might be possible, will check the live server when i can later and see if that's the case. if it is then at least this strange problem has an explanation :V

last i checked it was on those lines yes, the resulting problem in-game is the armor stand is still there even when nobody is on it

grim halo
#

Ive just read that the error only pups up on the live server. Are you sure the version you got is the same?

frigid ember
#

I wonder... Is there a plugin which delays packets sent/received to client/server? I want to test out now the server responds to player with high latency.

#

Nvm I can test it in offline mode with man in the middle Linux program I guess

grim halo
#

You can just register a packet adapter for every player packet. Catch it and send it some 100 millis later

native frost
#

both test and live server uses paper-208 (1.15.2), the only difference is the live server has more players on while the test server only has me and my alt

grim halo
#

Yes or you just connect via a proxy array through southafrica -> russia -> europe

frigid ember
#

Or tor

wraith thicket
#

Most likely just 100ms later isn't a good representation of a bad connection. A random pattern would probably represent it better. It's possible one packet is delayed by just 20ms while some other is delayed by 200ms

frigid ember
#

Even (better) worse

#

I once had connection with 9000ms ping. Servers kicked me out like in 15 seconds

#

Or wait, did I timeout...?

#

I don't remember

wraith thicket
#

@native frost If you're running a fork of Spigot, you'd need to contact the developers of said fork for help

native frost
#

will do. asked here first since it might have been a plugin prob first. thx for the help all btw

scarlet creek
#

Does anyone know how to create a mute rank? I have LuckPerms and Essentials (the LuckPerms Discord wasn't very helpful)

grim halo
#

just add a rank that revokes chat permission?
something like

  • foo.chat
scarlet creek
#

Yeah, it was essentials.chat, but the player I tested it on still could type.

cinder monolith
#

As soon as I join a minecraft server, my laptop just shutdowns
i see this The driver \Driver\WudfRd failed to load for the device ACPI\INT3400\2&daba3ff&0.
in event log

#

does it have anything to do with minecraft?

stone rampart
#

perhaps

#

but I'd say it has nothing to do with spigot

frigid ember
#

So w-a-s-d to make them walk

#

But I can't find how

#
        if (e.getRightClicked() instanceof Creeper) {
            Player pl = e.getPlayer();
            Entity ent = e.getRightClicked();
            ent.setPassenger(pl);
        }```
#

So this is to make the players passengers

#

but they can't controll the mobs yet :/

crimson sandal
#

What is a Complex Recipe? Firework rockets seem to make use of them, and I've just found out my autocrafter doesn't support them

#

Ah crap, it looks like they're not very well supported in the api 😦

#

It would be super useful if there was an api method that would return the Recipe when provided with a list of 9 ItemStack aka the Crafting Grid

grim halo
#

@crimson sandal You basically have to do the same thing as minecraft. Iterate over all recipes and find a match

crimson sandal
#

Yeah I already do that for ShapedRecipes and ShapelessRecipes

#

But ComplexRecipes for Armour Dyeing and Rockets etc is a different story

#

The API only returns the result for Complex recipes

timber thorn
#

I mean someone else also had some issues https://www.spigotmc.org/threads/intellij-live-debug-run-your-server-inside-the-ide.364782/
@bold anchor So I checked this out and it works... kind of...
The answer's author links to a newer tutorial he wrote here: https://www.spigotmc.org/threads/guide-windows-extremely-productive-development-environment.394754/ But unfortunately this kind of hotswapping does not seem to work with the relocations maven has to do to build my plugin. Any ideas regarding that problem?

native frost
#

I have a new question (not related to my previous chaircombos one): I'm trying to make custom weapons that do something based on yml data that can be set.
How does one save yml data into an Item? If this is not possible then instead a way to compare an ItemStack with info from a yml, and if it matches then it does something. Cuz so far I've just been comparing if the display names match and that works until someone renames their weapon

#

i was told by someone else in the past to use UUIDs on the items but I don't understand how to do that

sinful spire
#
on right click:
  tool is stick
  if {%player's uuid%.sticktnt.use} < 100:
    shoot primed tnt with speed 4
    add 1 to {%player's uuid%.sticktnt.use}
  else:
    set {%player's uuid%.sticktnt.use} to 0
    remove stick from player's tool
#

next, ask in the skript discord please

lone fog
#

@frigid ember you can’t just put the player on any entity, you have to have a custom entity that allows control with wasd

#

Using nms

timber thorn
#

Jesus you need an Oracle Account to get JDK 11?

#

What kind of bs are they pulling...?

frigid ember
#

whats nms @lone fog ?

native frost
#

net.minecraft.server Lazinq

#

also anyone got an answer for my q?

mellow wave
#

You can store information with the PersistanDataContainer

#

Store a UUID with it and match it to the effect when required

grand current
#

hey! i figured out how to use permissions in my anvil color rename plugin but if the player doesnt have op he cant interact with anything or break/place blocks
the listener:

package com.delight.anvilcolorrename;

import org.bukkit.ChatColor;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.PrepareAnvilEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class AnvilColorRenameListener implements Listener {
    
    //Constructor
    public AnvilColorRenameListener(Main plugin) {
        
    }

    //EventHandler
    @EventHandler
    public void onPlayerRenameItem(PrepareAnvilEvent event){
            final HumanEntity p = event.getViewers().get(0);
            if (p.hasPermission("anvilcolorrename.use")) {
            if(event.getResult() != null && event.getResult().hasItemMeta() && event.getInventory().getRenameText() != ""){
                ItemStack result = event.getResult();
                ItemMeta resultMeta = result.getItemMeta();
                String nameColored = ChatColor.translateAlternateColorCodes('&', event.getInventory().getRenameText());
                resultMeta.setDisplayName(nameColored);
                result.setItemMeta(resultMeta);
            } return;
            } else return;
    }
}
mellow wave
#

That has nothing to do with your plugin

#

Check the server.properties file for spawn-protection

grand current
#

oh

#

hold on lemme do that

#

lmao it worked, tysm!

mellow wave
#

No problem 🙂

hexed harness
#

Is there anything I can use to prevent against these other types of "attacks"?
It must also be applicable to buttons https://i.thevirt.us/07/E0v8o.mp4

I know about the piston expand/contract events, but do they even hold the information about the affected plate when used indirectly, like with the sticky one?

crimson sandal
#

How does chunk loading work exactly? I always thought then when you moved out of the servers render distance those chunks unloaded. However I've moved 10000 blocks away and found that chunks 9000 blocks away are still loaded 🤔

river cradle
#

Hi there, is there a way for me to in each separate world only show this world's players on the tab list? I've heard that this could be done by sending the "remove player" packet but this seems hard so another method would be more comfortable

#

(I must add: BungeeCord does not seem an option since I only have one server, and all of the "tab list" plugins I've seen so far don't work for 1.16.1)

crimson sandal
#

I'm pretty sure the only way is to send the remove player packet

#

something like this? PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, entityplayer);

#

Obviously you'd need NMS or some other way of sending packets

#

Have you tried calling hidePlayer()

#

That would work maybe?

grim halo
#

hidePlayer is probably the best way to go

crimson sandal
#

Yeah that basically sends that packet for you

timber thorn
#

😩 why does hotswapping on IntelliJ have to be so complicated when Eclipse handles it just fine without any issues...

crimson sandal
#

So listen for world join event and then for all the other worlds hide that player

grim halo
#

@hexed harness You can get every target block in the extend/retract event. Just cancel it if you find blocks that shouldnt be moved.

clever hornet
#

anybody know a plugin that lets you loop music disks in a world

plush kraken
#

why do I get this? https://prnt.sc/tna8jh I did /ban and I got this.

code:

if (command.getName().equals("ban")) {
            if (sender.hasPermission("lirus.ban")) {
                Player player = Bukkit.getPlayer(args[0]);
                FileConfiguration config = getConfig();
                List<String> list = config.getStringList("BannedPlayers");
                assert player != null;
                boolean add = list.add(player.getUniqueId().toString());
                config.set("BannedPlayers", list);
            }
        }

I also did /ban DevPig which should have added my name to the BannedPlayers list in config.yml and it did nothing.

#

?

mellow wave
#

You're trying to use a player name a doesn't exist

plush kraken
#

Oh

#

How do I fix it?

mellow wave
#

Check if you have entered a name, i.e check if args is longer than 0

plush kraken
#

Ohhhh ok

#

gimme a sec

#
        if (command.getName().equals("ban")) {
            if (sender.hasPermission("lirus.ban")) {
                if (args.length == 2) {
                    Player player = Bukkit.getPlayer(args[0]);
                    FileConfiguration config = getConfig();
                    List<String> list = config.getStringList("BannedPlayers");
                    assert player != null;
                    boolean add = list.add(player.getUniqueId().toString());
                    config.set("BannedPlayers", list);
                }
            }
        }
#

like that?

#
        if (command.getName().equals("ban")) {
            if (sender.hasPermission("lirus.ban")) {
                if (args.length == 2) {
                    Player player = Bukkit.getPlayer(args[0]);
                    FileConfiguration config = getConfig();
                    List<String> list = config.getStringList("BannedPlayers");
                    assert player != null;
                    boolean add = list.add(player.getUniqueId().toString());
                    config.set("BannedPlayers", list);
                } else {
                    sender.sendMessage("§cUsage: /ban [player] [time] [reason]");
                }
            }
        }```
#

would that work?

#

Ok

#

Actually 3 because of player, reason and time

#

How

#

But I only want 3

#

No more

#

oh ok

lone fog
#

Then you can use == 3

plush kraken
lone fog
#

Although you will be limited to a one word reason

#

It already can

#

Because they have arg 3 as the time

plush kraken
#

Ohhhh

lone fog
#

I guess they could read args.length - 1

plush kraken
#

Lemme see if it adds my uuid to config now

#

Ok

grim halo
#

equals -> ==
less or equal to -> <=
more or equal to -> >=
less than -> <
more than -> >

plush kraken
#

Ok thanks

grim halo
#

Did you save the FileConfiguration content to the File?

plush kraken
#
            if (sender.hasPermission("lirus.ban")) {
                if (args.length > 2) {
                    Player player = Bukkit.getPlayer(args[0]);
                    FileConfiguration config = getConfig();
                    List<String> list = config.getStringList("BannedPlayers");
                    assert player != null;
                    boolean add = list.add(player.getUniqueId().toString());
                    config.set("BannedPlayers", list);
                } else {
                    sender.sendMessage("§cUsage: /ban [player] [time] [reason]");
                }
            }
        }```
#

thats my code

#

oh

grim halo
#

Objects in java lay in RAM. Just because you write data into objects does not mean they are automatically on your hard drive.
You need to explicitly write data to a file.
This is told in every basic java course. Pls learn the fundamentals of the language.

plush kraken
#

sorry

grim halo
#

You dont have to be sorry lol. Just take some time and learn the basics. There are alot of tutorials and it wont take you long.

native frost
#

ok so i started using PersistentDataContainer for custom weapons but I've encountered a problem: As soon as the weapon takes any durability damage. Whatever info was in the PersistentDataContainer is lost (either that or for some reason the data isn't being read)

grim halo
#

The data should not be affected by the weapons damage...

native frost
#

it does on my end for some reason....
why do i keep getting the weird errors :<

grim halo
#

Ill write a quick test on that... brb

native frost
#

*problems, mb

#

?

#

this is the help channel . w.

plush kraken
#

What did I do wrong?

#

Im watching a tutorial

native frost
#

Oh wait I was a big dummy. I was making a check if the weapon had full durability or not at the start of the code. My bad . w.;;

plush kraken
#

??

#

Ill look it up

#

I needa learn anyway

grim halo
#

@native frost Everything works for me...

#

Ah ok

native frost
#

oh wait one last thing: how do i get the max durability of an item?

#

thx

plush kraken
#

my brain hurts

#

How do I pass the instance from my main class to my commands class?

#

??????

#

where do I put that

#

like that?

#

Ok

silent shuttle
#

Lirus

plush kraken
#

Ah ok

silent shuttle
#

why do u have a " over there?

plush kraken
#

idk

silent shuttle
#

omg

plush kraken
#

i removed it and it had a stroke

silent shuttle
#

bro

#

stroke?

plush kraken
#

wait fixed

#

dw

silent shuttle
#

;

#

omg lol

plush kraken
#

bruh 3 warnings in 1 seccond

#

Do as I said before...
@frigid ember how

lone fog
#

What is that extra

plush kraken
#

idkdkkdkdkd

worldly heathBOT
plush kraken
mellow wave
#

As ILikeToCode says you need to get the string of the UUID

plush kraken
#

How

lone fog
#

.toString

plush kraken
#

?

mellow wave
#

... add .toString not that hard

plush kraken
#

Where

mellow wave
#

on the UUID

plush kraken
mellow wave
#

:/ Please I'm not going to spoon feed you everything

plush kraken
#

?

#

-__-

mellow wave
#

Yeah we're basically writing the plugin for you

sturdy oar
#

Guys i need you little help as I can't test this myself rn. If I throw a poison potion on a zombie and I listen for EntityPotionEffectEvent , will the event throw with Action type 'CANCELLED'? For any of you that instantly like to say 'XY problem', I am making mobs such as zombie vulnerable to potion overriding vanilla mechanics

frigid ember
#

Just learn Java 😉, isn't it annoying to ask others questions all the time? Solve problems by yourself. @plush kraken

hardy cedar
#

ILikeToCode nice name lol

sturdy oar
#

There is

#

Yeah I mean CLEARED my bad

#

I think the only way to know it is testing tbh

#

I don't know the internal implementation of this event so it may not throw at all for zombies since They don't even get the potion

frigid ember
#

how can i get all arguments from a command?

#

something like args[all]?

#

thanks

bold anchor
#

Oh, String.join

#

Or**

#

You know, default java methods 👍

#

J8

tiny dagger
#

StringJoiner is the best

#

you can't change my mind on it

woeful shore
#

What's the new method to load advancements?
(As oppose to the deprecated Bukkit#getUnsafe()#loadAdvancement)

naive goblet
#

Lemme check

#

Is there even a new method for that?

woeful shore
#

From what I can see no, I'm assuming the entire system has been changed, but there is no replacement link within the old class, which is ya know, smart af

naive goblet
#

Idk if you should call method like reloadData or just try to get and Advancment and hope that it loads itself

woeful shore
#

Will do, appreciated

naive goblet
#

Take a look at the entire spigot jar

#

Frosty

#

(;

woeful shore
#

Imagine if things were properly documented :fingerguns:

quick turtle
#

Is there any event for preventing the manipulation of a players armor?

naive goblet
#

Imagine if we had fingerguns emote here

woeful shore
#

Just imagine

grim halo
#

@quick turtle You mean equiping and so on?

quick turtle
#

Yes

#

I want only my plugin to change armor, not any other plugin for the duration a field is true

lone fog
#

You would need to listen to a few

#

InventoryClick or move, interact, dispenser

naive goblet
#

Lol fr

woeful shore
#

Imagine using the deprecated annotation properly :fingerguns:

grim halo
#

I think paper has a player armor equip event. In spigot you just need to listen to a few events then you can create/fire your own.

lone fog
#

IIRC one is being worked on for spigot

quick turtle
#

i just switched from paper to get PacketPlayOut in the api

#

;0

#

yesterday I switched from 1.8.8 to 1.16.1, paperspigot to spigot, then buildtools just to get one thing to work

naive goblet
#

Hmm

#

Pretty sure you should switch to 1.15.2 before going up to 1.16.1 iirc

quick turtle
#

well i mean my code works and my world hasnt broken yet so

#

pretty good signs xd

naive goblet
#

That sounds beautiful

quick turtle
#

had to change from durabilities to materials in the code but

#

oh and packetwrapper no longer functions so i need to rewrite that to be vanilla

naive goblet
#

Ah

#

Is there a stable 1.16.1 version now?

quick turtle
#

hell if I know someone just told me 1.15.2 was "legacy" as well (I consider legacy to be <1.13.2) on the papermc discord

naive goblet
#

Hmm yeah

#

Idk

#

1.15.2 isn’t legacy though

grim halo
#

1.16 will be default as soon as the Buildtools doesnt require --rev for it anymore.
For a production server i would at least wait for 1.16.2

naive goblet
#

Yeah fair enough

quick turtle
#

so like

#

i cant use the 1.16.1 that i stayed up until 5am to make work ;c

#

I mean I was using 1.8.8 so its not like Im using any new things in 1.16 that arent in older APIs

#

ok wait regardless of that

#

thats not important, the armor manipulation, anyone have a gist of it or something to look at?

naive goblet
#

What’s that about

quick turtle
#

I want to cancel all manipulation of armor

naive goblet
#

“Manipulation”

quick turtle
#

a player will never have armor to put on in this game but they can take it off, I want to cancel that

#

There will also be no chance for dispensers or other, its a minigame

naive goblet
#

Isn’t there a statistic for that?

grim halo
#

InventoryClickEvent, PlayerInteractEvents, i think dispenser can equip armor. All that stuff

quick turtle
#

What would the interact event be for?

#

Right clicking armor on?

grim halo
opal adder
#

InteractEvent can be used for so many things

#

I didn't even know there was an armorequipevent haha what the fack!

#

That would've made things easier

#

Oh okay

quick turtle
#

its custom using the handlerlist in that gist ultra

torn robin
#

It doesn’t check dispensers

opal adder
#

There should be though

#

Would be a nice event, save a lot of time

#

That would make custom enchants on armor way too easy

#

It got a de-equip in there to?

#

Ah it does. That's hot.

#

Well this link says it's a thing with the library this guy made

warped ivy
lone fog
#

Yeah it has an oldArmor and newArmor variable

opal adder
#

Maybe you need to set the base permission? I used to have that problem all the time. Like some plugins will have a "permission.omg.dosomething" and in order for that to work you also need "permission.omg"

#

Ah okay, well still seems very handy!

warped ivy
#

someone pls help

torn robin
#

?ask

worldly heathBOT
#

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.

devout crest
#

Is there anyone that can make a bed wars plugin?

#

1.8

naive goblet
#

DIY 🤙

vernal spruce
#

Arent there enough bedwars for 1.8 out there?

#

It was such a plague we have like 100 or more

devout crest
#

They are all bugy

vernal spruce
#

somehow i doubt that

#

all are bugy

#

Especially since bedwars

#

is only played on 1.8

naive goblet
#

A decent coded bed wars core plugin requires some skill (non buggy one)

wraith thicket
#

Perhaps the issue is not that the plugin is buggy, but that the version is?

naive goblet
#

Afaik there is some pretty shitty bed wars plugins but not all of them

vernal spruce
#

there has to be 1 good out of 50 or w/e there are

wraith thicket
#

It's possible there's also so many bad ones that it's difficult to find the good one(s)

vernal spruce
#

well thats the job of a server owner

#

dont want to spend time,pay for a custom one

devout crest
#

The owner will pay for one that's what I was kind of asking

vernal spruce
#

there are alot of premium ones wich most likely still get updated

tiny dagger
#

i have shamefully made a bedwars plugin 😂

naive goblet
#

Ah why does premium plugins still exist on spigot

devout crest
#

Okay

naive goblet
#

Lol

shy shard
#

Hello does spigot takes actions against people which use leaked plugins if I have prof in spigot messages

#

Some guys asked my for help with my plugin and the jar which he is using is latest from that b-spigot

#

Because I am ok use my leaked plugin but don't come and ask from my help and waist my time

#

it hurts in chest

devout crest
#

Would a bedwars plugin be a medium sized plugin?

quick turtle
#

Elephant

devout crest
#

?

quick turtle
#

not even done yet

#

thats for a private tournament

quick arch
#

dlg do you still need help with hiding armor kek

quick turtle
#

yes bedwars is considered medium sized

devout crest
#

Okay

quick turtle
#

nah I used buildtools to get PacketPlayOutArmorEquip packet

quick arch
#

nms territory

#

oh boy

quick turtle
#

@devout crest Actually, if its fully functioned and featured its a large plugin

shy shard
#

I was just curious

quick turtle
#

I think they take action against people who leak premiumresources, but not who use them

#

but I dont know for sure, thats just my assumption

soft fable
quick turtle
#

?ask

worldly heathBOT
#

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.

soft fable
#

?

#

wdym?

quick turtle
#

whats the issue

#

we need an error or something

#

not just code

soft fable
#

Its in the source

quick turtle
#

Oh mb I see

#

Legacy plugin FunWars v1.0.0 does not specify an api-version.

#

What version u running this on

soft fable
#

1.16

mellow wave
#

That's fine

#

org.bukkit.plugin.InvalidPluginException: org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled

#

That's the issue

quick turtle
#

I know.

#

His plugin is probably auto disabled or something

#

so fix things one at a time

unborn island
#

question so when I load up the plugin download list the bukkit/spigot selecter is gone all I see is sort by (x,y) I am using server.pro

mellow wave
#

True my bad :/

quick turtle
#

api-version: "1.16" put that in your plugin.yml

soft fable
#

did it

quick turtle
#

alright try now

frigid ember
#

i have this problem

#
[WARNING] The POM for com.wasteofplastic:askyblock:jar:3.0.8.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.143 s
[INFO] Finished at: 2020-07-23T19:24:28+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ArtMap: Could not resolve dependencies for project com.gitlab.blockstack:ArtMap:jar:2.7.4: Failure to find org.spigotmc:spigot:jar:1.12-R0.1-SNAPSHOT in https://hub.spigotmc.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of spigot-repo has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException


#
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.12-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
#

and this is my depedency

mellow wave
#

Are you using the correct repo?

soft fable
#

its the same issue but the Legacy plugin FunWars v1.0.0 does not specify an api-version error is gone now

quick turtle
#

Alright

frigid ember
#
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
        </repository>```
quick turtle
#

any other errors in console?

frigid ember
#

this is my repo

quick turtle
#

There has to be a reason it gets disabled

quick arch
#

did you run buildtools for 1.12.2

frigid ember
#

i dont know, its not my resource

soft fable
#

I don't have any other errors there

quick arch
#

oh

#

you usually have to do that to get it installed in your local repo

frigid ember
#

something is wrong with repository

quick arch
#

I know because I had to run buildtools for all the versions cause of a combat tag plugin 🤢

quick turtle
#
    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
frigid ember
#

should work?

quick turtle
#

Thats from Spigot Maven wiki

#

so probably

frigid ember
#

im trying it now

quick arch
#

😏

quick turtle
#

trash

#

(not saying gradle is trash i mean him hes a bully ok)

soft fable
frigid ember
#

does not work

#

@quick turtle

quick arch
#

yeah you probably have to run buildtools for 1.12.2

quick turtle
#

^

#

unfortunately might be the case

frigid ember
#

okayy

soft fable
quick turtle
#

dont keep tagging me

#

i can see

#

;c

#

uh honestly no idea why its disabled

#

there has to be a reason it gets disabled

#

oh yes

#

im stupid

quick turtle
#

its being done when the class is instantiated

quick arch
#

It's ran before the plugin enabled ._.

quick turtle
#

Not when the plugin is enabled

#

also use Bukkit.getScheduler().runTaskTimer(this -> { code here });

#

so much better ;9

quick arch
#

there's nothing different between the two

quick turtle
#

idk it looks better

quick arch
#

^

quick turtle
#

i want my damn external emojis

#

how can i get them e.e

quick arch
#

uh..

#

boost

grim halo
quick arch
#

😏

#

see

quick turtle
#

there we go

#

much better

quick arch
#

._.

#

right?

grim halo
quick arch
#

just put the emojis on github and redirect a domain to them

quick turtle
woeful shore
#

ILikeToCode, just an FYI the class you mentioned to check, doesn't exist :fingerguns:

frigid ember
#

can somebody compile me one plugin?

#

its open source

soft fable
#

it worked. Thanks guys

frigid ember
#

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project ArtMap: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

#

i have this error

woeful shore
#

Considering I'm using latest :fingerguns:

grim halo
#

@frigid ember You need to install a jdk and choose it as your project compile. If the project has proper VCS ill compile it quick for you.

quick arch
#

it's a 1.8.8 plugin I think

vernal spruce
#

mhmm how could i ease this

#
        itemsInside[0] = im.getPersistentDataContainer().get(pl.slot0,pl.bpi);
        itemsInside[1] = im.getPersistentDataContainer().get(pl.slot1,pl.bpi);
        itemsInside[2] = im.getPersistentDataContainer().get(pl.slot2,pl.bpi);
        itemsInside[3] = im.getPersistentDataContainer().get(pl.slot3,pl.bpi);
        itemsInside[4] = im.getPersistentDataContainer().get(pl.slot4,pl.bpi);```
quick arch
#

what is that

#

backpacks?

vernal spruce
#

yes

#

im solely using datacontainer

quick arch
#

Couldn't you just serialize the whole inventory into a String

#

and put it in there

vernal spruce
#

might reach max nbt limit through that

quick arch
#

Compress it

#

👀

vernal spruce
#

but atm im going though with this

#

as i simply store the itemstack inside each tag

#

but i want to minimize that wall of code

grim halo
#

I think we need a bit more context for that.

old barn
#

How do i check if the player's inventory is full? Spigot 1.8

grim halo
#

What is im and what is pl

vernal spruce
#

im=itemmeta pl=main

frigid ember
#

@old barn try player.getInventory().firstEmpty()
if itreturns -1 its full

unborn island
#

can I have some help?

vernal spruce
#

im basically retrieving a custom persistentdatatype from the item

unborn island
#

so you know when you go onto server.pro and click browse plugins and you can choose spigot or bukkit plugins well that wont show up and now I cant tell which plugins are bukkit and which are spigot anyone know how to fix?

#

does that make sense?

vernal spruce
#

i was thinking of storing them into something that can get by index

grim halo
#

so itemsInside stores the content and im is the itemmeta of your backpack?

vernal spruce
#

yeah

#

idk why i used a array ngl

#

a list wouldv done same thing

#

or i might just screw it

#

and store the hole array/list inside the persistentdata

#

for more context this is the snippet

#
        ItemMeta im = backPack.getItemMeta();
        Integer uuid = im.getPersistentDataContainer().get(pl.uuid, PersistentDataType.INTEGER);
        Inventory inv = Bukkit.createInventory(null,9, Utils.asColor("&aBackPack - "+uuid));
        ItemStack[] itemsInside = new ItemStack[9];
        itemsInside[0] = im.getPersistentDataContainer().get(pl.slot0,pl.bpi);
        itemsInside[1] = im.getPersistentDataContainer().get(pl.slot1,pl.bpi);
        itemsInside[2] = im.getPersistentDataContainer().get(pl.slot2,pl.bpi);
        itemsInside[3] = im.getPersistentDataContainer().get(pl.slot3,pl.bpi);
        itemsInside[4] = im.getPersistentDataContainer().get(pl.slot4,pl.bpi);
        itemsInside[5] = im.getPersistentDataContainer().get(pl.slot5,pl.bpi);
        itemsInside[6] = im.getPersistentDataContainer().get(pl.slot6,pl.bpi);
        itemsInside[7] = im.getPersistentDataContainer().get(pl.slot7,pl.bpi);
        itemsInside[8] = im.getPersistentDataContainer().get(pl.slot8,pl.bpi);
        for(int x = 0;x<9;x++){
            inv.setItem(x,itemsInside[x]);
        }

        opened.add(inv);

        toOpen.openInventory(inv);

    }```
#

see that wall of shit i want to get rid of that

grim halo
#

I think you should just do that... i mean there is a way to automate the index stuff but you should
just convert the itemstack array to a Base64 String and save it

vernal spruce
#

im breaking it into byte arrays storing it then converting it back

#

well time to modify it i guess

quick arch
#

🤔

#

you can compress those byte arrays and then turn it into a string, and save it

grim halo
#

pl.slot is the namespacedkey right?

quick arch
#

seems so

lone fog
#

You could make that a loop

quick arch
#

^

#

or you could save the whole inventory and use 1 namespacedkey

vernal spruce
#

thats what im gonna do

#

simply store all inside 1 rather than splitting them

soft fable
#

Can someone help me with this error i got. The error i am getting is when I am looking at a LOG, I want it to break but it doesn't but spam errors https://sourceb.in/3e84f9bfe6

#

Plugin plugin; is this it?

frigid ember
#

not set to any value tho

grim halo
#

first line in onEnable: pluigin = this
Which is pretty much obsolete because you can just use "this" instead of "plugin" as it points to the instance you are in

frigid ember
#

oh yea this is the main class

dusky sigil
#

I want to check if the string already exists in config. Tried to do if (FileConfiguration.contains(args[0])) but im getting an error: Cannot make a static reference to the non-static method contains(String) from the type MemorySection Main.java /Factions/src/net/FlashPlex/Factions line 20 Java Problem

frigid ember
#

u dont even need it

#

u cant use this in the runnable?

quick turtle
#

I think there is a way

#

ive seen it before

timber prairie
#

Hello.
I have an error, what disables me, to join to the server.
The error:
When I try to join, the game is still thinking to join, but it failes every time, and kicks me with the reason io.netty.channel.AbstrackChannel$AnnotatedConnectionExpection. Can someone help me please?

grim halo
#

Oh didnt read everything... anonymous class woops

quick turtle
#

CLASS.this.<>

#

Class being the name of your class that the runnable is in

dusky sigil
#

anyone has any idea about my error?

soft fable
#

WOW, It worked. I am so dumb, Thanks guys (again)

frigid ember
#

we all make mistakes in the heat of passion jimbo

dusky sigil
#

PASSION

quick turtle
#

@frigid ember You can actually access the this of a class even in a lambda

frigid ember
#

no but this then points to the runnable

quick turtle
#

Class.this

frigid ember
#

instead of the main class

grim halo
#

Yes.This happens if you use static and dont know what it actually does/means.
Pls show us some code @dusky sigil

quick turtle
#

Nah You use MainClass.this

#

well whatever class name that has the runnable

vernal spruce
dusky flare
#

hi guys

quick turtle
quick arch
#

👀

frigid ember
#

tf

dusky sigil
#
package net.FlashPlex.Factions;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {
    
    @Override
    public void onEnable() {
        getConfig().options().copyDefaults(true);
        saveConfig();
    }
    
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (label.equalsIgnoreCase("after")) {
            if (FileConfiguration.contains(args[0])) {
                
            }
            getConfig().set("faction.name", args[0]);
        }
        return false;
    }
}``` im just starting this plugin out
dusky flare
#

i need ur help with something

frigid ember
#

never seen this usedlike that before

timber prairie
#

Hello.
I have an error, what disables me, to join to the server.
The error:
When I try to join, the game is still thinking to join, but it failes every time, and kicks me with the reason io.netty.channel.AbstrackChannel$AnnotatedConnectionExpection. Can someone help me please?

vernal spruce
#

as im lazy

quick arch
#

oh I'm using zstd for it

#

Insanely good

dusky flare
#

i wana chang my aternos server with freenom

quick turtle
#

aternos

dusky flare
#

so can any one help me ?

timber prairie
#

i wana chang my aternos server with freenom
@dusky flare impossible.

dusky sigil
#

@frigid ember thanks.

dusky flare
#

@timber prairie no can

quick arch
#

btw, that's 36 items with 2500 lores

timber prairie
#

{...} Does the issue occur when no plugins are loaded?
Yes.

quick arch
dusky flare
#

@timber prairie cuz my friend changed his aternos ip to
data.tk

timber prairie
#

gud

quick arch
#

that's just a redirection

dusky flare
#

wanna see

timber prairie
#

And why are you adversiting?

dusky flare
#

?

#

@timber prairie 😒😒😒

timber prairie
#

Böööh. Suttyó féreg.

quick turtle
#

@quick arch the real genius plan is using worldguard flags to define region traps

quick arch
#

what

dusky flare
#

طز

#

هاهاه

quick turtle
#

vehicle-place in base_pink means theres an alarm trap

vernal spruce
#

wrong tag?

quick turtle
lone fog
#

Why not at least use custom flags :p

quick arch
dusky flare
#

@frigid ember no thats a domain name

quick turtle
#

thats a thing?

vernal spruce
lone fog
#

mhm

quick turtle
#

pog

timber prairie
#

@frigid ember yes. The thing is coming up, when no plugins loaded. I have already reistalled the server, but still the same thing. I have tried to modify the Bungee config, but nothing. Whatever, version is 1.8.8 (spigot).

vernal spruce
#

were 200iq boys we can handle even more

timber prairie
#

...

dusky flare
#

look guys i really need help

timber prairie
#

Server IP is not set, because it's a premade...

#

So nothing.

vernal spruce
#

also anyone know if this is called if a player throws the item right out of the inventory?

timber prairie
#

(I'm making a premade, because why not)

#

(Actually I can't read the server)

vernal spruce
#

yeah but will it still get called

#

when i click Q on a item

wraith thicket
#

No

vernal spruce
#

hmm

timber prairie
#

(kicks me with "Elérési időtúllépés", so "ReadTimeout")

wraith thicket
#

That methodevent gets called when an inventory moves an item

vernal spruce
#

thats gonna be a nnoying

wraith thicket
#

I.e a hopper

quick arch
#

You can just listen to the inventory click event

vernal spruce
#

might not cover all

#

need some mins to think of some sort of anti dupe logic

#

for the backpack now

wraith thicket
#

The point is, the InventoryMoveItemEvent has nothing to do with player inventories

sturdy oar
#

Guys I'm having so many issues with an event i think this time I'll need your help

quick arch
#

cancel everything and just check if the click is allowed then

#

🤔

vernal spruce
#

@wraith thicket not even relation between

#

player inventory = custom inventory

#

Called when some entity or block

#

then whats with the entity