#help-development

1 messages · Page 1743 of 1

dull sparrow
#

I don't know why I put ignoredCancelled = true, it just hit me actually hahaha

#

Cheers

young knoll
#

You need to be holding an item as well

dull sparrow
#

Yes luckily im checking if an item is right clicked so that works

#

thank you though

subtle kite
#

If I am tracking a player placing down a block. What even do I use?

vague oracle
#

Blockplaceevent

subtle kite
#

Maybe because I made a itemstack, it is not working.

dull sparrow
#

event.getItem() gets the itemstack in the hand just before it’s placed, if this is what you mean?

subtle kite
#

ok , thanks I needed to do.
event.getItemInHand().getItemMeta().equals()

quaint mantle
#

dont use equals on the meta

#

use it on the item

young knoll
#

isSimilar

subtle kite
#

does this apply if I'm not using a normal mc block

patent horizon
#

do i have to delete an inventory after creating one for a player?

#

because it seems like every time i reopen an inventory, the event gets called +1 more times than the last

quaint mantle
#

what

subtle kite
#

I think he is saying he is stacking items every time a gui is being open

#

so like on open add 1 stick

patent horizon
#

no

subtle kite
#

ok

patent horizon
#

the events are stacking

quaint mantle
#

send code

hardy agate
#

how do you sendMessage() with a custom color?

patent horizon
#

ChatColor.translateAlternateColorCodes

quaint mantle
patent horizon
#

oh custom color

young knoll
#

Hex colors are ChatColor.of

hardy agate
#

I want orange, but spigot does not have orange

quaint mantle
#

its gold

#

or just use hex

#

ChatColor.of

hardy agate
#

receiver.sendMessage(TextCompoent.setColor(ChatColor.of("#7375ff")) + text);

patent horizon
hardy agate
#

thats what the spigot help said to do

quaint mantle
hardy agate
#
receiver.sendMessage(ChatColor.of("#7375ff") + text);
patent horizon
#

idk

hardy agate
#

that's new code

quaint mantle
#

just save it

patent horizon
#

i just skimmed through a tutorial

#

save it?

quaint mantle
#

as a variable

hardy agate
young knoll
#

You using the bungee import?

hardy agate
#

aperently

young knoll
#

Doesn't sound like it

patent horizon
hardy agate
#

import net.md_5.bungee.api.chat.TextComponent;

#

^ that's what I have

hardy agate
#

I have no idea

#

but I presume the latest

young knoll
#

You don't know what version your server is running?

quaint mantle
#

tip

        List<String> lore = new ArrayList<>();
        List<String> coloredLore = new ArrayList<>();
        lore.add("&7Open special booster packages containing"); lore.add("&7electrifying and spooky rewards!"); lore.add("&7"); lore.add("&fYou have &6"+ packageCount + " &fspooky packages." ); lore.add("&7"); lore.add("&7Click to open a spooky package.");
        for (String loreLine : lore) coloredLore.add(ChatColor.translateAlternateColorCodes('&', loreLine));

vvv

List<String> lore = Arrays.asList(
              "&7Open special booster packages containing",
              "&7electrifying and spooky rewards!",
              "&fYou have &6" + packageCount + " &fspooky packages.",
              "&7Click to open a spooky package.")
    .stream()
    .map(str -> ChatColor.translateAlternateColorCodes('&', str))
    .collect(Collectors.toList());
hardy agate
#

/ver says I'm running the latest version

young knoll
#

What version of the game do you launch when you go to join your server

hardy agate
#

oh game version

patent horizon
#

i havent tried streams yet

hardy agate
#

1.17.1

#

I though you meant java version

young knoll
#

Then you should have access to said method

hardy agate
#

eclipse ide would like to disagree

#

so you're saying it will work, despite the error?

young knoll
#

Well no, that isn't how compile errors work

hardy agate
#

ok

young knoll
#

But I can assure you the method exists

hardy agate
#

so just disregard the red

young knoll
#

Still not going to compille

hardy agate
#

so then how do I get rid of said error

young knoll
#

Are you for some reason developing against an older spigot api

hardy agate
#

nope

#

spigot-1.17.1.jar

#

so your autocomplete says that it will accept a string

#

but mine said you can't

golden turret
#

which is the packet sent right after the player joins (for load the map)

patent horizon
quaint mantle
#

whats the point

young knoll
golden turret
#

hm

patent horizon
quaint mantle
#

i dont understand

#

oh i get it

patent horizon
#

if i save the inventory to a variable, it'll save the items that contain lore with old var values

#

yeah

hardy agate
golden turret
#

or just heir positions

young knoll
#

Part of map chunk

#

Consult the protocol wiki

patent horizon
# quaint mantle i dont understand

i assume that's why the events are stacking every time i make an new inventory, because the server thinks the old inventories still exist and they meet the requirements for the event

quaint mantle
#

makes sense

young knoll
#

I don't think that is quite how this works

patent horizon
#

is there a way to delete an inventory?

quaint mantle
#

what you can do is

public class InventoryContainer implements Listener {
    private final Set<UUID> uuids = new HashSet<>();

    public void addUuid(UUID uuid) {
        uuids.remove(uuid);
    }

    public boolean isInventory(UUID uuid) {
        return uuids.contains(uuid);
    }

    public void remove(UUID uuid) {
        uuids.remove(uuid);
    }

    @EventHandler(ignoreCancelled=true, priority=MONITOR)
    public void onInventoryClose(InventoryCloseEvent event) {
        uuids.remove(event.getPlayer().getUniqueId());
    }
}
#

so you arent checking any conditions on the inventory itself

#

just the player

young knoll
#

Recreating an inventory has never caused issue for me

quaint mantle
#

when you create the inventory, you just add the player's uuid to this container

young knoll
#

It should be impossible for it to fire on multiple inventories, since the player may only have 1 inventory open at a time

quaint mantle
young knoll
#

It should still only fire on the open instance

#

Since that is the one you are clicking on

quaint mantle
#

he means for multiple people

patent horizon
#

no?

quaint mantle
#

then whats your problem 🤨

patent horizon
#

its stacking events

#

im not sure why

#

i had a theory

quaint mantle
#

are you making the listener more than once?

patent horizon
#

no

unreal quartz
#

where’s wally

patent horizon
#

😐

#

i get that joke too much to be funny anymore

quaint mantle
#

"imagine dragons"

unreal quartz
#

only solution is to change your name

quaint mantle
#

"imagining developing?"

#

Yes.

golden turret
#

i just need the position of each block

young knoll
patent horizon
#

how can i log when an instance of something is created

quaint mantle
#
public class MyClass {
    {
        Bukkit.getLogger().info("NEW INSTANCE");
    }
}
floral kindle
quaint mantle
#

whats this supposed to do

young knoll
#

Is all caps the new standard for Javadocs

#

It's a click combo activation system

#

Like Wynncraft

unreal quartz
#

well it’s not in a class so that ain’t compiling

young knoll
#

It's also all static

unreal quartz
#

position looks like it makes more sense as an int

young knoll
#

Also that way of storing things in the map is very strange

unreal quartz
#

you have three nested ifs for whatever the hell combotype is meant to be

#

it’s a mess really

young knoll
#

Storing 4 keys for each player, rather than mapping a single key to some form of data holder class

unreal quartz
#

why not write

young knoll
#

Single letter constants

unreal quartz
#

LEFT, RIGHT, SHIFT

#

rather than leaving a comment

patent horizon
#
        ItemStack openPackage = CreateCustomSkull.createSkull("ZGQzMTE3M2U3YjdjNzhlNWU0OGRjZmY2NmQ1Nzk4MGFlY2EzODI0Y2Q4NTg0YWFjNDZkNzdjMjYwYzM4YmI0YyJ9fX0=");
        openPackage.getItemMeta().setDisplayName(ChatColor.translateAlternateColorCodes('&', "&6Open a package"));

        GUI.setItem(11, openPackage);```
would anyone know why none of the ItemMeta i add to my items gets added?
young knoll
#

Because getItemMeta is immutable

unreal quartz
#

get item meta returns a copy

young knoll
#

Hence the existence of setItemMeta

patent horizon
#

ah

#

oh right

#

setItemMeta

#

100 IQ

ivory sleet
#

Quality of the code?

young knoll
#

Code is a bit wack, but hey it works

#

Using a 4 combo gives a lot more options than wynncraft’s 3

floral kindle
young knoll
#

Just use a custom class as the value

#

And have an array in that class

floral kindle
golden turret
young knoll
#

There’s a link to it in the chunk data packet section

golden turret
#

thanks

#

that is really interesting

#

but now im stuck with a long

#

in need to conver it to positions

young knoll
#

You’ll just want to take the chunk x and z and then add to that based on the index

golden turret
#

🤔

#

tomorrow i will back here

rancid pine
#

how can i find creeper movement speed and edit it

#

is it in the metadata?

young knoll
#

it’s an attribute

#

getAttribute

rancid pine
#

thanks

midnight crow
#

Hey guys, where should plugin.yml be saved?

#

under src?

#

I'm getting a "jar does not contain plugin.yml"error

rancid pine
#

i think its under the main package

#

but idk im new

midnight crow
#

src/main then?

subtle kite
#

for me it is in the resources folder

midnight crow
#

I don't have a resources folder

#

Working in Maven

#

in VScode

subtle kite
#

where is your config file?

midnight crow
#

I don't think I have that either

rancid pine
summer scroll
#

So I have a plugin that use mysql as the database and I want to add couples of column to the database without creating any issues to my plugins user, how can I do that?

cold pawn
#

How can I make an editor mode that gets what a player types in chat and returns something back based on what they type or uses what they type for something else.
Kind of like what item edit dose?

#

Srry for the shit explination

summer scroll
cold pawn
#

why didn't I think of that lol

summer scroll
young knoll
cold pawn
#

Its insert

#

Or do you mean smthing else? Cause it might be alter

summer scroll
#

I think it's alter.

cold pawn
#

alr

summer scroll
#

How can I check if the table or column is exist?

cold pawn
#

True

cold pawn
young knoll
cold pawn
#

ok

summer scroll
cold pawn
#

Yeah your right

#

Did the wrong one

golden turret
#

hack: try selecting somethibg from the table

#

or the column

#

and get the Exception message

summer scroll
#

What about DatabaseMetaData#getColumns

#

You can get it from Connection#getMetaData

pine island
#

I am using economy.getBalance() to get balance of a player but i want to subtract but the problem is i have to use economy.format(economy.getBalance); but this can only be in a string any good way to fix?

young knoll
#

What

pine island
#

I want to subtract 15K from a str

young knoll
#

Subtract it before you turn it into a string?

pine island
#

Nope it has to be a string or it will givea error

#

It also says that Economy is Invalid

young knoll
#

Then you’ve done several things wrong

#

getBalance should return a number which you can easily add and subtract

#

Once you are done with that you can pass it to format to make it into a string

pine island
#

Sending my code & u will know what i mean

#


import me.lumina.hardcorepurge.HardcorePurge;
import net.md_5.bungee.api.ChatColor;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;


public class purge implements CommandExecutor, Listener {



    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args ){





        if (sender instanceof Player){
            Economy economy = HardcorePurge.getEconomy();
            Player player = (Player)sender;
            String bal1 = economy.format(economy.getBalance(player));
//purge
            if (cmd.getName().equalsIgnoreCase("purge")){
                String PlayerName = player.getName();


                 String bal = economy.format(economy.getBalance(player));
                if (bal1 - 15000 == bal){

                    Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(),"gamemode survival " + PlayerName);
                    Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(),"tp " + PlayerName + " ~ ~5 ~");
                    sender.sendMessage(ChatColor.GOLD + "<-(!)You have spent 15K & you are now back to life->");
                }
                else{
                    sender.sendMessage(ChatColor.RED + "<-(!)Not enough Money->");
                }


            }
        }

        return true;
    }




}
```\
young knoll
#
double balance = economy.getBalance()
balance -= 15000
String balanceString = economy.format(balance)
pine island
#

Ok got it ty!

midnight crow
#

Hey guys, I'm getting this error when I'm trying to utilize the IF library: java.lang.NoClassDefFoundError: com/github/stefvanschie/inventoryframework/gui/type/ChestGui

#

So I'm not sure what the issue is

summer scroll
midnight crow
#

Yep:

#
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.1.0</version>
          <configuration>
              <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
              <relocations>
                  <relocation>
                      <pattern>com.github.stefvanschie.inventoryframework</pattern>
                      <shadedPattern>com.dyno.inventoryframework</shadedPattern>
                  </relocation>
              </relocations>
          </configuration>
          <executions>
              <execution>
                  <phase>package</phase>
                  <goals>
                      <goal>shade</goal>
                  </goals>
              </execution>
          </executions>
        </plugin>```
summer scroll
#

decompile your output jar and see if the class that you shaded is there, if not then it's not shaded properly i guess.

pine island
# young knoll ``` double balance = economy.getBalance() balance -= 15000 String balanceString ...
            Economy economy = HardcorePurge.getEconomy();
            Player player = (Player)sender;
            double bal1 = economy.getBalance(player);
//purge
            if (cmd.getName().equalsIgnoreCase("purge")){
                String PlayerName = player.getName();
                
                bal1 -= 15000;
                String balanceStr = economy.format(bal1);


                 String bal = economy.format(economy.getBalance(player));
                if (Objects.equals(balanceStr, bal)){

                    Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(),"gamemode survival " + PlayerName);
                    Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(),"tp " + PlayerName + " ~ ~5 ~");
                    sender.sendMessage(ChatColor.GOLD + "<-(!)You have spent 15K & you are now back to life->");
                }
       ``` is this correct?
midnight crow
#

Not sure how to fix it though, unfamiliar with shading in general

summer scroll
#

can i get your full pom.xml?

midnight crow
#

Sure

#

Can't post file

summer scroll
#

?paste

undone axleBOT
midnight crow
#

It's basically just the maven quickstart template

summer scroll
#

idk what does the <pluginManagement> do but I think that's the problem.

midnight crow
#

Alright I'll try without all that

midnight crow
summer scroll
#

The dyno-1.jar

#

original is the jar without the shade file

#

and the rest is with the shaded file

midnight crow
#

"the rest"?

torn shuttle
#

what's a clever way of slowly dragging a raytrace after a target point with a limited angle between each raytrace to give is a follow effect?

#

the only solutions I can think of involve doing a lot more rotations than I'd like to do and that might be because I'd rather go to bed at this point

summer scroll
# midnight crow "the rest"?

dyno-1.jar and dyno-1-shaded.jar is the same i think, and you want to use the jar with the shaded file included

quaint mantle
midnight crow
summer scroll
midnight crow
#

Wonder why they return 2 then

#

huh

#

Alright thanks

last ledge
#
            Evoker evoker = (Evoker) event.getEntity();

            Wither wither = (Wither) evoker.getLocation().getWorld().spawnEntity(evoker.getLocation().add(0.5, 0, 0.5), EntityType.WITHER);
            wither.setCustomName(ChatColor.translateAlternateColorCodes('&',"&cThe Boss"));
            wither.setCustomNameVisible(true);
            wither.getBossBar().setColor(BarColor.RED);
            wither.setMetadata("Boss", new FixedMetadataValue(plugin, "witherr"));
            wither.setHealth(1000);

        }```
#

i want to kill the existing Vex

#

when Evoker dies

#

how do i do it

midnight crow
#

Do you guys have any recommendations for guides regarding mySQL implementation?

steady smelt
#

if (item_data.has(new NamespacedKey(Main.getPlugin(), "cool"), PersistentDataType.STRING)) {}
lets say i have an item with the {"plugin:amazing":"cool"} tag, what does it detect

midnight crow
#
jar: null: IllegalArgumentException -> [Help 1]``` Any ideas behind why this is happening?
#

?paste

undone axleBOT
midnight crow
noble lantern
#

That i am 100% offended by your class name

#

I shall now make a 20 minute long rant on my youtube about it

quaint mantle
#

can someone help me i got a problem on my server. When other players make a nether portal on a completely different world and when they get back into that same portal they came out of it makes another portal in my main world just outside of spawn!

royal hawk
#

Guys im have this code create npc. How add item to hand with nms.

I try add item

CraftLivingEntity cle = npc.getBukkitEntity();
        ItemStack itemstack = new ItemStack(Material.DIAMOND_SWORD,1);
        cle.getEquipment().setItemInMainHand(itemstack);
        npc = (EntityPlayer) cle.getHandle();

but not work

onyx shale
#

pretty sure your not supposed

stone sinew
onyx shale
#

to convert it back to nms from bukkit entity

#

hes doing it the raw way

#

not packet based

royal hawk
onyx shale
#

as i said

royal hawk
onyx shale
#

your casting nms to bukkit entity

royal hawk
#

packet PacketPlayOutEntityEquipment?

onyx shale
#

once created just use the api to set the equipment

royal hawk
#

I send packet the incorrectly, I sent it before it appeared, which prevented the item from being issued

old cloud
#

Hello, whats the difference between BlockPlaceEvent#setBuild(false) and BlockPlaceEvent#setCancelled(true)?

old cloud
#

Ok I found out that setCancelled does nothing, so the player can still build and setBuild can prevent it

#

Still wondering what setCancelled does now

onyx shale
#

simply stop the placement

old cloud
#

But it doesnt do that

onyx shale
#

yes it does..

old cloud
#

ur right it does

#

Ok then different question, why 2 methods for the same thing?

onyx shale
#

go to the method

#

and see the description

old cloud
#

That isnt very helpful

onyx shale
#

look above it

old cloud
#

I know what it does but that was not my question

meager raptor
#

nvm

#

found reason

quaint mantle
#

i have a question, the javaplugin.getDataFolder()

#

what is the path

#

"./plugins/pluginname" ?

#

cause i want to make ymls store in for example "./plugins/pluginname/files"

stone sinew
#

Will new NBTTagCompound().getKeys() be null or empty?

quaint mantle
eternal night
stone sinew
#

👍

nova grove
#

I need to save some data but I don't know what the best way to do it is.
I'm saving 2 separate bits. The first is a collection of characters and strings that go togeather. And some bools.
What would the best way to save this data be?

stone sinew
#

Usually json or yaml but if its player/entity based you can probs get away with PersistentDataContainer.

nova grove
#

Thanks.

stone sinew
#

np

quaint mantle
#

    public void respawnEvent(Player p) {
        Random aba = new Random();
        int abas = aba.nextInt(100);
        if (abas == 1) {
            return;
        }
        List<String> a = new ArrayList<>(getConfig().getConfigurationSection(path).getKeys(false));
        Random aa = new Random();
        int ab = aa.nextInt(Math.max(a.size() - 1, 1));
        for (String abb : getConfig().getStringList(path + a.get(ab) + ".messages"))
            p.sendMessage(chatcolor(abb));
        p.sendTitle(some messages here, some more, 20, 60, 20);
    }```

so basically im making a random thing...
so first random `aba` is to check if the number is 1 (for 1% chance to get the easter egg message)
if it is not then it will go to the next random which is for getting the normal random messages
#

i feel like it is kinda messy

#

so uhh

#

do we have any ways to make it less messy?

steep comet
#

Can you please share some example of AsyncPlayerPreLoginEvent with me? I am not experinced with async code in Java.. I need to make HTTP request and only if it returns data i want, only then I want to let player access the server.. While waiting for HTTP response, I want player to be waiting - not joined.

How do I hook it into AsyncPlayerPreLoginEvent?

stone sinew
stone sinew
quaint mantle
stone sinew
# quaint mantle no, both aren't the same random
public void respawnEvent(Player p) {
    Random aba = new Random();
    if(aba.nextInt(100) == 1) return;

    List<String> a = new ArrayList<>(getConfig().getConfigurationSection(path).getKeys(false));
    int ab = aba.nextInt(Math.max(a.size() - 1, 1));
    getConfig().getStringList(path + a.get(ab) + ".messages").forEach(string -> p.sendMessage(chatcolor(string))
    p.sendTitle(some messages here, some more, 20, 60, 20);
}
ivory sleet
quaint mantle
# stone sinew ```java public void respawnEvent(Player p) { Random aba = new Random(); ...

uhh tks, actually before the return im gonna do another

    List<String> a = new ArrayList<>(getConfig().getConfigurationSection(path).getKeys(false));
    int ab = aba.nextInt(Math.max(a.size() - 1, 1));
    getConfig().getStringList(path + a.get(ab) + ".messages").forEach(string -> p.sendMessage(chatcolor(string))
    p.sendTitle(some messages here, some more, 20, 60, 20);```
so i can have more multiple message lol
ivory sleet
#

Unless you have a very good reason not to ofc

eternal night
#

ThreadLocalRandom 🙏

quaint mantle
stone sinew
ivory sleet
steep comet
stone sinew
#

You use the same instance and just initialize a new variable

quaint mantle
#

yeah im dumb lol

#

i forgot....

#

that

quaint mantle
#

thanks man

steep comet
#

Great thanks. Hero! 🙏

stone sinew
#

You can set the timeout in the spigot.yml

quaint mantle
#

Wait this is so messy... lol

    public void respawnEvent(Player p) {
        Random aba = new Random();
        int abas = aba.nextInt(100);
        if (abas == 1) {
            List<String> a = new ArrayList<>(getConfig().getConfigurationSection("respawn-easter-eggs").getKeys(false));
            int ab = aba.nextInt(Math.max(a.size() - 1, 1));
            for (String abb : getConfig().getStringList("respawn-easter-eggs." + a.get(ab) + ".messages"))
                p.sendMessage(chatcolor(abb));
            p.sendTitle(chatcolor(getConfig().getString("respawn-easter-eggs." + a.get(ab) + ".title")), chatcolor(getConfig().getString("respawn-easter-eggs." + a.get(ab) + ".subtitle")), 20, 60, 20);
            return;
        }
        List<String> a = new ArrayList<>(getConfig().getConfigurationSection("respawn").getKeys(false));
        int ab = aba.nextInt(Math.max(a.size() - 1, 1));
        for (String abb : getConfig().getStringList("respawn." + a.get(ab) + ".messages"))
            p.sendMessage(chatcolor(abb));
        p.sendTitle(chatcolor(getConfig().getString("respawn." + a.get(ab) + ".title")), chatcolor(getConfig().getString("respawn." + a.get(ab) + ".subtitle")), 20, 60, 20);
    }```
#

....

stone sinew
quaint mantle
stone sinew
quaint mantle
#

dududududu

#

it is time to disappear because im dumb...

eternal night
#

also concerning your logic is doubled after you select your List of strings, just isolate that

#

well and the title

quaint mantle
#

dont worry

#

im redo-ing it

#

will be less messy i hope

eternal night
#
final List<String> messages = new ArrayList<>();
String title = "";

if(ThreadLocalRandom.current().nextInt(100) == 1) {
  messages.addAll(getConfig().easterEggs)
  title = ....
} else {
  messages.addAll(getConfig().normal)
  title = ....
}
stone sinew
#

So I've always used reflection in my NBT class but In my more recent plugins I only support latest version so figured I would ditch reflection for the performance lol
Is this clean enough?
https://pastebin.com/LxjLBAgL

eternal night
#

any reason getTag does not return NBTTag ?

stone sinew
eternal night
#

NBTTagCompound don't directly store those tho do they ? They store those wrapped

#

E.g. through NBTTagString

stone sinew
#

🤷 I don't have any problems with how its currently written

eternal night
#

o.O does casting it directly to a string actually work

#

yea, the NBTTagCompound method returns a NBTBase

#

if you cast that directly to a string/list/integer you'll explode

stone sinew
eternal night
#

I mean, one is the SNBT representation

#

but we aren't talking about SNBT here

#

in.getTag(i, "Enchantments") does not return you a List<Enchantment>

stone sinew
#

True but then I have to go through all object types lol Enchants, ItemFlags, Booleans, Custom tags etc...

#

Most nms methods allow json though and the NBT for enchantments is a json string so thats pretty close

eternal night
#

I'd be careful with calling SNBT json

#

anyway, I digress. If it works it works /shrug

stone sinew
#

Yeah I can only test it with me adding like ItemNMS.get().addTag(ItemStack, "Test", -123); and then getting that tag with the getTag method. Don't currently have any other plugins that add tags that aren't either an int or a string

little trail
#

whats the best way to initialise a websocket and keep it alive

#

note that i am creating the server it connects to as well

stone sinew
#

I just used a thread and serversocket.

true perch
#

I want to make my own vote listener. Votifier says I can compile a listener by "including Votifier in the class path" using: javac -cp Votifier.jar FlatfileVoteListener.java
How do I do this?

true perch
#

Would I just add it as an external library?

last ledge
#

the Skeleton Stopped spawning

fallow merlin
#

How do I use the deobfuscated mappings in intellij?
eg:

EntityLiving.bP.a -> EntityLiving.goalSelector.a();
EntityLiving.bQ.a -> EntityLiving.targetSelector.a();
quaint mantle
#

ChatColor.translate alternative color codes?

#

idk

#

i dont think it would work after add it

#

but just try lol

last ledge
#

no doesnt

quaint mantle
fallow merlin
#

?

#

plz elaborate idk what that is

quaint mantle
#

A maven plugin which allows you to develop spigot plugins with mojang mappings

fallow merlin
#

sounds like what im lookin for

#

where do i get it?

quaint mantle
#

with what

paper viper
#

no

#

Lol

ivory sleet
#

Tho verbose name nowadays,
RandomGenerator.SplittableGenerator catup

hearty zephyr
#

hello

#

how can i upload my plugin

quaint mantle
#

what is the equivalent of entity.passengers from 1.16 in 1.17?

#

cause getPassengers() is an immutable collection so I cannot add a passenger thru that

#

just make yourself a lib or use an available one, it's pretty simple after I guess

deep tiger
#

Do you guys have any idea how to export dependencies from a plugin to another when they were registered using a dependency injection framework ? For instance, I have a plugin (let's say A) which need a FooService defined out of. A. This interface is implemented in a plugin B. A depends on B. That means that B is loaded before A. In B, I tell the injection framework that FooService is implemented by FooServiceImpl. And I'd like to use FooService in A

ivory sleet
#

What DI framework is it?

eternal night
#

also how is B loaded before A if the plugin B is depending on a class (and hence the classloader) of plugin A as B definitely needs to depend on FooService which is part of A?

hearty solar
#

hello

#

i have the code below:

#
@EventHandler
    public void onWorldChange(PlayerChangedWorldEvent event) {
        currentWorld = event.getPlayer().getWorld();
        Player player;
        player = event.getPlayer();
        if(currentWorld.getName() == "bwlobby")
        {
            PlayerInventory inv = player.getInventory();
            inv.clear();
            ItemStack compass = new ItemStack(Material.COMPASS, 1);

            ItemMeta im = compass.getItemMeta();

            im.setDisplayName("§6Game Navigation §7[Use]");

            compass.setItemMeta(im);

            inv.setItem(4, compass); //Slot 1 = 0

        }
    }
#

i want when player went to world bwlobby

#

it will be given a compass

tardy delta
#

sometimes finding names for a class goes brr

eternal night
#

string comparison using == will not work too well

#

use .equals

hearty solar
#

but i used multiworld and tp to the world it did not give

hearty solar
#

currentWorld.getName().equals("bwlobby")

#

?

eternal night
#

yea

tardy delta
#

yes

hearty solar
#

alright lemme try

hearty solar
#

to player

#

help

#

i use multiworld command mw goto bwlobby

#

but my inventory still empty

last ledge
#
        saveDefaultConfig();```
when i change value in config
it doesnt change
in game
and when i restart
config goes to default value
  ```  @Override
    public void onDisable() {
        saveConfig();
        // Plugin shutdown logic
    }```
i have this too
opal juniper
#

you need to do like getConfig().addDefault(key, value) or something

eternal oxide
#

no

opal juniper
#

wait

eternal oxide
#

don;t set defaults unless you really know what you are doing

opal juniper
#

i misunderstood

hearty solar
eternal oxide
undone axleBOT
hearty solar
#

i changed my code to this:

 @EventHandler
    public void onWorldChange(PlayerChangedWorldEvent event) {
        event.getPlayer().chat("onWorldChange executed.");
        currentWorld = event.getPlayer().getWorld();
        Player player;
        player = event.getPlayer();
        if(currentWorld.getName().equals("bwlobby"))
        {
            event.getPlayer().chat("worldislobby executed.");
            PlayerInventory inv = player.getInventory();
            inv.clear();
            ItemStack compass = new ItemStack(Material.COMPASS, 1);

            ItemMeta im = compass.getItemMeta();

            im.setDisplayName("§6Game Navigation §7[Use]");

            compass.setItemMeta(im);

            inv.setItem(4, compass); //Slot 1 = 0
            event.getPlayer().chat("item given executed.");
        }
    }
hearty solar
#

but when i use multiworld plugin and changed world, none of the event.getPlayer().chat("");

#

was runned

eternal oxide
#

I don;t see you changing anything in the config there

last ledge
river spear
#

How can I sort locations from a list in such a way that when I look to the east, the back blocks are looped first and the front blocks at the end

eternal oxide
#

that doesn't change anything in the config

#

You are only reading from the config

last ledge
#

so.. what do i do..

eternal oxide
#

Well, what are you trying to do?

last ledge
#

i am trying to set my skeletons custom name from config

eternal oxide
#

does this path exist in your config? Bossname.Skeleton

last ledge
#

yes

#
Bossname:
  Skeleton: '&cSaviour'
  Wither: 'The Boss'
BossMaxHealth:
  Skeleton: '300'
  Wither: '1000'
eternal oxide
#

looks fine

last ledge
#

i set something in config and save it

#

and when i refresh the page

#

the config has default value

eternal oxide
#

?paste your config

undone axleBOT
eternal oxide
#

You have yet to show me any code that is altering your config

last ledge
#

i am only trying to String s = config.getString("Bossname.Skeleton"); skeleton.setCustomName(s)

eternal oxide
#

IF that is the actual config.yml that is being saved into your plugins folder then there is no reason that code should not work

#

that code is only reading from yoru config. its not making any changes

last ledge
#

no leme show u

#
            skeleton.setCustomName(s);```
#

it reads

#

and stores in String s

eternal oxide
#

yes

last ledge
#

then i use String s

#

to change name

#

of skeleton

eternal oxide
#

it does NOT change anything in yoru config

last ledge
#

yes so how do i change

eternal oxide
#

is yoru Skeleton getting that name correctly set?

last ledge
#

yes default value is being shown correctly

eternal oxide
#

if you want to change the value in the config config.set("Bossname.Skeleton", "new name here");

last ledge
#
            config.set("Bossname.Skeleton", s);
            skeleton.setCustomName(s);```
#

this should work?

eternal oxide
#

thats pointless

#

you are reading the value from the config, then putting it straight back in, exactly the same and unchanged

last ledge
#

config.set("Bossname.Skeleton", "new name here");

#

where do i put this then

eternal oxide
#

what are you trying to change the name to?

last ledge
#

the one in config

eternal oxide
#

um, you are going in circles and making no sense

last ledge
#

leme explain you

#

my default skeleton name is "Saviour"

#

and it shows the default name correctly

#

now i want, players to easily change the name of skeleton from config itself

#

so i tried changing name from config

#

but doesnt work

eternal oxide
#

you mean you manually tried editing the config.yml while the server was running?

last ledge
#

yes and i reload too

#

still doesnt work

eternal oxide
#

ok, your issue then is that you are performing a saveConfig() in yoru onDisable

#

thats overwriting yoru file changes with the default you have in memory

last ledge
#

so what do i do

eternal oxide
#

add a command to allow admins to change teh name in game

#

letting users edit the yaml by hand is always a disaster

last ledge
#

no, i want to change from my config itself

#

how do i do it

eternal oxide
#

if you alter teh file manually you have to call reloadConfig() after you have edited it

hardy agate
#
package me.theeyeofthepotato.stats;

import java.util.ArrayList;
import java.util.List; 

import com.mojang.brigadier.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;

public class StatTab implements TabCompleter {
    
    List<String> arguments = new ArrayList<String>();
    
     public List<String> onTabComplete(CommandSender sender, Command cmd, String label,  String[] args) {
         if (arguments.isEmpty()) {
             arguments.add("logins"); arguments.add("playerKills");
             arguments.add("deaths");  arguments.add("mobKills"); 
         }
         
         List<String> result = new ArrayList<String>();
         if (args.length == 1) {
             for (String a : arguments) {
                 if (a.toLowerCase().startsWith(args[0].toLowerCase())) {
                     result.add(a);
                 }
             }
             
             return result;
         }
         
         
         return null;
     }
}
hardy agate
#

in the code above, I get two errors: one on StatTab, and one on Command
StatTab: The type StatTab must implement the inherited abstract method TabCompleter.onTabComplete(CommandSender, Command, String, String[])

Command Command is a raw type. References to generic type Command<S> should be parameterized

eternal oxide
#

you could probably just call it before you read teh value

last ledge
#

ok

last ledge
#

this should work?

eternal oxide
#

delete the config.set line

last ledge
#

will this work ?

eternal oxide
#

yes

last ledge
#

leme test

last ledge
#

and reload the server

#

the value changes to default one

eternal oxide
#

you don;t reload

#

just change the name in the config

#

when you spawn a boss it will use the new value

last ledge
#

doesnt work

#

still default value

eternal oxide
#

actually, as you never make any config changes in game you could just delete the saveConfig() from your onDisable

last ledge
#

k leme test

opal juniper
#

Granted

last ledge
#

its empty

eternal oxide
#

impossible

last ledge
#

it is

opal juniper
#

It doesn't seem to cover any of teh player joining shit

eternal oxide
#

unless your config.yml in your plugin jar is empty

last ledge
#

no its not

eternal oxide
#

are you adding the values into your config in onEnable or something?

last ledge
#

no

#

can i screen share somewhere?

eternal oxide
#

Then from the code you have shown, what you are describing is impossible

last ledge
#

leme screen share you

#

ok?

#

@eternal oxide

midnight crow
#

Hey guys, could someone take a look at my pom and tell me why this error might be occuring?[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project dyno: Error creating shaded jar: null: IllegalArgumentException -> [Help 1]

Here's the pom: https://paste.md-5.net/bowagohanu.xml

My suspicion is that this issue has to do with my aws-mysql-jdbc dependency, as when I remove it I didn't not get that error. How can I fix this?

eternal oxide
#

I doubt you can. I have every type of invite blocked

last ledge
#

you can send me request

#

i will accept it

tropic kelp
#

Hey, I saw in a spark profile that this uses 25% of my server tick: org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboardManager.getScoreboardScores() anyone has a idea to reduce this?

paper viper
#

where are you calling scoreboard functions

hearty solar
hardy agate
#
package me.theeyeofthepotato.stats;

import java.util.ArrayList;
import java.util.List; 

import com.mojang.brigadier.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;

public class StatTab implements TabCompleter {
    
    List<String> arguments = new ArrayList<String>();
    
     public List<String> onTabComplete(CommandSender sender, Command cmd, String label,  String[] args) {
         if (arguments.isEmpty()) {
             arguments.add("logins"); arguments.add("playerKills");
             arguments.add("deaths");  arguments.add("mobKills"); 
         }
         
         List<String> result = new ArrayList<String>();
         if (args.length == 1) {
             for (String a : arguments) {
                 if (a.toLowerCase().startsWith(args[0].toLowerCase())) {
                     result.add(a);
                 }
             }
             
             return result;
         }
         
         
         return null;
     }
}

in the code above, I get two errors: one on StatTab, and one on Command
StatTab: The type StatTab must implement the inherited abstract method TabCompleter.onTabComplete(CommandSender, Command, String, String[])

Command Command is a raw type. References to generic type Command<S> should be parameterized

eternal oxide
#

import org.bukkit.command.Command;

hardy agate
#

oooh

#

thank you!

muted crest
#

What is the best way to check if block is generated or placed by the player ?
I want to make that for a lot of block so the solution of store meta is not opti

eternal oxide
#

you have to track teh block when it is placed

#

and broken

#

either in a database or pdc of the chunk

muted crest
#

But i want to check for every bloc so if i need to store every bloc placed/broke, that will not opti

eternal oxide
#

its your only option

muted crest
paper viper
tropic kelp
leaden falcon
#

yo

#

is there a way to make a border effect for y-level

#

just like the normal worldborder has

hardy agate
#

I'm trying to make a custom command that will literally just run the arguments through the brigadier parser
example: /varm give @s stone 64
Here's my question: is there any way to do auto tab complete without going through manually and writing in every single tab complete?

steep comet
#

Inside AsyncPlayerPreLoginEvent event I waited for 200 ticks (using scheduler) and then ran event.disallow..
Problem is, spigot didnt care about my code at all and simply let player in instantly.. Never kicked

quaint mantle
#

so it doesnt occur again?

opal juniper
#

exactly

steep comet
#

Well, I need it to wait until I get my HTTP response and then decide if I want to let player into a server or not. Is that not possible? I understand 200 ticks is a long time, but my HTTP server can be delayed and it could actually take this long.. Why dies it let player into server anyway?

opal juniper
#

10 seconds later the server isn’t gonna care

#

if your method returns then it will admit them to the server

#

blocking them for 10 seconds is a TERRIBLE idea

#

they may even time out

steep comet
#

my method is async :/ If it doesnt wait for my permission and it simply lets player in, that is not what I want. I need to make sure I have HTTP response before I let player in

opal juniper
#

idk how that bit works

opal juniper
#

no http request normally takes 10 secs tho

steep comet
#

I dont want to freeze everyone on server just because someone is trying to connect and I am awaiting for response from my database.

steep comet
paper viper
#

if you're http request is taking 10 seconds, something is wrong

opal juniper
#

hence the name

#

it’s async

steep comet
#

Soo inside async event I should freeze the code until I get response from HTTP request, correct? And it would not freeze server itself?

opal juniper
#

yes and yes

#

but i hate that

#

you should put them in some sort of limbo area imo

#

where they then get put in the actual world later on

steep comet
steep comet
opal juniper
#

this is what i would do;

lean gull
#

anyone have a good tutorial for multiple config files?

opal juniper
#

on preLoginEvent:
start the http request

onJoin:
tp them to a different world / area where they are separate.
when the http request finishes then either return them to the normal world or kick them or whatever.

tardy delta
muted crest
#

Did GlassBottleFillEvent exist (or something similar)

tardy delta
#

PlayerInteractEvent

#

check the player's main hand itemstack

little trail
#

only just got this now java [17:39:45 ERROR]: Could not load 'plugins/Tooty-0.0.0-a4.jar' in folder 'plugins' org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[patched_1.17.1.jar:git-Paper-338] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:158) ~[patched_1.17.1.jar:git-Paper-338] at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:419) ~[patched_1.17.1.jar:git-Paper-338] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:287) ~[patched_1.17.1.jar:git-Paper-338] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1217) ~[patched_1.17.1.jar:git-Paper-338] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-338] at java.lang.Thread.run(Thread.java:831) ~[?:?] Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml ... 7 more

tardy delta
#

org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml 🌝

little trail
#
main: tootymc.Tooty
name: TootyMC
version: 0.0.0-a4
author: ooliver1 - Oliver WIlkes
api-version: 1.17
#

thats valid right?

tardy delta
#

put your whole package name in the main:

#

liek mine
main: io.github.FourteenBrush.MagmaBuildNetwork.MagmaBuildNetwork

little trail
#

ive been able to load it fine up until now

#

i dont get it

#

like ive only touched the version ever since it worked

#

all ive done since is deleted some files and changed one dep in the pom

#

since it worked i have deleted some files, added some code, changed version in plugin.yml, added a dependency in pom.xml

muted crest
tardy delta
#

check if the block the player clicks on is a honey block (i guess) and the player is holding a glass bottle

solid cargo
#

do you need to register event if the event is in main class?

tardy delta
#

yesh

muted crest
tardy delta
#

ah the block is probably a beehive

#

i dunno how to get honey :kekw:

muted crest
#

with block meta

tardy delta
#

smh

golden turret
#

hello, i need to get the positions of each block in the PacketPlayOutMapChunk in 1.12

#

but i dont understand about bitwise operators so i need a little help

tardy delta
#

how can i get the Door class from a block?

little trail
#

didnt i show you

tardy delta
#

i mean if its a door

midnight crow
#

Is there an argument I can add to my run.bat to stop my cmd from closing on server stop?

little trail
#

ok a recompile seemed to have fixed it

muted crest
west sail
#

Hey I have an issue with importing NMS with Maven. Everyone is saying that you should use this dependency to get Spigot with NMS libraries:

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

but this doesnt seem to exist anymore in the spigot repository https://hub.spigotmc.org/nexus/content/repositories/snapshots/.
The spigot-api dependency doesn't contain NMS. Is there any other way how to import NMS with Maven?

young knoll
#

You need to run buildtools

midnight crow
#

I have Pause but I still get the "press any key to continue" message which closes the cmd whenever I interact with it

#

How can I keep it open

west sail
young knoll
#

It puts NMS into your local maven repo

little trail
rotund pond
#

Hey !

I'd like to use the spigot event system but I don't understand the priority system.

I want my method to be called last when the event is triggered, this way I can check if it was canceled.
But I don't know which priority to give it.

Logically, it has the lowest priority. But according to the docs, if it has the lowest priority then it will be called first!

unreal quartz
#

highesy / monitor]

#

the priority system is based on which plugin should get the last say in how the event is handled

#

i.e. plugin with highest priority has the last say on whether an event shoul dbe cancelled

little trail
midnight crow
#

Hey all, I'm trying to check my database on player join to see if I have a corresponding entry to that player's UUID. Is there a listener for when a player joins?

young knoll
#

Since you are using a database I would use the AsyncPlayerPreLoginEvent

midnight crow
#

Ok, I'll check that out

little trail
lean gull
#

can someone help? i'm makin a gun in a plugin and i want to make it so you need to reload, so basically when you run out of ammo you have to wait 5 seconds, and each second it renames the item with like "GUN [5s]" or "GUN [4s]", and then when it's done reloading it will do "GUN [30]" (30 being the how much ammo you have left), but the problem is, is that the player can move the item around their inventory, or put them in containers, log off, or drop it and stuff

rancid pine
lean gull
#

okay, but how do i change the item's name and stuff

young knoll
#

ItemMeta

lean gull
#

well yeah but how do i know what slot to change and where to change and whatnot

young knoll
#

Just keep reference to the item and change that

lean gull
#

wdym

young knoll
#

I imagine that will work fine even if it's moved

midnight crow
#

I'm a bit unfamiliar with how async events work sorry

young knoll
#

Same way you use a normal event

#

Just be mindful that it isn't on the main thread

little trail
midnight crow
young knoll
#

No?

#

That's the PlayerJoinEvent

midnight crow
#

Could you point me to an example?

young knoll
#
@EventHandler
    public void whatever(AsyncPlayerPreLoginEvent ev) {
        //...
    }
midnight crow
#

Oh

#

lmao

#

I'm dumb thank you

#

Wow yeah don't know what I was thinking

golden turret
#

is possible to create separate chests in 1.12?

#

without using trap chests

pine island
#

Kinda new to this spigot thing but i want to take a player name using command so /eco reset Lumina somth like this any help?

quaint mantle
#
if (args.length != 2) {
    return false;
}

Player player = Bukkit.getPlayer(args[1]);
// ...

@pine island

pine island
#

Pls explain better LOL

hushed fulcrum
#

that is super clear

quaint mantle
#
if the args arent right, send the usage and exit

get the player from the second argument
pine island
#

Ok got it tysm this should work with most other values right?

quaint mantle
#

yes

pine island
#

Ok!

#

So Arg 1 is the command itself arg 2 is the playername?

quaint mantle
#
eco reset player
arg 0 = reset
arg 1 = player
pine island
#

Ok got it!

#

I have no clue whhat the error is & what caused it Anyhow here is the thing:

#

at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:761) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]
#
At net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:1936) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:1779) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1732) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:49) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:28) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

#
At net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(SourceFile:144) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(SourceFile:118) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1061) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1054) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(SourceFile:127) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1038) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:970) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1

at me.lumina.hardcorepurge.commands.ClearEco.onCommand(ClearEco.java:38) ~[?:?]

at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.16.5.jar:3096-Spigot-9fb885e-296df56]```
pine island
#

Also its said +19 more

#


import me.lumina.hardcorepurge.HardcorePurge;
import net.md_5.bungee.api.ChatColor;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;

import java.util.Objects;


public class ClearEco implements CommandExecutor, Listener {



    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args ){





        if (sender instanceof Player){
            Economy economy = HardcorePurge.getEconomy();
            Player player = (Player)sender;
            double bal1 = economy.getBalance(player);
//purge
            if (cmd.getName().equalsIgnoreCase("ClearEco")){

                if (args.length == 1) {
                    Player playerToReset = Bukkit.getPlayer(args[1]);
                    Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "eco reset " + playerToReset);
                    Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "clear" + playerToReset);
                }
                else{
                    sender.sendMessage("Whoops Something went wrong Try again?(/ClearEco <playerName>");
                }
            }
        }

        return true;
    }




}
``` the code
storm hare
#

What is good premium plugins?

young knoll
#
                if (args.length == 1) {
                    Player playerToReset = Bukkit.getPlayer(args[1]);```
#

Arrays start at 0

#

So 1 is out of bounds

pine island
#

Hmm

#

So i set it to 0?

young knoll
#

mhm

pine island
#

Ok

indigo cave
#

/testcommand arg0 arg1 arg2 -> args-lenght = 3

pine island
#

Why did it just give me null

indigo cave
#

thats how it works

#

it is case sensitiv

pine island
#

Yeah im used to python

west sail
shadow night
west sail
#

yes

shadow night
#

🤔

undone axleBOT
pine island
#

Yeah got it!

west sail
dim bronze
#

check your local m2 repo manually in your user folder/.m2/repository/org/spigotmc/spigot

west sail
golden turret
#

basically, i want to fake a block

#

but when i place the block in a tall grass it dont fake the block

#

when i relog it show me the fake blocks

dim bronze
#

check this when working with 1.17.1

#

specifically the last part of the developer notes

golden turret
#

you said it to me?

dim bronze
#

no sorry @west sail

golden turret
west sail
# dim bronze no sorry <@!422633274918174721>

i did and I would love to avoid using NMS but the only way how to change the texture of a skull block is by using NMS.
I got it working in IntelliJ but how can I export my plugin now?

#

btw I also tried it with the remapped-mojang version but I also cant export that

dim bronze
#

haven't worked with 1.17 NMS yet since I can't get build tools to run so I'm not speaking from experience but I thought that the nms.core package was for the remapped jar?

#

when you type BlockPosition in IntelliJ are you prompted with any other imports?

pine island
#

Whenever i use player.getName() i get CraftPlayer{name=LuminaEXE}

Any other method?

#

Will Player player = (Player)sender work?

west sail
pine island
#

Ok

dim bronze
#

because everything in intellij looks fine

west sail
#

yeah everything in intelliJ is fine only when i try to compile it it breaks with this error

pine island
#

If its a runtime or import restart IntelliJ it will fix it for the most part

west sail
pine island
#

Hmm

#

Idk man

dim bronze
#

I can only think its something to do with obfuscation but I'm not sure since I haven't worked with it

arctic moth
#

?paste

undone axleBOT
west sail
pine island
#

Also i did the thing still no help

#


import me.lumina.hardcorepurge.HardcorePurge;
import net.md_5.bungee.api.ChatColor;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;

import java.util.Objects;


public class ClearEco implements CommandExecutor, Listener {



    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args ){





        if (sender instanceof Player){
            Economy economy = HardcorePurge.getEconomy();
            Player player = (Player)sender;
             double bal1 = economy.getBalance(player);
//purge
            if (cmd.getName().equalsIgnoreCase("ClearEco")){

                if (args.length == 1) {
                     String Sender = player.getName();
                    Player playerToReset = Bukkit.getPlayer(args[0]);
                    economy.withdrawPlayer(Sender, bal1);
                    Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "clear " + player);
                }
                else{
                    sender.sendMessage("Whoops Something went wrong Try again?(/ClearEco <playerName>");
                }
            }
        }

        return true;
    }




}
#

The code

eternal night
#

+ player does really look like you are calling getName()

young knoll
#

You are not calling getName

dim bronze
#

^^

pine island
#

It was declared as sender?

eternal night
#

and you just don't use it ?

#

heh ?

#

You can declare a lot of things

west sail
#

Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "clear " + player.getName());

eternal night
#

🥄

pine island
#

Ah ok got it

quaint mantle
#

if you dont do .getName all youre going to do is print out the toString of the object

pine island
#

Hmm

west sail
#

did anyone here ever compile a plugin using 1.17.1 Maven NMS imports?

quaint mantle
#

I have but I forget what I did to get it to work lol

pine island
#

No sorry i only do 1.16.5

quaint mantle
#

Did you put the correct maven configurations in?

golden turret
#

how could i override a block?

west sail
quaint mantle
#

I always use install so im not sure

golden turret
golden turret
quaint mantle
#

What's your pom.xml look like? @west sail

pine island
#

Also is there a way to clear a ender chest?

quaint mantle
# west sail

You're missing classifier in your spigot dependency

west sail
quaint mantle
#

<dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot</artifactId> <version>1.17-R0.1-SNAPSHOT</version> <classifier>remapped-mojang</classifier> <scope>provided</scope> </dependency>

#

You used that?

dim bronze
#

don't you need to run build tools with --remapped?

quaint mantle
#

Yes

west sail
quaint mantle
#

No it installs the remapped jars into your maven repo

west sail
#

again I dont have a problem with loading it in intellij i can work with it fine. Only when I try to export it it doesnt work

dim bronze
#

When I'm running build tools for 1.17.1 i'm getting an error
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact org.spigotmc:minecraft-server:csrg:maps-spigot-fields:1.17.1-R0.1-SNAPSHOT

west sail
#

here is your remapped case.

west sail
quaint mantle
#

is there something to listen for when a player picks something up with a bucket of water? (e.g fish, axolotl)

west sail
quaint mantle
#

how exactly would I go about determining whether a player used a bucket of water / picked up X?

west sail
dim bronze
#

PlayerBucketEntityEvent?

west sail
#

ah yeah forgot about that

quaint mantle
#

oh right

#

thank you

west sail
#

ok I found a more detailed error message: class file has wrong version 60.0, should be 55.0 Please remove or make sure it appears in the correct subdirectory of the classpath.

#

what does that mean? Im using Java 16

eternal night
#

are you actually compiling against java 16 tho ?

young knoll
#

No

west sail
#

how can i check that?

young knoll
#

55 is 11 if my math serves

eternal night
#

you hopefully defined your target somewhere either the the poms properties section or in the compiler-plugin

alpine urchin
little trail
eternal night
#

yea

west sail
# eternal night yea

can you send me a sample pom.xml with Java 16? I always get an error when i just change the java-version to 16: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project EDUHub: Fatal error compiling

eternal night
#

read the java 9 and beyond part

west sail
eternal night
#

?paste the error then

undone axleBOT
eternal night
#

but please paste, neither screenshots nor discord files are particularly exciting to read

eternal night
#

that is all ?

west sail
#

yes?

eternal night
#

the entire output of mvn package is that single line

little trail
west sail
#

that is the output of the Run window

little trail
#

paste the actual error

eternal night
#

don't run it in the run window

#

run it properly

little trail
#

use powershell or cmd, dont double click or whatever

eternal night
#

intellij should have a view where it shows the entire output tho

dim bronze
#

looks like its compiling with jdk 14

eternal night
#

not quite xD

#

it says that release version 16 is not supported

#

meaning you are not actually using java 16 on your system

#

run java --version and validate

#

oh right, creppy that path 😂

#

overlooked that

west sail
eternal night
#

your system is running using java 14 tho

#

you can't tell java 14 to compile java 16

west sail
#

java -version is telling me Java 17

java -version
java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
eternal night
#

well whatever you use to run maven does use java 14

#

as you can tell by the first line in your pasted logs

little trail
#

whats javac --version or something

west sail
#

does intelliJ use a different version and where can i see this?

chrome beacon
#

Open project settings

quaint mantle
#

Project structure

chrome beacon
#

^

west sail
#

ah yeah right i found it. Thanks for the help ^^

fickle helm
#

any idea how I might troubleshoot it? It appears to be related to a entity's custom name

chrome beacon
#

Are you changing the name?

fickle helm
#

my plugin uses ProtocolLib to show a fake name but does not actually update the custom name

eternal night
#

Well looks like you have a mob spawner that is configured to spawn some badly named entities

fickle helm
#

thanks that might help narrow it down

dull whale
#

is it posibble to send a packet to run a runnable client side

olive valve
#

hello i am trying to get a water bottle and this code doesnt work ItemStack item = event.getItem(); ItemStack bottle = new ItemStack(Material.POTION, 1); ItemMeta meta = bottle.getItemMeta(); PotionMeta pmeta = (PotionMeta) meta; PotionData pdata = new PotionData(PotionType.WATER); pmeta.setBasePotionData(pdata); bottle.setItemMeta(pmeta); if(item == bottle) can some one help me?

eternal night
#

unless you have client side modifications, packets do exactly what the client defines them to do

dull whale
eternal night
#

well, no idea what your "runnable client side" is.

dull whale
#

sorry

dull whale
young knoll
#

Use isSimilar

dull whale
#

at

#

idk

#

i dont know english

eternal night
#

are you creating a runnable on the client side of things using a mod ?

dull whale
#

no i create it on server

#

but ok it isnt posibblt

eternal night
#

Yea, you cannot execute arbitrary code on the client.

#

thank god for that

dull whale
#

:D

gloomy edge
#

Yeah I couldn’t imagine ^^^

dull whale
#

yeah I just realised thats too much to ask for :P

eternal night
#

would also be the biggest security flaw ever created

gloomy edge
#

Yeah lol 😂

hasty prawn
#

Would be useful though PauseChamp

gloomy edge
#

😈

dull whale
#

to torture exploiters

hasty prawn
#

I'd use it for injecting custom BlockStates and ItemStacks

gloomy edge
#

I’d use it to inject malware

eternal night
#

true, I always wanted to like

client.run(() -> {
  sendTo("https://myevil.server", Files.readAllBytes(pathToYourSSHKey))
})
hasty prawn
#

You are the reason we don't have that

dull whale
#

I just want a hologram to change its y as player moves

quaint mantle
#
if (e.getClickedInventory().equals(serverselector())) 

e.getClickedInventory() returns null no matter what i do

#

This is pain

fringe hemlock
#

how to fix worldguard in ./plugins not showing ?

young knoll
#

Read the startup error

fringe hemlock
#

where ?

quaint mantle
#

In the console

fringe hemlock
#

ok wait

#

[Server thread/ERROR]: [Skript] (wood axe named "?6|-| ?7Item main of WorldEdit ?6|-|" with lore ("", "?7Description: ?6This item allows to create position 1 and 2 !", "" and "?7Use: ?cLeft click to create position 1 !") and '" &cRight click to create position 2 !" with no nbt') can't be added to {_sender} because the former is not an object (Wand.sk, line 76: give {@WorldEdit-use-itemtype-use} of sharpness 0 named "{@WorldEdit-use-itemname-use}" with lore {@WorldEdit-use-itemlore-use} with no nbt to {_sender}')

#

end im don't have a rg command end egion

#

endspent

chrome beacon
#

You should ask in the skript discord

#

Also why do you have a WorldEdit skript

#

Why not use the original plugin

fringe hemlock
#

im dont have

#

can you send ?

young knoll
#

Just google wordedit

#

Pretty sure it's on curseforge

chrome beacon
#

Bukkit dev

#

CurseForge is for Forge/Fabric

eternal night
#

or just their page

fringe hemlock
#

end ?

chrome beacon
#

?

fringe hemlock
#

only this plugin

#

?

#

not working

young knoll
#

"not working" does not tell us anything

somber ember
#

can someone say to me pls and help, im using nuvotifier it seemed to work okay, but then when i got on server it was spamming reminder to vote every 10seconds or 1min

#

im gonna show gimme sec

#

no videos showing the reminder time

#

also they doesnt show how to put multiple votes for multiple websites..

#

if they vote for one with same port does it go to all of the websites at the same time

#

i have two thinks that video showed me to download for votifier to work

#

i mean someone voted in game and website got 1 more vote ... thats what i mean

#

those two ...

#

i cant remember the name but those two i have

#

doesnt work

#

i putted in thre /pl

#

just says unknown command

#

Plugins (7): ActionHealth, DiscordSRV, Essentials, LuckPerms, SinglePlayerSleep, SuperbVote, Votifier

#

thats what its saying

#

could u also explain me pls how it works.. and where i need to put links to so it gets multiple votes for multiple websites..

#

no, its reminding people to vote for the server every 10 second

#

its kinda so annoying just popping hundreds time in chat, vote for this server ..... or you have voted 1 time vote more ..

#

ya thats what i wanna do change the reminder so it doesnt pop up on chat so often

#

like put remind every 1h or so

#

i cant even see it plugins

#

o wait fuck i found it gimme sec

#

is it that ?

#

broadcast

#

in seconds

#

its this

#

?

#

yes same message

#

i think it is

#

thanks so much i putted 3600 seconds so its 1h

#

is it after vote he gets so many diamonds ? or something

#

else

#

and what is change percentage.. sry im really first time using votifier ... its so hard

#

i hope i have patience for that, it already pissed me for 3 days .. that youtubers dont show those thinks .. :/ for week it was pain lol

#

thanks you so much

untold rover
#

Hey can someone help me? I am trying to generate my Javadocs but I have a Space inside my path, is there a way to fix it without Moving my Folder?

lost matrix
untold rover
#

I am not using Command line to do it tho, I am using the goals

somber ember
lost matrix
untold rover
#

Is it maybe because of the non-ascii symbol?
Exit code: 1 - javadoc: error - File not found: "G:/» Projects/Unique/UniqueAPI/src/main/java/eu/unique/api/bungee/APIBungee.java"

lost matrix
#

» This looks very sus

#

I really hope this is not your actual path

untold rover
#

It is, It works for everything except Javadocs

#

Its just a way of having my actual Projects folder at the top in my Drive

#

Never had problems with it

lost matrix
#

Did you check if the file does actually exist?

untold rover
#

jup it does

#

it really looks like as if it can't handle the whitespace

lost matrix
#

Try using the very latest version of maven. If that doesnt work then you might have to remove the whitespace from your path. Mabye even write an issue in their github.

tender shard
somber ember
#

and also how do i do the, command for voting list ?

tender shard
#

anyway maven should handle it just fine

untold rover
#

okay I think I found the issue, so my symbol (») appears as (┬╗) when executing the javadocs command manually

tender shard
#

unless you're on windows or some other retarded OS

#

oh you are using windows

untold rover
#

yes

tender shard
#

yeah just change the directory name then

#

windows is a bit strange when it comes to unicode

untold rover
#

Big oof move project because of Javadocs...

tender shard
#

how do javadocs require hardcoded paths?

lost matrix
tender shard
#

or try using git bash

#

it SHOULD work fine

lost matrix
#

Thats also an option

tender shard
#

no idea about powershell but yeah, 100% better than windows' regular "shell" ^^

#

but anyway I would recommend to only use "normal" symbols for file names, many programs have trouble with "strange" file names