#help-development

1 messages Β· Page 465 of 1

twilit roost
#

Minecraft stuff needs to be sync

tardy delta
#

needs

#

nothing needs to be sync at the end of the day

granite owl
#

my bukkitrunnable "im going in" pulls out reflection

#

and then the server prob crashes

quaint mantle
twilit roost
#

you can, but sync

left depot
#
     
Material material = Material.STICK;
int ammount = 1;
String name = "Stickman's arm";
 
ItemStack item = new ItemStack(material, ammount);
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(name);
 
itemMeta.setLore(Arrays.asList("line1", "line2", "line3"));
 
item.setItemMeta(itemMeta);
#

this will work right

tardy delta
#

hmm

twilit roost
tardy delta
#

inserts itembuilder

quaint mantle
tardy delta
#

i had my pc on for two days and the counter had an overflow

quaint mantle
# twilit roost you can, but sync

but player chat event is a async event ```
AsyncPlayerChatEvent

maybe i add player to a list when he chat and then execute a method for every player on that list ?
quaint mantle
#

yeh

left depot
twilit roost
quaint mantle
#

anyway thx for info

twilit roost
#
@EvenHandler
void ...(... e)
  BukkitScheduler.runTask(...){
    //spawn here
}
tardy delta
#
void asyncChat(event) {
  scheduler.runtask(plugin, () -> {
    // back sync, spawn mob
  })
}```
tardy delta
#

got ninjad

quaint mantle
#

bruh i hate myself , thx a lot

quaint mantle
#

im joking

#

please dont sue me

quaint mantle
twilit roost
#

nervous in Badlion

left depot
#

πŸ’€

quaint mantle
#

i used to use badlion but now im sticking with fabric and forge

quaint mantle
#

more mods

#

but they arent client side

#

plus i can make my one ones if i please

quaint mantle
quaint mantle
#

OMG GUYS FINALLY IT WORKS

#

i just had to tell someone

twilit roost
#

cgf

quaint mantle
#

it took me 1h..

twilit roost
#

only 1h? pathetic

river oracle
#

?paste

undone axleBOT
quaint mantle
#

1h for the listener to trigger..

#

its empty-

twilit roost
#

πŸ’€

river oracle
#

gradle is faster guys πŸ€“

wise mesa
#

Kill yo self

#

My bad

tardy delta
#

im happy with my xml instead of 10 levels of indents

twilit roost
river oracle
#

why does aggregateJavadocjar hate me 😭

#

what did I do to it

left depot
#

Now only need to find a way, that an event will only happen when the blockname is "SuperBlock" ;p

tardy delta
#

hmm?

#

cancel it when the name isnt?

wise mesa
#

that’s crazy

left depot
#
if (type == Material.PURPUR_BLOCK)

Currently the code btw,
Need only a way to check if the displayname is "Super Block"

tardy delta
#

what name

#

blocks dont have custom names

left depot
#

i know

river oracle
# left depot yes
@EventHandler
OnSuperDupeBlockUltraPlace(@NonNull @NotNull final BlockPlaceEvent event){
  Preconditions.checkArgument(event, "Lol wtf even happened");
  final ItemStack super_ultra_item = event.getItemInHand();
  final ItemMeta super_ultra_item_meta = super_ultra_item.getItemMeta();
  if(super_ultra_item.getItemMeta().hasDisplayName(){
     if(super_ultra_item.getItemMeta().getDisplayName().equals("Super Block"){
        // Do stuff here
     }
  }
}
#

may be what you are looking for

#

butr yeah spigot doesn't have custom blocks

#

so unsure exactly what you want

tardy delta
#

@NotNull final πŸ’€

river oracle
#

oop

#

forgot one thing

#

there we go

tardy delta
#

and that calls himself a java dev

river oracle
#

I probably killed my professor

#

@While go brrrrrr

tardy delta
#

i once started to use annotations and a month later i looked at it and thought wtf have i done

river oracle
#

my code legit looked like
private static int i = 10;
@While("functionName". condition = (i <= 0))

#

was horrid

tardy delta
#

πŸ’€

river oracle
#

cuz it worked

#

as intended

tardy delta
#

wiriting a parser for that gotta be fun

loud jacinth
#

When I want to report an issue on Jira, it asks for the output of /version. Is it okay if that's paper?

quiet ice
#

Not quite.

river oracle
#

replicate on spigot otherwise you'll likely be turned away

quiet ice
#

Reproduce it on spigot first, otherwise report to paper

river oracle
#

haha beat you to it nerd

quiet ice
#

Does anyone know where to find the compiled (i.e. as a ".class") gradle buildscript file?

river oracle
#

build/classes

#

oh gradle build hmm

#

not sure

quiet ice
#

Hm. Do you at least know the java gradle api equivalent of sourceSets.main.runtimeClasspath

river oracle
#

I'm having 2 issues with this build.gradle file

  1. It won't compile unless I remove aggregateJavadocJar
  2. When I remove aggregateJavadocJar and try to depend on this project none of the classes show up in the depending project

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

And they say gradle compiles faster :P

river oracle
haughty storm
#

How can I add custom trades to a villager?

tardy delta
#

gradle :(

quiet ice
twilit roost
#

how do I make Projectile go down?
NMS

river oracle
quiet ice
river oracle
quiet ice
#

Remove the java plugin for the root project

#

You may need to add it in that "core" project

#

Same with maven-publish and shadow

river oracle
quiet ice
#

I have never used that plugin - so I have no examples at hand

river oracle
#

I'm just confused because I pretty much copied @remote swallow multi module project and his seems to be working fine lol

quaint mantle
#

can someone tell me why it just Literally takes every item in the config for the drops list

#

instead of only taking the ones in the Barrel section

quiet ice
quaint mantle
#

first ss ccut of this one better

quiet ice
#

Heck - I'd not publish fat/aggregate/shadow jars over maven at all

tender shard
#

looks like you didnt register the advancement

river oracle
tender shard
# tender shard looks like you didnt register the advancement

I create the advancement like this ( https://github.com/JEFF-Media-GbR/JeffLib/blob/master/spigot_1_19_4_R1/src/main/java/com/jeff_media/jefflib/internal/nms/v1_19_4_R1/NMSHandler.java#L377 ) using the AdvancementBuilder. Are you sure Bukkit.getAdvancement returns your custom one?

GitHub

Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - JeffLib/NMSHandler.java at master Β· JEFF-Media-GbR/JeffLib

lost matrix
#

I already got it working. I dont want to register the advancement.

tender shard
#

what was the issue?

quiet ice
tender shard
#

why didnt you want to register it?

quiet ice
#

Sadly Gradle is extremely painful when it comes to maven publishing

lost matrix
#

Because there is no need of the server knowing anything about the advancement.
The issue was that clearing the current advancements also cleared the progress that
was about to be added. I needed to clear the advancements one packet later.

ocean hollow
#

Why doesn't it work? I have an EntityDamageByEntity event. And if the player hit another with an object, then continue the execution. According to logic, there should be one item, but it says that there is no necessary object in the hand.

lost matrix
quiet ice
tender shard
#

it will never be == to anything else

quiet ice
lost matrix
#

Use isSimilar() or even better: Use the PDC to tag custom items

ocean hollow
#

and why can't you use ==, you need to use only equals?

#

okay

tender shard
#

you can ofc use ==, if it's the same object

#

but you create a new object every time

lost matrix
#

"new" always creates a new object on a new memory location

tender shard
#

btw using equals will also not work once someone has used the sword

#

or renamed it

#

use PDC tags

#

it's the only proper solution

#

ok well it's unbreakable, so using it won't damage it. nonetheless, you should use PDC tags

#

as said, it could be renamed, or enchanted, or whatever

ocean hollow
#

thanks, guys

river oracle
#

also I just removed the aggregate javadoc plugin

#

what I'm confused about though is this

#

I downloaded the jar

#

and everything is there

tender shard
#

what's the issue?

quiet ice
tender shard
#

the downloaded jar is the -all jar

quiet ice
#

(this is the reason why I don't like publishing shadowjars)

tender shard
#

just tell the shadowjar plugin to not use the classifier

#

can't one set it to null or sth

river oracle
tender shard
#

hm that's what I would have suggested lol

quiet ice
#

Ugh. Lemme bring out the big guns

tender shard
#

well I can only repeat myself, shading in gradle sucks

river oracle
#

whoever said it doesn't lied

#

why can't gradle just do the bear minimum and have an official plugin like maven

quiet ice
#

Because there is an official way

tender shard
#

but it's not properly explained in the docs

river oracle
#

what 😭

quiet ice
#

In the shadowJar block

tender shard
#

isn#t that deprecated since 5.1

quiet ice
#

It seems to work in a gradle 7.0.2 project

tender shard
#

the docs for shadowJar tell one to use archiveClassifier

river oracle
#

alright guys I got it working

tender shard
#

same for the official docs for jar

river oracle
#

using a little black magic

quiet ice
#

Alternatively we would need to define an output archive with a certain classifier

tender shard
#

how?

quiet ice
#

Converted to maven?

river oracle
#
shadowJar {
    archiveClassifier.set('')
}``` so basically I converted to islam and prayed to allah and this randomly started working
tender shard
river oracle
#

yeah apparently I lied

#

cuz it works now 🀷

#

the classifier is gone so

#

worlds most well explained commit

paper venture
#

Can I cancel player move event but allow them to rotate?

river oracle
#

probably but it might take a little logic

tender shard
#
on playermoveevent:
  x = from.getX();
  y = from.getY();
  z = from.getZ();
  pitch = to.getPitch();
  roll = to.getPitch();
  event.setTo(new Location(...))
#

sth like that

paper venture
#

Thanks!

peak depot
#

if Scoreboard#registerNewObjective is deprecated whats the new version to do

late sonnet
peak depot
#

ah got it thanks

jovial vigil
#

Hey
when I mine spawners this pops up

It doubles my spawners
when I delete essentials its gone Idk if its economy shop gui or essentials
but its duping

#

?img

undone axleBOT
quaint mantle
#

do i need to "replace" a barrel to update its pdc

jovial vigil
river oracle
# tender shard huh but ealier you said that that didnt work

just realized when looking at my last git commit it didn't work because that code wasn't their I actually copied somethin from one of my other projects and just didn't notice that it included the shadowJar archiveClassifier.set(''). πŸ€¦β€β™‚οΈ

tender shard
# quaint mantle do i need to "replace" a barrel to update its pdc

This PersistentDataHolder is only linked to the snapshot instance stored by the BlockState. When storing changes on the PersistentDataHolder, the updated content will only be applied to the actual tile entity after one of the BlockState.update() methods is called.

quaint mantle
#

thx

river oracle
#

What is a good way to handle translations for a plugin

quaint mantle
#

depending on for example a applied language permmison it uses a different response

#

you could either make lots of langueenglish.yml languagegerman.yml ...

#

or you make it all in one

river oracle
#

more internally speaking though I was just thinking best way to manage without it being messy. I know Locale exists I'm just not exactly sure how I could use that to manage languages

quaint mantle
#

what do you mean by "messy"

tardy delta
#

resourcebundles

quaint mantle
#

you dont want to have local files or what

regal scaffold
#

This parameter accepts a String as a sound

#

Where can I find the default sound files

#

I tried unzipping the client jar

tardy delta
#

have a resourcebundle based on the Player#getLocale

river oracle
regal scaffold
tardy delta
#

its just a bunch of files, each file is for one locale

river oracle
#

thanks

quaint mantle
regal scaffold
#

?stash

undone axleBOT
tardy delta
#

basically

river oracle
#

kinda, but seems like Bundles also provide good API for managing this internally

#

which makes a big difference

ocean hollow
#

How to put a head with a custom texture?

regal scaffold
#

I'm currently serializing a Set<?> using set.toArray()

#

When I deserialize it

#

Do I deserialize as List<?> and then apply

new TreeSet<Text>(Deserialize list)
tardy delta
#

uh collections can be serialized immediately afaik

regal scaffold
#

Not Set

#

It's not serializable

#

Using YAMLConfiguration

tardy delta
#

shouldve to try it

regal scaffold
#

I did try it

#

Which is why I know it's not

young knoll
#

paper

#

Paper has their own PlayerProfile in their api

ocean hollow
#

so, what i need to do?

chrome beacon
#

Use the other import

river oracle
ocean hollow
round finch
ocean hollow
round finch
#

Paper plugins yikes

river oracle
#

god paper just makes this so much worse for you

#

wrong import again

young knoll
river oracle
#

for the setPlayerProfile

river oracle
#

or do they add like one feature instead of just pr'ing it

young knoll
#

I have no idea

ocean hollow
chrome beacon
river oracle
#

might have to use papers then

#

but I have no clue how that works

young knoll
#

Their PlayerProfile extends bukkits

ocean hollow
river oracle
chrome beacon
ocean hollow
#

okay

round finch
# regal scaffold

I always wondered what those special .json/s is about

I know about item / block jsons

#

But GPU and fancy shet no clue

#

Isn't there vanilla shaders?

chrome beacon
#

There are

#

You can do some real cool stuff with them

tawny pine
#

is there a way to get a bukkitrunnable to run more than once in a tick/

#

???

#

πŸ™‚

young knoll
#

no

tardy delta
#

have your own threadpool thing

tawny pine
#

also how can i loop something inside of a bukkitrunnable

#

i noticed while loops don't work

#

is there anything else that might?

#

πŸ™‚

tardy delta
#

why wouldnt they work

tawny pine
#

idk

#

i tried using one and it gave error :/

quaint mantle
#

Which entity is the lightest entity? i mean Which entity make less lag ?

#

its bat ?

#

or armor stand ?

tawny pine
tawny pine
tender shard
#

maybe area effect clouds

tawny pine
#

aren't mushrooms entities as well?

tender shard
#

no

frigid sorrel
#

Does anyone know how to create a custom item that even shows up in the creative inventory?

tender shard
#

the creative inventory is client side

quaint mantle
young knoll
#

The new display and marker entities are the lightest

quaint mantle
#

wrong replay

quaint mantle
#

so i cant use marker

young knoll
#

Use TextDisplay

frigid sorrel
young knoll
#

Plugins cannot add items to the creative inventory

quaint mantle
young knoll
#

TextDisplay is basically designed for holograms

#

And offers some extra features like background color

quaint mantle
#

ik but its also spawn a entity ?

frigid sorrel
young knoll
#

Yes

frigid sorrel
#

Thanks

tawny pine
#

guys can i use
public void run() { task }
more than once a tick?

eternal oxide
#

why do you want to run faster than a tick?

tawny pine
eternal oxide
#

yes

tawny pine
# eternal oxide yes

i'm trying to get a particle to move in a line, but currently it moves very slowly

#

i'm using that to move it

eternal oxide
#

using packets?

#

or just spawning?

#

?paste

undone axleBOT
tawny pine
eternal oxide
#

ok you are spawning the particle

tawny pine
#

anyways i tried updating 1 to 0.1 in runtasktimer

tawny pine
eternal oxide
#

you can;t

tawny pine
#

i can't have less than 1 per tick?

#

more*

eternal oxide
#

to go faster than a tick you have to use a ScheduledExecutorService

eternal oxide
#

but you are then Async so spawning particles would nott be permitted

tawny pine
#

oh ok

eternal oxide
#

if you use packets you can spawn them faster

tawny pine
eternal oxide
#

I've not done particles by packets myself

tawny pine
eternal oxide
#

no, that would crash yoru server

tawny pine
#

oh ok

eternal oxide
#

you could increase the speed you are moving the particles

#

ie, moving them a greater distance each tick

tawny pine
eternal oxide
#

what are you trying to simulate with the moving particle?

tawny pine
#

moving particle hitting player

#

yk

young knoll
#

spawnParticle should be fine async

#

It basically is just a packet

tawny pine
#

ah ok

#

dw tho im doing a way around it rn

eternal oxide
#

I know there is no server component to particles but does it bypass the modifying the world async block?

young knoll
#

It should

regal scaffold
#
set.queryState(null, RPPhones.PHONE_ALLOW_FLAG == StateFlag.State.DENY)
#

Worldguard stuff

#

Would .equals work correctly?

#

Checking if a flag is denied

pseudo hazel
#

no

#

you are comparing 2 different types

#

read what it says

regal scaffold
#
        if (set.testState(null, RPPhones.PHONE_ALLOW_FLAG)) {
            event.setCancelled(true);
#

Their docs is... questionable

#

But I got it

tawny pine
#

guys how would i get the server time?

rotund ravine
#

Which time

#

The ingame time

#

Or system time

tawny pine
#

i mean the system time

#

does system time restard once the server does?

#

restart*

rotund ravine
#

It shouldn’t

tawny pine
#

i mean would using system time be an accurate way to do cooldowns?

rotund ravine
#

Sure

tawny pine
#

ok nice πŸ™‚

rotund ravine
#

You can do Instant.now()

tawny pine
#

what does that do?

rotund ravine
#

Or System.currentTimeMillis

tawny pine
rotund ravine
chrome beacon
#

I do recommend using Instant for cooldowns

#

Makes it easier

tawny pine
#

does that mean i'd have to edit the string it returns to just get the time?

rotund ravine
#

Hm?

#

To convert a Java Instant to a String, you can use the DateTimeFormatter class. Here's an example:

Instant instant = Instant.now();
DateTimeFormatter formatter = DateTimeFormatter.ISO_INSTANT;
String formattedInstant = formatter.format(instant);

To convert a String back to an Instant, you can use the Instant.parse() method. Here's an example:

String stringInstant = "2022-03-20T10:11:12Z";
Instant instant = Instant.parse(stringInstant);

I hope that helps! Let me know if you have any other questions.

Source: Conversation with Bing, 12/04/2023(1) Format Instant to String in Java | Baeldung. https://www.baeldung.com/java-instant-to-string Accessed 12/04/2023.
(2) Instant toString() method in Java with Examples - GeeksForGeeks. https://www.geeksforgeeks.org/instant-tostring-method-in-java-with-examples/ Accessed 12/04/2023.
(3) java - UnsupportedTemporalTypeException when formatting Instant to .... https://stackoverflow.com/questions/25229124/unsupportedtemporaltypeexception-when-formatting-instant-to-string Accessed 12/04/2023.
(4) Format Instant to String in Java | Baeldung. https://www.baeldung.com/java-instant-to-string Accessed 12/04/2023.
(5) java - UnsupportedTemporalTypeException when formatting Instant to .... https://stackoverflow.com/questions/25229124/unsupportedtemporaltypeexception-when-formatting-instant-to-string Accessed 12/04/2023.
(6) Instant toString() method in Java with Examples - GeeksForGeeks. https://www.geeksforgeeks.org/instant-tostring-method-in-java-with-examples/ Accessed 12/04/2023.

Baeldung

Learn two different ways to format an instant as a string - one using core Java and the other using the Joda-Time library.

regal scaffold
#

What datatype should I use

#

To store something like UUID, UUID in a pair but where the keys don't need to be unique, so not a key system

#

I need to store a list of <playerUUID, objectUUID> but there can be many same playerUUID just not the exact same combination

#

Something like Pair<UUID,UUID> but in a list

rotund ravine
#

So multiple objectuuid to one playeruuid?

regal scaffold
#

Multiple playeruuid to multiple object UUID

rotund ravine
#

But a playeruuid is unique yes?

regal scaffold
#

Player1 -> 1, 2 or 10 object UUID
player2 -> 1 2 or 10 object UUID

#

No

#

Because they need to be stored as a pair

#

So

rotund ravine
#

Player1 will always be player1 yes?

regal scaffold
#

Player1 -> Object1
Player1 -> Object2

rotund ravine
#

Yes

#

ArrayListMultiMap

regal scaffold
#

That's what it is

#

Jesus those datatype names

#

Player1 -> Object1
Player1 -> Object2
Player2 -> Object2 //same as above

#

And so on

#

Cool

boreal sparrow
#

Hey guys, getting this error in my PlayerDeathEvent:
NoSuchMethodError: event.getPlayer()
This is my code:

public class Events implements Listener {
        @EventHandler
        public static void onPlayerDeath(PlayerDeathEvent event){
            Player killer = event.getPlayer().getKiller();
        //---
        }
regal scaffold
#

And then I use ArrayListMultimap.containsEntry(UUID,UUID)

#

To get the pair combo and not just one or the other which will always be unique combo

#

Sick

scarlet kelp
#

So how then multiverse-core do it?
I tried to find it in the source code, but it looks like the unload should not work, because they use same functions from the same api, although it works

young knoll
#

Multiverse also cannot unload the main world

rotund ravine
#

?jd-s

undone axleBOT
scarlet kelp
rotund ravine
regal scaffold
#

We need a bot command to get

#

Β§

#

Β§

scarlet kelp
#

Ok, then i mean how multiverse-core do unload overworld maps?

boreal sparrow
rotund ravine
hazy parrot
rotund ravine
young knoll
#

Because it extends EntityDeathEvent

rotund ravine
scarlet kelp
rotund ravine
#

You can unload any worlds that’s not the main one

scarlet kelp
#
public boolean unloadWorld(World world, boolean save) {
        if (world == null) {
            return false;
        } else {
            WorldServer handle = ((CraftWorld)world).getHandle();
            if (!this.console.worlds.contains(handle)) {
                return false;
            } else if (handle.dimension == 0) {
                return false;
            } else if (handle.players.size() > 0) {
                return false;
            } else {
                WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
                //...
#

handle.dimension - overworld

rotund ravine
#

That’s not the api

scarlet kelp
#

it's spigot api

rotund ravine
#

Oh

scarlet kelp
#

or bukkit whatever

rotund ravine
#

Well the overworld is usually the main one ye?

scarlet kelp
#

wdym

young knoll
#

dimension is only 0 for the main world

#

iirc custom worlds made with the spigot api start with dimension id 10

rotund ravine
#

Prolly from ?stash

scarlet kelp
fluid river
#

guys going for elif after return

scarlet kelp
rotund ravine
#

I have trouble believing you

regal scaffold
#

Is there any good tools to format an entire project in IntelliJ?

#

Like, remove unecessary spaces, imports and auto-indent everything

misty ingot
#

gotta love placeholders

tardy delta
#

console.worlds πŸ€”

regal scaffold
#

Not the built in

fluid river
regal scaffold
#

Or anything tbh

rotund ravine
regal scaffold
#

Built in doesn't do it all correctly

tardy delta
#

just change the builtin settings

fluid river
kind hatch
regal scaffold
#

Unless I don't know how to use it

rotund ravine
regal scaffold
rotund ravine
#

Click em all

regal scaffold
rotund ravine
#

Except the vcs one

regal scaffold
#

Yeah seems like

#

There's still dumb spaces between fields and such

#

It just won't remove them

rotund ravine
#

Svow

#

Show

regal scaffold
#

Yes it's ocd

#

There's 2 instead of 1

#

Oh wait

#

It's because it goes from field to methods

#

It did do it correctly

#

nvm it didn't

young knoll
#

Does spigot have an event for when TNT ignites?

regal scaffold
misty ingot
rotund ravine
#

Looks fine tonme

#

Oh

regal scaffold
rotund ravine
#

That space

misty ingot
#

cheeki breeki sponge squeaky

rotund ravine
#

Probably some setting somewhere if you dislike it

scarlet kelp
regal scaffold
#

Rerunning it does nothing

#

I will look in settings

kind hatch
rotund ravine
#

Yes prolly

#

?jd-s

undone axleBOT
young knoll
#

That event calls just before it goes boom

#

Not when it ignites

young knoll
rotund ravine
regal scaffold
#

...

#

Sick options

young knoll
#

I don't think that fires but let's give it a shot

fluid river
regal scaffold
#

I did it!

#

Ok IntelliJ is actually crazy

young knoll
#

Only called for fire spreading

fluid river
regal scaffold
#

I'm team JetBrains anyways

#

I like it

scarlet kelp
#

It turned out that I didn't teleport all the players out of the world, and therefore it wasn't shipped, thanks to everyone who tried to help

regal scaffold
#

Except the stupid bug that sometimes a field won't show the "# usages" label

river oracle
scarlet kelp
# young knoll World#getEnvironment#getId
            print(w.getName());
            print(String.valueOf(world.getEnvironment().getId()));
            print(String.valueOf(getServer().unloadWorld(w, true)));

output

[20:18:22 INFO]: [ChangeMapByTeleport] world
[20:18:22 INFO]: [ChangeMapByTeleport] 0
[20:18:22 INFO]: [ChangeMapByTeleport] false
[20:18:22 INFO]: [ChangeMapByTeleport] m_12_Rooms
[20:18:22 INFO]: [ChangeMapByTeleport] 0
[20:18:22 INFO]: [ChangeMapByTeleport] true

So dimension still 0 for not main world

young knoll
#

Well you said it works so

#

I assume environment ID must not be the same as dimension ID

regal scaffold
#

It will be fixed

#

xd

scarlet kelp
#

Thanks anyway

young knoll
#

Looks like that issue got a PR

#

PR was marked as needs work

#

And then the person vanished

#

Sadge

left depot
#
@EventHandler
    public void mobDeath(EntityDeathEvent event) {
        LivingEntity e = event.getEntity();

        if (e instanceof Pig) {
            event.getDrops().clear();
            event.setDroppedExp(10);
            e.getLocation().getWorld().dropItem(e.getLocation(), new ItemStack(Material.DIAMOND_SWORD, 1));
        }


    }

What am i doing wrong

#

when mob killed, it doesnt drop the diamond sword

young knoll
#

IS the code running

left depot
#

yeah

young knoll
#

Add some debug prints

sacred mountain
#

is it possible to make a relational placeholder that works in tab?

river oracle
left depot
sacred mountain
#

i have the TAB plugin, the one by neznamy, and i've done a normal placeholder but iirc the relational ones need 2 players as arguments

#

idk if you can pass null into it

left depot
#

Yup fixed, was typo

#

Is their also a way to add like change of 2% of dropping the dia sword?

sacred mountain
#

what the fuck

#

i swear

#

i couldnt find

#

i have been looking for that

#

thanks

left depot
#

Its called

#

"That Tab Plugin"

sacred mountain
#

yeah i just didnt even see it

left depot
young knoll
#

Sure, just use ThreadLocalRandom#current

left depot
#

ty

young knoll
#

or nextDouble and < 0.02

#

Fair

left depot
#
int boundedRandomValue = ThreadLocalRandom.current().nextInt(1, 100);
if (boundedRandomValue <= 3){
                e.getLocation().getWorld().dropItem(e.getLocation(), new ItemStack(Material.WOODEN_SWORD, 1));
            }

Like this

ivory sleet
#

Yes

tardy delta
#

conclure working on mythology

ivory sleet
#

That if u know its always gonna be accessed on the same thread

young knoll
#

Why does ThreadLocalRandom have a nextInt with a min and max but random doesn't

#

Smh

ivory sleet
#

Just

tardy delta
#

ah that

quiet ice
ivory sleet
#

No, im sorry

ivory sleet
tardy delta
#

in pm probably

ivory sleet
#

Oh

#

Well im gonna just produce a prealpha release

tardy delta
#

or was that the mod

ivory sleet
#

And then let people help me with the mod loot balancing etc since im not at all educated in that but ye

#

I think?

left depot
#

What will happen if i dont store it?

tardy delta
#

ye

rotund ravine
#

yes

#

he meant chance prolly

tardy delta
rotund ravine
#

πŸ‘ŒπŸ»

#

Good ol’ days of people seralizing and deserializing to clone

tardy delta
#

thats not how cloning works

river oracle
#

is cloning faster / better tahn just doing
new MyClass(MyClass)

rotund ravine
#

the new class my class passed, is not defined the same as clone

river oracle
#

i'm aware just curious which one is technically "better" per say or like a usecase of cloning vs just making another constructor

tardy delta
#
class ItemStack {
  public: ItemStack(ItemStack& obj) : material(obj.material) {};
}```
#

lol

river oracle
#

could it be "kotlin"

left depot
#
Entity mob = e.getEntity();

        if(e.getEntityType() == EntityType.ZOMBIE) {

            mob.setCustomName("bandiet");


        }

How to add a chestplate to this mobspawm

rotund ravine
#

nah

left depot
#

cant find any good tut on yt/google

rotund ravine
# river oracle is cloning faster / better tahn just doing new MyClass(MyClass)

look at sources, not the text. Well you can

According to a post on StackOverflow, cloning is slower than calling new but faster than calling java.lang.Class.newInstance()ΒΉ. Another post on StackOverflow suggests that cloning is rarely a good idea in Java and that other techniques such as copy constructors or factory methods should be used insteadΒ².

I hope this helps!

Source: Conversation with Bing, 12/04/2023(1) Java 'Prototype' pattern - new vs clone vs class.newInstance. https://stackoverflow.com/questions/2427317/java-prototype-pattern-new-vs-clone-vs-class-newinstance Accessed 12/04/2023.
(2) java - Cloning vs. Instantiating a new class - Stack Overflow. https://stackoverflow.com/questions/3707612/cloning-vs-instantiating-a-new-class Accessed 12/04/2023.
(3) new Operator vs newInstance() Method in Java - GeeksforGeeks. https://www.geeksforgeeks.org/new-operator-vs-newinstance-method-java/ Accessed 12/04/2023.
(4) Java Cloning: Copy Constructors vs. Cloning - DZone. https://dzone.com/articles/java-cloning-copy-constructor-vs-cloning Accessed 12/04/2023.
(5) performance - Java 'Prototype' pattern - new vs clone vs class .... https://stackoverflow.com/questions/2427317/java-prototype-pattern-new-vs-clone-vs-class-newinstance Accessed 12/04/2023.
(6) java - newInstance() vs new - Stack Overflow. https://stackoverflow.com/questions/647111/newinstance-vs-new Accessed 12/04/2023.
(7) java - clone() vs copy constructor vs factory method? - Stack Overflow. https://stackoverflow.com/questions/1106102/clone-vs-copy-constructor-vs-factory-method Accessed 12/04/2023.

river oracle
#

oh actually that's C isn't it

tardy delta
#

c++

tardy delta
#

was too lazy for the fields but whatever

young knoll
#

Entity cannot have armor

#

You need to cast it to at least LivingEntity

tardy delta
#

C constructor?

#

change my mind

left depot
#

MM

#

so when it spawned. the plugin need to give the entity the armor

rotund ravine
#

bing says it's c++

left depot
#
LivingEntity mob = e.getEntity();

        if (e.getEntityType() == EntityType.ZOMBIE) {

            mob.setCustomName("bandiet");
            new ItemStack(Material.DIAMOND_SWORD, 1);

            
        }

Like this

#

ohhh

pine cipher
#

Hello I wanna ask if it's possible to change texture of leather armor (and icons) with mcpatcher/optifine ?

river oracle
#

πŸ€·β€β™‚οΈ why not just use custom model data and good ol texture packs

tardy delta
#

why error

river oracle
#

ItemMeta#setCustomModelData

lost matrix
#

I think he is joking

tardy delta
#

ah A cannot be casted to B πŸ€”

lost matrix
#

Because this is a pretty trivial ClassCastException

eternal oxide
#

why implement Cloneable in B when it's already in A

#

override not implement

tardy delta
#

idk wanted to test smth stupid

eternal oxide
#

ah ok, go ham πŸ™‚

distant forge
#

Can someone pls help me with updating my plugin from 1.19.2 to 1.19.4?
This is how my poml looks currently.
`||<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>

</dependencies>||`

When I change all occureances from 1.19 to 1.19.4 I get a dependency error.

left depot
#

Fixed my issue πŸ‘

eternal oxide
#

wrong version in pom

#

run buildtools for the 1.19.4 version

lost matrix
#

To do what?

#

Just call ItemStack#clone() ...

#

Between cloning the meta and the ItemStack?

distant forge
# lost matrix You need to change the version in the special sources plugin configuration as we...

here?
<plugin> <groupId>net.md-5</groupId> <artifactId>specialsource-maven-plugin</artifactId> <version>1.2.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-obf</id> <configuration> <srgIn>org.spigotmc:minecraft-server:1.19-R0.1-SNAPSHOT:txt:maps-mojang</srgIn> <reverse>true</reverse> <remappedDependencies>org.spigotmc:spigot:1.19-R0.1-SNAPSHOTπŸ«™remapped-mojang</remappedDependencies> <remappedArtifactAttached>true</remappedArtifactAttached> <remappedClassifierName>remapped-obf</remappedClassifierName> </configuration> </execution> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-spigot</id> <configuration> <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile> <srgIn>org.spigotmc:minecraft-server:1.19-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn> <remappedDependencies>org.spigotmc:spigot:1.19-R0.1-SNAPSHOTπŸ«™remapped-obf</remappedDependencies> </configuration> </execution> </executions> </plugin>
I tried to change everything here to 1.19.4, but it doesnt work. Do I need to restart the computer after running the buildtools?

lost matrix
#

But most importantly: Run BuildTools with --rev 1.19.4 and --remapped

distant forge
#

thats prolly the issue

lost matrix
#

Ive never used the copy constructor. I would assume that there is actually no difference.

mint nova
#

Can i somehow get the time in minecraft, not in real world?

#

or real life

kind hatch
#

World#getTime()

mint nova
#

Thanks

wise mesa
#

I think he wants like 24 hour time

#

But crammed within the 10 minutes a Minecraft day takes place

#

Like those sleeping plugins that say what time it is

#

Or not

lost matrix
#

getTime returns an int from 0 - 24000
Thats just 24h in minecraft. Should be easy to format this.

wise mesa
#

Oh shit

#

That’s nice

distant forge
lost matrix
#

Let your IDE import that

distant forge
#

Ide suggested v1_19_R3. Is that correct?

kind hatch
#

For 1.19.4 yes.

sage patio
#

This is how i save a chest as something for my plugin, any idea how can i remove a location from this?
as you can see the chests are sorted by number, if i remove some chest like number 58 how i can rearrange all of the locations again?

public static void setLootBox(Location location) {
        if (!isLootBox(location)) {
            int count = lootboxes.getConfigurationSection("").getKeys(false).size() + 1;
            lootboxes.set(count + ".world", location.getWorld().getName());
            lootboxes.set(count + ".x", location.getX());
            lootboxes.set(count + ".y", location.getY());
            lootboxes.set(count + ".z", location.getZ());
            FileManager.saveData(FileType.LOOTBOXES);
        }
    }

    public static boolean isLootBox(Location location) {
        List<Location> currentLootBoxes = new ArrayList<>();
        for (String key : lootboxes.getConfigurationSection("").getKeys(false)) {
            currentLootBoxes.add(new Location(
                    Bukkit.getWorld(lootboxes.getString(key + ".world")),
                    lootboxes.getInt(key + ".x"),
                    lootboxes.getInt(key + ".y"),
                    lootboxes.getInt(key + ".z")
            ));
        }
        return currentLootBoxes.contains(location);
    }
prisma steeple
#

whatsup all, anyone know the solution to player max health?

lost matrix
lost matrix
tardy delta
#

its in memory anyways :)

#

not really clean but ye

lost matrix
#

Doesnt matter

sage patio
prisma steeple
lost matrix
#

Also: Your isLootBox() method is really really inefficient.
You should create a manager class which handles a

Map<Location, Lootbox>

and then call containsKey() on that.
Iterating through all lootboxes can get really expensive, really fast

#

And while you are at it: Remove the static keyword

tardy delta
#

imma probably begin static abusing again but this time in c++

#

:)

lost matrix
# sage patio thanks

Example of how to write a simple manager class:

public class LootboxManager {

  // Never expose the map directly, as it is mutable.
  private final Map<Location, Lootbox> lootboxMap;

  public LootboxManager() {
    this.lootboxMap = new HashMap<>();
  }

  public boolean isLootBoxAt(Location location) {
    return lootboxMap.containsKey(location);
  }

  public void addLootBox(Location location, Lootbox lootbox) {
    Preconditions.checkArgument(!isLootBoxAt(location), "There is already a lootbox at this location.");
    lootboxMap.put(location, lootbox);
  }

  public Lootbox getLootBox(Location location) {
    return lootboxMap.get(location);
  }

  public void removeLootBox(Location location) {
    lootboxMap.remove(location);
  }

}
sage patio
lost matrix
sage patio
#

unfortunately this is how i do this stuff for my plugin, never tried "to go well"

quaint mantle
#

int barrelhealth = barrel.getPersistentDataContainer().get(new NamespacedKey(plugin, "healthkey"), PersistentDataType.INTEGER); why doesnt it work

#

the pdc is there

#

i can read it with /data

#

but my plugin fails to do so

rotund ravine
#

Show the data?

tawdry echo
#

you can create class with static final NamespacedKey instead of creating always new, thats only tip

quaint mantle
rotund ravine
#

And reading?

quaint mantle
#

cant check it rn but i know it works i read it before

lost matrix
#

I can see the problem already

jovial shadow
#

Is a program like oracle better or a program like intelij idea better

quaint mantle
glossy wren
#

Quick question, can I just use the raw Event to detect any event in EventHandlers?

quaint mantle
jovial shadow
lost matrix
rotund ravine
#

Community is fine 🀞🏼

jovial shadow
#

oh okay!

#

thanks

tall dragon
rotund ravine
quaint mantle
jovial shadow
#

How is a custom rank plugin made? i have watched many tutorials on java and still havent figured it out.

lost matrix
#

Step 1) Use LuckPerms

jovial shadow
#

which is?

tall dragon
#

a very nice plugin

lost matrix
jovial shadow
#

oh

jovial shadow
remote swallow
#

thats a prefix

#

you can add them with luckperms

lost matrix
#

Well then LuckPerms is the status quoe for this

jovial shadow
#

Yeah but i kinda wanna make it myself...

#

i want to learn with the experience

tall dragon
#

well you're welcome to make a permission plugin

#

but aperantly its a pain

jovial shadow
#

oh

remote swallow
#

thats just like rewriting the wheel

icy beacon
#

hell yeah it is but that means you'll learn finely

lost matrix
#

Its one of the less fun plugins to write

remote swallow
#

luckprems also has its own gui

tall dragon
#

why make one when luckperms has everything

#

and is battle tested

river oracle
#

perms plugins aren't fun to make apparently lol I wouldn't

jovial shadow
icy beacon
#

if you want to do it, go ahead

worldly ingot
#

Yeah I’d avoid trying to learn to make a permission plugin. There’s no reason to touch anything beyond hasPermission()

icy beacon
#

it just won't be practical

#

that's it

jovial shadow
#

how**

tall dragon
#

even choco woulnt

#

and he does anything!

icy beacon
#

break down the plugin and take it step by step

lost matrix
# tall dragon and is battle tested

There are some very specific cases where a custom permissions plugin
is viable. Im currently writing an implementation because i need multiple
profiles per player and LuckPerms has no sane support for that.

remote swallow
jovial shadow
tall dragon
copper scaffold
tall dragon
#

if so i have a question

icy beacon
#

not anymore

lost matrix
copper scaffold
#

yea changed it quickly sorry :/

icy beacon
#

well looks like your JSON file is malformed

tall dragon
#

@lost matrix how the hell does it figure out the permission strings i use in my plugin (only using #hasPermission) and lets me autocomplete them

#

i dont get that

#

black magic

river oracle
#

who knows maybe they do practice black magic

lost matrix
tall dragon
#

no

#

thats the thing

#

i dont

#

yet it always knows perfectly

kind hatch
#

Yea, I've noticed that LuckPerms can find them without them being registered.

#

You don't think it does code analysis?

copper scaffold
lost matrix
#

Maybe it scans classes on the classpath for patterns like hasPermission("...")

tall dragon
#

that might be the case yea

kind hatch
river oracle
#

😭 why do peolpe do this. Code without knowing what a syntax error is nor how to highlight over it and see what is wrong

lost matrix
lost matrix
#

Well then he can go where the pepper grows

#

Wait that doesnt make sense in english

#

Or does it

river oracle
#

no it doesn't

kind hatch
#

Not really. ;P

lost matrix
#

XD

kind hatch
#

More like he can go where the wind blows.

lost matrix
#

Yeah that makes more sense

river oracle
lost matrix
tall dragon
#

any1 here well versed in pc hardware?

#

im tryna decide what cpu i want to buy

#

but all these numbers i cant figure out which ones better

copper scaffold
river oracle
lost matrix
#

Whats your budget range? 12500 is really decent currently

river oracle
tall dragon
#

was thninking about the new amd one that got released few days ago

kind hatch
#

The latest? 7800x3d?

tall dragon
#

yea

lost matrix
#

Watch the LTT video on it first

tall dragon
#

but not a a thread ripper or epyc

kind hatch
#

The 7800x3d is actually somehow better than the 7900x3d in most cases.

tall dragon
#

just a normal consumer cpu

#

yea thats what i dont get

#

so weird

lost matrix
tall dragon
#

and then u have ryzen 7 and ryzen 9

#

whcih ones better

kind hatch
#

Generally bigger number means better performance.

#

At least in CPUs

#

Memory can be tricky

tall dragon
#

yh but i also heard the 9 was actually worse due to it swiching between cores or something

#

something to do with v cache

kind hatch
#

I wouldn't get the latest 7900x3d because it's still bleeding edge.

#

Plus the new AM5 platform is still expensive as hell.

chrome beacon
tall dragon
#

i prolly do want to go am5 tho

#

then i mfine for the coming cpu's

chrome beacon
lost matrix
#

What resolution are you going to drive? High resolutions are way more
bottlenecked by your GPU

tall dragon
#

prolly just 1080p with 144hz refresh

kind hatch
#

Also what's your usecase? Gaming? Streaming? Programming?

tall dragon
#

Gaming and programming

#

i wanna be able to compile shit fast

#

but games gotta run good too

chrome beacon
#

You might want to continue this in #general or #verified

tall dragon
#

fair enough

regal scaffold
#

Is anything done differently between creative and survival/adventure regarding EntityDamageByEntityEvent

I have a event that works perfect on creative but not on survival/adventure even tho the event still gets called

tardy delta
#

isnt that the right syntax for my .gitignore or smth?

remote swallow
#

hold on

#

here is proper git ignore

tardy delta
#

looks like /.idea/ did it

#

i always have to find a gitignore to use when creating a new project lol

#

ah found the issue

#

actually idk

#

as long as my project is on gh its good

river oracle
#

I love when you write code and it works first time

obsidian plinth
#

tracking if a player places a amour stand would be a EntitySpawnEvent right

tardy delta
#

resourcebundles?

river oracle
tardy delta
#

a few events are probably fired

river oracle
#

EntitySpawnEvent isn't one of them though

tall dragon
river oracle
#

it just did

#

to me

tall dragon
#

cap

river oracle
#

no cap

#

the test worked first try

tardy delta
river oracle
#

MockBukkit wouldn't lie to me

tall dragon
#

youl find a bug, trust me

obsidian plinth
#

ig ill have to play around before i dive into docs

river oracle
#

the one possible bug I haven't covered is defaulting back to english if the spanish locale doesn't exist for a certain field

#

it literally worked again first try

tardy delta
#

imma reinstall my os bruh

#

discord had a stroke when i just typed smth

river oracle
#

lol

#

discord has issue

#

guess I'ma reinstall my os

tardy delta
#

chrome also crashed today

#

nah its a bunch of stuff

river oracle
#

use Fedora uwu

tall dragon
#

firefox superiority

#

:>

river oracle
#

librewolf superiority

#

:>

tardy delta
#

need windows for college

river oracle
#

RIp

tardy delta
#

but i prefer linux

#

so ill probably dualboot again with debian

river oracle
#

my friend in uni right now and he's gotten away with Linux Only somehow

#

he runs arch on his laptop and fedora on his desktop

tall dragon
#

is linux hard to get into when u have been using windows ur entire life?

tardy delta
#

hmm microsoft office will not like that

tardy delta
#

when u gotta deal with nvidia drivers YES

tall dragon
#

well arent there hundreds xd

#

which do u choose

regal scaffold
#

Is anything done differently between creative and survival/adventure regarding EntityDamageByEntityEvent

I have a event that works perfect on creative but not on survival/adventure even tho the event still gets called

tardy delta
#

ive been using debian for a while

#

also used kde neon, classic ubuntu ofc, manjaro, kubuntu, fedora for a while and probably a few more

#

bruh where did git repo go

river oracle
#

use Fedora

tardy delta
#

imma clone it again when my os is back lol

river oracle
#

try it out

tardy delta
#

is that debian based?

quiet ice
#

Nah

#

Fedora is RHEL

tardy delta
#

never heard of

quiet ice
#

Come on - you have heard of Red Hat Enterprise Linux

tardy delta
#

ah yes

#

i know where to find everything on debian so ill gotta stay with that for a while now

river oracle
# quiet ice Nah

Fedora doesn't have telemetry πŸ€·β€β™‚οΈ not a huge deal

#

its nice os

quiet ice
#

I am using Fedora πŸ˜†

river oracle
#

lol

tardy delta
#

uh oh got a bit of files to transfer, not to talk about my 40 gigs iso folder

quiet ice
#

First and only linux distro I tried out.
But I did quite a lot of hopping between Fedora's flavours (or Spins as how they call it). Ultimately GNOME is the better choice

tardy delta
#

meh gnome

#

kde for the win

halcyon mica
#

Did the gradle repo for the spigot api change?

#

I can't resolve for 1.19.4 anymore

quiet ice
#

You mean maven repo?

halcyon mica
#

Same thing different colour

quiet ice
#

Just wanted to be sure

river oracle
quiet ice
#

The answer is no

tardy delta
#

ive tried installing arch probably 4 times πŸ’€

#

failed probably 3 times

quiet ice
#

Make sure you are using the spigot API

halcyon mica
#

I'm quite sure I am

quiet ice
halcyon mica
#

It worked before

quiet ice
#

Because you had it in mavenLocal

halcyon mica
#

No, I remember, I was using a proxy repo by a friend

quiet ice
#

Use https://hub.spigotmc.org/nexus/content/repositories/snapshots/

quiet ice
river oracle
#

atleast use ubuntu server

quiet ice
#

I am pretty sure it is vulnerable against hundreds if not thousands of exploits

tardy delta
#

:)

quiet ice
#

Debian is so outdated that I don't even bother updating it

tardy delta
#

uh shit

#

id rather not copy all this stuff over

#

hmm another spicy 40 gigs

#

i would be able to setup a whole server architecture XD

hard socket
#

the file I use if from /schematic save

#

and load arg works too

tardy delta
#

Files.newInputStream :)

hard socket
#

tried that

chrome beacon
hard socket
#

tried .schematic too

eternal oxide
#

file format

#

not extension

hard socket
#

thats why I use SPONG_SCHEMATIC

eternal oxide
#

you extracted it from your jar?

young knoll
#

If it isn't a sponge schematic it's probably legacy

hard socket
#

got the file from worldedit then put it im my jar

eternal oxide
#

yep

#

you used filtering when including resources when packaging your jar

#

filtering breaks zip files

young knoll
#

You have to tell it to exclude them

#

Or only to include files you want to filter

hard socket
#

I will try this File file = new File("plugins/WorldEdit/schematics/jfg.schematic");File file = new File("plugins/WorldEdit/schematics/jfg.schematic");

eternal oxide
#
        <resources>
            <!-- Include all resources -->
            <resource>
                <directory>resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>*.yml</include>
                    <include>*.txt</include>
                    <include>*.json</include>
                    <include>*.properties</include>
                </includes>
            </resource>
            
            <resource>
                <directory>resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>*.nbt</include>
                </includes>
            </resource>
        </resources>```
tawny pine
#

guys I'm using:
if (System.currentTimeMillis() - cooldown.get(p.getName())) {
to try and minus the current time from the time stored in a hashmap.
whenever i do this it says:
Incompatible types. Found: 'long', required: 'boolean'
How can I fix this?
(I've already done the fixes I found on the internet however they just cause more errors)

young knoll
#

Show us how you declare the map

#

Oh wait

eternal oxide
#

an if() requires a boolean result not a value

rotund ravine
young knoll
#

It needs to evaluate to true or false

tawny pine
rotund ravine
#

Also why not use Instants?

tawny pine
#

sorry im stupid

#

:/

young knoll
#

Why do you like instants so much

rotund ravine
#

Comparing stuff is easy using the date api

chrome beacon
#

Instansts are great

remote swallow
#

use instants

#

theres an example on the cooldowns wiki

#

?cooldowns

#

?cooldown

#

@quaint mantle cooldowns wiki link command

young knoll
#

But muh bytes

remote swallow
#

dont carte

#

care

#

use instant

rough drift
#

Finally setup my own vpn

#

It's pog

rotund ravine
quaint mantle
#

?cooldownmanager

#

?cooldowns

young knoll
#

Yeah but it's a class so it has more overhead

undone axleBOT
remote swallow
#

thank

rotund ravine
young knoll
#

So muh bytes

rotund ravine
#

People are feeding their server with way too much ram anyway

#

It’s fine to use a bit of it for a bit

remote swallow
#

conclure has a cat in jhis pfp

#

im gona sue him

desert tinsel
#

how to send messages to player with clickable content, not all message, like: Do you accept the trade [Yes] [No]?

young knoll
#

?components

#

Darn

rotund ravine
#

Huh

young knoll
tawny pine
#

guys I'm trying to check if a hashmap contains a player name.
How would I do this?

rotund ravine
#

@tawny pine how does your hashmap look

young knoll
#

Is it a key or a value

river oracle
vocal cloud
#

UUIDs reign supreme

twin venture
#

in terms of performance is it better to use PlayerMoveEvent or use a runTaskTimerAsynchronously(this,0,5L) to check for Player location if its bellow certin y level , do stuff

tawny pine
# rotund ravine <@928322034121977966> how does your hashmap look

ArrayList<UUID> haveCooldowns = new ArrayList<UUID>();
That's how I define it.
if (!(cooldown.containsKey(p.getName()))) {
That is the code I'm using to check if it contains the player name.
My issue is that this if statement triggers when it isn't supposed to.

tawny pine
rotund ravine
#

That’s notba map

tawny pine
rough drift
#

it doesn't even matter if you have a check every move event

twin venture
rotund ravine
twin venture
#

it was doing the method i added in it twice ..

rough drift
rotund ravine
#

Wait

twin venture
#

with the runnable it only , do it once

tawny pine
rough drift
rotund ravine
#

@tawny pine show me the cooldown map

twin venture
#

no

rough drift
#

Are you sure?

twin venture
#

for now i use :

#

this does work and it does not repeat the code twice .

tawny pine