#help-development

1 messages · Page 1787 of 1

restive tangle
#

No.

young knoll
#

No

lucid bane
#

oh

#

,,

tawdry scroll
#

uhm no, i also decompiled their resource pack it dosn't have any modifcation for player_head

young knoll
#

That’s

#

Not possible

#

Afaik

#

They can’t just magically make them flat

tawdry scroll
#

i am also surprised XD

lucid bane
#

am i right?

young knoll
#

Yes

lucid bane
#

success in spigot, now CatServer's turn

#

SUCCESS!
the answer is 1:1 comparison with spigot

#

ty all you guys

spare marsh
#

Is something like this possible?

private final Map<String, CommandExecutor> commandExecutors = new HashMap<>();

    public void addCommandExecutor(String command, CommandExecutor executor){
        commandExecutors.put(command, executor);
    }

    public void complete(){
        for(Map.Entry<String, CommandExecutor> entry : commandExecutors.entrySet()){
            MainFFA.getInstance().getCommand(entry.getKey()).setExecutor(entry.getValue());
        }
    }```
#

Auto register commands

chrome beacon
#

Sure just remember to add the commands to the plugin.yml

spare marsh
#

I did but it appears as it hasn't been registered when I type it nothing happens

chrome beacon
#

Are the commands in the plugin.yml?

#

If they are show the code where you're using the add and complete methods

spare marsh
#

They are

#

Each command class adds itself to the list on the constructor

#

And the last thing on the onEnable is the complete

chrome beacon
#

Show the code for it

spare marsh
#
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            Bukkit.getPluginManager().registerEvents(this, this);
        } else {
            getLogger().warning("Could not find PlaceholderAPI! This plugin is required.");
            Bukkit.getPluginManager().disablePlugin(this);
        }

        plugin = this;
        eventsAuto = new EventsAuto();
        commandAuto = new CommandAuto();
        loadConfiguration();

        getServer().getConsoleSender().sendMessage(getName() + ChatColor.GREEN + " Plugin loaded successfully! " + ChatColor.RED + "<3");
        commandAuto.complete();
chrome beacon
#

Alright are the commands added in loadConfiguration?

spare marsh
#

No, the commands are added on the classes of the commands. For Exmaple

#
public class SetSpawnCommand implements CommandExecutor {

    public SetSpawnCommand() {
        MainFFA.getCommandAuto().addCommandExecutor("setSpawn", this);
    }

    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        if(!(commandSender instanceof Player)) return false;

        Player player = (Player) commandSender;
etc....
chrome beacon
#

I see

spare marsh
#

But nothing really happens. I don't think it actually register itl

chrome beacon
#

Now where is the constructor called

spare marsh
#

registers it

chrome beacon
#

I'l be going now

#

Good luck

spare marsh
#

Alright thanks

tribal gyro
#

how do I get killer of onPlayerDeath

#

is it getPlayer().getKiller() ?

young knoll
#

Yes

west oxide
#

found this on a thread:
PlayerDeathEvent#getEntity().getKiller()

#

hey am still struggling to make this work

                Inventory taggui = Bukkit.createInventory(p,45 ,"Tags list :");
                List Tagslist = Arrays.asList(Tags.getConfig().getConfigurationSection("Tags").getKeys(true));
                for (int i = 0;i<Tagslist.size();i++)
                {
                    String Tag = TagsList.get(i);
                    ItemStack tagItem = new ItemStack(Material.WOOL, 1);
                    ItemMeta meta = tagItem.getItemMeta();
                    meta.setDisplayName(Tag);
                    ArrayList<String> lore = new ArrayList<>();
                    lore.add(ChatColor.AQUA + "Tag: "+Tag);
                    meta.setLore(lore);
                    taggui.addItem(tagItem);
                }

                p.openInventory(taggui);```
#

this code does this

#

want it to display the tags each on as an item

tardy delta
#

Item.setitemmeta

west oxide
#

oh yes

#

thank you how did i miss that lol

#

been looking since yesterday lol

quaint mantle
#

how to get a list of player's permissions ?

#

or like check permission.perm.???

#

and get the ???

#

for example the ??? is a double

frank bramble
#

I think some time ~2016, though I could be wrong

candid galleon
quaint mantle
#

it was not hard

#

i found it

candid galleon
#

enlighten me

summer scroll
#

Player#getAffectivePermissions or something.

candid galleon
#

please do let me know if that works as intended

summer scroll
#

i usually use that, ik it's not the best but it works as intended

#

like for example using it for a permission based multiplier

hidden cloak
#

Is there a way to access minecraft's loaded usercache.json data or do I need to read it myself?

candid galleon
#

probs read it yourself

brisk estuary
#

Hi guys, could I use a BucketFillEvent to whenever a player fills a bucket with water it converts the bucket of water into a bucket of lava and the same for lava (a bucket of lava converted into a bucket of water)?

hidden cloak
#

yes

#

PlayerBucketFillEvent

#

do event.setItemStack to the lava or water bucket

brisk estuary
#

okay, ty

west oxide
#

hey i was wondering if this is good way to reload plugin ?

        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
                plugin.getPluginLoader().disablePlugin(BwCore.getPlugin());
                plugin.getPluginLoader().enablePlugin(BwCore.getPlugin());
                plugin.reloadConfig();
                Tags.reloadConfig();
            return true;
        }```
#

Tags is a custom config file

#

my question is ;
is this needed ? ``` plugin.reloadConfig();
Tags.reloadConfig();

brisk estuary
#
    private final ItemStack lavaBucket = new ItemStack(Material.LAVA_BUCKET);
    private final ItemStack waterBucket = new ItemStack(Material.WATER_BUCKET);
@EventHandler
    public void onPlayerBucketFill(PlayerBucketFillEvent event){
        if(event.getItemStack().equals(waterBucket)){
            event.setItemStack(lavaBucket);
        }else if(event.getItemStack().equals(lavaBucket)){
            event.setItemStack(waterBucket);
        }
    }
#

Would it work?

brisk estuary
restive tangle
#

It would work.

#

Well I don't know for certain. But it should.

brisk estuary
#

k, thanks : )

iron palm
#

player.spigot().respawn(); is not working when an entity (not a player) is a killer
code:

            public static void onPlayerDeath(PlayerDeathEvent e) {
        Player player = e.getEntity();
        player.spigot.respawn();
      }

Is it somehow an issue or im missing something?

iron palm
iron palm
west oxide
#

hi so i made a thing where players can create tags but how can i make it so that they can activate the tag from the gui ?

#

i know i have to use event so i have this so far


import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class TagsMenu implements Listener {
   @EventHandler
   public static void onTagPick (InventoryClickEvent event){
       Player p = (Player) event.getWhoClicked();

       if(event.getView().getTitle().equalsIgnoreCase("§bTags list :")){
           if(event.getCurrentItem().getType()== Material.NAME_TAG){
               //activate tag
           }
           event.setCancelled(false);
       }

   }
}

Tag will work like this
on player message: message format: {prefix}{playername}{tag}":"{message}

restive tangle
#

Make a hasmap with a player UUID and a string. Then store the tag name and player UUID and when they chat get the value of the player's UUID which will be the tag they choose and set the message to include the prefix.

west oxide
#

and then onevent send message i get it from there

#

is that good idea ?

restive tangle
#

On the chat event you will use it.

west oxide
#

yes

#

so like when they click a tag on the gui
this gets created on yml file

     (insert actual player uuid):(TAG that they clicked on)```
this will also make it so that if they had a tag selected before it will get changed


and then when they talk the onevent gets UUID and looks what tag they are using
restive tangle
#

No.

west oxide
#

F

restive tangle
#

The uuid is the player's uuid.

west oxide
#

yes

restive tangle
#

player.getUniqueId()

west oxide
#

yes

#

i just typed UUID

restive tangle
#

You'd make it more like

UUID:
    tag: ""
west oxide
#

oh

#

isnt that the same thing ? or am i missing something

restive tangle
#

The one you edited. Yes that would be the same.

west oxide
#

yes

#

yeah that's what i meant

#

ty

snow latch
#

I'm gonna become crazy, I tried soooo much!!
I have a class SocketServer that waits for a socket connection in an infinite while loop and use it like this:

@Override
public void onEnable() {
    getServer().getScheduler().scheduleAsyncDelayedTask(this, new SocketServer());
}

I tried runTaskAsynchronously as well, but it produces the same problem.
The socket connections work, but I have no idea on how to end the task onDisable.

getServer().getScheduler().cancelTasks(this);

doesn't work 🤷‍♂️ ...
I somehow have to end the listener inside the SocketServer; It would also be ok to just to break it, no data can be lost that way.

west oxide
#

||would help but i am still noob and i dont understand what any of this means srry||

tidal hollow
#

how is that? could you give me an example? XD

snow latch
#

@austere cove You're online and have a cool pfp, I hope rn you're the 40% computer nerd cuz I wish you can help me 🙏

austere cove
#

?ask

undone axleBOT
#

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

crimson terrace
ivory sleet
#

A socket server is only an endpoint, and ideally you’d have a thread per accepting socket, then you also have some sort of shutdown signal which the iteration inside every thread depend on @snow latch

#

Take a peek here

#

Wrote that example not too long ago

snow latch
ivory sleet
#

Also I use an atomic boolean as opposed to a normal boolean due to atomicity

#

But you could really just use a volatile boolean variable if you want

#

Also, that example doesnt handle management of resources (like closing them) afterwards

snow latch
#

Whats the BlockingDequeue?

ivory sleet
#

A queue is a first in first out data structure

#

A dequeue is basically a bidirectional queue

#

Blocking means that you can await for some other thread to supply an element to the queue

eternal night
#

and block until another thread removed an element

ivory sleet
#

That too ^

eternal night
#

which is neat, because you can wait for the queue to have space again

west oxide
ember estuary
lavish hemlock
#

Deque stands for "double-ended queue"

pastel juniper
#

Hey, I 've been struggling to make a custom snowball that explodes when it touches sth....... but a couldn't a way to check for snowball NBT when is launched without checking the mainhand.

nocturne trail
#

Get the uuid

quaint mantle
#

hello is there anyway to get a player's Node from string in luckperms api ?

#

an existing node

pastel juniper
summer scroll
#

and listen for ProjectileHitEvent, if the entity has pdc that you put, make it kaboom

pastel juniper
#

Ty, I 'll try it

west oxide
# west oxide so like when they click a tag on the gui this gets created on yml file ```Tags:...

hey so am working on this and this is my code so far ```package online.shakiz.BwCore.Events;

import online.shakiz.BwCore.BwCore;
import online.shakiz.BwCore.files.TagsManager;
import online.shakiz.BwCore.files.TagsPlayerData;
import online.shakiz.BwCore.utils.utils;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.plugin.Plugin;

import java.util.UUID;

public class TagsMenu implements Listener {

private TagsManager Tags;
private TagsManager PlayerTag;
private static BwCore plugin = BwCore.getPlugin();
@EventHandler


public static void onTagPick (InventoryClickEvent event){
    String prefix = utils.chat(BwCore.getPlugin().getConfig().getString("prefix"));
    Player p = (Player) event.getWhoClicked();
    Plugin PlayerTag = (Plugin) new TagsPlayerData(plugin);
    UUID uuid = p.getUniqueId();


        if(event.getCurrentItem().getType()== Material.NAME_TAG){

            PlayerTag.getConfig().set("Tags."+uuid ,event.getCurrentItem().getItemMeta().getDisplayName());
            p.sendMessage("§bavailable Tags:");

        }


    
    event.setCancelled(false);
}

}

but when i clic on the item it does nothing
#

and there's no errors and i double checked multiple times if i registred it and it is

crimson terrace
#

keep to java conventions and make the first letter of a variable not capitalized

crimson terrace
#

doesnt matter rn. ill explain later

west oxide
#

ok

#

its not an issue rn ?

crimson terrace
#

what do you want it to do anyway

#

youre clicking on a nametag in an inventory and want to send the player the message "available Tags:"?

west oxide
#

not that's just messed up cuz i was trying to fix

#

and it doesnt send that message

young knoll
#

I don’t see an @EventHandler

#

Also did you register it

crimson terrace
#

event handler is there

#

just make the method non static

#

see if that does anything

west oxide
#

ok

#

nope

#

still not working

west oxide
#
        saveDefaultConfig();
        BedWars.registerEvents(new TagsMenu());```
#

this is where its registred

young knoll
#

Oh it is there is just a newline after it

#

Does that work

west oxide
#

?

west oxide
#

i tried to move it up and it gave an error

crimson terrace
#

have you tried debugging it?

#

put this
p.sendMessage("CP1");
at different points in your code with different numbers to see where it fails and where it gets to. has helped me out a lot

west oxide
#

oh ok

crimson terrace
#

mainly in front of and after if(){}

digital rain
#

are there any other ways increment player health other than the .setHealth method

crimson terrace
#

you have to set the Attribute of a player to a higher value

#

if you want the player to have extra hearts as I understand it

digital rain
#

no just healing the player

crimson terrace
#

why dont you want to use that method?

digital rain
#

sethealth sets players health, not max health

crimson terrace
#

ok explain bit by bit what you want to do.

digital rain
#

so set health value must be from 0.0 to 20.0

crimson terrace
#

unless you change the max health attribute

digital rain
crimson terrace
#

so you want to heal the player but not increase the max hp?

digital rain
#

yes

west oxide
crimson terrace
crimson terrace
west oxide
#

basically everywher

crimson terrace
west oxide
#
        String prefix = utils.chat(BwCore.getPlugin().getConfig().getString("prefix"));
        Player p = (Player) event.getWhoClicked();
        Plugin PlayerTag = (Plugin) new TagsPlayerData(plugin);
        UUID uuid = p.getUniqueId();

        p.sendMessage("CP1");
            if(event.getCurrentItem().getType()== Material.NAME_TAG){
                p.sendMessage("CP12");
                PlayerTag.getConfig().set("Tags."+uuid ,event.getCurrentItem().getItemMeta().getDisplayName());
                p.sendMessage("§bavailable Tags:");

            }
        p.sendMessage("CP1");


        event.setCancelled(false);
    }```
crimson terrace
#

are you getting errors in console?

west oxide
#

no

digital rain
west oxide
#

1 sec

#

?paste

undone axleBOT
crimson terrace
west oxide
#

issue with bedwars1058

#

i knew it had to do with it

ivory sleet
digital rain
lavish hemlock
#

If you need help remembering it, just think of the word Dick when you need to talk about double-ended queues 🧠

crimson terrace
misty current
#

hey, i've noticed my tabcompleter starts the completion from the start of the list i provided even if I'm already writing something and i press tab

misty current
#

how can I make it finish whatever im writing if it is a valid completion?

crimson terrace
young knoll
#

Or StringUtil, don’t remember

digital rain
#

one that detects health healing and getting damged and stuff

misty current
#

so i'd have to loop my tab completions

young knoll
#

No one said that

misty current
#

wait i just slap in the list?

#

ohh i though it took a string as an argument

young knoll
#

It takes the current input as an argument

#

Which you already have access to

crimson terrace
young knoll
#

I assume it’s the PlayerRegainHealthEvent

#

You can fire it manually

digital rain
#

no yeah well, nah its ok, the primary question was whether anyone was aware of other methods of healing players

crimson terrace
digital rain
#

no need to check further down the path

crimson terrace
#

im not finding that event tho

young knoll
#

Might be entity

digital rain
#

yeah entity

#

anyways thats good to know

young knoll
#

Could make a PR to have the method fire the event I suppose

digital rain
#

i mean so far that would be unnecessary, but ill think about it later on :)

vale ember
#

how to send warning to console? just sendMessage()?

ember estuary
#

isnt sendmesssage for players?

#

maybe use the logger

young knoll
#

You can use it for console too

vale ember
#

Bukkit.getConsoleSender().sendMessage()

ember estuary
#

ah

young knoll
#

Use plugin.getLogger.warning

ember estuary
#

^

young knoll
#

Or warn, whichever it is

ember estuary
#

something along those lines, am not sure either xD

vale ember
ember estuary
#

On PlayerDropItemEvent, how can i replace the item and cancel the drop?

misty current
#

thanks

misty current
ember estuary
#

PlayerDropItemEvent = presses Q

#

has nothing to do with death

misty current
#

oh im blind

#

sorry

ember estuary
#

xD

misty current
#

i read it as death for some reason

#

gimme a second

#

getItemDrop gets the item entity

ember estuary
#

right now i do e.getPlayer().getInventory.setItem(...) and then e.setCancelled(true); , but no matter in what order, it moves the old item to the first slot instead of replacing it

#

i could just not cancel and set the item entity to null, right?

#

does that work? xD

young knoll
#

Maybe

misty current
#

i mean not sure if you can set the entity

#

but you can kill it? i guess

young knoll
#

If it’s an Item not an ItemStack you can use .remove

ember estuary
#

i see

#

it is

misty current
#

yea the method returns an Item

young knoll
#

You can also modify it with Item#setItemStack

misty current
#

^

ember estuary
#

but i dont want anything to be thrown

#

but good to know

#

:D

#

useful for sure

misty current
#

my brain is going slow af today

#

pain

ember estuary
#

how can i find out which slot the itemstack was dropped from?

last ledge
digital rain
#

what am i doing wrong?

hollow bluff
#

Any recommendations for good scoreboard API's or something?

chrome beacon
digital rain
#

oh im stupid

#

youre totally right

#

im just drained out today

#

i just forgot to delete it since first i tried adding a modifier multiple times, and found out that doesnt work, but i handled that already

chrome beacon
#

Eh it happens

peak granite
#
            Utils.Test(event.getPlayer());
        }, 3L);
    }
}```
#

it does this after like

#

a minute

#

i want it to do it after 3 ticks

#

how do i fix it

chrome beacon
#

That will run after 3 ticks

peak granite
#

thag?

chrome beacon
#

Typo :)

peak granite
#

what do i do make it after 0.5 seconds

hollow bluff
#

10

digital rain
#

20 ticks = 1 sec

pearl vessel
#

0.5*20

#

so 10 ticks

digital rain
#

math :)

peak granite
#

ty

ember estuary
#

So i did

player.setWalkSpeed(0);
player.setFlySpeed(0);

But the player can still sprint-jump and swim.
How can i stop him from doing that?

#

Canceling the move-event isnt an option as that will stop any physics from moving the player

tardy delta
#

Cancel jump

#

Player move event

#

Check for y

#

Player y VS event y

ember estuary
#

i see

#

and swimming?

#

water should still move him, so canceling moveevent if in water doesnt work

quaint mantle
ember estuary
#

i basically just want to disable the wasd and space controls

#

so the player cant move by himself, but can be moved

tardy delta
#

Is there a swim event?

#

Idk

peak granite
#

how do i get the region name at player

quaint mantle
#

from worldguard?

peak granite
#

ye

neat laurel
#

@digital rain you are using the same modifier multiple times

ember estuary
#

Can you make the player ride a mob without him actually sitting down?

quaint mantle
#

but why

ember estuary
#

cuz i want to stop him from being able to move

#

making him ride an entity is the only good way for that

#

but then it makes him sit

#

which i dont want

wide coyote
#

try to force enable and disable swimming for player

#

i dont think it will work but give it a shot

ember estuary
#

wym by that? is there a function?

patent horizon
#
    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>authlib</id>
            <url>https://papermc.io/repo/repository/maven-public/</url>
        </repository>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>2.3.31</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.10.10</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>```
undone pebble
#

did you reload your pom changes?

patent horizon
#

yes

#

successful

undone pebble
#

it worked?

patent horizon
#

i can extend Placeholder but not PlaceholderExtension

undone pebble
#

it's PlaceholderExpansion

vernal basalt
#

everytime i run a command it runs the command but says /life <arg> in chat

#

why?

patent horizon
#

is this the right thing?

undone pebble
#

nope

patent horizon
#

ima just try restarting my ide

undone pebble
#

👍

patent horizon
#

ah yep

#

that did it

#

weird

undone pebble
#

yeah, IntellIj is weird

spare marsh
#

Question, so I am trying to make this work but for some reason it wont.

public class CommandAuto {

    Map<String, Class> cmds = new HashMap<>();

    public void addCMD(String command, Class c){
        cmds.put(command, c);
    }
    
    public void complete() {
        for(Map.Entry<String, Class> entry : cmds.entrySet()){
            try {
                MainFFA.getInstance().getCommand(entry.getKey()).setExecutor((CommandExecutor) entry.getValue().new);
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }

}
#

This is suppose to auto register any commands I add there

#

and I add this command when I initialize the class

public class SetSpawnCommand implements CommandExecutor {
    public SetSpawnCommand() {
        MainFFA.getCommandAuto().addCMD("setspawn", this.getClass());
    }
#

but this won't work at all

lavish hemlock
#

entry.getValue().new this shouldn't even compile

spare marsh
#

My bad

#

it is newInstance

lavish hemlock
#

oh

#

ok well 1.

#

don't use newInstance for something so small

#

it is a very expensive operation

#

(as is most of reflection)

spare marsh
#

Oh okay got it, but this would only run at the onEnable once

lavish hemlock
#
  1. the code in your constructor is only run when new is called on that class
vocal cloud
#

Is the SetSpawnCommand ever instantiated?

lavish hemlock
#

so, either way

#

I'd recommend just making a util method in your plugin class called register or smthn

#

that takes in a command name and an instance of a command executor

#

bc this is a very messy, inefficient way to do things :p

vocal cloud
#

I'm confused to why you collect them all then register them? Why not just register them in one go?

patent horizon
#

meow

spare marsh
#

I actually hated doing this and found a worse one on the spigot website. What I want to do is just auto register the command or when it is initialized but I guess its a bit messy to make I have tried different options

#

How would I do that Mike>

vocal cloud
#

You could do that with actual reflection

spare marsh
#

?

lavish hemlock
#

Well if you implement classpath scanning + reflection it'd be possible yeah, but that's maybe a bit advanced for someone who's clearly a beginner.

spare marsh
#

Brother I used that yesterday I am telling you that I tried more than one option

patent horizon
#
        return when (params.lowercase()) {
            "level" -> "${playerData.globalLevel}"
            "kills" -> "${playerData.kills}"
            "deaths" -> "${playerData.deaths}"
            "streak" -> "${playerData.streak}"
            "bounty" -> "${playerData.bounty}"
            "experience" -> "${playerData.globalExp}"
            "levelup_experience" -> "${Util.globalLevelupExp(playerData.globalLevel)}"
            "levelup_progress_bar" -> Util.legacyProgressBar(playerData.globalExp / Util.globalLevelupExp(playerData.globalLevel), 20)
            else -> null
        }``` is there a way to do something like this in java instead of just repeated if, else if conditions?
spare marsh
#

but not even then

lavish hemlock
#

nice Kotlin tho

patent horizon
#

its a friends 😬

#

starting to learn how much easier you can do stuff in kotlin over java

lavish hemlock
#

anyway lemme just hand-convert that to Java lmao

#
switch (params.toLowerCase()) {
    case "level": return "${playerData.globalLevel}";
    // insert other cases here
    default: return null;
}
#

or, if you use newer versions, you can actually shorten it to

patent horizon
stone sinew
#

switch can return and object in later java versions.

lavish hemlock
#

I think this is the syntax:

return switch (params.toLowerCase)) {
    case "level" -> "${playerData.globalLevel}";
    default      -> null;
}
lavish hemlock
#

otherwise you get switch fall-through

patent horizon
#

:(

#

my one-line code AHHH

vocal cloud
#

@spare marsh Something like this would work

public void register(CustomCommandExecutor customCommandExecutor) {
        this.getCommand(customCommandExecutor.getName()).setExecutor(customCommandExecutor);
    }

You'd still need to run a new xyz.
Personally I have a base class that supers this register method and then I just need to do new XYZ() and it auto registers it. Eventually I switch back to reflection

patent horizon
#

wait what if the action in the switch is a return?

lavish hemlock
patent horizon
#

awesome

#

ezpz

lavish hemlock
#

return will end the method, therefore no fall-through cannot occur

spare marsh
#

thank you

vocal cloud
#

👍

patent horizon
#

alr so now that i have this

#
public class Placeholders extends PlaceholderExpansion {

    @Override
    public String onRequest(OfflinePlayer player, String params) {
        switch (params) {
            case "guild": return "text1";
            case "guildRole": return "text2";
            case "guildMemberCount": return "text3";
            case "guildMemberCountCap": return "text4";
        } return null;
    }

    @Override
    public @NotNull String getIdentifier() { return ""; }
    @Override
    public @NotNull String getAuthor() { return "wally"; }
    @Override
    public @NotNull String getVersion() { return "1.0"; }

}```
#

when does onRequest get requested?

tardy delta
#

hewwo

patent horizon
#

PlaceholderAPI.setPlaceholders(player, string); ?

tardy delta
#

on request?

patent horizon
#

yeah does it get requested when you use setPlaceholders on something?

tardy delta
#

i think when you set ones it checks for your code

patent horizon
#

wha....

#

what

tardy delta
#

that's for placeholderapi support

ivory sleet
#

@tardy delta bad

#

No sending discord links

tardy delta
#

):

ivory sleet
#

Pssst, DMs

tardy delta
#

🙄

eternal night
hasty prawn
tardy delta
#

i dont understand di when you have multiply classes calling super(plugin) so all those classes pass the same instance and the parent instance will only change the first time

patent horizon
#

whats the difference between return; and return void;

hasty prawn
#

return actually works and return void gets you yelled at

patent horizon
#

ah

#

awesome

tardy delta
#

whats even yield?

#

more dotnet but yeah

ivory sleet
#

Yield is for switch expressions

#

Similar to return for methods

lavish hemlock
#

It was part of the original proposal but I see code that doesn't use it.

ivory sleet
#

Oh did they remove it?

#

Ah

lavish hemlock
#

void is basically the absence of a type

#

null is the absence of a value

#

null is implicitly everything too though

#

(since you can cast anything to null, BUT null is still technically not of that thing's type, it can just act as it)

#

(so, small language quirk, even after casting null to something, that something will fail instanceof checks no matter what as long as it is null)

vernal basalt
#

what math am i doing wrong

#
                        if (x <= 1 && y == 0) {
                            sender.sendMessage("§cYou must have more than 1 life and they must have 1 or more lifes");
                        }```
lavish hemlock
#

all of it

vernal basalt
#

x is the lives the sender has

#

y is the lives the receiver has

#

if the sender has 1 life they cannot send

lavish hemlock
#

well if you need more than 1, don't use <= as that means "greater than or equal to"

vernal basalt
#

if the receiver has 0 they cannot receive

#

if i do x < 1 if they have 1 then what does it return

#

because it's not less or greater

#

false right?

#

because it will only return true if it's less than

lavish hemlock
#

aight so currently

#

in your code

#

if:
x = 0 - false
x = 1 - true
x = 2 or higher - true

vernal basalt
#

yes

lavish hemlock
#

the second case, = 1, is because of <=

#

you're checking "if x is greater than or equal to 1"

#

when you should be checking "if x is greater than 1"

#

so, x < 1 should work

vernal basalt
#

if the sender only has 1 they cannot send their life

#

it would kill them

lavish hemlock
#

ok fucking cool

#

I don't care about what your plugin does

#

just fix your code lmao

tardy delta
#

whats the best way to empty a string builder? i saw setLength(0)

vernal basalt
#

if i do x < 1

#

user has 1

lavish hemlock
vernal basalt
#

it's still going to allow it

lavish hemlock
#

no, it wouldn't

tardy delta
#

isnt that just feeding the gc?

lavish hemlock
#

x = 1
x < 1 = false

#

1 is not greater than 1

#

1 is equal to 1

lavish hemlock
tardy delta
#

hmm

lavish hemlock
#

like sure there's a small bit of extra GC action

#

but actually doing a setLength might be more expensive

#

as it possibly has to copy the underlying array into a smaller one

tardy delta
#

yea i saw the Arrays.copy

lavish hemlock
#

I haven't looked at the impl

#

yeah copy is a bit slower than new

#

so the GC impact is negligible

#

if you actually wanted the most performant option, it would be storing a char[] yourself

#

but that's a bit more error-prone and hard to read

tardy delta
#

how the f does it know its going to be changed?

lavish hemlock
#

oh

#

yeah you can't modify variables within lambdas

#

this is a limitation of the fact that lambdas are just syntactic sugar for private methods

#

and as such, cannot modify a reference passed to them

patent horizon
#

anyone know what im doing wrong?

tardy delta
#

not setting the placeholders

#

also should i store something in a list or a set when i dont need a .get()?

lavish hemlock
#

List is the only interface that implements get

#

But Set is faster for iteration and contains

tardy delta
#

yea iknow

#

ah

#

forgot that list doesnt have contains

lavish hemlock
#

No, it does.

#

It's just slower.

tardy delta
#

nvm it has

lavish hemlock
#

Since ArrayList has to loop over the underlying array.

#

Which is an O(n) operation.

tardy delta
#

uhu

#

and set is just hashing stuff things

#

or something uwu

lavish hemlock
#

meanwhile HashSet should probably be O(1) when it comes to contains but I don't know, haven't looked at the implementation.

ivory sleet
#

It is in best case O(1) ye

quaint mantle
#

What does O(n) mean

tardy delta
#

how bigger it comes

#

how longer it takes

lavish hemlock
#

O(n) where n = size of the collection

quaint mantle
#

Ah

tardy delta
#

like f(x) = ax

lavish hemlock
#

e.g. scaling complexity, where more elements = a slower operation

#

Meanwhile O(1) is constant time

ivory sleet
#

yuh, iteration at O(1) wen roo_confuse

lavish hemlock
#

I mean

#

you could probably figure out some way to do it

ivory sleet
#

yeah lol

lavish hemlock
#

if you utilized concurrency

ivory sleet
#

I mean okay for singleton collections

lavish hemlock
#

but that'd be very heavy for processors

ivory sleet
#

technically O(1)

lavish hemlock
#

(oh yeah btw HashSet can be much slower if equals/hashCode aren't implemented properly, just a bit of a PSA for y'all)

eternal night
lavish hemlock
#

...what the fuck? lmao

ivory sleet
tardy delta
#

bruh

ivory sleet
opal juniper
#

duh

jade perch
#

Yeah can't loop through a list at o(1) that literally makes no sense

west oxide
#

?paste

undone axleBOT
solid cargo
#

have any ideas for a report comand that even a toddler can write?

#

cause idk if a 3rd grader can write /report player_name

crimson terrace
solid cargo
#

its for a school project- build battle

#
  • english isnt their native language
crimson terrace
#

just make an alias to the command /report to be in their native language

#

that could be easier

solid cargo
#

our native language is hard tho

#

/sudzeties or /report

crimson terrace
#

shorten it to /sud

solid cargo
#

ah

#

yes

#

thanks

crimson terrace
#

let me guess... that means something weird in that language?

solid cargo
#

nahj

#

sudzeties = report/complain

#

sūdzēties

crimson terrace
#

i meant the shortened version "sud". google isnt telling me anything tho so it should be fine

solid cargo
#

ah

#

yeah, but "sud" is pretty similar to "sūds", which means "shit"

crimson terrace
#

/sd

#

lmao

solid cargo
#

i will make just multiple alisases

#

thanks for the help!

crimson terrace
#

np. if you need help implementing just say so

solid cargo
#

will ask if i need to

#

like this? do i need to put anything in the commands class

crimson terrace
#

without the []

solid cargo
#

ah ok

#

thats it?

crimson terrace
#

actually nvm

solid cargo
#

i need them?

crimson terrace
#

it actually is with the [] my bad

solid cargo
#

no worries

crimson terrace
#

only ever used one alias

#

if the command class was set up correctly from the start you dont have to put in anything else

solid cargo
#

it works!

#

thanks

crimson terrace
#

np

livid tundra
#

how do I accept a persistantdatatype in a method

patent horizon
#

my placeholders i made don't seem to be working

#
public class Placeholders extends PlaceholderExpansion {

    Data data = new Data();

    @Override
    public String onRequest(OfflinePlayer player, String params) {
        switch (params) {
            case "guild": return data.getGuild(player);
            case "role": return data.getRole(player);
            case "memberCount": return String.valueOf(data.getMemberCount(player));
            case "memberCountCap": return String.valueOf(data.getMemberCountCap(player));
            case "level": return String.valueOf(data.getLevel(player));
            case "exp": return String.valueOf(data.getEXP(player));
        } return null;
    }

    @Override
    public @NotNull String getIdentifier() { return "Guilds"; }
    @Override
    public @NotNull String getAuthor() { return "wally"; }
    @Override
    public @NotNull String getVersion() { return "1.0"; }

}```
quaint mantle
#

i guess it will be %Guilds_guild%

#

fix the caps

#

and btw

#

is the placeholder registered ?

#

in main class new Placeholders().register()

#

onEnable

long helm
#

im getting an error "Could not pass event PlayerMoveEvent to ~~filename~~
org.bukkit.event.EventException: null
does anyone know what could be causing it?

crimson terrace
#

send the full error in a paste please

#

?paste

undone axleBOT
crimson terrace
long helm
#

do errors get stored anywhere outside of console print?

crimson terrace
#

not sure. maybe in the log. can you reproduce the error?

long helm
#

yeah

crimson terrace
#

ok nice

young knoll
#

Yes they are in the log

long helm
#

console doesnt show the whole error I can just send what I have

#

ill check there

#

in logs it says "...at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.17.1.jar:3238-Spigot-6c1c1b2-9217b52]
... 18 more" so ill send what I have

crimson terrace
#

just send the entire error from the console. Ill get you an example

long helm
#

oh hold on in logs its showing more than console, enough for me to see which variable is null

crimson terrace
#

very roughly tho as theres many errors you could get

tribal gyro
#

does anyone know whats the difference between GetDefaultValue and the GetValue in an attribute?

crimson terrace
#

I think defaultValue would be the value you start with and value would be the current actual value

long helm
#

so it seems that I have a null teams object, I think all I have to do is run checks on it after initialization

crimson terrace
#

from initialization to changing

crimson terrace
long helm
#

I check for if a team has a certain player, however I think if a team has no players it treats the players container as null.

#

which is what is causing the error

#

I wonder if I can provide a placeholder player object to the team that gets deleted after initialization

crimson terrace
#

put it all into an if statement to check wether team has more than 0 players

tribal gyro
eternal night
#

no

tribal gyro
#

if i use getValue()

#

ok

#

ty

crimson terrace
#

theres a method in Entity I think to get Absorption hearts

eternal night
#

on damageable

crimson terrace
#

yeye

tribal gyro
#

i mean i dont want it

#

btw can i set maxhealth value to 0

#

or thats not posible

crimson terrace
#

test it

#

I dont think you should tho

tribal gyro
#

why

crimson terrace
#

not sure, probably gonna screw with some stuff.

tribal gyro
#

tru

crimson terrace
#

setHealth(0) on an entity would have the same effect

tribal gyro
#

deprecated :/

crimson terrace
#

what version are you using

tribal gyro
#

wdym

crimson terrace
#

what version of minecraft are you coding for

young knoll
#

setHealth(0) will kill them

tribal gyro
#

1.17.1

young knoll
#

Setting max health to 0 will let them live until they get hit

crimson terrace
tribal gyro
calm star
#

Hi guys, I am trying to get NBTapi to shade with my plugin but it doesnt work here is my pom.xml so far:

eternal night
#

?paste

undone axleBOT
quaint mantle
#

Are you manually typing your pom xml or smth

calm star
#

no

#

disc crashed

eternal night
#

why are you defining the shade plugin twice

calm star
#

where

eternal night
#

in your pom ?

#

both your first and third plugin for your build are maven shade xD

calm star
#

this is my first shade

#

so i have

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
``` twice?
livid tundra
#

how do I make a method that acepts PersistentDataTypes?

long helm
crimson terrace
long helm
#

same thing, cant do anything on an empty team object

crimson terrace
long helm
#

smart

#

brb

crimson terrace
calm star
eternal night
#

huh ? during build time ?

#

oh

#

your dependency is bad

#

when declaring the dependency, use the actual group id

#

the "relocation" happens as basically one of the last steps

quaint mantle
livid tundra
#

but when I do ```java
void method(PersistentDataType<Object, Object> persistentDataType)

the input(PersistentDataType.BYTE) causes an error
eternal night
#

I mean

#

that is not how generics work

#

well

crimson terrace
#

T,K?

livid tundra
#

that just causes an error in the method

quaint mantle
#

<?, ?>

eternal night
#
private <T,Z> void pdc(final PersistentDataType<T, Z> type) {
    
}
#

or what manya said yea

calm star
eternal night
#

?paste your pom again please

undone axleBOT
calm star
eternal night
#

that is the wrong group id xD

livid tundra
#

thanks!

eternal night
#

that is the one you are relocating to

#

you want the original one

calm star
#

i had that to start with

eternal night
#

no

calm star
#

wait

eternal night
#

you had your projects group id

calm star
#

no

eternal night
#

as a maven variable

#

bruh

#
<dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>item-nbt-api</artifactId>
            <version>2.8.0</version>
            <scope>compile</scope>
        </dependency>
#

this was your first pom.xml

calm star
#

it saied that ona random spigot forum

#
            <groupId>de.tr7zw</groupId>
            <artifactId>item-nbt-api</artifactId>
            <version>2.8.0</version>
            <scope>compile</scope>
#

thats it now

eternal night
#

I mean yea

#

looks better

tardy delta
#

is it useful to check if there's more than one player before looping Bukkit.getOnlineplayers?

eternal night
#

no

calm star
#

now i get Could not find artifact de.tr7zw:item-nbt-api:pom:2.8.0 in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

quaint mantle
#

no

tardy delta
#

ki

eternal night
#

you haven't added the repository needed to even find it

#

did you read that wiki ?

patent horizon
#

so im watching this yt spigot dev tips video and he recommends to do whatever this is instead of just passing the plugin name through the method params that uses it. how does this work and why is it better?

eternal night
#

wouldn't call it better

tardy delta
#

only the sysout

patent horizon
#

yeah why not just do public int doSomething(String pluginName)

tardy delta
#

meh

eternal night
#

that is a perfectly fine way to do it

#

the functional programming peeps would even prefer that

crimson terrace
patent horizon
eternal night
#

I mean, now your doSomething method depends on state

#

which is meh

patent horizon
#

state?

tardy delta
#

i'm not a pepe

eternal night
#

state ?

#

like object state

#

fields

patent horizon
#

whats that mean

eternal night
#

like that current state of an class instance and its fields

patent horizon
#

ah

tardy delta
#

@patent horizon u dutch?

eternal night
#

idk, generally the showed example of the yt is not better than passing it to the method parameter. it is a design decision

patent horizon
#

so if you set the this.pluginName when the plugin starts up like new ExampleManager(pluginName) it'll use that plugin name every time after?

eternal night
#

entirely depends on the actual usage of it

#

yea

patent horizon
tardy delta
#

sad

#

🙄

patent horizon
#

yeehaw

tardy delta
#

🤠

quaint mantle
#

Do you know any well-done pluginswhere i can steal database managment from except luckperms

tardy delta
#

i stole it from

#

uhhh

#

uhhhhh

#

💀

patent horizon
#

i havent tried databases yet, just local yaml configs

tardy delta
#

i let my connection open for a week so dont ask me

livid tundra
#

how do I fix this warning?```
Unboxing of 'player.getPersistentDataContainer().get(nameSpacedKey, PersistentDataType.BYTE)' may produce 'NullPointerException'

quaint mantle
#

use Byte instead of byte, or reqnonnull if you are sure that container has value

tardy delta
#

Byte instead of byte?

#

for putting values?

quaint mantle
#

yes

#

Byte can be null, byte cannot

livid tundra
#

so I should put PersistentDataType.Byte?

eternal night
#

👀

#

no

#

the issue is that the get method may return null if there is no value for the key

livid tundra
#

I'm sure the key has a value

tardy delta
calm star
torn oyster
#

the dependency is local
and working
no errors in pom
its just this

onyx fjord
#

Hover on it

#

What does it say

tardy delta
ivory sleet
eternal night
#

with mvn package

#

if so, just flame intellij for being trash

quaint mantle
#

I already mentioned it here, tho, it has very specific design cases. All objects are moslty immutable and you cant really change them in future. Thats.. Easier

ivory sleet
#

Oh

onyx fjord
#

It uses very weird depency injection

calm star
#

yes it works now thanks @eternal night

eternal night
#

👍

onyx fjord
#

That breaks 90% of plugins

quaint mantle
#

uhm

acoustic pendant
#

Why is this sending an error?

eternal night
#

that is not a task

ivory sleet
eternal night
#

neither a runnable nor a Consumer<BukkitTask>

quaint mantle
eternal night
#

additionally that would not increase the cold value by one either

acoustic pendant
#

runTaskTimer is not a task?

eternal night
#

no what you are passing as the second parameter is wrong

onyx fjord
eternal night
#
scheduler.runTaskTimer(plugin, () -> {
  System.out.println("Example code that hates loggers");
}, 0, 20 * 10);
#

as an example

acoustic pendant
#

but the second parameter is not the action the task does?

eternal night
#

it is

#

but you can't just pass statement like code in there

acoustic pendant
#

but

#

runTaskTimer cannot be used with lambda

eternal night
#

what

acoustic pendant
#

well

eternal night
#

did I miss something

acoustic pendant
#

or it's giving an error of other thing

lost matrix
acoustic pendant
#

but if i don't do it as lambda it doesn't give an error

eternal night
#

I mean, the code i pasted above should work

quaint mantle
eternal night
#

after I added the initial delay

acoustic pendant
eternal night
#

add the 0

#

as the third paramter

#

as the initial delay

acoustic pendant
#

() this?

eternal night
#

0

#

like the number

acoustic pendant
#

oh

#

now

#

ty

quaint mantle
ivory sleet
#

That’s why you wanna separate asynchronous, parallel and concurrent logic with your data model, as much as possible

lost matrix
onyx fjord
quaint mantle
#

then dont use their plugins md_5

onyx fjord
#

K

#

Well

#

I only had to modify 2 plugins

#

And I pred the changes like normal person

#

:)

acoustic pendant
#
            scheduler.runTaskTimer(plugin, () -> {
                setCold(1);
            }, 0, 20 * 10);``` 

ok, so this will add 1 to cold every second i guess?
lost matrix
twilit wharf
#

Like in Hypixel, how do I change the text above a players head? I tried player.setName() and it didn’t work

onyx fjord
#

They use armorstands don't they

twilit wharf
#

I thought about that

onyx fjord
#

Use nametagedit API maybe

quaint mantle
#

LibertyBans makes world better by being an example of why you always should relocate depenencies 🙂

twilit wharf
quaint mantle
#

are you sure if its done with armorstand

onyx fjord
#

For thay

quaint mantle
#

I've ran in a lots of issues while trying to do custom name tags with armorstands

twilit wharf
onyx fjord
#

Otherwise you only have 2 lines to work with

lost matrix
#

Armorstands only make sense if you want to have multiple lines over a players head. If you just want to change their display name then there are several other ways of achieving that.

twilit wharf
#

So are packets the way to do it then?

onyx fjord
#

Scoreboard teams and stuff are used

#

Aren't they?

twilit wharf
#

I got no clue

mortal hare
#

i present to you - dinnerbone fox

gray comet
#

Hacking fox in the background

plucky fog
mortal hare
#

you havent seen my whole squad

plucky fog
west oxide
#

hey i have question ```public class TagsMenu implements Listener {
@EventHandler
public static void onItemClick (InventoryClickEvent event){
Player p = (Player) event.getWhoClicked();
TagsManager tagsList = new TagsManager(BwCore.getPlugin());
TagsPlayerData tagsPlayerData = new TagsPlayerData(BwCore.getPlugin());

    if (event.getCurrentItem().getType() == Material.NAME_TAG){
        String prefix = utils.chat(BwCore.getPlugin().getConfig().getString("prefix"));
        UUID uuid = p.getUniqueId();
        String tagname = event.getCurrentItem().getItemMeta().getLore().get(0);
        tagsPlayerData.getConfig().set("Tags."+uuid ,tagname);
        tagsPlayerData.saveConfig();
        p.closeInventory();
        p.sendMessage(prefix +"tag set to "+ tagname );
    }
}

}```

    uuid:Tagname```
#

it does nothing

mortal hare
#

you need to save the yaml via save() method afaik

#

it only sets the key in memory

west oxide
#

i am embarassed

#

but thank you

#

alot

mortal hare
#

np

west oxide
#

cuz i thought about this for a while now lol

peak granite
#

how do i get the region name at player

quaint mantle
mortal hare
peak granite
#

yes

ivory sleet
peak granite
mortal hare
#
ApplicableRegionSet set = WorldGuard.getInstance().getPlatform().getRegionContainer().get(new BukkitWorld(location.getWorld())).getApplicableRegions(BlockVector3.at(location.getX(),location.getY(),location.getZ()));
ivory sleet
#

Btw if you haven't checked it out, caffeine is a pretty neat library which has expiring caches as well as soft caches, with removal listeners and what not.

peak granite
#

like i wanna see if the region they're standing at is named "pvp"

calm star
#

How can i make an item have an enchant but not say it (just haveing the glint to it)?

peak granite
#

enchant it and hide flags

west oxide
calm star
mortal hare
#

use .getRegions() then do for each loop to check for regions name

#

this javadoc is old

#

but it should work

lost matrix
west oxide
#

@ivory sleet i have question ,
do you think am ready to make a minigame plugin ?

lost matrix
mortal hare
#

you just need to get the discipline and courage to finish it

west oxide
ivory sleet
west oxide
#

like in hours spent

quaint mantle
mortal hare
lost matrix
west oxide
#

sumo,thebridge bedwars etc..

#

something like frost

mortal hare
#

the more I look at other people's github repos the more depressed I get.

lost matrix
median mason
#

Hi, How can I create a Handler of two Events ??
I am using Bukkit

@EventHandler
public void onPlayerClickHologram(
      PlayerToggleSneakEvent eventSneak, 
      PlayerInteractEvent eventClick
) {
      System.out.println("Double event")
}```
lost matrix
mortal hare
#

i would handle the events in the separate methods

#

with eventhandler annotations

lost matrix
#

EventHandler methods are only allowed to have a single argument T where <T extends Event>

mortal hare
#

interesting to note that skript has possibility to listen to couple events at the same time afaik (or maybe skript-mirror) but that's wrapping plugin around spigot api.

median mason
quaint mantle
#

No

mortal hare
#

you can do that but that's unnecessary

#

just create one private method which does the calculation for you, and execute that method in both eventhandlers.

lost matrix
# median mason so I have to create a CustomEvent that contains the other Events?

Separate your concerns. What do you need from those events?

@RequiredArgsConstructor
public class SomeListener implements Listener {

  private final SomeHandler someHandler;

  @EventHandler
  public void onSneak(final PlayerToggleSneakEvent event) {
    final Player player = event.getPlayer();
    this.someHandler.doSomething(player);
  }

  @EventHandler
  public void onInteract(final PlayerInteractEvent event) {
    final Player player = event.getPlayer();
    this.someHandler.doSomething(player);
    this.someHandler.doSomethingDifferent(player);
  }

}
tardy delta
#

final 🌝

mortal hare
#
@EventHandler
public void onPlayerSneak(final PlayerSneakEvent event) {
  if (!this.doSomething(event.getPlayer()) event.setCancelled(true);
}

@EventHandler
public void onPlayerInteract(final PlayerInteractEvent event) {
  if (!this.doSomething(event.getPlayer()) event.setCancelled(true);
}

private boolean doSomething(final Player player) {
  return false;
}
calm star
#

when i do condenserWandMeta.addEnchant(Enchantment.ARROW_INFINITE, 1, true); there is no option for .flag after it

tardy delta
#

do it before

mortal hare
lost matrix
calm star
#

oh got it

#

ye

tardy delta
mortal hare
#

am i the only one who prefers writing this keyword for instance variables, methods?

calm star
#

is there a way to add a itemflag which stops the NBT:1

#

on the item

tardy delta
#

i dont like it in methods

lost matrix
west oxide
mortal hare
#

it just makes more clear if the variable derived from instance or it is some sort of local/static variable

tardy delta
#

for two hands

#

iirc

mortal hare
onyx fjord
#

You can add a cooldown

west oxide
#

wdym for two hands

mortal hare
#

not playerinteractevent

west oxide
onyx fjord
#

Idk I'm not an expert

tardy delta
#

ah uhh

west oxide
onyx fjord
#

But it probably takes taking and putting back item as 2 event fires

lost matrix
lost matrix
west oxide
#

ok will try

lost matrix
#

Should fix it

west oxide
#

.setCancelled ?

onyx fjord
#

Yes

#

(true) afaik

crimson terrace
west oxide
#

ok

onyx fjord
#

I'd put that before GUI closing

west oxide
#

didnt fix ...

#

tried before , after and after message

lost matrix
west oxide
#

1.8.8

lost matrix
#

Well...

west oxide
#

o.o

tardy delta
#

why do people like 1.8.8 that much?

west oxide
lost matrix
#

Use a version that has lost support half a decade ago and expect bugs to happen. Nobody supports/uses 1.8 anymore

tardy delta
#

only pvp 🙄

crimson terrace
tardy delta
#

mmh me and pvp goes brr so uhh yeah

west oxide
#

i expect bugs with anything tbh

#

so idk

lost matrix
onyx fjord
#

We also have old combat plugin

#

;)

crimson terrace
onyx fjord
#

We use it on new versions, but we have to time our attacks

lost matrix
onyx fjord
#

To deal critical damage

#

And avoid getting hit

mortal hare
#

this is my first time seeing fox sitting

sullen marlin
#

what does the fox say

west oxide
lost matrix
west oxide
onyx fjord
#

Apparently fox mouth is left hand

#

So where's right hand

mortal hare
#

in its butt

#

L

crimson terrace
onyx fjord
#

No plz

crimson terrace
#

all I gotta say is prison wallet

lost matrix
west oxide
# mortal hare

is this a normal pose? like is this a thing on minecraft or you actually created a new pose for fox ?

west oxide
#

oh ok

onyx fjord
#

Crazy plugin idea, fox hats

west oxide
#

u know ...1.8.8 ...I didnt know

#

lol

onyx fjord
#

Using custom models on fox left hand

#

@west oxide we don't support 1.8, paper would ban you lol

west oxide
onyx fjord
#

We don't ban

west oxide
#

paper = player . owner ?

onyx fjord
#

Another server software

west oxide
#

oh

#

lol

onyx fjord
#

Spigot fork

mortal hare
#

a.k.a paperspigot (nowadays just papermc)