#help-development

1 messages ยท Page 1600 of 1

eternal oxide
#

yes

proud basin
#

I get com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONSTRAINT kitCooldown PRIMARY KEY ('631b2936-7672-474d-9b4f-3366504065f0', 'pvp' at line 1

#

The version of mysql is 8

eternal oxide
#

no

#

you are adding a UUID

proud basin
#

yeah that's what you told me to do

eternal oxide
#

CONSTRAINT kitCooldown PRIMARY KEY (UUID, Cooldown)

#

in teh table creation

#

cooldown and UUID are you column names

proud basin
#

yea I know

eternal oxide
#

not an actual uuid

#

you only define it in your table creation

proud basin
#

what?

#

You confused the shit out of me

#

am I not suppose to add a uuid?

eternal oxide
#

that is just to set a Primary key pair on teh table

#

you don;t use it anywhere else in any other query

proud basin
#

so?

#

uh

#

How am I suppose to delete the column then without it

eternal oxide
#

you access the table exactly as you would normally

quaint mantle
#

hey i can use ChatColor.of(hex code (string?)); to get a HEX in text.. yes?

#

or nah

proud basin
#

but If I can't check their UUID how else would I check

eternal oxide
#

select * from ? where uuid = ? and cooldown = ?

proud basin
#

BUT YOU JUST TOLD ME NOT TO USE UUID ANYWHERE ELSE

eternal oxide
#

you don;t use CONSTRAINT anywhere else

proud basin
#

oh

#

so do I not use it setting their time and getting their time?

#

only use it on one?

eternal oxide
#

you ONLY use CONSTRAINT on table creation

proud basin
#

I don't have a table creation though

eternal oxide
#

when you setup your table

#

you shoudl have an sql query to CREATE TABLE

proud basin
#

i don't

#

I made it manually

eternal oxide
#

write a query to do it

proud basin
#

But isn't that just less efficient?

#

wait

#

can't I just run that in the query of the table on phpmyadmin?

crude charm
#

but why lmfao

proud basin
#

or does it have to run constantly?

crude charm
#

why would you do it manually every time you want to delete a table

eternal oxide
#
CREATE TABLE Cooldowns(
    UUID varchar(50) NOT NULL,
    Cooldown varchar(255) NOT NULL,
    Time BIGINT UNSIGNED,
    CONSTRAINT PK_KitCooldown PRIMARY KEY (UUID, Cooldown)
);```
proud basin
#

because it's easier?

crude charm
proud basin
#

yea

crude charm
#

...

quaint mantle
short shale
#

is there any expression like that?:
event.getMessage().getFirstCharacter()...

quaint mantle
cold tartan
proud basin
cold tartan
eternal oxide
unreal quartz
#

just nuke the db in code then lol

short shale
#

someone knows if there is some expression who can get the first character of player's message?

#

i was trying this:
event.getMessage().getFirstCharacter()

unreal quartz
#

like getCharAt or something

#

yes..

eternal oxide
#

getMessage() is just a String

mystic sky
#

https://ibb.co/QjjymZJ < The imagine
Why im getting (imports) ImportOrder error while trying to compile BungeeCord( Added custom patches)

proud basin
terse orbit
#

event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 60, 1)); doesn't seem to apply any blindness for some reason

terse orbit
#
package blue.polar.rtp.events;

import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

public class PlayerRespawn implements Listener {

    Random random = new Random();
    List<Material> unsafe = Arrays.asList(Material.CACTUS, Material.LAVA, Material.LAVA_CAULDRON, Material.WATER);

    @EventHandler
    public void onPlayerRespawn(PlayerRespawnEvent event) {
        if (!event.isBedSpawn()) {
            boolean isSafe = false; int attempts = 0; while (!isSafe) {
                attempts++;
                int x = this.random.nextInt(20_000) - 10_001; int z = this.random.nextInt(20_000) - 10_101;
                Block block = event.getPlayer().getWorld().getHighestBlockAt(x, z);
                if (this.unsafe.contains(block.getBlockData().getMaterial())) continue;
                event.setRespawnLocation(new Location(event.getPlayer().getWorld(), x, block.getY() + 4, z));
                System.out.printf("[RTP] %s has respawned and been randomly teleported to %s, %s, %s after %s attempts!%n", event.getPlayer().getName(), x, block.getY() + 4, z, attempts);
                event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 20 * 10, 1));
                event.getPlayer().sendTitle(ChatColor.translateAlternateColorCodes('&', "&6&lWelcome... Home?"), "You've been teleported to a random place!", 10, 70, 20);
                isSafe = true;
            }
        }
    }
eternal oxide
#

player is still dead in that code. Potion will not apply

quaint mantle
#

wait 1 tick

terse orbit
#

1 tick after setRespawn?

eternal oxide
#

and in teh delayed code, get a new Player object from the UUID

terse orbit
#

How would I wait 1 tick

eternal oxide
#

runTask

tacit storm
#

Bukkit.getScheduler().runTask()

dusk flicker
#

?scheduling

undone axleBOT
terse orbit
#

With my code how would I get the plugin it's using?

tacit storm
#

Put everything in that runTask

#

So all of your code is delayed by 1 Tick

#

Or after ur first if() statement

#

Would prob. be the easiest way

eternal oxide
#

only the code after setRespawnLocation

tacit storm
#

^ or that would also work

eternal oxide
#

your plugin instance you pass it to the class via dependency injection

terse orbit
#

Yeah so

                scheduler.runTaskLater(plugin, () -> {
                    ...
                }, 1);
eternal oxide
#

either pass a reference or Bukkit.getPlugin("yourPluginName")

#

or somethign close

terse orbit
#
                scheduler.runTaskLater(Bukkit.getPluginManager().getPlugin("RTP"), () -> {
                    ...
                }, 1);
#

so this should work?

eternal oxide
#

yes

dusk flicker
#

Use an instance of your plugin if you have it

terse orbit
#

I don't think I do?

terse orbit
eternal oxide
#

you could

dusk flicker
#

It would be however you instance your main class

terse orbit
#
package blue.polar.rtp;

import blue.polar.rtp.events.PlayerJoin;
import blue.polar.rtp.events.PlayerRespawn;
import org.bukkit.plugin.java.JavaPlugin;

public final class RTP extends JavaPlugin {

    @Override
    public void onEnable() {
        System.out.println("[RTP] RTP has been enabled!");

        getServer().getPluginManager().registerEvents(new PlayerRespawn(), this);
        getServer().getPluginManager().registerEvents(new PlayerJoin(), this);
    }

    @Override
    public void onDisable() {
        System.out.println("[RTP] RTP has been disabled!");
    }

}

#

this is the main class

eternal oxide
#

when you register your Listener you do new listener() just use new listener(this)

terse orbit
#

so new PlayerJoin(this)

eternal oxide
#

yes, then in your PlayerJoin class you add the reference in its constructor

#

store to a Field

#

plugin

terse orbit
#

alright tysm

eternal oxide
#

your IDE will show you an error and one of the options will be to add a constructor

terse orbit
#
public PlayerRespawn(RTP rtp) {}
#

it created this

#

do i just leave it like that or change it to

#
    private final RTP plugin;

    public PlayerRespawn(RTP rtp) {
        this.plugin = rtp;
    }
eternal oxide
#

now in teh constructor add this.plugin = rtp

#

yep

#

make teh Field final

#

oh you have

terse orbit
#

yeah ide did it for me

tacit storm
#

Hey I have a quick question!
I am currently trying to get MySQL running again, but I'm running into a problem since I never worked with INSERT INTO ON DUPLICATE KEY.

Here's my SQL:

            "ON DUPLICATE KEY UPDATE %selection% = %var%```

My table looks like this:
``user | vote1 | vote2 | vote3 | vote4 | vote5 | vote6 | vote7 | vote8 | vote9 | vote10``
(The values vote1-10 are replaced by actual names, just to simplify I wrote it as vote)

I am replacing %table% with the Table, 
%selection% with the selected *vote1-10* column,
%player% with the Player's Name
and %var% with a Number from 1 - 5

I am currently getting this Error though: ``java.sql.SQLSyntaxErrorException: Unknown column 'StunterLetsPlay' in 'field list'``
lost matrix
#

Or after the closing bracket at the line above. Same outcome.

tacit storm
#

Nope, sadly didn't work, same error after all

#

I should add that it worked when the SQL looked like this:

            "ON DUPLICATE KEY UPDATE %selection% = %var%```
#

But this then set's the User as [NULL] and keeps adding new Rows

manic crater
#

It's returning null for no reason. And it started doing this after i checked if the user had a permission,

So i was wondering what the cause is??? Cause if they run the cmd for example: /refresh test than it would work but yet just /refresh in general doesn't work and returns null it doesn't make much sense, and i have return true; after the msg, so im starting to think that i just need to put return;

dusk flicker
#

It's not returning null firstly, its a index out of bounds

lost matrix
tacit storm
#

okay I figured it out, I typed StunterLetsPlay instead of "StunterLetsPlay" in the Values.

It is putting in the Lines now, but it's not replacing the currently existing ones.

manic crater
#

Well im trying to do like a "help" cmd, type thing, soo, im wondering if its spacing issues or not

manic crater
lost matrix
manic crater
#

Ok

#

But i want it to return a msg, and not an error,

#

Cuz i never had this issue before where running a cmd with a perm check leads to this

lost matrix
#

Show your code pls

manic crater
#

Yep

#
if(cmd.getName().equalsIgnoreCase("refresh")) {
            if(p.hasPermission("plugmode.refresh")) {
                if(args.length == 0) {
                    p.sendMessage(prefix + ChatColor.RED + "Please select a plugin from the list:");
                    p.performCommand("pl");
                    return true;
                }
                if(args[0].equalsIgnoreCase("PlugMode")) {
                    p.sendMessage(prefix + ChatColor.RED + "You can not reload the plugin" + ChatColor.YELLOW + " PlugMode");
                    return true;
                }else if(args[0].equalsIgnoreCase(args[0])) {
                    if (Bukkit.getServer().getPluginManager().getPlugin(args[0]) == null) {
                        p.sendMessage(prefix + ChatColor.RED + "This plugin isn't loaded on the server.");
                        return true;
                    }
                    if (Bukkit.getServer().getPluginManager().getPlugin(args[0]) != null) {
                        p.sendMessage(prefix + ChatColor.GREEN + "Reloaded the plugin: " + ChatColor.YELLOW + args[0]);
                        getServer().getPluginManager().disablePlugin(Bukkit.getPluginManager().getPlugin(args[0]));
                        getServer().getPluginManager().enablePlugin(Bukkit.getPluginManager().getPlugin(args[0]));
                        return true;
                    }
                }
            }
            if(!p.hasPermission("plugmode.refresh")) {
                p.sendMessage(prefix + ChatColor.RED + "You do not have the permission to run this command.");
                return true;
                }
            }
#

Everything else works fine dont get me wrong

#

But its just the when u run the cmd it just doesnt return a msg

lost matrix
#
  1. if(cmd.getName().equalsIgnoreCase("refresh")) This check is useless in 99% of cases
manic crater
#

I still find it helpful to have tbh

#

Soooo im gonna keep it

lost matrix
manic crater
#
  • i have other cmds in that as well
manic crater
lost matrix
#

Ah i see. So you use one CommandExecutor for several commands

manic crater
#

Yes pretty much

#

But that doesnt matter, anyway how can i fix that array null issue

#
if(cmd.getName().equalsIgnoreCase("refresh")) {
            if(p.hasPermission("plugmode.refresh")) {
                if(args.length == 0) {
                    p.sendMessage(prefix + ChatColor.RED + "Please select a plugin from the list:");
                    p.performCommand("pl");
                    return true;
                }
#

Cuz its just that issue,

#

That doesnt return anything

lost matrix
#

Show the full stack trace pls

manic crater
#

I showed u the entire error.

lost matrix
#

Oh wait. You use your main class as CommandExecutor?

lost matrix
manic crater
#

If (args[0].equalsIgnoreCase("pluginfo")) {

#

Thats line 37

lost matrix
#

Then the "args" array does not contain any elements at that point

#

But you are using 1.8 anyways so im out

hasty prawn
#

You must be doing that before the args.length == 0 return

manic crater
#

Im not

#

Lmfao

#

Im using 1.17.1

#
if (args[0].equalsIgnoreCase("pluginfo")) {
            if(p.hasPermission("plugmode.info")) {
                if(args.length == 0) {
                    p.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "---------------------------------");
                    p.sendMessage(ChatColor.BLUE + "");
                    p.sendMessage(ChatColor.GRAY + "Author: " + ChatColor.YELLOW + "Dishy");
                    p.sendMessage(ChatColor.GRAY + "");
                    p.sendMessage(ChatColor.GRAY + "Version: " + ChatColor.GOLD + "1.0");
                    p.sendMessage(ChatColor.GRAY + "");
                    p.sendMessage(ChatColor.GRAY + "Support Discord: " + ChatColor.LIGHT_PURPLE + "https://");
                    p.sendMessage(ChatColor.BLUE + "");
                    p.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "---------------------------------");
                    return true;
                }
            }
            if(!p.hasPermission("plugmode.info")) {
                p.sendMessage(prefix + ChatColor.RED + "You do not have the permission to run this command.");
                return true;
            }
          }
#

Shiz self ad my bad

hasty prawn
#

Yeah you are, check args.length first

lost matrix
manic crater
#

Just bc im running a 1.8 server doesnt mean the plugin cant be 1.17

hasty prawn
#

Doesn't really matter

lost matrix
manic crater
hasty prawn
#

Yes

manic crater
lament minnow
#

you should really update

manic crater
lament minnow
#

1.8 is very old

manic crater
hasty prawn
#

!= 0

manic crater
#

It doesnt matter if im on 1.8 as a client side

lament minnow
hasty prawn
#

If it's 0 you should tell them to put something

lament minnow
#

yes but 1.8 is still very old

manic crater
hasty prawn
#

The version doesn't even matter here so why are we talking about it

manic crater
#

Everything else works fine except for the code at == 0

hasty prawn
#

Yeah because you're checking for an argument when there are none

#

That's why it's erroring

#

So check if there's args, then check them

manic crater
#

Ok so if the argument = something than under that i put != 0?

lost matrix
manic crater
#

Idk why versions matters to you so much anyway

lost matrix
#

Because the small community still clinging to old versions hurt the progress of the api for several years now.

manic crater
lost matrix
lost matrix
manic crater
# hasty prawn Yeah because you're checking for an argument when there are none
if (args[0].equalsIgnoreCase("pluginfo")) {
            if(p.hasPermission("plugmode.info")) {
                if(args.length == 0) {
                    p.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "---------------------------------");
                    p.sendMessage(ChatColor.BLUE + "");
                    p.sendMessage(ChatColor.GRAY + "Author: " + ChatColor.YELLOW + "Dishy");
                    p.sendMessage(ChatColor.GRAY + "");
                    p.sendMessage(ChatColor.GRAY + "Version: " + ChatColor.GOLD + "1.0");
                    p.sendMessage(ChatColor.GRAY + "");
                    p.sendMessage(ChatColor.GRAY + "Support Discord: " + ChatColor.LIGHT_PURPLE + "https://discord.gg/spigotmc");
                    p.sendMessage(ChatColor.BLUE + "");
                    p.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "---------------------------------");
                    return true;
                }
            }
            if(!p.hasPermission("plugmode.info")) {
                p.sendMessage(prefix + ChatColor.RED + "You do not have the permission to run this command.");
                return true;
            }
          }

Im basically trying to make a "help" menu here.

manic crater
hasty prawn
dusk flicker
#

love how that made the invite

manic crater
#
  • im using 1.17.1 for my plugin lol
manic crater
hasty prawn
#

Wait I see what you're doing

manic crater
#

Ok

hasty prawn
#
if(args.length == 1 && args[0].equalsIgnoreCase("pluginfo") {
  //execute pluginfo here
}
manic crater
# lost matrix What is Spigot to you then?

My plugin is fr on the latest version and my server is on 1.8 idk why this is uch a big deal over a SERVER version. When a PLUGIN is on 1.17.1. Do you not see how stupid you sound rn?

manic crater
lost matrix
hasty prawn
#

Then get rid of the args.length == 0 inside

manic crater
dusk flicker
#

dude calm down

manic crater
#

Yk what everyone just stfu except for dessie and rack

whole stag
#

You're the one that wants support for unsupported software

manic crater
hasty prawn
#

Should they be using 1.17? Yes. Does it matter with what they need? Nope. Don't even know why we're talking about versions.

manic crater
#

Why does a server version matter when hit has nothing to do with a plugin version

lost matrix
lament minnow
#

Bugs.

tacit storm
#

Why are we fighting over Minecraft Versions

lament minnow
#

I dunno.

dusk flicker
#

Server version matters because the api has changed over multiple versions

lament minnow
#

I missed most of it.

whole stag
#

Yee

manic crater
#

Is that fr what you guys care about??? A server fversion thats my preferance???? If so PLEASE just leave teh chat rn, and go help someone in #help-server please.

manic crater
whole stag
#

Does spigot 1.17.1 support 1.8 servers?

manic crater
#

Yes

dusk flicker
#

Spigot officially only supports latest

hasty prawn
#

To an extent it does

#

As long as you don't use anything new/changed

dusk flicker
#

This discord, it's up to the users which they support

manic crater
#

Really? Cause last time i checked im making a 1.17.1 plugin and it works on 1.8

manic crater
lost matrix
whole stag
#

There's a lot of stuff that's changed backend

hasty prawn
#

It'll work as long as the methods, fields and classes you use are also in the 1.8 JAR

dusk flicker
#

Just because something is backwards compatible doesn't mean its supported.

tacit storm
#

It might work cuz it prob. has the same loading structure, doesn't say it will work for everything though

whole stag
#

It might work, it might not

manic crater
hasty prawn
#

With what they needed, it works. So version is completely redundant.

manic crater
#

^

hasty prawn
#

Just recommend they update and move on ๐Ÿ˜‚

lost matrix
whole stag
#

That's all

manic crater
hasty prawn
#

Your life will be easier you you build against 1.8 JAR btw Dishy

manic crater
hasty prawn
#

Ah

#

Well, whatever floats your boat

manic crater
whole stag
#

Can build against both

manic crater
dusk flicker
#

Well if it's a 1.8 plugin you should be building against the 1.8 API

#

Even with it not being supported officially

whole stag
#

Yup

manic crater
dusk flicker
#

Let me rephrase

hasty prawn
#

They're just giving suggestions & trying to help. They are right tbh ยฏ_(ใƒ„)_/ยฏ

dusk flicker
#

If you are going to be running it only on 1.8 you should build against the 1.8 jar

lament minnow
#

^

manic crater
#

Im not gonna be running it only on 1.8

dusk flicker
#

As a lot of methods have changed in 9 major versions

manic crater
#

Thats why there is a 1.17.1 jar file in it

lost matrix
#

If you just call one method in 1.17 that doesnt exist in 1.8 your plugin will just crash... Makes literally no sense to build a 1.17 plugin then run it on a 1.8 server.

whole stag
#

Run on 1.8, build on 1.8
Run on 1.17, build on 1.17

lament minnow
#

make two versions of the plugin

whole stag
#

Run on both, build on both

manic crater
hasty prawn
#

If that's what works for you, go for it. It only really makes a difference for the developer.

lost matrix
lament minnow
#

Yeesh, guys.

dusk flicker
#

at least this is better then paper

#

lmao

manic crater
#

Dude it doesnt matter over a server version

#

Just like move on from the topic

#

Idk why this is such a big deal

hasty prawn
#

Have you been able to verify what I said is what you needed dishy?

dusk flicker
#

What was the original problem?

manic crater
hasty prawn
#

๐Ÿ‘

lost matrix
hasty prawn
manic crater
manic crater
#

Like, thats all

whole stag
#

Your choices are questionable and may lead to issues

#

As for your code, I'm still parsing it

manic crater
#

K gud for me

#

I still get an error @hasty prawn

whole stag
#

I think dessie's fix works, but it's mildly spaghetti

hasty prawn
#

Send the new code

manic crater
lost matrix
lost matrix
manic crater
#
if(args.length == 0 && args[0].equalsIgnoreCase("refresh")) {
            Player p = (Player)sender;
            String prefix = ChatColor.GRAY + "[" + ChatColor.AQUA + "PM" + ChatColor.GRAY + "] ";
            if(p.hasPermission("plugmode.refresh") && sender instanceof Player) {
                if(args.length == 0) {
                    p.sendMessage(prefix + ChatColor.RED + "Please select a plugin from the list:");
                    p.performCommand("pl");
                    return true;
                }
                if(args[0].equalsIgnoreCase("PlugMode")) {
                    p.sendMessage(prefix + ChatColor.RED + "You can not reload the plugin" + ChatColor.YELLOW + " PlugMode");
                    return true;
                }else if(args[0].equalsIgnoreCase(args[0])) {
                    if (Bukkit.getServer().getPluginManager().getPlugin(args[0]) == null) {
                        p.sendMessage(prefix + ChatColor.RED + "This plugin isn't loaded on the server.");
                        return true;
                    }
                    if (Bukkit.getServer().getPluginManager().getPlugin(args[0]) != null) {
                        p.sendMessage(prefix + ChatColor.GREEN + "Reloaded the plugin: " + ChatColor.YELLOW + args[0]);
                        getServer().getPluginManager().disablePlugin(Bukkit.getPluginManager().getPlugin(args[0]));
                        getServer().getPluginManager().enablePlugin(Bukkit.getPluginManager().getPlugin(args[0]));
                        return true;
                    }
                }
            }
            if(!p.hasPermission("plugmode.refresh")) {
                p.sendMessage(prefix + ChatColor.RED + "You do not have the permission to run this command.");
                return true;
                }
            }
hasty prawn
#

args.length == 1

#

not 0

lost matrix
#

-> args.length == 0 && args[0].equalsIgnoreCase("refresh") This will always throw an exception

manic crater
#

I event put == 1 and it didnt work

whole stag
#

I'd wrap the whole thing in a length checker

manic crater
lost matrix
#

args.length == 0 -> args.length != 0 is more resilient than args.length == 1

manic crater
#
if(args.length == 1 && args[0].equalsIgnoreCase("refresh")) {
            Player p = (Player)sender;
            String prefix = ChatColor.GRAY + "[" + ChatColor.AQUA + "PM" + ChatColor.GRAY + "] ";
            if(p.hasPermission("plugmode.refresh") && sender instanceof Player) {
                if(args.length == 0) {
                    p.sendMessage(prefix + ChatColor.RED + "Please select a plugin from the list:");
                    p.performCommand("pl");
                    return true;
                }
                if(args[0].equalsIgnoreCase("PlugMode")) {
                    p.sendMessage(prefix + ChatColor.RED + "You can not reload the plugin" + ChatColor.YELLOW + " PlugMode");
                    return true;
                }else if(args[0].equalsIgnoreCase(args[0])) {
                    if (Bukkit.getServer().getPluginManager().getPlugin(args[0]) == null) {
                        p.sendMessage(prefix + ChatColor.RED + "This plugin isn't loaded on the server.");
                        return true;
                    }
                    if (Bukkit.getServer().getPluginManager().getPlugin(args[0]) != null) {
                        p.sendMessage(prefix + ChatColor.GREEN + "Reloaded the plugin: " + ChatColor.YELLOW + args[0]);
                        getServer().getPluginManager().disablePlugin(Bukkit.getPluginManager().getPlugin(args[0]));
                        getServer().getPluginManager().enablePlugin(Bukkit.getPluginManager().getPlugin(args[0]));
                        return true;
                    }
                }
            }
            if(!p.hasPermission("plugmode.refresh")) {
                p.sendMessage(prefix + ChatColor.RED + "You do not have the permission to run this command.");
                return true;
                }
            }
whole stag
#

Still raises the exception on that first line?

hasty prawn
manic crater
#

Also these arent arguments

#

These are new cmds

#

With arguments to them

hasty prawn
manic crater
#

its still the same,

#

my wifi died on my pc soooo doing this on a chromebook now....

whole stag
#

that code will not throw that error

manic crater
#

it does

whole stag
#

It's not possible

lost matrix
#

Not possible.
Is this line 37? if(args.length == 1 && args[0].equalsIgnoreCase("refresh")) {

manic crater
#

No

#

thats line 120

hasty prawn
#

Whats 37

manic crater
#

wups i mean 113

lament minnow
#

bruh

manic crater
#

37 is plugininfo

hasty prawn
#

Are you still doing args.length == 0

#

because don't

lost matrix
#

Then pls show us the code that actually throws the exception...

whole stag
#

Wait, why are you showing us this code if it's not what's broken

manic crater
#

No i used the code u sent me dessie

hasty prawn
#

Send that then

manic crater
#

you know

#

u guys dont listen

#

do u

#

i just said

#

my wifi is out on my pc

#

like i JUST said that

#

soon as u pinged me

whole stag
#

That makes no difference really

manic crater
#

Yeah it does

#

bc i have to retype it all out

whole stag
#

Take a picture if you really need to

#

The codes on the server so you could still check the error, just won't be able to hot patch

manic crater
#
if(args.length == 00 && args[0].equalsIgnoreCase("pluginfo")){
  if(p.hasPermission("plugmode.info")){
    p.sendMess("msg u get the point x this by 8"); <- duck this im not typing out all the msgs over and over.
    return true;
  }
  if(!p.hasPermission("plugmode.info")){
    p.sendMessage(prefix + ChatColor.RED + "You dont have the perms to d othis yaayyaytayay ata");
    return true;
  }
}
whole stag
#

You don't listen do you

hasty prawn
#

๐Ÿ˜‚

lost matrix
#

This again, always throws an exception if(args.length == 00 && args[0].equalsIgnoreCase("pluginfo"))

manic crater
whole stag
#

Do you understand how java arrays work?

manic crater
#

dude,

#

i dont mess with arrays 24/7

lost matrix
manic crater
#

exactlyyyy

#

ur sarcasm fits the mood

#

honestly

dusk flicker
#

I think that was more of an insult but idk

whole stag
#

Okay

manic crater
#

well i took it as sarcasm so

#

idk

whole stag
#

Here's what you should do

#

Go learn java

manic crater
#

bro i know java,

#

thats the thing

#

i fr initially came in here to get to know what the error was about and how i could solve it

#

bc i never encoutered the error before

whole stag
#

if(args.length == 00 && args[0].equalsIgnoreCase("pluginfo"))

#

What do you think caused it

manic crater
#

dude even before that

whole stag
#

It gives you the line, it tells you what happened

lost matrix
whole stag
#

It's the same error all the way back

manic crater
#

when i had args[0].equalsIgnoreCase("pluginfo"){
if(args.length == 0){
}
}

eternal oxide
manic crater
#

why is it every plugin i code related to cmds and do args[0] and etc and everything wroks out no errors

#

and this one has to be problematic

#

for no reason

whole stag
#

Array index out of bounds on line ## means you tried to access an array index that was out of bounds on line ##

lost matrix
eternal oxide
#

If I have zero apples, give me an apple

whole stag
#

That one causes the issue because it's the first one that has a chance to throw the error

hasty prawn
#

What does that mean

#

args.length == 0 can't throw an error ๐Ÿค”

whole stag
#

The next part does

hasty prawn
#

Yeah ik

lost matrix
#

Yes but the second condition

hasty prawn
#

you said first which threw me off

whole stag
#

First of the several if statements

hasty prawn
#

Gotcha, just wanted to clarify.

lost matrix
#

He is referring to the method exiting as soon as an exception is thrown

manic crater
#

yk what i just said fuck it and removed the entire cmd itself

#

the cmd itself can live without being in the plugin

#

and guess what

#

soon as i removed that

#

everything started to work again

whole stag
#

@manic crater best way to handle this would probably be to just check that the arg array is at least one before continuing, else print an error and return

manic crater
#

ughh

manic crater
lost matrix
manic crater
#

no im not

whole stag
#

See previous statement about learning java

manic crater
#

im being dead ass serious

#

i removed the cmd

#

and it just started to work

whole stag
#

Go learn java

manic crater
#

I DONT NEED TO LEARN JAVA!

#

stop saying thast

#

non

hasty prawn
#

Well yeah if you remove the errored code it does tend to start working again...

whole stag
#

You don't even understand arrays though

manic crater
whole stag
#

That's like week four basic java

lost matrix
manic crater
#

im not TechsCode where i use arrays in 90% of my plugins

manic crater
#

gonna be real with u on that

whole stag
#

If you knew java, you should know arrays

hasty prawn
#

Well, good luck making future commands with arguments without arrays.. ๐Ÿ‘€

dusk flicker
#

Maybe don't compare yourself to TechsCode with what happened

manic crater
manic crater
whole stag
#

Why should we help someone without a basic understanding of the language?

lost matrix
manic crater
#

im stating a fact that techscode knows more about arrays

manic crater
#

value = 0

whole stag
#

There's not much about arrays to know

manic crater
#

so does the whole point in this toxicity bit of the gc

lost matrix
#

Thank you ๐Ÿ˜„

manic crater
whole stag
#

So learn it

hidden delta
#

๐Ÿ˜’

manic crater
#

arrays store data and value in them if u know how to do so

dusk flicker
manic crater
#

shush

whole stag
#

Stop debugging by superstition and actually git gud

manic crater
#

yeah techscode died in a car accident...

#

so his friends are taking over the coding...

quaint mantle
manic crater
#

ok well thanks for ur help

#

im gonna go now

#

cya

quaint mantle
#

what happened

lost matrix
#

What did i just witness?

manic crater
manic crater
dusk flicker
#

dude doesn't know how to use arrays -> instead of listening deletes entire section of code -> problem solved

whole stag
manic crater
dusk flicker
#

Maybe don't tell them to shut up and actually read it

manic crater
manic crater
#

i just didnt understand the error,

lost matrix
#

I felt like he was a bit rude. But then again... he is a 1.8.8 user after all.

eternal oxide
#

New mantra, if deleting doesn't make it work give up?

whole stag
#

Obviously you don't

dusk flicker
#

Don't know why you need to ping me two fucking times with the same reason and you clearly haven't enough

manic crater
#

im gonna punch u one day in the fact @lost matrix honestly,

#

server versions for testing things doesnt matter

#

smh

eternal oxide
#

punch him in the facts, those hurt

quaint mantle
#

we dont support 1.8 here ๐Ÿ™‚

dusk flicker
#

hey imagine wanna add a 5s slowdown

lost matrix
manic crater
whole stag
manic crater
manic crater
#

just bc i wanna punch u in the face doesnt mean its a threat softy

whole stag
manic crater
dusk flicker
#

well you told him you were going to which makes it a threat rather then wanted

manic crater
#

its a TEST server for a reason not a REAL server

whole stag
#

We don't support 1.8 and we don't support stupid

dusk flicker
#

That should be pinned BobLaser

quaint mantle
manic crater
whole stag
worldly ingot
#

Dude imma start kicking some people if you don't knock it off

lost matrix
whole stag
#

You deploy to 1.17? Make a 1.17 server

manic crater
#

choco they are saying the support for me is unwanted bc i have a 1.8 test server and i found it easier to make a plugin on 1.17.1 and not change the server version as it was gonna take 2 seconds to do

quaint mantle
#

can yall just stop and move on?

whole stag
#

Nough said

worldly ingot
#

We have not supported 1.8 in this server since the release of 1.9

#

If you want to work on 1.8, do it yourself. Do not expect support here, you are not entitled to it

manic crater
#

okay but once again a 1.17.1 plugin clearly works on 1.8 if u dont use 1.17 methods

worldly ingot
#

That's great. Keep doing that

manic crater
#

yeah

#

thats what im TRYING to do

#

and we are having an argument

#

over a version i couldnt swap out in time even if i tried

worldly ingot
#

pepecringe So don't have an argument. I don't get it.

manic crater
#

yeah but the thing is i didnt even start it @lost matrix was crying over a version i didnt wanna swap for a cmd,

#

thats the thing

whole stag
#

For next time, it's best to have a testing environment that matches your production environment as close as possible. That's just standard practice

manic crater
#

sooo,

#

kind of just stating my point of view and everyone is attacking me for it

lost matrix
manic crater
#

dude it was a 2 minute plugin project.

#

it was just like 3 cmds

quaint mantle
#

then switch

manic crater
#

3 cmds that had nothing to do with 1.17 features

#

literally

#

i dont know why this is such a big deal

#

over a version that is gonna do nothing to a 1.17.1 plugin

whole stag
#

You can spin up a server in a few seconds

quaint mantle
#

bruh wheres your original question

dusk flicker
#

It's been solved

manic crater
quaint mantle
#

then move tf on its not hurting nobody

manic crater
#

just drop the argument fr, its a pointless argument and u are gonna just get us all kicked.

whole stag
quaint mantle
#

Yikes

manic crater
manic crater
#

but my situation is fixed

#

so don't bother

whole stag
#

C'mon dishy, think about it. You wouldn't write a program for windows 10 and test it on vista, would you? You at least understand why people are saying it's a bad idea?

quaint mantle
#

@whole stag move on

manic crater
#

ik that i understand that

whole stag
#

Cool

manic crater
#

but its acmd

#

that sends a msg

whole stag
#

Is good then

manic crater
#

idk how that effects 1.8 in anyway or 1.17.1

quaint mantle
#

both of you move on, last warning

tacit storm
#

can y'all not just drop the topic and move on jesus christ

#

y'all are worse than League of Legends Players

manic crater
#

anyway drop the convo bc imaginedev is gonna kick us

whole stag
#

As long as you understand the practices you break, there's no big issue. All good ๐Ÿ‘

manic crater
#

im not gonna get kicked bc of u

lost matrix
#

That was quite amusing

proud basin
eternal oxide
stable plinth
#

is there a way to modify the damage with armor point? or the formula is the only way?

proud basin
stable plinth
#

as damage modifier is deprecated

eternal oxide
#

Attributes

proud basin
#

it's still the same ElgarL

eternal oxide
stable plinth
proud basin
stable plinth
#

thats why idk is the formula the only way to do so

proud basin
#

that's how it's printing out

#

so 1

eternal oxide
#

1 is correct, thats what the constraint primary key pair does

#

it should be impossible to have more than one entry now

proud basin
#

๐Ÿคท

#

Want me to screenshare?

eternal oxide
#

what value is your getTime now returning?

proud basin
#

1627356326236

eternal oxide
#

is that for someone without a timer?

proud basin
#

yea

whole stag
#

What does it look like for someone with a timer?

eternal oxide
#

your getTime method is bad. it should be returning zero

proud basin
#

same thing

eternal oxide
#

?paste your entire getTime method

undone axleBOT
proud basin
#

the other kits are apperently on cooldown but they were never called or in the database

eternal oxide
#

um, is time a Field?

proud basin
#

no

eternal oxide
#

where is it defined then?

proud basin
#

above the method it's a long

eternal oxide
#

then its a field

hasty prawn
#

lmao

proud basin
#

wait a long counts as a field?

eternal oxide
#

it needs to be a local variable, or it will retain whatever was read last

hasty prawn
#

Fields and variables are the same thing

eternal oxide
#

a Field is a Class scope variable

whole stag
#

You thinking this is it Elgar?

return time = 0;
hasty prawn
eternal oxide
#

he needs to scrap all that time variable

#

just return zero in any instance there is no rs.next()

#

the only result you care about is the time

#

if there is a next() then you got a result which means there must have been a UUID and Cooldown match

#

if no rs then returns zero

proud basin
#

oh I see

eternal oxide
#

you could also shrink it to

proud basin
#

I thought if res.next passed through it was empty

eternal oxide
#

yes, which means no timer so return zero

proud basin
#

I wish it was a bit faster to connect and load the data but it's fine

#

Thank you very much

eternal oxide
proud basin
#

You still got ; in the try

#

Is your mission to make it as small as possible

eternal oxide
#

I was just playing ๐Ÿ™‚

digital plinth
#

gradle why

proud basin
#

lmao

digital plinth
#

i just added a plugin yml

#

and boom

#

i restart the IDE too

proud basin
#

show your build.gradle

#

?paste

undone axleBOT
whole stag
eternal oxide
proud basin
#

Is it faster if It's not

eternal oxide
#

it won't be faster but you won;t lock up the server (lag) while its running the query

#

get it working first though

#

You also know these kind of timers can be stored in the PDC where queries would be instant?

proud basin
#

Yeah I got it working

digital plinth
#
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    mavenLocal()
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
    maven { url = "http://repo.onarandombox.com/content/groups/public/" }
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compileOnly 'com.onarandombox.multiverseinventories:Multiverse-Inventories:4.2.2'
    compileOnly 'com.onarandombox.multiversecore:Multiverse-Core:4.2.2'
}
digital plinth
#

it just crashed

#

when i tried to add a new fie :/

proud basin
digital plinth
#

weirdd

eternal oxide
#

?pdc

eternal oxide
#

its data stored on teh Player object

proud basin
#

1.8 man

eternal oxide
#

pleb ๐Ÿ™‚

proud basin
#

smh

quaint mantle
#

ew 1.8

#

write an nms wrapper

proud basin
#

you look like nms

eternal oxide
#

does TagAPI work on 1.8?

proud basin
#

uh

quaint mantle
proud basin
#

maybe Elgar

quaint mantle
#

that pfp so bright it lit up my dark room

#

that dot on your chin was mistaken for a bug on it

eternal oxide
quaint mantle
#

im sorry

#

plz accept apology

#

@proud basin i havent roasted in 2 years because quartinine

proud basin
#

I want a direct message from you on spigot page

quaint mantle
#

about what :P

proud basin
#

not my account

quaint mantle
#

what is it

proud basin
#

for some reason my friend tried linking his account to mine ๐Ÿคท

#

but search me up on spigot

#

my account

proud basin
#

Is there a reason why nbt-api would make it faster

eternal oxide
#

you store directly on the player object

#

so no sql

proud basin
#

Is that how like essentialsX and all the other ones do it?

eternal oxide
#

no

#

essentials saves to flat file

#

holds all data in memory for online players

proud basin
#

ah ok

#

so

#

all the work I did is useless if I'm gonna use player object

eternal oxide
proud basin
#

True

#

Why do you have ```java
public ItemBuilder() {
this.setType(Material.BARRIER);
}

stone sinew
proud basin
#

hm ok

quaint mantle
#

you should name the clone method "build"

stone sinew
proud basin
#

He could also name it "make"

digital plinth
#

...so if i want an event to run before all other event

#

do i use lowest or highest

stone sinew
digital plinth
#

confusing description

digital plinth
#

okay

#

if i set damage to 5 in a lowest event and then some other event with the priority of high sets the damage to 10

#

will the dmg be 5 or 10

eternal oxide
#

10

stable plinth
#

guy is zombie got 2 armor pt by default?

#

with livingEntity.getAttribute(Armor)

digital plinth
#

i need the highest priority

eternal oxide
#

yes

#

and hope you are teh last to run

digital plinth
#

so if other plugins also use the highest

#

mine might not make it

eternal oxide
#

correct

digital plinth
#

rip

wheat sierra
#

Hello guys! How are you? I really need your help. So my friend created a server in minecraft with mods and everything was ok. But when i want to connect to server there is error that comes in. Please help me with this problem. Thank you so much, i really appreciate you!!!

#

i can't send the picture

stone sinew
wheat sierra
#

how to?

stone sinew
#

The verification channel. I can't mention it cause I'm verified.

eternal oxide
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

digital plinth
#

?

#

u can mention it

wheat sierra
#

!verify MeFoZ_313

undone axleBOT
wheat sierra
#

#verified

stone sinew
digital plinth
#

!verify gooGooGaaGaa

undone axleBOT
digital plinth
wheat sierra
#

i can't see verification server here

#

thats a problem

digital plinth
#

oh he cant see the verified channel?

wheat sierra
#

ye

digital plinth
#

RIP

stone sinew
digital plinth
#

contact staff probably dunno

digital plinth
#

its just

#

ppl started talking in the verified channel

wheat sierra
#

like i see

digital plinth
#

a while ago ppl only do the !verify in there

wheat sierra
#

but the problem they say

stone sinew
#

I'm not talking about the newly created "VERIFIED" channel. I'm talking about the verification channel you used to verify.

Again it might have been removed.

eternal oxide
#

The command works fine in here, but you have to use your ACTUAL spigotMC.org account name

wheat sierra
#

here you go

#

i m verified

digital plinth
#

i forgot XD

#

its like a year ago

wheat sierra
#

๐Ÿ˜ญ

digital plinth
#

gradle go brrrr

#

help pls i have no fuckin idea whats happening

#

like i added plugin.yml

#

and then the IDE lagged

#

and then bukkit got un-imported or something

eternal oxide
#

thats probably a messed up cache

digital plinth
#

i invalidated cahce and restrated :<

eternal oxide
#

Then no clue, I don;t use gradle

digital plinth
#
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    mavenLocal()
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
    maven { url = "http://repo.onarandombox.com/content/groups/public/" }
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compileOnly 'com.onarandombox.multiverseinventories:Multiverse-Inventories:4.2.2'
    compileOnly 'com.onarandombox.multiversecore:Multiverse-Core:4.2.2'
}```
#

build.gradle btw

#

is gradle so unpopular

#

how many ppl use maven vs gradle

eternal oxide
#

gradle is just more powerful than most need

stone sinew
eternal oxide
#

don;t need the features or complexity

digital plinth
stone sinew
digital plinth
#

oh

#

where can you like

#

see which R is it

#

is there like a convenient website somehwere

stone sinew
eternal oxide
#

just look in teh maven repo

digital plinth
#

gradle is related to maven somehow?

eternal oxide
#

yes, it uses maven depends and repos

digital plinth
#

oh okay

stone sinew
#

Huh... looks like it is R0 Why would /version be R3?

wheat sierra
# wheat sierra

im waiting for your aid. Thank you so much again( if you can't resolve it, it's okey!!!!)

#

๐Ÿฅบ ๐Ÿ™Œ

stone sinew
wheat sierra
#

yeap

#

all exactly

stone sinew
#

Update your server software ๐Ÿคท

hasty prawn
#

Why are you using clone()

stone sinew
hasty prawn
#

You should have a build() method that returns the ItemStack with all the properties.

#

And I wouldn't even bother extending ItemStack really

#

Just use the build method to get an actual ItemStack

stone sinew
hasty prawn
#

You're technically making one anyways

stone sinew
hasty prawn
#

In your constructor, try calling super()

#

I'm guessing it does some backend stuff that you're not

stone sinew
stone sinew
hasty prawn
#

Send the new code

stone sinew
hasty prawn
#

do super(material);

#

super() just makes an ItemStack that's Air

stone sinew
#

Nope doesn't work either

hasty prawn
#

๐Ÿค”

stone sinew
#

Well I took off clone on the first one and all the items showed up.... But the second one (after I set everything) still has .clone()

hasty prawn
#

first and second what

stone sinew
#

top is first

hasty prawn
#

Yeah get rid of the clone

stone sinew
hasty prawn
#

I just tested and this works:

public class TestItem extends ItemStack {
    public TestItem(Material material) {
        super(material);
    }
}

//Then to give to the player
player.getInventory().addItem(new TestItem(Material.BARRIER));
stone sinew
#

Well its works now so ๐Ÿคท Thanks for the help

hasty prawn
#

You realize you're adding it twice right

#

Oh well, glad you fixed it ๐Ÿคทโ€โ™€๏ธ

stone sinew
#

so was making sure it was even created the invalid item.

hasty prawn
#

Ah

stone sinew
#

SkullMeta.setOwner(String) was replaced with SkullMeta.setOwningPlayer(OfflinePlayer)
I use setOwner() for MHF skulls so what would I used for that as an offlineplayer?

worn tundra
stone sinew
worn tundra
#

You can also still just use the #setOwner

#

and ignore the deprecation warning

stone sinew
worn tundra
#

The offlineplayer is deprecated too so..

#

Your choice

static whale
#

youd want to get the player by uuid

hardy swan
#

Without using deprecated methods, you cannot obtain a player with name unless the player is online

worn tundra
hardy swan
#

If the player is online you can getPlayer by name

worn tundra
#

Of course

static whale
worn tundra
#

Bruhh

hardy swan
#

Paper..

worn tundra
#

Yeah, but then he'll have to wait until the official MHF accounts join his server lmao

static whale
#

right my bad, wrong build up

#

let me see if spigot has it

worn tundra
#

What are we talking about? This isn't a solution

static whale
#

now my eyes are playing tricks with me yeah thats different nevermind

worn tundra
hardy swan
#

But you can getOfflinePlayers and filter with name lolol

worn tundra
#

Only if they have joined your server previously

hardy swan
#

Yea and that

static whale
#

let me look into the code

#

but if that is the case it can be used whether or not theyve been online

static whale
#

damn took a look into the code and it just routes back to the server

#

another dead end

hardy swan
#

But it makes sense to say he/she might not be connected

#

A reference to the player object might still exists

#

After he/she disconnects

#

Hence PlayerQuitEvent or PlayerKickEvent

static whale
#

this appears as if theyre trying to grab players that have been online long ago, though

#

the only solution i could think of is directly accessing mojang's api to get the uuid then using that in Bukkit#getOfflinePlayer(UUID uuid)

stone sinew
#

Just pointing out MHF are mojang usernames and will never join the server. (Unless someone some how got ahold of one.)

hardy swan
#

I think your best bet is using deprecated methods, it is fair to do so since spigot's deprecated methods aint really gonna get removed

hardy pivot
#

Hello. I was wondering how to optimize debug time.
I use the intellij live server, but the hoswap is very limited.
I saw that there is a JDK (DCEVM) that allows Hotswaps with fewer limitations, but it is for jdk7,8,11

#

How do you work?

quaint mantle
#

my server have problem

#

when i login in my account

#

i got disconnect after login 5second

somber hull
#

Can I create multiple methods with different parameters but the same name?

#

Like

somber hull
#

setColor(String color)
And
setColor(int colorNumber)

stone sinew
#

^^^

somber hull
#

Wow

#

That

#

That shall help me a lot

#

Thank you

rotund pond
#

Hello to you !
Quick question about the spigot API.

I'm creating a freeze system and so I have to cancel all the commands of a player.
Logically I have to choose the priority of the event, but I don't understand Spigot's priority system ...
The event with the highest priority will be called last if I understood correctly ... So in my case, since I want my event to cancel all other same events from plugins, I have to give it the lowest priority?
It's not very intuitive ...

granite stirrup
#

you dont need to give it a priority?

stable plinth
#

guy is zombie got 2 armor pt by default?
with livingEntity.getAttribute(Armor)

granite stirrup
#

Idk

#

I thought it would be 1

stable plinth
#

but other mob are 0

granite stirrup
#

ยฏ\_(ใƒ„)_/ยฏ

#

Does it have armour on

stable plinth
#

including player

#

without armour on

rotund pond
granite stirrup
#

Because you don't???

#

I never gave any events s priority and it works fine

stable plinth
#

wait zombie actually has 2 basic armor?

granite stirrup
#

Idfk xd

rotund pond
#

Oh okay ๐Ÿค”

#

After all, isn't it because you don't do it that I shouldn't do it?
Maybe you never asked yourself the question, but I prefer to be sure that my event will override the others

static whale
# rotund pond why ?

If you donโ€™t give it a priority it defaults to โ€œnormalโ€ which is between low and high

#

It specifies the call is neither important nor unimportant

rotund pond
static whale
#

Then EventPriority.HIGHEST is what youโ€™re looking for

#

Itโ€™s going to depend on if the other plugins ignore already cancelled events or not

#

I just saw your original question

rotund pond
#

Oh okay thank you, I though it was EventPriority.LOWEST ๐Ÿค”
So the highest priority will be triggered first

#

Ah, so it doesn't depend on me

static whale
#

If you cancel the event first most plugins will ignore it when it is passed to them

#

Some, for one reason or another, will still work with it however

rotund pond
#

Oh okay xD

#

Ty

static whale
#

Yup of course!

stable plinth
#

how do i add the availability for some items on enchantment?

static whale
#

Test with just highest first and see how it goes, you might need to also make an event with lowest priority just to see if that fills in the gaps if highest doesnโ€™t work on its own

stable plinth
#

eg damage_all for a diamond hoe

#

and u can use avril or enchant table to add the enchantment

#

onto the diamond hoe

regal dew
#

LOWEST is first, ending with HIGHEST and then MONITOR

regal dew
#

Cancelling should be done on LOWEST/LOW such that you can give other plugins the ability to check for the cancelled state on NORMAL / HIGH / HIGHEST, for maximum compatibility

iron condor
#

How can I slower natural health regen?

regal dew
#

Cancel EntityRegainHealthEvent

crude sleet
#

I would like to program my own ore generator where you place a diamond generator for example, and a diamond comes out every 200 seconds. I am not sure because this is a kind of freebuild server and I think that with 50 players it is a bit bad for performance, My idea would be to start 5 runnables for 5 generator types and as an example the 1 is the diamond generator, then it goes through all diamond generators or does someone have a better idea?

regal dew
#

I mean, why would you need 5 runnables?

#

you can just schedule one, and loop over a collection of generators to generate their next ore

iron condor
quaint mantle
#

Yes so keep track of it yourself

regal dew
#

Yeah, but if you want to โ€œslowerโ€ regeneration, you just cancel the event sometimes

quaint mantle
#

Like maybe just cancel every other event

regal dew
#

You could skip it alternating, so skip, allow, skip, allow on a per-player basis (keeping track of some counter in some map or sth, but thats up to you)

iron condor
regal dew
#

and you ofc need to check if its a player, and determine what type of regains you want to slow down

upper skiff
#

hi! I made a countdown timer but nothing happens here is my code:

gleaming grove
#

this timer works every 120 seconds, so command Run is invoke every 2 minutes

#

maybe change 2400 to lower value for test purpose

upper skiff
#

oh ok thanks i didnt know that

#

i tought it will run for 120 seconds

gleaming grove
#

nope

regal dew
#

Assuming count is a class variable it wont work when youโ€™re scheduling 2 games

gleaming grove
#

you should control time by count varble

regal dew
#

It might be better to initialise a map, from game id -> start time, and compare that to System.currentMillis

#

& it seems you never reset the count variable after use

gleaming grove
#
        new TaskTimer(20, new TaskTimer.TaskAction()
        {
            @Override
            public void execute(int time, TaskTimer taskTimer)
            {

                //after 120 seconds task is stoped
                if(time>120)
                {
                    taskTimer.cancel();
                }
            }
        }).runAsync();```
upper skiff
#

Thank you very much ๐Ÿ™‚ very nice of you

gleaming grove
#

you only need to change InicialazerAPI.getPlugin(), to your plugin reference

lost matrix
hoary knoll
#

is there a way to get a food's nutrition value without NMS?

smoky oak
#

Hard coding it?

lost matrix
maiden briar
#

If I want spectators in a minigame (people who died) what is the best thing to give them? I though about cancelling interact event, give them fly and make them invisible. Anything I miss here?

smoky oak
#

can't you just set them in spectrator?

maiden briar
#

Then I can't give them the compass item

smoky oak
#

press f1

#

just 1

#

that brinbs up a menu of players

#

in spectrator

maiden briar
#

Probably a good idea

#

But also why doesn't Hypixel this?

lost matrix
#

Otherwise you will have to make sure that the user doesnt interfere with other users by catching arrows for example.

wispy plume
#

Hey, how was the concurrent queue for HashMap named?

smoky oak
#

probably for a number of different reasons, what i guess is that they want you to be able to open the menu

maiden briar
#

Yes that is a problem

#

I will leave them in spectator then

smoky oak
#

can't you set their hitbox to zero?

#

I know the game sometimes glitches out and does that

maiden briar
#

Hitbox?

smoky oak
#

yea

#

theres a glitch where the hitbox of a player is just gone

#

i dont know how that happened tho

#

maybe its a paper specific thing too

maiden briar
#

Btw I already cancel an event where the player gets hit, this also works for arrows

plain scroll
stone sinew
smoky oak
#

or that

#

there is a give command for heads

#

it grabs the current skin and throws it onto a head

plain scroll
smoky oak
#

wdym?

#

online generator?

maiden briar
#

Yes I will make them hidden, then the chance they hit with anything is so small

#

And I already cancel damage events

#

But how can I add the invisible effect?

plain scroll
# smoky oak wdym?

more like i wanna use a skin thats not on my player? is there a way i can get it from a link?

#

or like how can i use a head as a mat in my plugin?

smoky oak
#

thats possible you just need to define the player you want the head of

#

material is more difficult

plain scroll
smoky oak
#

not exactly, I have to go now but, if the skin changes, the heads that were generated should not change

#

try the /give command there is a way to get player heads

#

just change your skin around a bit

#

see you guys later

maiden briar
#

Can't I just do player.hidePlayer to others?

lost matrix
maiden briar
#

Yes true

lost matrix
#

Because the server still knows that they are there

maiden briar
#

But that chance is so low

#

I don't know how to solve that

lost matrix
maiden briar
#

That seems complicated

lost matrix
maiden briar
#

Yes if you can do for me

lost matrix
#

Alright let me start my IDE

maiden briar
#

You have .setBounce, I will set it to false

stone sinew
#

I don't remember hidePlayer() causing that type of issue...

lost matrix
maiden briar
#

Yes

#

So it will fly through the entity?

lost matrix
#

Yes

maiden briar
#

Ok thx

#

How can I get the head of a player to put in the spectator menu?

#
for(org.bukkit.entity.Player onlinePlayer : Bukkit.getOnlinePlayers())
{
    ItemStack playerHead = new ItemStack(Material.PLAYER_HEAD);
    SkullMeta skullMeta = (SkullMeta) playerHead.getItemMeta();
    skullMeta.setOwningPlayer(onlinePlayer);
    playerHead.setItemMeta(skullMeta);
    inventory.addItems(playerHead);
}

Smth like this?

native nexus
#

setOwningPlayer is deprecated so use setOwner instead

stone sinew
native nexus
#

Oh yeah my bad

smoky oak
#

How do i simulate a end gateway block that's spawned far out in the end? IE, throw a player in the end to the obsidian platform on the main island as if you jumped through one?

#

I know i can just grab the coordinates but i want it to work for every server not just my test server

native nexus
#

That facepalm was harsh and unnecessary but thanks I guess ๐Ÿ‘

lost matrix
smoky oak
#

aaaah

#

ok

lost matrix
#

So just get the spawn location from the end and tp there

stone sinew