#help-development

1 messages Ā· Page 1778 of 1

tranquil viper
#

Why is my name red, shouldn't it be white?

eternal oxide
#

you are using ess chat I expect

#

it modifies teh display name

tranquil viper
#

oh

#

lmao

#

how to disable with essentials chat

eternal oxide
#

no clue, look in its config

tranquil viper
#

meh not worth the work lmao I was just testing on priv server anyways

#

real server wont have ess

round finch
#

@tranquil viper player getName

#

your displayname probably have red in it lel

tranquil viper
#

lmao

round finch
#

also Name won't change

#

šŸ˜„

young knoll
#

Generally you want display name in chat though

#

That’s what it’s for

round finch
#

lol

#

Sure if you want Displayname

sleek pond
#

rate my code quality

stone sinew
sleek pond
#

i literally am

#

I couldn't find a better way to do this

stone sinew
#

WHY DO YOU HAVE 3 NESTED RUNNABLES!

sleek pond
#

because they need to be run one after the other

young knoll
#

You heard of repeating tasks?

#

And counting down an int

hasty prawn
#

Also...

Should be using long instead of Long
Ping isn't imported (or doesn't exist)
The IDE is telling you that you can use a lambda, and you don't PepeHands

sleek pond
#

"The IDE is telling you that you can use a lambda, and you don't"

#

where?

sleek pond
#

but they aren't really in a logical fasion

#

it goes 10->5->1->announcment

waxen plinth
young knoll
#

And?

sleek pond
#

i suppose you could do if(10)->5

waxen plinth
#

You can schedule them all at once you know

#

And write a helper method

#

That is horrible

young knoll
#

Or you can run it once per minute

torn lintel
# sleek pond

This is actually good, no clue what the others are on about.
It's very clean.

young knoll
#

And then check how many minutes are left and do the appropriate action

torn lintel
#

Maybe they've haven't actually coded before?
šŸ¤”

waxen plinth
#

It's true, I've been faking it this whole time

young knoll
#

Obvious troll is obvious

torn lintel
#

Yeah but honestly, it's messy but it should work?

young knoll
#

Well yeah

#

But this also works

eternal oxide
#

I can drive a screw in with a hammer and it will work, but its not the best thing to use.

sleek pond
#

but here it's redundant get players

young knoll
#

And you have redundant runnables

sleek pond
#

well how would you do it?

#

pseudo

young knoll
#

One runnable that counts down an int each minute

#

When int == 10 do one thing, when int == 5 do another, etc

sleek pond
#

jesus christ

#

i am stupid

silent dew
#

ah aight thx

sharp bough
young knoll
#

Art

sleek pond
#

it's better now

#

i just use 1 repeating timer

onyx valve
#

i'm trying to find a way to modify the item tooltip players see without actually modifying the item's nbt data server side. is this even possible, and if so, could someone point me in the right direction? googling yielded little.

young knoll
#

Packets

#

Specifically PacketType.Play.Server.WINDOW_ITEMS and PacketType.Play.Server.SET_SLOT

round finch
#

my eyes seeing 3 runnables

#

one for each countdown that is cursed

quaint mantle
#

hey so i have an issue with formatting on some Component stuff

#

essentially, the formatting from the component mute transfers throughout everything else

#

how should i fix that?

candid galleon
#

isn't there a reset function

sullen marlin
#

well of course it does, since you did staffFormat = mute lol

#

consider using ComponentBuilder, it is much clearer than making components directly

quaint mantle
#

thanks for the advice, off i go!

#

<3

#

frankly, im confused now

waxen plinth
#

A story in 3 parts

quaint mantle
#

yeah

#

let me try smt first

#

also

#

how hsould i .getPlainText() of a BaseComponent[]

#

i'll brb, if you do have a response pls ping me

waxen plinth
#

Why do you have a space() method

#

And you're misusing the builder pattern

quaint mantle
#

its just an empty white space, that has all formatting removed

quaint mantle
waxen plinth
#

It should be .append(mute).append(" ").append(formatRevised)

quaint mantle
quaint mantle
waxen plinth
#

Uhh

quaint mantle
#

isnt that the same thing

waxen plinth
#

This is so absurdly overcomplicated

quaint mantle
waxen plinth
quaint mantle
#

ah

waxen plinth
#

The builder might clone on each step rather than mutating the internal state

quaint mantle
#

ah

#

so this is better?

#

(i like spacing things like that, its easier for me to read)

livid tundra
#

how would I make something run when day turns to night

candid galleon
#

you'd probably have to make a runnable check the time every now and then

#

compare it to if is no longer day

livid tundra
#

other than that

young knoll
#

That’s basically the only option

candid galleon
#

well you could have a command block run a command constantly and check the time when that command is run

#

or listen to entity move event and check the time whenever an entity moves

#

or player move event

livid tundra
#

there's a entity move event?

candid galleon
#

Yes

quaint mantle
candid galleon
quaint mantle
#

actually i cant really say "bruh" but still

candid galleon
#

oh wait there isn't

#

i forgot

#

you got me there

#

check player move event then

#

or just use a runnable

young knoll
#

That is likely slower than just using the runnable

candid galleon
#

it 100% is slower

livid tundra
#

so a runnable is the best solution?

candid galleon
#

yes

#

why are you trying to detect a time change?

quaint mantle
#

im having more issues now, with the BaseComponent[] thingy dealio

#

now formatting just copies over to each and every text component

#

how do i reset formatting per text component

#

especially where there shouldnt be formatting, i.e; hover events, etc.

dense shoal
#

Does anyone have any advice to how I could stop the effects of an enchantment? I want players to be able to have quick charge on their bows, but I don't want that effect to do anything (unless players have unlocked something) [not a paywall or anything]. Currently, we are completely removing the enchantment from crossbows entirely and I want to stop doing that.

waxen plinth
hasty prawn
#

You could always fake the enchantment, so it looks like it's there but it's really not

dense shoal
#

Yeah unfortunately, it's not functionally feasible to do that.

young knoll
#

You could maybe remove the enchantment in the outgoing packet

dense shoal
young knoll
#

Use protocollib to intercept outgoing packets and remove the enchantment

sullen marlin
tidal ether
#

can someone help me with my plugin?

#

I am getting this error: at me.deadshot.vault.Main.lambda$RestoreInvs$0(Main.java:49) ~[?:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at me.deadshot.vault.Main.RestoreInvs(Main.java:47) ~[?:?]
at me.deadshot.vault.Main.onDisable(Main.java:34) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-1.17.1.jar:3276-Spigot-3892929-b58f429]

#

please ping me if you have an answer

sullen marlin
#

Well what is line 49

#

And what is the error

lavish hemlock
#

line 49 is probably a collection.forEach

#

based on the fact that error relates to a lambda and the top stacktrace element is Iterable.forEach

#

soooo

#

probably a NPE tbh

#

but yes please include the actual fucking exception

quaint mantle
#

crying

glossy venture
sullen marlin
#

Guys tone down the language please

tidal ether
sullen marlin
#

Post the actual code

#

And the error

tidal ether
#

Ok

#

public void RestoreInvs() {
// the code that restores the inventory from the config.yml
this.getConfig().getConfigurationSection("data").getKeys(false).forEach(key ->{
@SuppressWarnings("unchecked")
ItemStack[] content = ((List<ItemStack>) this.getConfig().get("data." + key)).toArray(new ItemStack[0]);
menus.put(key, content);
});
}

sullen marlin
#

And which is line 49

quaint mantle
#

is it not a class cast exception?

lavish hemlock
#

. . .

#

List<ItemStack>
ItemStack[]

#

oh wait

#

nah that's correct

#

hm

sullen marlin
#

There’s a toArray

lavish hemlock
#

I think the problem is that you can't cast that data to a list of itemstacks

sullen marlin
#

Menus might be null

#

But we really need more info

tidal ether
#

Line 45 is public void restoreInvs

lavish hemlock
#

ye then it's probably a ClassCastException

sullen marlin
#

Unlikely

lavish hemlock
#

so this makes sense to you? (List<ItemStack>) this.getConfig().get("data." + key)

#

what is the fuckin' error lmao

lavish hemlock
#

I'm highlighting the spot where List is actually casted

#

the toArray doesn't fuckin' matter bc I already verified it makes sense

#

the part that is strange is trying to cast the return value of get to List<ItemStack>

sullen marlin
#

Thats valid

#

Get returns object

tidal ether
#

Should the config.yml file be in src or project folder?

sullen marlin
#

Should use getList but same thing really

lavish hemlock
#

jesus christ people we need errors

#

code is good but errors tell us the actual problem

#

that is a stacktrace

#

what is the error type

#

getCommand or getItemMeta is probably returning null.

#

the former meaning you don't have the command configured in your plugin.yml

#

I don't know which contexts getItemMeta returns null tho, not like Bukkit's docs say anything

lavish hemlock
#

btw if you're working in newer versions, the NPE will show exactly what caused the exception to be raised

lavish hemlock
# tidal ether ?

src/main/resources if you're using Gradle/Maven, or your source folder if you aren't

tidal ether
lavish hemlock
#

then its probably not the fault of config.yml

tidal ether
#

The rest of the plugin is working, it is having a problem in taking the info from the config.yml

tardy delta
#

Seems

#

Stupid autocorrection

quaint mantle
#

EnumSet

#

Create an enum set

#

Add all materials from configs to it

#

And then check if set contains your block material

#

Google

verbal nymph
#

I am trying to implement per-player damage multipliers (eg. some may take 2x damage and others may only take 0.5x)
On plugin startup I'm loading all the settings from my config file, but how should I go about caching it?
Create a HashMap contatining player UUID and the float multiplier or is there a better / more efficient way?

glossy venture
#

a hashmap would be good i think

#

quite efficient

#

its O(1) time complexity so it should be fast no matter how many players you have

marsh plaza
#

Can anyone help with bungee supervanish?

bright jolt
#

Could anyone help me with hooking into MVdWPlaceholderAPI? I have copied the repository and dependency from the SpigotMC page, and it doesn't seem to work...

verbal nymph
#

Alright, thank you orby šŸ™‚

tribal holly
#

Hi, is there by any way that an event can't be fired (even if it's register) ?

glossy venture
tribal holly
# tribal holly Hi, is there by any way that an event can't be fired (even if it's register) ?
@EventHandler(priority = EventPriority.HIGHEST)
    public void onProjectileLaunch(ProjectileLaunchEvent e) {
        System.out.println("trigger");

        if (HGuard.getByLocation(e.getLocation()) == null) {
            return;
        }

        HGuard hguard = HGuard.getByLocation(e.getLocation());

        if (!hguard.isPvp())
            e.setCancelled(true);

    }```
Some times (when i'm in a area protected of my plugin) the message trigger is not fire. How an event can't be fired everytime ?
#

Can an other event can block the fire of an another event ?

glossy venture
#

do you have any other plugins installed?

tribal holly
#

nop any

glossy venture
#

no clue

quaint mantle
#

To what evetns are you listening

glossy venture
#

maybe println is broken itself or some projectiles dont trigger the event

tribal holly
#

somethjing outside the event is blocking it

glossy venture
#

what is "your area"

quaint mantle
#

ah didnt saw

tribal holly
#

and i don't understand what could block the fire of this event

tribal holly
glossy venture
#

are you listening to/cancelling any other events?

tardy delta
#

something like a fake worldguard?

#

šŸŒ

tribal holly
tribal holly
tardy delta
#

why not just using worldguard, or doesnt it support certain features you need?

tribal holly
#

The only thing that i can conclud, there is something blocking the event to fire but what ? i d'ont even know if we can cancel with en event all other event or something like this

glossy venture
#

maybe replace

System.out.println("triggered");
``` with
```java
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "triggered");
tribal holly
glossy venture
#

might be more reliable or something because i have no idea why it wouldnt work

quaint mantle
#

plugin.gerLogger() šŸ˜€

glossy venture
#

can you send any code snippets?

#

of your HGuard class or the listener

quaint mantle
#

Probably a dumb question but did you register your listener

glossy venture
#

they said it fires sometimes

glossy venture
#

so im assuming it is registered

tribal holly
#

Look HGuard object and Hguard Listener

tribal holly
quaint mantle
#

on what version you are

tribal holly
#

change nothing the version i'm on

glossy venture
#

maybe the compiler optimized away your println statement

#

unlikely

#

but idfk

tribal holly
#

i change the print and i tell you, but even if i print you the fire the event is canceled

#

The message trigger is not print, the event is btw canceled, and the area hasPVP TRUE

#

so any sense

glossy venture
#

any errors?

#

in console

tribal holly
#

any

glossy venture
#

what

#

are there errors

tribal holly
#

any error

glossy venture
#

no idea what that means

#

also i have no clue what could be happening

#

maybe md_5 could help idk

tribal holly
#

The only thing, that append is an other event intervening that cancel the event in the area

tardy delta
#

no errors?

tribal holly
#

but it's the only moment i called the event PlayerShoot

marsh plaza
#

Can anyone help with bungee supervanish?

tardy delta
marsh plaza
glossy venture
#
public void onBlockEat(EntityChangeBlockEvent e) {
``` why is it called `onBlockEat` lmao
tribal holly
#

link to wither block eat

glossy venture
#

ooh

#

or enderman

#

im assuming

tardy delta
#

yummy

tribal holly
#
@EventHandler
    public void onCustomItemThrow(ProjectileLaunchEvent e) {

        if (e.getEntity().getShooter() instanceof Player) {
            Player shooter = (Player) e.getEntity().getShooter();

            if (CustomItemStack.hasTag(shooter.getInventory().getItemInOffHand())) {

                CustomItemLaunchEvent customItemLaunchEvent = new CustomItemLaunchEvent(shooter, CustomItemStack.getCustomMaterial(shooter.getInventory().getItemInOffHand()), shooter.getInventory().getItemInOffHand(), e);
                Bukkit.getPluginManager().callEvent(customItemLaunchEvent);

                return;

            } else if (CustomItemStack.hasTag(shooter.getInventory().getItemInMainHand())) {

                CustomItemLaunchEvent customItemLaunchEvent = new CustomItemLaunchEvent(shooter, CustomItemStack.getCustomMaterial(shooter.getInventory().getItemInMainHand()), shooter.getInventory().getItemInMainHand(), e);
                Bukkit.getPluginManager().callEvent(customItemLaunchEvent);

                return;

            }
        }
    }

@EventHandler(priority = EventPriority.HIGHEST)
    public void onProjectileLaunch(ProjectileLaunchEvent e) {
        System.out.println("trigger");

        if (HGuard.getByLocation(e.getLocation()) == null) {
            return;
        }

        HGuard hguard = HGuard.getByLocation(e.getLocation());

        if (!hguard.isPvp())
            e.setCancelled(true);

    }




```the only two ProjectileLaunchEvent of my plugin
tribal holly
glossy venture
#

can you listen to the same event twice?

tribal holly
#

i do it a lot of time in my plugins and yes

#

you just need to handle correctly the priority

glossy venture
#

oh ok

#

so the

@EventHandler(priority = EventPriority.HIGHEST)
public void onProjectileLaunch(ProjectileLaunchEvent e) {
``` is supposed to be run first?
#

because the priority is highest

tribal holly
#

nop latest, hi will have the last world of cancel event or not

glossy venture
#

HIGHEST priority makes it run first i think

tribal holly
glossy venture
#

oh

#

nvm

tardy delta
glossy venture
#

yeah i know

#

i saw it

#

ty

tardy delta
#

can i get a cookie now?

glossy venture
#

no

tribal holly
#

i just wanna jump out of my building

#

that makes me 6hours i'm on this problem

glossy venture
#

oh no

#

its a weird problem

#

i have absolutely no idea whats happening

tardy delta
#

anyways do you need to close a PreparedStatement?

tribal holly
#

?

glossy venture
#

wtf is a PreparedStatement

#

isnt that like a scripting api thing

summer scroll
#

yes, always close after using it

tardy delta
#

thats sql

glossy venture
#

oh yeah

tribal holly
#

ahhh

#

yes of course

#

always close it

tardy delta
#

oki

quaint mantle
#

Use try-with-resources

tardy delta
#

ah uh

#

?paste

undone axleBOT
ivory sleet
tardy delta
#

made this

ivory sleet
#

Why not hikari?

round elbow
#

ItemMeta#setLore(List<String>); is deprecated
does anybody have any idea which is the new method?

slim kernel
#

can I somehow prevent the Particle.SPELL from moving automatically? I mean this weird kind of fading out thing they do when you spawn them at a specific location.

round elbow
#

ye

opal juniper
#

doesn’t say it is on the jd

round elbow
#

ItemMeta#setDisplayName(String)
deprecated aswell

opal juniper
#

wait

#

are you using paper

round elbow
#

ye

opal juniper
#

there you go

ivory sleet
#

ItemMeta::lore

opal juniper
#

it probably wants components

ivory sleet
#

and ItemMeta::displayName

opal juniper
#

go to paper if you are using paper api

round elbow
#

ok

tardy delta
ivory sleet
#

Hikari is a connection pool

opal juniper
tardy delta
slim kernel
opal juniper
#

doubt it

#

that would be really expensive on the server to manage

#

so if i was mojang that would be client side

slim kernel
opal juniper
#

they all tend to have animations really

#

the server only tells the client when/where to spawn them

slim kernel
opal juniper
#

hate that class

#

but yeah

slim kernel
opal juniper
#

Meh the naming

bright jolt
#

Can anyone help me hook into MVdWPlaceholderAPI?

opal juniper
#

there is usage on the page

bright jolt
#

I copied that repository and dependency, it didn't work..

opal juniper
#

show

#

?paste your pom

undone axleBOT
waxen barn
#

Btw, how can I make, that snowgolem will target fire? I quite undersand custom entities, but I don't know any good way find the block with fire.

bright jolt
#

kk

opal juniper
#

what about this doesn't work?

solar sable
#

guys is it okay to extend JavaPlugin without adding onEnable() and onDisable() ?

opal juniper
#

add <scope>provided</scope> to the papi as well

opal juniper
solar sable
#

oh okay then

opal juniper
#

you cant register any events or commands

solar sable
#

oh

#

well then

opal juniper
#

yeah they have to go in the onEnable block otherwise none of your other code will be run

solar sable
#

imma fix it

opal juniper
#

so basically you need an onEnable

bright jolt
#

It keeps saying "Cannot resolve be.maximvdw:MVdWPlaceholderAPI:3.1.1"

opal juniper
#

onDisable often isnt needed

bright jolt
#

kk

waxen barn
opal juniper
#

i thought that needed an onEnable, hmm probably not then ig

opal juniper
waxen barn
opal juniper
#

you may have to download the api

#

and depend on the jar

bright jolt
opal juniper
#

unfortunately

#

yea

bright jolt
#

How do that?

opal juniper
#

do you use intellij?

bright jolt
#

Yes

opal juniper
#

so download it from the spigot page

bright jolt
#

Done

opal juniper
#

File -> Project Structure -> Modules -> Dependencies -> + -> Jars or directories -> select jar -> Change scope on the right to Provided

bright jolt
#

Alr

quaint mantle
#
  1. Clone sources from github
  2. Build and install mvdw to your local repo
  3. Use
opal juniper
#

you could do that

#

but it works the same

opal juniper
solar sable
#

guys if i put a recipe in a public void recipe() and just put that recipe in will it still work?

#

because i used to just let my recipe out in the open at the main class but now when i put it at separate classes i do not know if it will work or not

quaint mantle
#

hello how to modify the nbttagcompound of an armorstand in 1.12.2 nms ?

#

there is no method for it

#

Why

#

cause there is no pdc api in 1.12.2

solar sable
#

then maybe you cant?

quaint mantle
#

you can

solar sable
#

idk i never used 1.12 before

opal juniper
#

?pdc

quaint mantle
#

1.12.2

quaint mantle
opal juniper
#

"1.14 pdc api"

quaint mantle
#

i know

#

the pdc is in 1.14

#

and i want to use NBTTagCompounds

solar sable
quaint mantle
#

to make it in 1.12.2

ivory sleet
#

Probably need to use nms or the obsolete tag container api thingy

quaint mantle
#

i want to use nms

indigo cave
#

They shoot projectiles

young knoll
#

Look at the cat AI, specifically how they target chests

waxen barn
#

but maybe it's possible because chests re tile entities, but I;ll look at it

hollow spindle
#

I believe I might be working with some UNSPECIFIED_META and for some reason I cannot pick out the getLore() component. (Keeps giving me NullPointerExpection or something of the sort).
How do i know if the "weapon" in this case has no lore attached?

#
public class EnchantRename implements Listener {

    // An array of items that are prohibited to the rename event.
    Material[] weapon = {Material.DIAMOND_SWORD, Material.DIAMOND_AXE, Material.BOW, Material.IRON_AXE, Material.IRON_SWORD, Material.STONE_AXE
    , Material.STONE_SWORD, Material.WOODEN_AXE, Material.WOODEN_SWORD, Material.GOLDEN_SWORD, Material.GOLDEN_AXE, Material.NETHERITE_AXE, Material.NETHERITE_SWORD};
    Plugin plugin;

    public EnchantRename(Plugin plugin) {
        // Bukkit.getLogger().warning("I got called.");
        this.plugin = plugin;
    };

    @EventHandler
    public void onEnchant(PlayerItemHeldEvent e) {
        ItemStack item = e.getPlayer().getInventory().getItemInMainHand();

        for (Material m : weapon) {
            if (m == item.getType()) {
                String oldname = Objects.requireNonNull(item.getItemMeta()).getDisplayName();
                // This check is if the item has been updated or not.
                // Bukkit.getLogger().info(String.valueOf(oldname.toCharArray()[oldname.length() - 1]));
                
             int count = 0;
             Bukkit.getLogger().severe(String.valueOf(item.getItemMeta().toString()));
             if (!Objects.requireNonNull(item.getItemMeta().getLore()).isEmpty()) count = item.getItemMeta().getLore().size();

             ... // Code here that utilises the count var.
                

Errors initially looked like this with the .getLore() function

[23:01:02 ERROR]: Could not pass event PlayerItemHeldEvent to Dropbox v1.0.0
java.lang.NullPointerException: null
        at java.util.Objects.requireNonNull(Objects.java:208) ~[?:?]
        at xyz.nekonii.hexcraft.dropbox.listeners.EnchantRename.onEnchant(EnchantRename.java:42) ~[Dropbox-1.0.0.jar:?]

and just printing the .getItemMeta()

[23:02:50 ERROR]: UNSPECIFIC_META:{meta-type=UNSPECIFIC, enchants={PROTECTION_ENVIRONMENTAL=12, DURABILITY=12}}
[23:02:50 ERROR]: Could not pass event PlayerItemHeldEvent to Dropbox v1.0.0
java.lang.NullPointerException: null
young knoll
#

Check it lore is null

hollow spindle
#

Would a ... == null suffice or is there a built-in feature for checking nulls?

young knoll
#

That is the built in feature

#

I don’t think there is a hasLore

quaint mantle
young knoll
#

Is there? Then use that

hollow spindle
#

ah there is

#

coolios, thank you both manya and col!

west oxide
#

hi

quaint mantle
#

Though == null makes idea shut up

west oxide
#

why does this command not work for me ?
sender.sendMessage(utils.chat(Plugin.getConfig().getString("credit")));

quaint mantle
#

idk

west oxide
#

it shows error on .getConfig

young knoll
#

Because it’s not a static method

west oxide
#

i dont understand

#

how can i fix that ?

tardy delta
#

use your main class' instance

quaint mantle
#

get an understanding what class is and whats the difference between static and non static context

west oxide
#

okay

#

will the config file be directly placed in to a folder with this ?

#

or i need something else to be added ?

waxen barn
bright jolt
tardy delta
#

add the repo

quaint mantle
opal juniper
#

you can't, damm thats shit

#

oh well then yeah

bright jolt
#

How do I add the repo?

opal juniper
#

you will have to install it to maven local

bright jolt
#

How do I do that?

opal juniper
#

see this

bright jolt
#

Alr

#

I'm kind of confused....

#

I don't understand how u do it.....

#

Can anyone show me how to do it

opal juniper
#

this one

#

you need to give the arguments correctly

#

let me try and make the cmd

#

mvn install:install-file -Dfile=<path-to-file> -DgroupId=de.maximdw -DartifactId=MVdWPlaceholderAPI -Dversion=2.1.1-SNAPSHOT -Dpackaging=jar -DgeneratePom=true

#

you just need to add the path to the file

bright jolt
#

Where do I enter the command?

opal juniper
#

cmd prompt

crimson terrace
#

?paste

undone axleBOT
crimson terrace
#

https://paste.md-5.net/iluwuzebox.cs

Hey guys. I have a problem where the code Ive written makes the projectiles from the blaze into different projectiles. somehow the vectors I set make the new projectiles fly towards the targeted player (which is what I want) but then they turn around when theyre at the players position. any ideas?

The bossBlazeTargetMap saves the blazes Entity ID as a key and their targetted Entites UUID as a value.
Please disregard the weird chances setup, havent gotten around to changing it.

Just setting it to the original fireball vector does not work. they always fly in the same direction, no matter where the player is.

mystic sky
#

Probly the world?

crimson terrace
#

?

tardy delta
#

cant i just execute a sql Statement?

#

do i really need a PreparedStatement

#

i'm trying to create a table

quaint mantle
#

How do I subtract 1 from the amount of item that a player has
p.getInventory().getItemInMainHand().getAmount();

crimson terrace
#

setAmount(getAmount()-1)

tardy delta
#

😳

quaint mantle
#

sheeesh

#

ill see if it works

#

also i am dumb why didnt i think of that

#

yes it work thx

crimson terrace
#

np šŸ™‚

#

some brainfarts none of us can avoid

crimson terrace
tardy delta
#

in a try with resources are exceptions in the ( ) also catched?

#

i guess it does

quaint mantle
#

yeah

#

otherwise it wouldnt work

quaint mantle
#

Anyone know some sort of custom crafting gui api that i can use? Similar to hypixel skyblock's crafting

somber belfry
#

Hello, i'm looking to fill an empty cauldron with lava on it, someone know how to ?

#

I have find Levelled class but it's seems to be only for the amount of fluid not for fluid type

quaint mantle
#

Thats what Regular statements dor

tardy delta
#

yea i found it

#

but preparedstatements have a better performance

#

pre compiled

spare prism
#

I've got an exception: java.lang.NullPointerException: Cannot invoke "String.toUpperCase()" because the return value of "org.bukkit.configuration.file.FileConfiguration.getString(String)" is null at md.mirrerror.thewalkingdead.utils.ItemUtils.getCustomItemFromConfig(ItemUtils.java:60) ~[?:?]

Line with the exception: Material material = Material.valueOf(fileConfiguration.getString("CustomItems." + name + ".Material").toUpperCase());
But System.out.println(fileConfiguration.getString("CustomItems." + name + ".Material") == null); prints [17:38:20] [Server thread/INFO]: false

tardy delta
#

the path doesnt exist?

#

ah false

spare prism
#

yeah

summer scroll
#

Material is null?

spare prism
eternal oxide
#

use match not valueof

ember estuary
#

Can you update a server-texturepack mid-game?

#

without people having to redownload it

#

like just change a specific texture

eternal oxide
#

no

spare prism
eternal oxide
#

show code

#

?paste

undone axleBOT
tardy delta
#

is this a good way to save data periodically starting a second after oneEnable?

eternal oxide
#

ok show your yaml

spare prism
#

omg

#

i think i got it

#

one sec

quaint mantle
#

Custom Crafting GUI Api

spare prism
#

yeah, solved for now

#

ty

red sedge
#

hey so uh... my config generates empty?

#

but I can still access the data from the code

#

<the default config>

eternal oxide
#

in onEnable saveDefultConfig()

red sedge
#

I did

eternal oxide
#

then it won;t be empty, unless the config.yml in yoru jar is also

red sedge
#

oop I did saveConfig before saveDefaultConfig

#

that makes sense..

#

sorry

spare prism
#

Why doesn't it work?

    @EventHandler
    public void onCraftItem(CraftItemEvent event) {
        if(!(event.getRecipe() instanceof ShapedRecipe)) return;
        if(!RecipesManager.getShapedRecipes().contains((ShapedRecipe) event.getRecipe())) {
            event.setCancelled(true);
        }
    }

I want to block all the recipes except my recipes, but it blocks all the recipes (default and my recipes)

tardy delta
#

is there a shorter way for !(bool) && !(bool)?

sterile token
#

Like what are you trying to do?

tardy delta
slim kernel
#

how can I check if a number is a multiple of another number

tardy delta
quaint mantle
tardy delta
vale ember
tardy delta
#

😳

small ivy
#

@tardy delta Yup, DeMorgan's Law

tardy delta
small ivy
#

yes

tardy delta
#

heh

ivory sleet
#

ugh

tardy delta
#

shh not again

quaint mantle
#

ugh

sterile token
#

Is there a way for throwing exceptions using the run() method?

tardy delta
#

false, false -> true right?

sterile token
#

true, true -> true
false, false -> true

quaint mantle
#

You can sneaky throw runtime exceptions

sterile token
#

But that need a try catch

#
public class Run implements Runnable {

    protected <E extends RuntimeException> void exception(Throwable throwable) { throw (E) throwable; }

    @Override
    public void run() {
        try {
            execute();
        } catch (Throwable throwable){
            exception(throwable);
        }
    }

    public void execute() throws Throwable { }
}

I find that on google. What do you think?

quaint mantle
#

runtime exceptions

quaint mantle
#

Use it

#

Ah wait

tardy delta
#

create an instance

#

ah

sterile token
#

Why does your command executor extends java plugin?

#

That the question

#

Ahh

tardy delta
#

use a method of it

sterile token
#

That happens because all my plugins main class are called "Main"

#

Btw

tardy delta
#

woah i use 5 times JavaPlugin#getPlugin(MainClass.class)

small ivy
#

You generally want to avoid naming it Main

tardy delta
#

?main

tardy delta
#

ez guess

sterile token
# tardy delta ez guess

I use this:

private static MainClass instance;

public void onEnable() {
    instance = this;
}

public static MainClass getInstance() {
    return instance;
}

Then you can simply do MainClass#getInstance()

tardy delta
#

i dont use that

sterile token
#

i couldnt find that coma

tardy delta
#

its next to the m on my keyboard

#

well the enter in fact

young knoll
#

It’s next to 1 on American keyboards

tardy delta
#

😳

sterile token
#

I use Uruguayan keyboard btw

tardy delta
#

)

quaint mantle
#

Maybe you could exclude classes that extends JavaPlugin from intellij inspections?

sterile token
#

I think im the only one here from uruguay.

sterile token
tardy delta
quaint mantle
#

To kragleh

#

Just ignore it though, thats not really a problem that you should care about

red sedge
#

question should I make every event in 1 class or separate every event's class

quaint mantle
#

if you'd use your plugin instance in other classes the warning will disappear

quaint mantle
sterile token
#

I have a dought from java pure. Its there a way of getting class instance like: getClassName()#getMethod()?

red sedge
quaint mantle
#

What a bullshit

tardy delta
#

but that creates a new one

sterile token
quaint mantle
#

Just dont use singletones

small ivy
#

you would use a singleton pattern

sterile token
#

One said dont use singleton and the other said use a singleton pattern

#

Omg

quaint mantle
#

Pass your objects in constructors as any other depenency

tardy delta
#

big brain time today

#

not possible in enums and utility classes

quaint mantle
#

You shouldnt use plugin in enums and utility classes

red sedge
young knoll
#

I use JavaPlugin.getPlugin in enums

red sedge
#

separate or all in one

quaint mantle
#

If you use plugin in enums you are doing something wrong

tardy delta
quaint mantle
#

enums are static, plugin is not by its natutre

young knoll
#

Namespaced keys

#

Although you don’t need a plugin instance for those anymore so I could remove it

quaint mantle
#

Enums are being initialized on class loading, before plugins

quaint mantle
tardy delta
#

plugin.getName() 😳

#

and Bukkit.getPluginManager().disablePlugin(PLUGIN);

spare prism
#

Why doesn't it work?

    @EventHandler
    public void onCraftItem(CraftItemEvent event) {
        if(!(event.getRecipe() instanceof ShapedRecipe)) return;
        if(!RecipesManager.getShapedRecipes().contains((ShapedRecipe) event.getRecipe())) {
            event.setCancelled(true);
        }
    }

I want to block all the recipes except my recipes, but it blocks all the recipes (default and my recipes)

sterile token
#

dont spam

#

You have already ask that before

quaint mantle
spare prism
spare prism
sterile token
#

Which was it?

tardy delta
#

is ChatColor.GRAY the default one for console?

#

or is it white?

small ivy
#

it's fine if it's not used

sterile token
#

What do you want to do?

small ivy
#

it's fine

#

I doubt that

quaint mantle
small ivy
#

that's not because it's not used

#

ItemSlotLock line 10

#

you're getting a NPE

quaint mantle
#

thats unecessary parsing

sterile token
#

You should first read about the library. And then use the api

#

btw

small ivy
#

Null Pointer Exception, or in other words your program was trying to use something that was null

tardy delta
#

nullpointer, calling null.someMethod()

spare prism
tardy delta
#

the itemmeta can be null, the lore

quaint mantle
#

so many npes can happen hetr lol

#

the item can be null

tardy delta
#

i never understood the difference between null and new ItemStack(Material.AIR)

quaint mantle
#

you can call methods on air itemstack

tardy delta
#

why?

#

can i have a meta or something

chrome beacon
#

Air can't have meta

young knoll
#

But you can call other methods on it

quaint mantle
#

you still can getType and getAmount

young knoll
#

Like isAir

tardy delta
#

2 air šŸ¤”

quaint mantle
#

Btw is there any "R" alternatives in hextalk?

digital rain
#

i know this is a weird question but what do i do when i created a soup instead of lines of code :(

brave goblet
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.meta.ItemMeta.getLore()" because the return value of "org.bukkit.inventory.ItemStack.getItemMeta()" is null
  if(player.getInventory().getItemInMainHand().getItemMeta().getLore().equals("[§2Reusable Mob Changer]")){
              player.sendMessage("Clicked on spawner correctly");
          ```
I get these error message but when i run this it works and returns [§2Reusable Mob Changer] could some one help pls?
```java
   if(action.equals(Action.RIGHT_CLICK_AIR)){
            String str = player.getInventory().getItemInMainHand().getItemMeta().getLore().toString();

            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Clipboard clipboard = toolkit.getSystemClipboard();
            StringSelection strSel = new StringSelection(str);
            clipboard.setContents(strSel, null);
        }```
young knoll
#

getItemMeta only returns null on air

quaint mantle
#

wtf are you doing with system clipboard

brave goblet
digital rain
#

yes check first whether the the item has meta

quaint mantle
#

From system clipboard????

brave goblet
young knoll
#

Lore means it has meta

brave goblet
#

well then yes i do have meta

young knoll
#

But the item you are holding may not always be that item

#

If you are holding nothing, then it won’t have meta

brave goblet
#

ye thats true

#

so how can i correct this?

#

should i use a try catch

quaint mantle
#

what are you trying to do, lmao? ItemMeta.clone?

digital rain
#

i always first if all this only then i ask for the lore

quaint mantle
#

(local variables exist)

young knoll
#

You really could use a variable there

young knoll
#

But yes that is correct

digital rain
#

or .getitemmeta

quaint mantle
#

Wdym by copying ItemMeta?

digital rain
#

^

brave goblet
#

I mean with colour codes

#

it has special characters

digital rain
#

hmm?

brave goblet
#

ah it works now ty

#

and I am idiot

#

player.getInventory().getItemInMainHand().getItemMeta().getLore().toString().equals()
not player.getInventory().getItemInMainHand().getItemMeta().getLore().equals()

quaint mantle
#

Ehhh....

digital rain
#

getlore returns list <String>

quaint mantle
#

ToString is worse

ancient plank
#

have you ever heard of else if statements

digital rain
#

ok but i need people to help me know bc i have also barely any knowledge with yml, so is this all within boundaries of good syntax?

#

whats that

ivory sleet
#

But how does that code have anything to do with yml?

digital rain
#

config file

ivory sleet
#

Yuh but it’s not yaml specific based on that code you sent

digital rain
#

its not configuration tho i just save it there for now

ivory sleet
#

Alright

digital rain
ivory sleet
#

Wdym by good syntax?

#

Clean code?

digital rain
#

i mean whether it works

ivory sleet
#

Papple try and see

tardy delta
digital rain
ivory sleet
#

If it’s a java class then it is not a script

#

But yes show those 5 errors then maybe?

tardy delta
#

js :kekw:

quaint mantle
#

Why did i got pinged

tardy delta
#

about using the system clipboard

#

dont use event.setCancelled(false)

#

thats defaulted

digital rain
#

line 49, nullpointerexcpetion Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

tardy delta
#

this line? timesHitList.set(playerList.indexOf(p.getUniqueId()), System.currentTimeMillis() - 5000);

digital rain
#

yes

#

playerlist is most likely empty

tardy delta
#

is timesHitList a map?

digital rain
#

list

#

i use them all as lists instead of maps

#

and then i check for indexes

tardy delta
#

it says the size is 0 and you're trying to get index 0 (the first element)

digital rain
#

yes

summer scroll
#

How can I get remaining time from a LocalDateTime? I want to compare it with 24 hours for example. So get remaining time from 24 hours and the LocalDateTime, idk If I explain it clearly.

quaint mantle
summer scroll
#

What should I do with the duration?

#

Duration#between(24h, LocalDateTime#now())

quaint mantle
#

what are you trying to do?

summer scroll
#

Getting remaining time

digital rain
#

countdown you mean?

summer scroll
#

Something like that, yeah.

quaint mantle
#

Hmm? Maybe Duration.between(date, date.minusDays(1))

summer scroll
#

I want to get a nice format too, like 2h 25m for example.

#

Basically I have a reputation system, and you can only give 3 reputation, and after that it will start countdown 24 hours till get your reputation usage reset.

digital rain
quaint mantle
#

social credit

tardy delta
#

i dunno

digital rain
#

hmm

tardy delta
#

why not just adding?

digital rain
#

bc they have to be in an order since i use multiple lists as maps basically

#

basically if the first list contains values they will be associated with the values in the other list at the same index

#

okay at least ik what the problem

tardy delta
#

if you use a set i guess the values will be overwritten if they are already in the set

sterile token
#

Hey people is there way of adding a fake player to spigot server. So we can use the spigot messaging channel without online players?

tardy delta
#

add npcs?

sterile token
#

No no fake players.

tardy delta
#

npcs are in theory fake players

hybrid spoke
#

you could also just jump to an alternative

tardy delta
#

with a gameprofile

sterile token
#

I want to do this, connect fake players to proxy, so the spigot server has recipients for the plugin messaging channel

hybrid spoke
#

just use redis

sterile token
#

I use shared hosting

quaint mantle
#

NamespacedKey key = new NamespacedKey(new StoneMind(), "calcite");
Im trying to reference my main plugin class (StoneMind) in a NamespacedKey, is it correct?

sterile token
#

I cannot host redis

tardy delta
#

btw what is redis?

sterile token
#

do you know how to create an entityplayer that affects the Bukkit#getOnlinePlayers() Collection?

quaint mantle
hybrid spoke
sterile token
#

He?

#

Explain

#

With redis I need a hosting bruh

#

I use a shared hosting and i dont have money to buy a redis hosting service

#

Thats what i refer to

quaint mantle
hybrid spoke
#

search up redis pub/sub

sterile token
#

I NOWW

#

But i need a hosting for that redis

tardy delta
sterile token
#

You need to install redis somewhere

#

Omg

#

You cant use redis if you dont have installed it

quaint mantle
tardy delta
#

i know

sterile token
#

And i dont use a vps where i can install redis. I use a hosting

tardy delta
#
public class MainClass {
private static MainClass instance;

public void onEnable() {
  instance = this;
}

public static MainCLass getInstance() {
  return instance;
}
}

in your other class

new NameSpacedKey(MainClass.getInstance(), "   ");```
quaint mantle
#

oh ok

quaint mantle
tardy delta
#

what doesnt work?

quaint mantle
#

i tried your method and tried registering a custom recipe

#

wait holduip

#

ok nvm it worked

red sedge
#

how can I get a value from a string like "Damage: +%float%"

tardy delta
#

substring it?

#

or is it from config?

red sedge
#

its not

#

from the lore of the item

tardy delta
#

if its Damage: 1234567890 then use

Long.parseLong(lore.get(line).substring(8));```
red sedge
#

hmm

#

maybe i can combine that with starts with

#

but like what can I do about the colour codes?

tardy delta
#

ChatColor.stripColor(String) is something u guess

red sedge
#

oh

#

okay thank you!

quaint mantle
#

lore is not for data storage

tardy delta
#

he says it is from lore

tardy delta
#

smh disabling tabcomplete for console

#

i'm trying to execute a method every time a overridden method is called without putting it in every overridden method

smoky tinsel
#

guys

misty current
#

i'm calling spigot().respawn(); on a player on PlayerDeath event, but the dead player picks up the items dropped in the location they died, resulting in a keep-inventory like behaviur

errant snow
#

anyone have issues with unresolved references when trying to compile a module in intellij that depends on another module in the same project?

I've run maven install on the project i need as a dependency and I see it in my .m2 folder, however when compiling the second project it gives me unresolved reference errors and fails to compile

smoky tinsel
#
public class npc {

    private static List<EntityPlayer> NPC = new ArrayList<EntityPlayer>();
    private static DataWatcher watcher;

    public static void creatNPC(Player p, String skin)
    {
        MinecraftServer s = ((CraftServer) Bukkit.getServer()).getServer();
        WorldServer w = ((CraftWorld) Bukkit.getWorld(p.getWorld().getName())).getHandle();
        GameProfile gameProfile = new GameProfile(UUID.randomUUID(),skin);
        EntityPlayer npc = new EntityPlayer(s,w,gameProfile,new PlayerInteractManager(w));
        npc.setLocation(p.getLocation().getX(),p.getLocation().getY(),p.getLocation().getZ(),p.getLocation().getYaw(),p.getLocation().getPitch());


        watcher = npc.getDataWatcher();
        watcher.set(new DataWatcherObject<Byte>(16, DataWatcherRegistry.a), new Byte((byte) 127));
        npc.setHealth(100);
        String[] name = getSkin(p,skin);
        gameProfile.getProperties().put("textures" , new Property("textures",name[0], name[1]));

        addNPCPacket(npc);
        NPC.add(npc);
    }
#
   public static String[] getSkin(Player p, String name)
    {
        try{
            URL url = new URL("https://api.mojang.com/users/profiles/minecraft/" + name);
            InputStreamReader reader = new InputStreamReader(url.openStream());
            String uuid = new JsonParser().parse(reader).getAsJsonObject().get("id").getAsString();
            URL url2 = new URL("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid + "?unsigned=false");
            InputStreamReader reader2 = new InputStreamReader(url2.openStream());
            JsonObject property = new JsonParser().parse(reader2).getAsJsonObject().get("properties").getAsJsonArray().get(0).getAsJsonObject();
            String texture = property.get("value").getAsString();
            String signature = property.get("signature").getAsString();
            return new String[] {texture, signature};
        }
        catch (Exception e)
        {
            EntityPlayer player = ((CraftPlayer) p).getHandle();
            GameProfile profile = player.getProfile();
            Property property = profile.getProperties().get("textures").iterator().next();
            String texture = property.getValue();
            String signature = property.getSignature();
            return new String[] {texture , signature};
        }
    }
#
 public static void addNPCPacket(EntityPlayer npc)
    {
        for(Player p : Bukkit.getOnlinePlayers())
        {
            PlayerConnection c = ((CraftPlayer)p).getHandle().playerConnection;
            c.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, npc));
            c.sendPacket(new PacketPlayOutNamedEntitySpawn(npc));
            c.sendPacket(new PacketPlayOutEntityHeadRotation(npc,(byte) (npc.yaw * 256/360)));
            watcher = npc.getDataWatcher();
            watcher.set(new DataWatcherObject<Byte>(16, DataWatcherRegistry.a), new Byte((byte) 127));
            c.sendPacket(new PacketPlayOutEntityMetadata(npc.getId(), watcher, true));
        }
    }

    public static void addjoinNPCPacket(Player p)
    {
        for(EntityPlayer npc : NPC)
        {
            PlayerConnection c = ((CraftPlayer)p).getHandle().playerConnection;
            c.sendPacket(new PacketPlayOutEntityDestroy(npc.getId()));
            c.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, npc));
        }
    }

    public static List<EntityPlayer> getNPCs()
    {
        return NPC;
    }

}
#

this was work in 1.16.5

#

but i do not have any idea to fix this

errant snow
#

you're using nms, it'll break every version

smoky tinsel
#

can someone help me to fix this?

smoky tinsel
misty current
#

you need to change the imports

errant snow
#

find the new mappings

#

there are resources on spigot to deobfuscate the mappings

smoky tinsel
#

for ex what did npc.yaw change to

#

?

#

i alr change the import

#

b-but nothing change mean almost all of thing didn't change

#

at all

#

;-;.......... pls help this poor kid...... ;-;

livid tundra
#

does the method getBedSpawnLocation in Player get the spawn for respawn anchors? if not, how do I get the spawn?

smoky tinsel
#

also almost of thing that i was use is changed

#

playerConnetion is changed

#

mean PlayerConnection c = ((CraftPlayer)p).getHandle().playerConnection is changed

#

;-; help me

digital rain
#

playerconnection?

lyric grove
#

Hi, im trying to access PacketPlayOutSpawnEntityLiving "a" field, how would i make it accessible?

digital rain
#

wdym

#

accessible where

lyric grove
#

sorry i meant the b field

#

as it is private

digital rain
#

if its a private you can only acces it in that class

lyric grove
#

yeah but is it possible to set it accessible

young knoll
#

Reflection

digital rain
lyric grove
#

thats in the spigot

#

PacketPlayOutSpawnEntityLiving

digital rain
#

where do you want it accessible

#

like an input?

lyric grove
#

in my plugin

#

wdym

digital rain
#

bro "public" makes it accessible anywhere you just do className.variable

lyric grove
#

yes but the one i want to access it private

lyric grove
young knoll
stone sinew
lyric grove
#

so would i get the field from that class and set it accessable?

west oxide
#

hey

#

how can i do something onevent after a command ?

#

i want to be able to freeze players

#

on /freeze player

red sedge
#

how can I run something periodically while a player is online

digital rain
#

runnables

red sedge
#

but like how do I put a condition to runnables?

digital rain
#

simply get the list of online players and run it for eeach of him

digital rain
red sedge
#

I was thinking while the player is online

#

like I can get if the player is online

#

but how do I make it so it stops if the player is not

digital rain
#

well in the runnable you can check whether the player eaquals null, if he does hes ofline

red sedge
#

how?

digital rain
#

if (p == null) {return;}

red sedge
#

no but like how do I use that in a runnable

#

wouldnt that just restart it

#

and not stop it

digital rain
#

you mean stopping the runnable?

red sedge
#

mhm

#

        new BukkitRunnable() {
            @Override
            public void run() {
                // things
                if (Bukkit.getPlayer("iBoard") == null) cancel();
            }
        }.runTaskTimer(OrbRPG.getInstance(), 0, 20);```
#

smth like this?

#

idk what cancel does

#

but it seems to cancel the task

#

but im not sure if it just stops it for that run

#

or stops it completely

digital rain
#

i think it stops completely

west oxide
#

hey

#

i have an array list

#

and i want to remove player from it

#

and add player to it

#

i cant find how :(

ivory sleet
#

List::remove
List::add?

west oxide
#

wait that's a thing ?

ivory sleet
#

Yuck, yes

west oxide
#

then why no one talking about it when i looked this up on google lol

#

F

#

ty

ivory sleet
#

No worries

west oxide
ivory sleet
#

no no no

west oxide
#

uuid is a var i declared before

ivory sleet
#

You need to call remove on the actual list instance

west oxide
#

oh

ivory sleet
#

For instance

#

List<UUID> x = new ArrayList<>();
x.add(player.getUniqueId());

west oxide
#
        if (args.length == 1){

            Player target = Bukkit.getPlayerExact(args[0]);
            if (target != null){
                UUID uuid = target.getUniqueId();

                if (freezed.contains(uuid)) {
                    List::remove(uuid);
                }
                else if (!(freezed.contains(uuid))) {
                    List.
                }
            else{
                sender.sendMessage(utils.chat("&cPlayer not found or offline."));
                }
        }```
ivory sleet
#

freezed.add(blah)

red sedge
#

List::remove(uuid);

#

since when thats a tihng?

ivory sleet
#

It’s not

#

Well

#

Method references can be used in certain places

#

But not with that syntax

west oxide
#

so i replace List::remove(uuid);
by freezed.remove(uuid); ?

ivory sleet
#

Yes

west oxide
#

oh ok

ivory sleet
#

freezed is a variable which contains your list object/instance

west oxide
west oxide
#

wait am stupid

#

lol

#

ok thank you it worked :D

ivory sleet
#

šŸ‘

west oxide
#

now i'll add an onevent that checks player movement

#

and if player is on the list

#

it will cancel the event

ivory sleet
#

😐

west oxide
#

is that good ?

#

i supose not lol

#

its /freeze command

ivory sleet
#

an array list is quite inefficient for that

#

use a hash set

west oxide
#

ok amma google that

#

thank you

ivory sleet
#

good luck

topaz cape
west oxide
#

why

#

and how better do it ?

topaz cape
#

that's usually so buggy instead tp the player to their frozen location

ivory sleet
#

yeah

#

as the event can only catch up to 20 ticks precision

west oxide
#

i'll try both since am still practicing

#

i've seen ppl say its buggy

#

i wanna see how it looks xD

red sedge
#

if you cancel the event it will look buggy client side

west oxide
#

ooh

#

i'll try it

red sedge
#

well i think it will look buggy eitherway?

#

maybe try teleporting them to the ground?

west oxide
topaz cape
west oxide
#

i dont mind it looking kind of buggy

#

as they'll receive a message saying they are frozen

west oxide
red sedge
topaz cape
west oxide
#

meanwhile ... :D

quaint mantle
#

how do i set a custom item with metadata as an ingredient in a recipe without it giving this error

west oxide
quaint mantle
#

Could try to set player velocity to 0 no?

red sedge
#

oh

red sedge
quaint mantle
#

player.setWalkSpeed(0.0F);

red sedge
#

you still should teleport the player btw

quaint mantle
#

And give them potion jump to.

red sedge
red sedge
#

oh wait no

quaint mantle
#

what

red sedge
#

wait

#

dont you need to set the items after settig the keys

topaz cape
# quaint mantle player.setWalkSpeed(0.0F);

teleporting the players is more respectful imo because in that case you can just not set the player speed back to something else because alot of servers Change the walk speed of players

quaint mantle
red sedge
#

you can just save the walk speed to a var

topaz cape
#

it really is kinda smooth

#

unlike cancelling the event

red sedge
#

are you sure you're considering ping?

topaz cape
#

well you can do both

digital rain
#
  b1ab20aa-20ba-4715-baba-c7ada4b2df76:
    Level: '1'
  9fef0449-7993-4a16-9875-4b095d67d65d:
    Level: '5'```
```for (String e : Main.instance.getConfig().getStringList("Players")) {
            playerList.add(UUID.fromString(e));
            levelList.add(Integer.valueOf(("Players." + e + ".Level")));```
tell me why this aint working
red sedge
#

combine em

quaint mantle
young knoll
#

mhm

quaint mantle
#

k thx

topaz cape
#

but just cache the player walkspeed before anything

red sedge
#

yh

#

and maybe just maybe close player's gravity or tp the player to the ground

visual tide
#

or just give speed 128

red sedge
#

we really just started arguing about the best way to make a practise plugin

tardy delta
#

šŸ‘€

golden turret
#

what is the name of this

red sedge
#

?

ivory sleet
#

You have a package private instance variable

#

And then on the same line, consecutively a clinit block