#help-development

1 messages · Page 2162 of 1

tardy delta
#

maybe if you move the datapack to the datapacks folder and restart the server

grim ice
#

Hey

#

so uh

#

anyone has an idea of what to start with if I wanna learn AI

#

ik thats too generalized but im not sure with what to start

harsh totem
#

Does anyone know why it crashes my server?

    public void DeadlyLava(PlayerMoveEvent event){
        Player player = event.getPlayer();
        if (player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.LAVA){
            while (player.getHealth() > 0){
                player.damage(1);
            }
        }
    }```
terse raven
terse raven
grim ice
#

cant i do it with java lol

#

im most comfortable with java

terse raven
grim ice
#

hmm

#

i wnna t ry deeplearning4j

#

but i dont really get how to use it

terse raven
#

then do it

#

look at the examples

#

and docs

harsh totem
terse raven
#

if you just while loop

#

without delay

#

he will insta die too

tardy delta
#

why is it crashing

terse raven
#

damage with a value of one

#

is probably cancelled

harsh totem
#

how do I delay it?

terse raven
#

so his health never reaches 0

#

or something and gives an infinite loop

harsh totem
tardy delta
#

?scheduling

undone axleBOT
grim ice
#

ok i dont get it

terse raven
grim ice
#

i literally

#

just wanna make

#

a rock paper scissors

#

ai

#

lmfao

#

nothing can get simpler than this

terse raven
#

literally a brain js example

tardy delta
#

why doing ai in java btw?

terse raven
#

probably wants it in his plugin or something

terse raven
#

this seems like a good resource

#

it lists a bunch of good and free machine learning frameworks for java

astral shard
#

For example numpy which is written in C making it faster than it would've been if it was written in python

harsh totem
#

How do I get the plugin?

                scheduler.runTaskLater(plugin, () -> {
                    player.damage(1);
                }, 20L * 30L);```
quaint mantle
#

I have a question, i use on my server tree twerk and its just enabled with op on the server, please say me how to fix

green prism
#

Hi guys, I created a plug-in with the use of placeholderapi. I used JAVA 8 in 1.16.5 but unfortunately placeholders are not registered in 1.18 with java 17, what could I do in your opinion to create a multicompatibility?

harsh totem
tardy delta
#

?di to get the plugin

harsh totem
#

So I get the plugin like this? Main plugin = new Main();

#

wdym

#

what is "yaw"

tardy delta
harsh totem
#

shouldn't it not be final?

tardy delta
#

are you doing it in the constructor?

harsh totem
tardy delta
#

show code

harsh totem
#

oh nvm

#

i fixed it

peak jetty
#

hi so i would like to tp the command sender to the target but player.teleport is not working for me, this is my code:

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("spectate")) {
            Player target = sender.getServer().getPlayer(args[0]);
            if (target == null) {
                sender.sendMessage(ChatColor.GOLD + args[0] + ChatColor.AQUA + " is not currently online.");
                return true;
            }
            player.teleport(target, PlayerTeleportEvent.TeleportCause.COMMAND);
        }
        return false;
    }```
tardy delta
#

uhm sir youre not checking the length of the args

quaint mantle
#

?paste

undone axleBOT
tardy delta
#

do player.teleport(target.getLocation())

peak jetty
quaint mantle
#

here is the pom file

#

anyone can help me?

#

or do I need to ask the citizen server thing

eternal night
tardy delta
#

bruh

#

i see

peak jetty
#

?

eternal night
#

Follow whatever tutorial you are following

#

You need to instanceOf check the sender

#

And then cast

#

But your tutorial should show you that

tardy delta
#
if (sender instanceof Player) { Player player = (Player) sender }```
#

🥣

eternal night
#

🥄

tardy delta
#

🍴

#

smh

harsh totem
#

I have this code but it only works in the first time it is executed since the plugin is reloaded

    public void DeadlyLava(PlayerMoveEvent event){
        Player player = event.getPlayer();
        if (player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.LAVA){
            while (player.getHealth() > 0){
                BukkitScheduler scheduler = Bukkit.getScheduler();
                Main plugin = new Main();
                scheduler.runTaskLater(plugin, () -> {
                    player.damage(1);
                }, 10L /*<-- the delay */);
            }
        }
    }```
harsh totem
eternal night
tardy delta
#

please

#

please

#

read what i sent

#

are you?

harsh totem
#

?

peak jetty
tardy delta
#

doing things like while(true) {} will block the whole server so thats why you need to use the scheduler

eternal night
#

No

harsh totem
# peak jetty THANK YOU

but first check if the sender is an instance of a player because the command could be executed from the console

eternal night
#

Fourteen literally already posted that

#

😭

tardy delta
#

🥲

#

im really sad now

eternal night
#

You are using the while look outside the scheduler

#

Mate

tardy delta
#

someone has to hug me now

eternal night
#

It isn’t rocket science here

harsh totem
#

im not

eternal night
#

I’d give you a hug fourteen but this is too depressing

#

Also generally speaking a while loop is never the answer

#

You want to run a task timer

harsh totem
#

I just want it to execute every 0.5s

eternal night
#

Run a task timer that ja a Delay of 10 ticks

tardy delta
#

read the docs about scheduling

eternal oxide
#

while loops are for iterating. Scheduling is for repeating tasks

eternal night
#

Roughly 500 ms

tardy delta
#

still depends on the tps but ye

harsh totem
#

I says I can do .runTaskTimer(plugin, 20L * 10L /*<-- the initial delay */, 20L * 5L /*<-- the interval */);
but my IDE says Cannot resolve method 'runTaskLater(Main, <lambda expression>, long, long)'

eternal night
#

Carefully read the method name

#

You got this

quaint mantle
#

anyone?

#

quack quack

ivory sleet
#

?ask

undone axleBOT
#

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

mellow edge
#

is there any way to use something like "PlayerChangeBlockEvent" instead of player move event

eternal night
#

No

mellow edge
#

can I do it somehow with PlayerMoveEvent

harsh totem
#

in the console

peak jetty
#

hey how can i hide player from target's tab?

eternal night
eternal oxide
harsh totem
#

I haven't created an instance tho

#
    public DeadlyLava(Main plugin) {
        this.plugin = plugin;
    }```
#

it's what he sent

eternal oxide
#

Somewhere else you have

eternal night
#

Most likely where you create the class

harsh totem
#

oh

eternal night
#

DeadlyLava

harsh totem
#

i got it

ivory sleet
#

remove any new Main()

harsh totem
#

i found one

#

thx

dark arrow
#

public class StrengthZombie extends EntityZombie {
public StrengthZombie(Location location){
super(EntityTypes.be,((CraftWorld)location.getWorld()).getHandle());

}

I unable to use this code and it give me error"x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type"

eternal oxide
#

1.18 I assume?

#

@dark arrow ^

flint coyote
dark arrow
eternal oxide
# dark arrow yup

You should be using the mojang mappings if you're using NMS on 1.17+

harsh totem
#

for some reason the scheduler repeats every seconds instead of 1/10 of a second

eternal oxide
#

?bootstrap read the 1.18 nms section AND the 1.17 post it links to

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

eternal oxide
#

EntityTypes.be is NOT a mojang mapping

wind tulip
#

Does the Inventory#remove method remove all items? Or is it just Inventory#removeItem under a different name

#

I checked the docs and it looks like the latter but I'm just making sure

quaint mantle
#

remove removes every item that is equal to that item

#

?jd-s

undone axleBOT
quaint mantle
#

you will find every answer you need in those docs

harsh totem
#
                scheduler.runTaskTimer(plugin, task -> {
                    player.damage(1);
                    if (player.getHealth() <= 0 || player.getLocation().getBlock().getType() != Material.LAVA){
                        task.cancel();
                    }
                }, 0, 2);```
#

the code

wind tulip
quaint mantle
#

yes

#

like i said

wind tulip
#

ok

quaint mantle
#

it says that in the docs

wind tulip
#

I checked the docs

river oracle
#

Nice aobaThumb just test it then

quaint mantle
#

if the docs says the amount matters, then it matters?

spiral hinge
#

Hey if I have a string in my messages configuration file and someone uses a formatting or color code like &7, how do I get it so that it will actually show the format or color with the sendMessage method?

crimson terrace
#

you should get that as an extra value

#

and then call ChatColor.of()

river oracle
#

Translate color codes method from CharColor class should do you well

eternal oxide
#

20 = once per second

harsh totem
spiral hinge
crimson terrace
#

save the nameColor as one value in the config and the actual name string as another

#

then you can do ChatColor.Of(config.getString())

crisp steeple
#

pretty sure .damage() has a cooldown on it

#

or at least it doesn’t update properly client side, i remember having issues trying to damage very quickly

harsh totem
#

how do i bypass this

quaint mantle
#

what

#

it repeats 10 times every second

quaint mantle
#

exsisting

quaint mantle
#

can anyone help?

eternal oxide
#

You are probably being muted as you are not using the repo correctly

#

I'm guessing they already linked you to some wiki

peak jetty
#

hello im trying to add a player to onlineplayerlist that has been removed from the list

tardy delta
#

i guess thats the tab

peak jetty
#

this is my code:

target.getServer().getOnlinePlayers().add(player);```
peak jetty
#

but i get this error: 'add(capture<? extends org.bukkit.entity.Player>)' in 'java.util.Collection' cannot be applied to '(org.bukkit.entity.Player)'

eternal night
#

What are you doing

tardy delta
#

uh thats the online player list that bukkit is keeping

eternal night
#

The list is immutable

#

Don’t even try to add a player

tardy delta
#

which i just wanted to say

eternal oxide
tardy delta
#

what are you tryin to do?

peak jetty
#

i have already removed a player tho and i want to add him back is there any way i can do so?

eternal oxide
#

You can;t manually remove an online player

tardy delta
#

^

peak jetty
#

i did tho target.getServer().getOnlinePlayers().remove(player);

eternal oxide
#

that did nothing

tardy delta
#

and did it give an error?

peak jetty
#

if i cant remove the player or add the player is there a way i can hide and show it?

tardy delta
#

wHaT aRe YoU dOiNg?

eternal oxide
#

you are talking about tab lists?

peak jetty
tardy delta
#

packets probs

quaint mantle
#

and then got banned

#

I tried

#

everything in the repo

peak jetty
quaint mantle
#

I mean the wiki

eternal oxide
jagged badge
#

When you right-click on a fake block, it disappears. I'd like to disable that.
The only packet I found that blocked this is PacketPlayOutChangeBlock. The problem is that this packet not only blocks what I want, but also blocks the sendblockchange etc. Someone would know how to just block the right click (cancel interact event etc doesn't work)

quaint mantle
#

and those staff emmbers

#

dont give a shit about u

peak jetty
#

how do it do my tab list show and hide?

eternal oxide
quaint mantle
#

dont press at the tab putton

granite owl
#

am i dumb why dont i find the durability flag under item meta?

#

xD

quaint mantle
#

bro

#

the thing

#

is just doing

#

what ever shit it wants

eternal oxide
#

No, you are not reading nor listening to anyone

quaint mantle
#

ok tell me

eternal oxide
#

?paste your current pom

undone axleBOT
quaint mantle
quaint mantle
#

did u find any issues

#

?

eternal oxide
quaint mantle
#

Could not transfer artifact net.citizensnpcs:citizens-main:pom:2.0.29-SNAPSHOT from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [everything (http://repo.citizensnpcs.co/, default, releases+snapshots)]

#

thats all

#

it said

eternal night
#

Well

#

Don’t use http

#

Pretty straight forward

quaint mantle
#

how to change?

eternal night
#

The repo you define

#

Define it with https

quaint mantle
#

o nvm

#

cannot access net.maploop.enums

#

and now this error

#

@eternal oxide

eternal oxide
#

opening my ide

quaint mantle
#

OMG

#

IT WORKED

#

LETS GO

#

THANK YOU GUYS SOO MUCH

#

@eternal night @eternal oxide

#

U GUYS ARE THE BEST

tardy delta
#

lol

quaint mantle
#

but im still getting a few erros

#

tho

quaint mantle
eternal oxide
#

What errors?

harsh totem
#

It crashes my client

    public void DeadlyLava(PlayerMoveEvent event){
        Player player = event.getPlayer();
        if (player.getLocation().getBlock().getType() == Material.LAVA || player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == Material.LAVA){
                BukkitScheduler scheduler = Bukkit.getScheduler();
                scheduler.runTaskTimer(plugin, task -> {
                    player.setNoDamageTicks(0);
                    player.damage(1);
                    if (player.getHealth() <= 0 || player.getLocation().getBlock().getType() != Material.LAVA || player.getLocation().getBlock().getRelative(BlockFace.UP).getType() != Material.LAVA){
                        player.setNoDamageTicks(20);
                        task.cancel();
                    }
                }, 0, 2);
        }
    }```
eternal oxide
#

you are creating a NEW task every move packet you are in or on Lava

#

there are Thousands of move packets

harsh totem
eternal oxide
#

You create a single task, outside the event, then either activate it or deactivate it in the move event

harsh totem
#

ok

peak jetty
#

hi i get this error in the console when typing a command from my plugin:

[19:57:50 INFO]: Gizmo0o issued server command: /unspec Gizmo0o
[19:57:50 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'unspec' in plugin PlutoCraft v1.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchCommand(CraftServer.java:906) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2306) ~[?:?]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2117) ~[?:?]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2098) ~[?:?]
    at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:46) ~[?:?]
    at net.minecraft.network.protocol.game.ServerboundChatPacket.a(ServerboundChatPacket.java:6) ~[?:?]
    at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51) ~[?:?]
    at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
    at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1399) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:188) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
    at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1376) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1369) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
    at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1347) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1229) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-337]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalArgumentException: location
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.0.1-jre.jar:?]
    at org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer.teleport(CraftPlayer.java:1131) ~[paper-1.18.2.jar:git-Paper-337]
    at org.bukkit.craftbukkit.v1_18_R2.entity.CraftEntity.teleport(CraftEntity.java:558) ~[paper-1.18.2.jar:git-Paper-337]
    at net.plutocraft.plutocraft.PlutoCraft.onCommand(PlutoCraft.java:74) ~[PlutoCraft-1.0.jar:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    ... 21 more
harsh totem
peak jetty
# harsh totem `IllegalArgumentException: location`

how can i fix this?:

        else if (command.getName().equalsIgnoreCase("unspectate")) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
            } else {
                sender.sendMessage(ChatColor.DARK_RED + "You must be a player.");
                return false;
            }
            Player target = sender.getServer().getPlayer(args[0]);
            Player player = (Player) sender;
            if (target == null) {
                sender.sendMessage(ChatColor.GOLD + args[0] + ChatColor.AQUA + " is not currently online.");
                return true;
            }
            player.teleport(getServer().getPlayer(player.getName()).getBedSpawnLocation());
            ((Player) sender).setGameMode(GameMode.SURVIVAL);
            target.showPlayer(player);
            player.setPlayerListName(player.getDisplayName());
            target.sendMessage(ChatColor.BOLD + "" + ChatColor.GOLD + "+" + ChatColor.YELLOW + player.getDisplayName() + ChatColor.GREEN + "joined the game");
            player.sendMessage(ChatColor.AQUA + "No longer spectating" + ChatColor.GOLD + target.getDisplayName() + ChatColor.AQUA + ".");
        }```
harsh totem
#

what is the command that you run

#

what did you type

peak jetty
#

./unspectate Gizmo0o

harsh totem
#

idk

crisp steeple
#

i would assume they don’t have a spawn location

peak jetty
#

its a prob with this i think:
player.teleport(getServer().getPlayer(player.getName()).getBedSpawnLocation());

peak jetty
harsh totem
#

if it's null it not a location

tardy delta
harsh totem
#

How do I make it execute also when im standing still in lava?

#
    public void DeadlyLavaKill(PlayerMoveEvent event){
        Player player = event.getPlayer();
        if (player.getLocation().getBlock().getType() == Material.LAVA || player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == Material.LAVA){
                scheduler.runTaskTimer(plugin, task -> {
                    player.setNoDamageTicks(0);
                    player.damage(1);
                    if (player.getHealth() <= 0 || player.getLocation().getBlock().getType() != Material.LAVA || player.getLocation().getBlock().getRelative(BlockFace.UP).getType() != Material.LAVA){
                        player.setNoDamageTicks(20);
                        task.cancel();
                    }
                }, 0, 2);
        }
    }```
peak jetty
harsh totem
harsh totem
tardy delta
#

early returns aaa

#

look at your code

#

does it look like a pyramid

harsh totem
#

@tardy delta does player.getLocation() return the xyz of the head block or the leg block?

tardy delta
#

feet

crisp steeple
harsh totem
crisp steeple
#

creating a repeating runnable every playermoveevent that runs every 2 ticks

tardy delta
#

elgarl explained

#

this looks like im typing 'egirl' lol

harsh totem
harsh totem
crisp steeple
#

idk

#

try it

harsh totem
#

ok

peak jetty
#

would this work or did i do it wrong?

            player.teleport(getServer().getPlayer(player.getName()).getBedSpawnLocation()); {
                if (player.getBedSpawnLocation() != null){
                    player.teleport(getServer().getWorld(player.getName()).getSpawnLocation());
                }
            }```
crisp steeple
#

its just youre effectively creating 20 repeating runnables every second a player is in lava

#

and each one of those is running 10 times a second

tardy delta
crisp steeple
#

and theyre performing fairly expensive operations as well

tardy delta
#

and dont request it twice

#

it does a map lookup

crisp steeple
#

overtime that is gonna break the server

quiet ice
#

Why the heck should one use getServer().getPlayer(player.getName())

peak jetty
#

what does this mean?

river oracle
#

Null points error

eternal night
#

Ah yes I love the world that is named after my player name

tardy delta
#

having a personal world

eternal night
#

It’s a good flex

peak jetty
#

how can i change my code to fix the error?
player.teleport(getServer().getWorld(player.getName()).getSpawnLocation());

eternal night
#

Well what world do you want

eternal oxide
#

player.getWorld().getSpawnLocation()

tardy delta
#

only for premium users

eternal oxide
#

What world?

peak jetty
eternal oxide
#

Is it a world named the same as the player?

eternal oxide
#

I don't understand noyes

peak jetty
#

yes

#

yes

eternal oxide
#

Is the player alreadyin that world?

peak jetty
#

i want it to tp the player to the spawn of the world wich the player is in

eternal oxide
#

then player.teleport(player.getWorld().getSpawnLocation())

#

no

peak jetty
#

oh ok

#

yes

#

thanks

#

👍

tardy delta
#

if i do heavy stuff in the async prelogin, that wont block the user from logging in right?

eternal oxide
#

They will not join until the async event finishes. but you are safe to delay a few seconds in it

crisp steeple
#

it would suck if i changed my name and lost my entire world

tardy delta
#

ah so it will block the user

#

then i probably confused it with smth else

#

owh ye i forgot

harsh totem
#

The player.damage(1) just kills the player instantly (it doesn't do it every 1/4 of a second, it just instantly kills me). I tried to remove it but then the lava didn't do the damage fast like I wanted.

    public void DeadlyLavaKill(EntityDamageEvent event){
        if (event.getEntity() instanceof Player){
            Player player = (Player) event.getEntity();
            if (player.getLocation().getBlock().getType() == Material.LAVA || player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == Material.LAVA){
                scheduler.runTaskTimer(plugin, task -> {
                    player.setNoDamageTicks(0);
                    player.damage(1);
                    if (player.getHealth() <= 0 || player.getLocation().getBlock().getType() != Material.LAVA || player.getLocation().getBlock().getRelative(BlockFace.UP).getType() != Material.LAVA){
                        player.setNoDamageTicks(20);
                        task.cancel();
                    }
                }, 0, 5);
            }
        }
    }```
eternal oxide
#

oh you are in teh damage event, even worse

harsh totem
eternal oxide
#

hundreds

golden kelp
eternal oxide
#

one sec

harsh totem
golden kelp
#

Just make one in your main class

Next time a player kills entity,
check if they are in the hashmap. If they are, check if they already damage (by getting their key which is true or false).

If they are not in the hashmap, just add them into the hashmap

eternal oxide
#

?paste

undone axleBOT
eternal oxide
golden kelp
#

yea it will

#

wait

#

it wont

#

where is the set used

eternal oxide
#

I couldn;t remember if the forEach was iterated

golden kelp
#

nvm found it

#

so you shouldnt remove it while iteratiing

#

use removeIf method

eternal oxide
#

ah yep, forgot about that

golden kelp
#
inLava.removeif(x -> x == id);
#

iirc

eternal oxide
#

@harsh totem

harsh totem
eternal oxide
#

actually 4 per second. Thats the speed you have the task set to run

harsh totem
#

it does it every second

eternal oxide
#

no, it does it every 1/4 a second. your client just isn;t updating that fast

#

if you want to slow the damage down, increase teh timer delay from 5 ticks to 10

#

so twice a second

harsh totem
#

i just checked

eternal oxide
#

It does 4 damage per second, as I just told you

#

it runs 4 times every second (5 ticks) doing 1 damage every time

#

1 damage = half a heart

#

so it will be taking 2 hearts per second

harsh totem
#

that's what it should do but it activates every seconds and not 1/4

harsh totem
eternal oxide
#

no it doesn't

#

not unless you are creating more than one listener

harsh totem
#

im not

eternal oxide
#

then that code I gave you will do 2 hearts per second, assumign you have not got any health scaling on

harsh totem
#

ok

eternal oxide
#

and assuming your server is not lagging to be able to run at 20 ticks per second

#

oh, fix this line, as currently your code will allow you to pop your head above the lava and stop taking damage java if (player.getHealth() <= 0 || (player.getLocation().getBlock().getType() != Material.LAVA && player.getLocation().getBlock().getRelative(BlockFace.UP).getType() != Material.LAVA)){

tardy delta
#

can i just add another <relocation></relocation> to shade something else?

#

ah noclassdef found

grim ice
#

ay

#

what do we call indentation overuse

#

i forgot that term

tardy delta
#

too much indents or smth?

grim ice
#

nah it has a nam

#

e

peak depot
#

someone got ideas what to code?

grim ice
#

ok its name is pyramid of doom

eternal oxide
#

We'd be writing it if we did

tardy delta
#

what scope do i need again for shading something?

#

compile?

eternal oxide
#

yep

tardy delta
#

still noclassdef found brr

sage dragon
#

I'm sure it's fun to play with

#

Or make a Gravity Gun plugin, that one is definitely fun

peak depot
#

im trying the herobrine one thats sounds good thanks for your idea

sage dragon
tardy delta
#

aight it seemed to work now

#

nice file extension tbh

opal juniper
golden turret
#

how could i make it possible for the player to cross the worldborder?

tardy delta
#

i probably shouldnt use the extension

coarse shadow
#

when we place jigsaw block through code, can we change its direction?

tardy delta
#

isnt that some old block

quaint mantle
coarse shadow
tardy delta
crisp steeple
golden turret
#

yes

crisp steeple
#

you cant do that

#

its prevented client side as well

wind tulip
#

Anyone know how to clear crafting slots? (The ones in the player inventory)

golden turret
#

alright so which packet is the one who sents the world border?

echo granite
#

any android developers?

golden turret
#

?ask

undone axleBOT
#

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

ivory sleet
echo granite
#

I do not have a specific question, I need to talk to one in PMs.

ivory sleet
#

I did Android with Java tho

#

So might not be able to help (was some time since)

echo granite
#

I'm basically stuck with the entire topic of making responsive layout

#

what I was taught in school is to use DP for everything, and now in the real world where I want to release my app, it looks more than horrible on other devices

#

ConstraintLayout is a big headache

#

I'm lost

ivory sleet
#

I mean using dp is wise

echo granite
#

how is it wise? it's a constant size

#

you should never use dp lol

quaint mantle
#

Is there a way to set the priority of world initialization event to low, so it doesn't hit the performance as much?

ivory sleet
#

Myeah there are probably better ones in practice now

#

But it can be favored in certain scenarios to some other size types

naive bolt
#

whats the event that happens when someone uses this

dusk flicker
#

highly doubt there is an event for it

#

but I could be wrong

ivory sleet
#

Creative mode is duct taped

#

Really abhorrent to work with

naive bolt
#

im trying to make it so when an item is removed either mannualy or with that button it adds it back

ivory sleet
#

InventoryCreativeEvent or whatever it’s called might be of help

naive bolt
#

ah yea

echo granite
#

but nobody shows a real example

#

I'm so lost

ivory sleet
#

Let me take a look at what that is

echo granite
#

I don't even understand how people made responsive layout prior to constraintlayout(which was released at 2016)

ivory sleet
#

Yeah well, I kinda “hard coded” it

golden turret
#

does it means that i can cross any border if the client wants to??????????

left swift
#

When I use my library in the multiple project (only for personal use) should I implement it manually adding library to the project structure or create maven artifact dependency using jitpack or smth like this?

ivory sleet
#

If you can put it on jitpack or sth

#

Since then it’s basically accessible from everywhere

left swift
#

Yeah, but when I use it in about 3 - 4 projects, personal use etc, putting it on the jitpack is better way than doing it manually?

ivory sleet
#

Maybe just put it in your local maven repository

wary harness
#

So got problem with softdpendcy
my plugin wont load after MythicMobs

#

my plugin soft depend

golden turret
#

how can i get the location based on the world border like this

eternal oxide
#

last I looked only Depend affects the actual load order

golden turret
eternal oxide
#

softdepend only makes sure they exist

wary harness
#

didn't know that

#

what can I do about it

eternal oxide
#

What issue are you having?

wary harness
#

because I got class which loads types of mythic mobs

#

so my plugin loads before Mmobs

#

and fires constructor which should store types of Mmobs to map

#

but they are not there yet because thing is null

eternal oxide
#

You are doing your loading in your onEnable?

eternal oxide
#

and does your plugin actually work without MM?

#

it it truly a soft depend

wary harness
#

yes it hooks as an option

#

it is soft depend it can work without it

eternal oxide
#

then detect MM in your onEnable, but schedule your init of your MM code 1 tick later

wary harness
#

it is token plugin which allows token drops

#

for mobs farmin etc

#

and mmobs are one of things

eternal oxide
#

with softdepend you can never guarantee load order so you should never expect other plugins to be loaded before yours

wary harness
#

but was confused didn't knew that soft depend only check if plugin is there

wary harness
#

I am lazy reader so probably slipped thru my eyes 🍻

eternal oxide
#

I don;t believe its actually written anywhere. I remember it from having this issue myself long ago in Towny.

golden turret
#

you guys

#

how can i draw lines based on the player location and world border

#

i will give an example

quaint mantle
#
@EventHandler(priority = EventPriority.LOW)
    void disableWorldLag(WorldInitEvent e){
        e.getWorld().setKeepSpawnInMemory(false);
    }```
#

Would this reduce lag when loading a world ?

#

The big lag spike that you get, when loading it.

golden turret
wary harness
#

so I made repeat task

#

which checks if plugin is loaded once a sec

#

and then loads thing and cancel task

fallow violet
#

maybe?

board.getTeam("RedTeam").setColor(ChatColor.RED);```
fossil lily
#

Is there an alternative for .isItem() on the 1.8.8 API?

fallow violet
#

oh, mmmh

eternal oxide
fallow violet
#

is there something like setGlowColor? @kind patrol

wary harness
#

looks like there is some other problem with Mythic api

eternal oxide
#

or is all access via Bukkit getPlugin?

wary harness
#

I was defining instance in class where I register event MythicMobDeathEvent

#

this helps

#
            @Override
            public void run() {
                if (pl.getServer().getPluginManager().isPluginEnabled("MythicMobs")){
                    mythicOn = true;
                    mythicMobs = MythicBukkit.inst();
                }

            }
        }.runTaskLater(pl,1);```
#

forgot I got it there

quaint mantle
wary harness
#

@eternal oxide look at the devil it is working

#

🤣

crimson terrace
crimson terrace
#

I is happy

crimson terrace
wary harness
crimson terrace
#

BANANA

mortal hare
#

Is it possible to instanciate generic array or generic fixed sized list?

#

new Foo<Baz>[50]; doesnt work, but Arrays.asList(new Foo<Baz>[50]; doesnt work either as you can see

#

there's a workaround to wrap interfaces inside subinterfaces with types already defined

#

but that would be a hassle to maintain in the long term, especially if there's no new functionality inside those interfaces

ivory sleet
#

class Sub derives Foo<Bar>{}

Sub[] could work altho it’s probably not what you’re looking for

mortal hare
#

that's what I currently do

#

but imagine many classes

#

and for each you have to create a new class or extend interface

#

smelly

ivory sleet
#

But else since types passed to type parameters aren’t necessarily retained during runtime it then becomes an issue for arrays hence why it isn’t possible

#

Yeah it’s smelly

mortal hare
#

well

#

wildcard type declaration works tho

#

new Foo<?>[50]

ivory sleet
#

Yes because then it accepts Foo<T> where T can be anything

#

So it effectively doesn’t impact anything in other words

proper lark
#

Anyone know a tnt tag plugin

crisp steeple
uneven fiber
#

Yo. I'm trying to create a command where it saves a message from the player, for example: /savemessage Hello my name is Steve. Any idea how to do this?

#

i tried this but it doesn't seem to work

eternal oxide
#

are you trying to store one message per player?

uneven fiber
#

yes

#

if they call the command again it resets to the new message

eternal oxide
#

then use a Map<UUID, String>

uneven fiber
#

Got it

eternal oxide
#

no need to loop over an array then

uneven fiber
#

ah so the for loop would be uneeded

eternal oxide
#

correct

uneven fiber
#

Ok

#

just wanted to clarify, the enderse array is for player and the msg array was used to store the players message

humble tulip
#

Hashmaps are also far more efficient

uneven fiber
#

I will try the map

#

never used one before so I was trying to do a different approach lol

high ridge
#

So has anyone gotten mojang mappings to work in gradle?

eternal oxide
#
Map<UUID, String> messages = new HashMap<>();

onCommand...
messages.put(event.getPlayer().getUniqueId(), event.getMessage());```
#

However, you would be better creating an actual command and not using the preprocess event

uneven fiber
#

let me send you a picture of my whole class

eternal oxide
#

?paste

undone axleBOT
uneven fiber
eternal oxide
#

yep, don;t use the preprocess event at all

uneven fiber
#

what would you suggest then?

eternal oxide
#

so the code would be something like```java
Map<UUID, String> messages = new HashMap<>();

onCommand...
if (sender instanceof Player player) {
if (args.length > 0) {
messages.put(player.getUniqueId(), String.join(" ", args));
return true;
}
sysout(player.getName() + " : " + messages.getOrDefault(player.getUniqueId(), "No message stored!")
return true;
}```

uneven fiber
#

what does .put do?

eternal oxide
#

that would allow you to use the same command to store or retrieve a message

#

put adds am entry in the Map

uneven fiber
#

so thats essentially what stores the messages into the hash map

eternal oxide
#

So it stores teh message under teh players UUID

uneven fiber
#

kind of like .add for an arraylist

uneven fiber
#

So I would'nt even need to use an event handler!

#

interesting

eternal oxide
#

no

#

just the command

#

if you enter teh command with no text after it will show you the stored message

uneven fiber
#

awesome

#

thats what .getorDefault does

uneven fiber
eternal oxide
#

If there is a message stored for that player it will fetch it, or if none it will add the no message message

uneven fiber
#

saying that if nothing was stored and nothing was put in then default is called

eternal oxide
#

getOrDefault is nice to prevent null errors

uneven fiber
#

what does String.join do?

humble tulip
#

Have a guess

uneven fiber
#

lol fair

eternal oxide
#

builds a single string of all the args with a space between each

uneven fiber
#

yah

naive loom
#

would any know how to fix when you teleport two players a world the one player can't see one and the other one can see the other one? (i don't know how to explain it one, but it's like as one of the players have invisiblity in one of the mc window but the other mc window sees the other play perfectly fine.)

eternal oxide
#

Is the world loaded before you teleport?

humble tulip
#

Player.setVisible()?

uneven fiber
#

its asking for character sequences.

eternal oxide
#

google it, I may have got it slightly wrong

uneven fiber
#

Ok got it

#

thank you for your help!

eternal oxide
#

yep I got it in reverse

uneven fiber
#

yeah just checked

#

space should go in the first param

eternal oxide
#

String.join(" ", args)

uneven fiber
#

👍

#

Hashmaps are useful lol

#

Need to learn more about them

dusk flicker
#

maps arrays sets

#

very useful indeed

uneven fiber
eternal oxide
#

yes, but not as easily

uneven fiber
#

Ok

eternal oxide
#

It would have been a nightmare to replace a message

#

and lots of looping to find the right entries

uneven fiber
#

I see

#

Hypothetically how would I go about storing the message tho?

#

would I need to use an event?

eternal oxide
#

this Map you can put straight into a FileConfiguration (config)

uneven fiber
#

Cool

#

yeah the whole reason I want to store this message is because i’m creating another command where when you call it it will display the saved message

#

and imma just extend the saved message class to it

eternal oxide
#

That code currently allows you to use just the command to see the message

uneven fiber
#

What do you mean by see

eternal oxide
#

the sysout line System.out.println

uneven fiber
#

oh ok

#

i changed that line so that it sends a message in the world

eternal oxide
#

if you just type the command with no message after it, it will show you whatever message is already stored

uneven fiber
#

well i slightly changed it so that it is player.sendMessafe instead of sysout

eternal oxide
#

yep, thats fine

uneven fiber
#

I guess it isn’t technically the world sending the message but whatever

steep cove
#

I have a question regarding IntelliJ and an artifact not being built and I'm loss as to why it won't build. Is anyone here familiar with IntelliJ on this one

uneven fiber
#

Show me your project structure

eternal oxide
#

?ask

undone axleBOT
#

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

steep cove
#

In my build.gradle I have org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT and in my plugin.yml I have 1.18.2-R0.1-SNAPSHOT however my server says that's an unsupported API version, what exactly do I put here?

eternal oxide
#

1.18 api version

steep cove
#

So just 1.18

eternal oxide
#

yes

steep cove
#

ah

#

does the main have to be accurate too

eternal oxide
#

very much so

steep cove
#

then I have quite the nooby question to ask you

#

I don't know the whole me.x.x I keep seeing on forums. What is the pattern for that because I only know the directory of the main file

eternal oxide
#

it will be the package name + your main class name

#

whatever package you have at teh top of your main class

steep cove
#

So I have SpigotGradleProject > src > main > java > Main.java

#

So the java folder

eternal oxide
#

no

steep cove
#

Oh?

ivory sleet
#

you use packages to structure your classes, like directories with normal files

eternal oxide
#

look in your actual class file, at teh top, the very first line will say package me.

ivory sleet
#

There’s one main class in spigot, the one that extends JavaPlugin as you are aware of

steep cove
#

Oh then I've done something wrong because I don't have a package

#

I thought package was synonomous with folder

#

I may have had a contextual misunderstanding then

eternal oxide
#

it is, kind of

ivory sleet
#

They’re to some extent

#

Packages do have a deeper meaning than just being directories in Java, but for your sake that deeper meaning isn’t substantially important

steep cove
#

Oh I mean I'll probably end up learning about them soon

ivory sleet
#

Yeah

#

But anyway you usually have to create the package yourself

#

or well, packages

steep cove
#

I have more of a C-background and some python, not a huge Java background besides some small projects

ivory sleet
#

Right

steep cove
#

Would it be acceptable structure to create a package underneath that java folder then?

ivory sleet
#

Java introduces several principles that advocate splitting the code up into different packages with different classes

#

yes

#

Usually (assuming you still use gradle) you got the src/main/java

#

Your packages should be under that directory

steep cove
#

Yup in gradle

#

And all the .java classes will go in that package I presume

ivory sleet
#

Correct

#

there are of course classes with no package (in other words they are located directly under src/main/java) but for most part you wanna avoid doing that

naive loom
dusk flicker
#

you could just load it yourself

naive loom
#

it says it's being loaded

#

im loading it through a db and the world is actually here when im teleported

eternal oxide
#

loading through a db?

steep cove
#

I believe my plugin.yml is correct - but my server is still spitting out "Unsupported API version 1.18.2-R0.1" and I just updated it with BuildTools to latest. Again for reference my project directory looks like SpigotGradleProject > src > main > java > me.goodvibes > Main.java and the plugin.yml main reads as me.goodvibes.Main. For version, in my build.gradle I have org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT and my plugin.yml is api-version: 1.18

eternal oxide
#

you can;t have updated teh jar or you did not update teh plugin.yml

steep cove
#

I rebuilt the artifact & rebooted server to make sure but I will do that again

ivory sleet
#

Wait

#

Hold on

#

You use gradle + artifacts?

eternal oxide
#

open your plugin jar with any (7zip) and view its plugin.yml

#

um, yes gradle + artifacts spells boom

ivory sleet
steep cove
#

I take it that's improper. After reviewing the spigot page real quick yeah it looks like those are separate methods of doing things, I must have bled one page to another

ivory sleet
#

I wrote this a while back

#

That shows you how to properly use gradle

uneven fiber
#

respect 💯

steep cove
#

I'm just built different, thank you for pointing that out. This just shows how unfamiliar I am with java & IntelliJ

uneven fiber
#

yo

#

question

#

why whenever I call this is always just defaults

ivory sleet
#

defaults?

wise hill
#

gradle? icky

ivory sleet
#

the defaultValue?

uneven fiber
#

like it always print the No message stores

#

yea

#

I think it has to do with my main method

ivory sleet
#

Oh that’s iirc called inlay hints or sth

#

It comes up whenever you pass a magic value to a function

#

A magic value is either this, or a number/boolean/string

wise hill
#

it's a null check iirc

uneven fiber
#

this is my save message class which im extending

eternal oxide
ivory sleet
#

oh that thing ye

#

You miss @NotNull for the parameters probably

eternal oxide
#

ah you seperated it to two commands

uneven fiber
#

yeah

eternal oxide
#

You are using different maps for storing and retrieving

uneven fiber
#

Am I?

eternal oxide
#

store is in yoru SaveMessage class

#

what store are you using when you broadcast?

uneven fiber
#

the same store from the savemessage class

#

i extended it

#

broadcast is subclass

wise hill
#

don't extend it just make the store static

eternal oxide
#

then make store static

uneven fiber
#

💯

#

oh duh lol my bad

#

otherwise that shit wont store !

eternal oxide
#

a static object only has one instance

quaint mantle
#

or are they just accessed through a load istore or something

eternal oxide
#

Not sure what you are asking

steep cove
#

Where does gradle make the .jar

eternal oxide
#

target folder

steep cove
#

I can't say I know where that is but after searching the entire directory there is no jar file being created

#

But I definitely followed that article to a T

eternal oxide
#

the target folder will be at teh same level as the src folder

steep cove
#

yeah there's nothing there

ivory sleet
#

It should be created in build/libs

steep cove
#

there is no libs folder, I'm definitely lost here I might revert back to the artifact method on a non-gradle project tbh

ivory sleet
#

Nonono

#

So did you follow the wiki I sent you?

steep cove
#

Yeah all the way

#

If it makes you feel better I'd rather stay on gradle but I definitely am drawing a blank here haha

#

If your DM's are open I could send screenshots of my stuff since I can't send them here, but like I'm lost lost

ivory sleet
#

Sure

maiden acorn
#

using a YamlConfiguration option to read a config file... is it not possible to .get("list.0.subkey") where 0 is the index of the list you want to pull?

flat olive
#

anybody know how to rewrite velocity of enderpearls whenever they are thrown - event?

#

basically what I mean is

#

when they touch a open fence gate, make it so people can pearl through open fence gates

#

basically tali pearls plugin

#

and like make it so people cant pearl glitch

#

refund pearl

flat olive
#

nvm ill figure it out myself

#

will be a journey

humble tulip
#

?nms

#

hm

iron palm
#

Hey everyone, im trying to extend EntityZombie but i can't since im getting an error

'x()' in 'net.minecraft.world.entity.EntityInsentient' clashes with 'x()' in 'net.minecraft.world.entity.EntityLiving'; attempting to use incompatible return type```
Im using spigot mapping 
https://paste.md-5.net/padobumofo.java
lone flint
#

I'm trying to add a metadata "role" to the player (runner, hunter, etc.) and im getting a null error which seems to be caused by this line from some debugging

        metadata = (MetadataValue) player.getMetadata("role");
```and i set it here ```java
        player.setMetadata("role", new FixedMetadataValue(plugin, role));
```and i have been unable to find any good resources regarding how to use and retrieve metadata
#

"role" is an enum btw

manic furnace
#

When I create a nbttagcompound, do have to set the uuid range? Or is there a chance that it is overwritten by another item?

harsh totem
#

How do I make an enderman be angry at players?

#

should I just use enderman.attack()?

summer scroll
summer scroll
harsh totem
summer scroll
#

May I know how? I'm curious also.

#

I thought you need to actually modify the PathFinderGoals.

harsh totem
# summer scroll May I know how? I'm curious also.
    public void MobAngry(EntitySpawnEvent event){
        if (event.getEntityType() == EntityType.ENDERMAN){
            Enderman enderman = (Enderman) event.getEntity();
            for (Player player: Bukkit.getOnlinePlayers()){
                enderman.setTarget(player);
            }
        }else if(event.getEntityType() == EntityType.ZOMBIFIED_PIGLIN){
            PigZombie pigman = (PigZombie) event.getEntity();
            for (Player player: Bukkit.getOnlinePlayers()){
                pigman.setTarget(player);
            }
        }
    }```
summer scroll
harsh totem
#

@summer scroll do you know how to make the enderman and piglin be angry even when the player dies?

#

because it works until the player dies and then they stop hunting him

summer scroll
harsh totem
summer scroll
#

Yeah, listen to that event and since you keep the reference of the Mob, you can just loop through the mobs and then set the target to the player.

harsh totem
#

ok

maiden briar
#
UPDATE scores s1 INNER JOIN (SELECT *, FIND_IN_SET(score, (SELECT GROUP_CONCAT(DISTINCT score ORDER BY score DESC) FROM scores WHERE ranked = 1)) AS rank FROM scores WHERE ranked = 1) s2 SET s1.previous_place = s2.rank"

This does nothing to my table? No error, just no value is changed

manic furnace
#

is ther a post player join event?

maiden briar
manic furnace
#

Is there a event that is called after the join msg?

maiden briar
manic furnace
#

No i want to send something after the join msg

maiden briar
manic furnace
#

ok thanks

iron palm
#

how can i run buildtools with mojang mappings?

chrome beacon
#

--remapped

iron palm
#

oh

#

thanks

maiden briar
iron palm
#

oh worked

#

thanks

harsh totem
#

it there a way in InventoryClickEvent to get the inventory after the click?

#

because event.getClickedInventory() returns the inventory before the click

summer scroll
#

All cancellable event will occur before the actual event happen.

harsh totem
summer scroll
#

I feel like this is an xy problem, can you tell us what you are trying to achieve?

harsh totem
#

This is what I have @EventHandler public void ArmorChange(InventoryClickEvent event){ if (event.getClickedInventory() instanceof PlayerInventory){ Player player = (Player) event.getWhoClicked(); if (IsArmor(player)){ for (Entity entity: player.getWorld().getEntities()){ if (entity.getType() == EntityType.ZOMBIFIED_PIGLIN){ PigZombie pigman = (PigZombie) entity; pigman.setTarget(player); } else if (entity.getType() == EntityType.ENDERMAN) { Enderman enderman = (Enderman) entity; enderman.setTarget(player); } } } } }

#

IsArmor(player) returns if the player wears armor

earnest forum
#

just check if the player clicked on an armour slot?

summer scroll
#

You can either delay it by 2-3 ticks, or you can check If player is about to wear the armor by getting the item on the cursor.

harsh totem
earnest forum
#

check if the slot isnt null after

harsh totem
#

so I need to schedule a delay of 2 ticks?

terse ore
#

How can I get the "targeted" block of a player

#

How could I get the location of that spruce log?

iron palm
# chrome beacon --remapped

what should i add after that in pom.xml?
Currently i have xml <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot</artifactId> <version>1.18.2-R0.1-SNAPSHOT</version> </dependency>
should i add something else too that applies the mojang mappings?

short raptor
#

How can I send a message as a target

iron palm
#

aight thanks

short raptor
peak jetty
#

hi how can i add cooldowns to my playermoveevent? i want it so when a player walks on COAL_ORE it gives the player RABBIT_FOOT but i want there to be a cooldown or 30 seconds so before the 30 seconds end, if the player wanks on the block again they wont get the RABBIT_FOOT

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        if(event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COAL_ORE) {
            Player player = (Player) event;
            player.getInventory().addItem(new ItemStack(Material.RABBIT_FOOT));
        }
    }
}```
earnest forum
#

use UUID if you want it to work while the player's offline

terse raven
peak jetty
#

how would i use that with my playermoveevent?

terse raven
peak jetty
#

alright thanks

#

@terse raven i have imported and created all i needed but now how can i implement this:

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        //Player only command
        if(sender instanceof Player){
            Player p = (Player) sender;
            int timeLeft = cooldownManager.getCooldown(p.getUniqueId());
            //If the cooldown has expired
            if(timeLeft == 0){
                //Use the feature
                p.sendMessage(ChatColor.GREEN + "Feature used!");
                //Start the countdown task
                cooldownManager.setCooldown(p.getUniqueId(), CooldownManager.DEFAULT_COOLDOWN);
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        int timeLeft = cooldownManager.getCooldown(p.getUniqueId());
                        cooldownManager.setCooldown(p.getUniqueId(), --timeLeft);
                        if(timeLeft == 0){
                            this.cancel();
                        }
                    }
                }.runTaskTimer(this.plugin, 20, 20);

            }else{
                //Hasn't expired yet, shows how many seconds left until it does
                p.sendMessage(ChatColor.RED.toString() + timeLeft + " seconds before you can use this feature again.");
            }
        }else{
            sender.sendMessage("Player-only command");
        }

        return true;
    }

}```
into my code:
```java
    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        if(event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COAL_ORE) {
            Player player = (Player) event;
            player.getInventory().addItem(new ItemStack(Material.RABBIT_FOOT));
        }
    }
}```
terse ore
#

Why I am duping the sponge?

#

When I place a sponge I get 1 extra

#

Before placing it, after placing it

kindred valley
terse ore
#

Infinite sponge

kindred valley
terse ore
#

Why that?

kindred valley
#

Are you getting another copy of sponge after placing it again?

terse ore
#

yeah

kindred valley
#

Because if slot has one than it wont be added again

terse ore
#

but the player can have more than 1 sponge

kindred valley
#

Umm i did not get the problem here

terse ore
#

x2

#

I am really confused

kindred valley
#

Can u explain your whole purpose

#

Physically

terse ore
#

wdym by physically

kindred valley
#

I mean what do you expect after placing a block

terse ore
#

I just want to make an infinite sponge, that when you place it you re-obtain it for using it again

kindred valley
terse ore
#

yeah

kindred valley
#

If you check that if the slot is null, cant you control adding a new one?

#

Or check if its "Air"

terse ore
#

let me try smt

peak jetty
#

hello, would this code work?

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player player = (Player) event;
        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
        if(timeLeft == 0) {
            if(event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COAL_ORE) {
                player.getInventory().addItem(new ItemStack(Material.RABBIT_FOOT));
                player.sendMessage(ChatColor.GOLD + "10 Coins Earned!");
                cooldownManager.setCooldown(player.getUniqueId(), CooldownManager.DEFAULT_COOLDOWN);
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
                        cooldownManager.setCooldown(player.getUniqueId(), --timeLeft);
                        if(timeLeft == 0){
                            this.cancel();
                        }
                    }
                }.runTaskTimer(this.plugin, 20, 20);
            }
        } else {
            player.sendMessage(ChatColor.GREEN + "You can get coins again in " + ChatColor.GOLD + ChatColor.GREEN + " seconds!");
        }
    }
}```
peak jetty
terse ore
#

Fixed it @kindred valley

terse raven
terse ore
#
    @EventHandler
    public void blockPlaceEvent(BlockPlaceEvent event) {
        ItemStack item = event.getItemInHand();

        if (item.getType() == Material.SPONGE) {
            if (item.getItemMeta().getCustomModelData() == 302) {
                Player player = event.getPlayer();
                BukkitScheduler scheduler = Bukkit.getScheduler();
                scheduler.runTaskLater(Neo.getInstance(), () -> {
                    event.getBlock().getLocation().getBlock().setType(Material.AIR);
                    ItemStack sponge = new ItemStack(Material.SPONGE, 1);
                    ItemMeta itemMeta = sponge.getItemMeta();

                    itemMeta.setDisplayName(Data.color("&eEsponja Infinita"));
                    itemMeta.setCustomModelData(302);
                    sponge.setItemMeta(itemMeta);

                    player.getInventory().addItem(sponge);
                }, 1L);
            }
        }
    }
peak jetty
#

hi i get this problem on console with my plugin not loading:

[11:44:57 ERROR]: Could not load 'plugins\PlutoCraftParkourRun-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Abnormal plugin type
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:87) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:415) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:323) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-337]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.InstantiationException: net.plutocraft.plutocraftparkourrun.PlutoCraftParkourRun
    at java.lang.Class.newInstance(Class.java:671) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:83) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    ... 8 more
Caused by: java.lang.NoSuchMethodException: net.plutocraft.plutocraftparkourrun.PlutoCraftParkourRun.<init>()
    at java.lang.Class.getConstructor0(Class.java:3617) ~[?:?]
    at java.lang.Class.newInstance(Class.java:658) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:83) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    ... 8 more

kindred valley
#

Ah

terse ore
#

Hoe? ._.

terse raven
#

he meant how i think

peak jetty
#

what does this mean?

Caused by: java.lang.InstantiationException: net.plutocraft.plutocraftparkourrun.PlutoCraftParkourRun
Caused by: java.lang.NoSuchMethodException: net.plutocraft.plutocraftparkourrun.PlutoCraftParkourRun.<init>()
terse raven
#

you are calling a method that does not exist

#

could you send us the corresponding lines?

peak jetty
# terse raven you are calling a method that does not exist

this my my code:

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player player = (Player) event;
        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
        if(timeLeft == 0) {
            if(event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COAL_ORE) {
                player.getInventory().addItem(new ItemStack(Material.RABBIT_FOOT));
                player.sendMessage(ChatColor.GOLD + "10 Coins Earned!");
                cooldownManager.setCooldown(player.getUniqueId(), CooldownManager.DEFAULT_COOLDOWN);
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
                        cooldownManager.setCooldown(player.getUniqueId(), --timeLeft);
                        if(timeLeft == 0){
                            this.cancel();
                        }
                    }
                }.runTaskTimer(this.plugin, 20, 20);
            }
        } else {
            player.sendMessage(ChatColor.GREEN + "You can get coins again in " + ChatColor.GOLD + ChatColor.GREEN + " seconds!");
        }
    }
}```
terse ore
#

How could I make a player double jump?

terse raven
#

give em flying

#

and when they start to fly cancel and give up velocity

terse raven
peak jetty
# terse raven the line that gets referenced in the error log

this is my log:

org.bukkit.plugin.InvalidPluginException: Abnormal plugin type
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:87) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:415) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:323) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-337]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-337]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.InstantiationException: net.plutocraft.plutocraftparkourrun.PlutoCraftParkourRun
    at java.lang.Class.newInstance(Class.java:671) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:83) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    ... 8 more
Caused by: java.lang.NoSuchMethodException: net.plutocraft.plutocraftparkourrun.PlutoCraftParkourRun.<init>()
    at java.lang.Class.getConstructor0(Class.java:3617) ~[?:?]
    at java.lang.Class.newInstance(Class.java:658) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:83) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    ... 8 more```
hardy raven
#

Is there any way to listen for packets with NMS?

terse raven
peak jetty
# terse raven could you send us the PlutoCraftParkourRun class?

here:

package net.plutocraft.plutocraftparkourrun;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

public final class PlutoCraftParkourRun extends JavaPlugin {

    private final CooldownManager cooldownManager = new CooldownManager();

    private final Plugin plugin;

    public PlutoCraftParkourRun(Plugin plugin) {
        this.plugin = plugin;
    }

    @Override
    public void onEnable() {
        getLogger().info("PlutoCraftParkourRun Enabled");
    }

    @Override
    public void onDisable() {
        getLogger().info("PlutoCraftParkourRun Disabled");
    }

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player player = (Player) event;
        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
        if(timeLeft == 0) {
            if(event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COAL_ORE) {
                player.getInventory().addItem(new ItemStack(Material.RABBIT_FOOT));
                player.sendMessage(ChatColor.GOLD + "10 Coins Earned!");
                cooldownManager.setCooldown(player.getUniqueId(), CooldownManager.DEFAULT_COOLDOWN);
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
                        cooldownManager.setCooldown(player.getUniqueId(), --timeLeft);
                        if(timeLeft == 0){
                            this.cancel();
                        }
                    }
                }.runTaskTimer(this.plugin, 20, 20);
            }
        } else {
            player.sendMessage(ChatColor.GREEN + "You can get coins again in " + ChatColor.GOLD + ChatColor.GREEN + " seconds!");
        }
    }
}```
#

thats everything in my class

quiet ice
#

You must have a no-args constructor

terse raven
# hardy raven Is there any way to listen for packets with NMS?
            @Override
            public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                super.channelRead(ctx, msg);
            }

            @Override
            public void write(ChannelHandlerContext ctx, Object object, ChannelPromise promise) throws Exception {
                if (object instanceof ClientboundBlockDestructionPacket) {
                    ClientboundBlockDestructionPacket packet = (ClientboundBlockDestructionPacket) object;
                    //if (packet.getId() != player.getEntityId()) return;
                    player.sendMessage("§a§l[BananaPrison] §f§lProgress: §e§l" + packet.getProgress()*10 + "%");
                    //if (packet.getProgress() == 0) return;
                }
                super.write(ctx, object, promise);
            }

        });


((CraftPlayer) player).getHandle().connection.connection.channel.pipeline().remove(player.getName());```
quiet ice
terse raven
#

^

peak jetty
hardy raven
#

Thanks

quiet ice
terse raven
#

remove the public PlutoCraftParkourRun () function

quiet ice
#

The plugin instance is going to be this anyways

kindred valley
terse raven
#

and add a this.plugin = this in onEnable

kindred valley
terse raven
#

but I'ma go now

peak jetty
# terse raven but I'ma go now

wait so like this?

    @Override
    public void onEnable() {
        getLogger().info("PlutoCraftParkourRun Enabled");
        this.plugin = this;
    }```
quiet ice
#

remove your plugin variable, it is completely nonsense

kindred valley
#

Instance named plugin?

quiet ice
#

You PlutoCraftParkourRun instance is going to be your plugin instance, what you have here is a useless GETFIELD operation

peak jetty
#

private final Plugin plugin; <---- do i remove that?

#

sorry im new to this

quiet ice
#

Yeah

#

And any references to this field are replaced with this and any assignments need to be dropped

terse ore
#

How do I check if a player is not holding any item?

quiet ice
#

?jd.s

#

?jd-s smh

undone axleBOT
peak jetty
#

@quiet ice i cant remove it tho because it caused a ton of errors

peak jetty
#

but it causes a lot of errors

quiet ice
#

As I say, you need to replace any this.plugin or plugin references with this

iron palm
#

Whats wrong with this code for spawning a npc?

        MinecraftServer minecraftServer = ((CraftServer) Bukkit.getServer()).getServer();
        Level level = ((CraftWorld) Objects.requireNonNull(e.getPlayer().getWorld())).getHandle();
        ServerPlayer player = new ServerPlayer(minecraftServer,level.getMinecraftWorld(),new GameProfile(UUID.randomUUID(),"Martin"));
        ServerPlayerConnection connection = ((CraftPlayer)e.getPlayer()).getHandle().connection;
        connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER,player));
        connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.UPDATE_DISPLAY_NAME,player));
peak jetty
#

so like this?:
@quiet ice

public PlutoCraftParkourRun(Plugin plugin) {
    this = plugin;
}
glossy venture
quiet ice
glossy venture
#

do you have a constructor defined with no arguments?

peak jetty
quiet ice
#

this cannot be assigned anyways

quiet ice
#

JavaPlugin implements Plugin

glossy venture
#

the instance this is your plugin

#

bukkit cant create your plugin if you dont have a 0 args constructor\

quiet ice
#

as such any plugin is going to be this anyways

glossy venture
#

you need to have either no constructor or a 0 arg constructor

quiet ice
#

What idiotic tutorial did you read to come to the conclusion that you need such a constructor

peak jetty
peak jetty
glossy venture
#

tf

peak jetty
#

@quiet ice so my code should be ok now?

package net.plutocraft.plutocraftparkourrun;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

public final class PlutoCraftParkourRun extends JavaPlugin {

    private final CooldownManager cooldownManager = new CooldownManager();

    public PlutoCraftParkourRun(Plugin plugin) {
    }

    @Override
    public void onEnable() {
        getLogger().info("PlutoCraftParkourRun Enabled");
    }

    @Override
    public void onDisable() {
        getLogger().info("PlutoCraftParkourRun Disabled");
    }

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player player = (Player) event;
        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
        if(timeLeft == 0) {
            if(event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COAL_ORE) {
                player.getInventory().addItem(new ItemStack(Material.RABBIT_FOOT));
                player.sendMessage(ChatColor.GOLD + "10 Coins Earned!");
                cooldownManager.setCooldown(player.getUniqueId(), CooldownManager.DEFAULT_COOLDOWN);
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
                        cooldownManager.setCooldown(player.getUniqueId(), --timeLeft);
                        if(timeLeft == 0){
                            this.cancel();
                        }
                    }
                }.runTaskTimer(this, 20, 20);
            }
        } else {
            player.sendMessage(ChatColor.GREEN + "You can get coins again in " + ChatColor.GOLD + ChatColor.GREEN + " seconds!");
        }
    }
}```
glossy venture
#

drop the constructor

#

you dont need the constructor

iron palm
peak jetty
glossy venture
#

only use a constructor if you need custom behaviour on instianiaton

iron palm
glossy venture
undone axleBOT
opal oasis
#

does anyone know how to make a give command and amount choice

peak jetty
opal oasis
#

i am quite new to coding

iron palm
peak jetty
#

is it ok now?

package net.plutocraft.plutocraftparkourrun;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

public final class PlutoCraftParkourRun extends JavaPlugin {

    private final CooldownManager cooldownManager = new CooldownManager();

    @Override
    public void onEnable() {
        getLogger().info("PlutoCraftParkourRun Enabled");
    }

    @Override
    public void onDisable() {
        getLogger().info("PlutoCraftParkourRun Disabled");
    }

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player player = (Player) event;
        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
        if(timeLeft == 0) {
            if(event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COAL_ORE) {
                player.getInventory().addItem(new ItemStack(Material.RABBIT_FOOT));
                player.sendMessage(ChatColor.GOLD + "10 Coins Earned!");
                cooldownManager.setCooldown(player.getUniqueId(), CooldownManager.DEFAULT_COOLDOWN);
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
                        cooldownManager.setCooldown(player.getUniqueId(), --timeLeft);
                        if(timeLeft == 0){
                            this.cancel();
                        }
                    }
                }.runTaskTimer(this, 20, 20);
            }
        } else {
            player.sendMessage(ChatColor.GREEN + "You can get coins again in " + ChatColor.GOLD + ChatColor.GREEN + " seconds!");
        }
    }
}```
glossy venture
peak jetty
#

thanks thanks geo bro

glossy venture
#

i recommend reading some java help articles or the oracle spec to get more familiar with java

#

or any of the links in ?learnjava

peak jetty
#

i started coding last week lol

earnest forum
#

?learnjava

undone axleBOT
iron palm
#

I recommend w3schools for learning java basics its good enough

opal oasis
#

Anyone able to help me. cause i wanna know how to make a command that gives items and you can choose the amount of it

peak jetty
#

i want this code to give me rabbit foot when i go on coal ore but it doesent work, how can i fix this?

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        Player player = (Player) event;
        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
        if(timeLeft == 0) {
            if(event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COAL_ORE) {
                player.getInventory().addItem(new ItemStack(Material.RABBIT_FOOT));
                player.sendMessage(ChatColor.GOLD + "10 Coins Earned!");
                cooldownManager.setCooldown(player.getUniqueId(), CooldownManager.DEFAULT_COOLDOWN);
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        int timeLeft = cooldownManager.getCooldown(player.getUniqueId());
                        cooldownManager.setCooldown(player.getUniqueId(), --timeLeft);
                        if(timeLeft == 0){
                            this.cancel();
                        }
                    }
                }.runTaskTimer(this, 20, 20);
            }
        } else {
            player.sendMessage(ChatColor.GREEN + "You can get coins again in " + ChatColor.GOLD + ChatColor.GREEN + " seconds!");
        }
    }
}```
terse raven
#

could you send us the cooldown manager class?

peak jetty
# terse raven could you send us the cooldown manager class?
package net.plutocraft.plutocraftparkourrun;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class CooldownManager {

    private final Map<UUID, Integer> cooldowns = new HashMap<>();

    public static final int DEFAULT_COOLDOWN = 15;

    public void setCooldown(UUID player, int time){
        if(time < 1) {
            cooldowns.remove(player);
        } else {
            cooldowns.put(player, time);
        }
    }

    public int getCooldown(UUID player){
        return cooldowns.getOrDefault(player, 0);
    }
}```
#

there

keen star
#

hi

#

is there have anyway to check if player is in water?

terse raven
#

has the error changed?

peak jetty
tardy delta
#

bruh thats literally the code from the cooldownmanager on the forum

keen star
peak jetty