#help-development

1 messages · Page 42 of 1

shadow zinc
#

thats what it says

lost matrix
#

Runtime or compile time?

shadow zinc
#

Caused by: java.lang.LinkageError: loader constraint violation: loader 'NeoPerformance-1.10.10.jar' @69f55382 wants to load class com.neomechanical.neoutils.inventory.managers.data.InventoryGUI. A different class with the same name was previously loaded by 'NeoConfig-1.0.3.jar' @215587da. (com.neomechanical.neoutils.inventory.managers.data.InventoryGUI is in unnamed module of loader 'NeoConfig-1.0.3.jar' @215587da, parent loader java.net.URLClassLoader @5c29bfd)

vocal cloud
#

Maybe the two 7s means he's 77

lost matrix
echo basalt
#

only boomers have a picture of themselves as a profile picture

shadow zinc
#

yeah I shaded in my api neoutils with my plugin that uses that api

echo basalt
#

7smile boomer confirmed

young knoll
#

Yeah!

#

Wait… fuck

desert frigate
#

is there a way to animate a armor stand to make it have a hit animation? basically like when a player hits another player or smth

echo basalt
#

that animation is rendered client-side

carmine nacelle
echo basalt
#

with packets and all

echo basalt
desert frigate
echo basalt
#

I just need to sort out some reflections but it's possible

desert frigate
#

but its for a armor stand?

carmine nacelle
#

I am absolutely clueless on reflections

glossy scroll
#

you know mirrors

#

windows

#

water

echo basalt
#

you just gotta access a couple fields

glossy scroll
#

reflect

quaint mantle
echo basalt
#

and change them to reflect a method's internals

quaint mantle
#

that might help you empathise with the hive?

#

and then they will tell you how their code works

echo basalt
#

basically just gotta do reflections to emulate this method

#

by changing the maps fields

glossy scroll
#

you gotta be careful tho

echo basalt
#

and inject your custom beehive

glossy scroll
#

if that registry is used in packets at all

#

youre fucked

echo basalt
#

it's a block registry type

#

but you pass the same id

worldly ingot
echo basalt
#

and just change the tile impl

glossy scroll
#

i still think you should just figure out the pdc thing but like

#

whatever

vocal cloud
#

I think that making a fake beehive and just playing pretend with it going in and out would bee better

vocal cloud
#

Server goes down and restarts you can just get all the stored bee info and generate a new set of bees while killing the old ones off

echo basalt
#

with this hacky tile approach all beehives act correctly in a deeper native level

vocal cloud
#

Yeah if it works. Good luck

echo basalt
#

I really don't want to change like 7 different fields over reflection

#

but all the tile code is handled

#

just need to hack into the registry

#

or unfreeze it, delete a value and insert stuff

quaint mantle
#

ignore my issue btw guys. the issue was itemstack referencing

#

.clone = .pain

echo basalt
#

you were checking for equality tho

#

but whatev

river oracle
#

similarity > equality

#

I phrased it this way so It gets taken out of context and I get cancelled

quaint mantle
desert frigate
#

how do i stop a bukkit runnable

vocal cloud
#

By beating it with a stick. Or storing it somewhere to cancel later

desert frigate
#

😀

#

im guessing its cancel()

carmine nacelle
#

im gonna beat my head with a lead pipe

worldly ingot
#

BukkitTask (and consequently, BukkitRunnable) has a #cancel() method, yeah.

wise mesa
#

location.add modifies the original location right?

glossy scroll
#

Yes

worldly ingot
#

Yeah it's all mutable

#

Though bear in mind, pretty much anything in Bukkit that returns a Location is a clone

#

(e.g. player.getLocation().add(0, 1, 0) won't teleport the player)

desert frigate
#

is metadata stored in memory ?

tender shard
#

depends

#

if that item is in a chest in an unloaded chunk, no

#

otherwise, yes

desert frigate
#

like a living entity

tender shard
#

then, yes

desert frigate
#

ah alr

#

does reloading the plugins change the metadata?

tender shard
#

no

worldly ingot
#

You're talking Bukkit metadata, right?

desert frigate
#

yes

worldly ingot
#

Kept in memory, not lost on plugin or server reload

desert frigate
#

specifically a armor stand

worldly ingot
#

Lost on shutdown though

tender shard
desert frigate
#

oh so it only loses on reboot

worldly ingot
#

Yeah

desert frigate
#

damn that sucks

tender shard
#

well well well

desert frigate
#

i tried without using a database

tender shard
#

you can just use the PDC to store "persistant" stuff

#

Entity#getPersistentDataContainer()

#

that data will be kept through shutdowns etc

#

Take a look at these two posts that explain PDC:

#

?pdc

desert frigate
#

oh i guess that works too

tender shard
#

it's basically an API for custom NBT tags

#

it's awesome!

#

was added in 1.14.1

desert frigate
#

yeah awesome now i have to rewrite everything

tender shard
#

F

desert frigate
#

im surprized ive gone so far and still not knowing 98% of java

tender shard
#

lol, yeah well

#

if you claim yourself that you don't know java very well, I highly suggest you to look at one of these:

desert frigate
#

literally my 3rd day using java and didnt take any lessons or anything lol

tender shard
#

?learnjava

undone axleBOT
desert frigate
#

i tried all of them but it gets so boring so fast

#

i mainly learn from experience

tender shard
#

oh really?

#

yeah also true

#

omg is that your cat in your pfp?

desert frigate
#

yes

tender shard
#

cuuute ❤️

desert frigate
#

i took it on my phone lol

#

ty

#

well

#

technically its my cousins

#

but noone knows

carmine nacelle
#

Well boys...

#

I got a working solution

#

If I set the UUID of my CustomBee, will it also set the UUID of the bukkit entity itself?

#

because I cant set the uuid of the bukkit entity

river oracle
#

i'd have to look at impl but thats pretty much bukkit almost ever does is wrap

carmine nacelle
#
 //Spawn custom bee
                    CustomBee newBee = beeManager.spawnBee(nearestHive, beeEnteredHive.getCustomName());
                    newBee.setUUID(storedBeeUUIDs.get(0));
river oracle
#

rather than doing something more hacky

carmine nacelle
#

nope

tender shard
#

Entity#getUniqueId simply returns vanilla's / NMS' getUniqueId()

river oracle
#

?stash

undone axleBOT
river oracle
#

you have to go to the CraftBukkit repository

quaint berry
#
commands:
  rtp:
    description: Randomly teleports you so a random place
    usage: /<command>

This is my plugin.yml for the command section, Do I need to add anything for adding args to commands?

#

For example /rtp {playername}

river oracle
#

if you want tab completions you need to register a TabCompleter

quaint berry
#

Ok thanks

river oracle
#

I'd reccomend using a command framework though I don't like bukkit's you could take a look at Brigadier I also think Lamp is really good though it adds a quite a bit of size to your jar versus brigadier which is packaged with servers and clients post 1.13

honest badge
#

help with itemstacks in shapeless recipes

river oracle
#

your limited to materials atm

honest badge
#

any way to use preparecraftevent

river oracle
#

for shapeless I guess you could check for every possability though just making it shaped is much easier

honest badge
#

i just need recipe for 1 item

#

using prepare craft event

#

but when putting multiple itemstacks

#

doesnt register

tender shard
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!

river oracle
#

are you using equals for comparison

#

or similarity

eternal oxide
#

recipes only take a single item per slot in teh Matrix

river oracle
#

ItemStack#isSimilar is way better tahn ItemStack#equals isSimilar ignores stack size

honest badge
#

hm

tender shard
#

you can NOT make a crafting recipe use more than one item of each itemstack

#

you need to do that manually

honest badge
#

oh ok

#

i was just wondering bc my friend is able to recreate something similar in skript

river oracle
#

Skript < Java

honest badge
#

ofc

river oracle
#

if skript can do it java can do it better a whole 100% of the time

honest badge
#

but i thought there must be a way to recreate it

river oracle
#

you can

#

you just have to use the event

honest badge
#

alright

#

ill try what you suggested

river oracle
#

if you need a specific amount of an item you need to manage how much is subtracted upon crafting the item because by default its only going to take one

honest badge
#

it works, thanks

#

any other methods besides isSimilar?

#

@river oracle

river oracle
honest badge
#

ok

river oracle
#

ideally what you'd want to use for crafting recipe stuff

honest badge
#

alright

bitter bone
#

still need help

honest badge
#

i can send you the code to take a look at if you think that will help

#

anyone else have an idea

river oracle
#

just send your code

#

lmao

honest badge
#

alr

river oracle
#

ik shadow master bouta drop a question I can't answer and I'ma have to dip outa shame

river oracle
undone axleBOT
river oracle
#

btw ^

kind hatch
#

Vanilla crafting works similarly. If you have multiple items in the proper slots and then you only craft one item. The crafting table will remove one from every relavant itemstack and you will still have something left over that results in a valid craft.

kind hatch
river oracle
#

and I was gonna have to run but nah u just answered him

river oracle
#

in a way that i can process

#

what is happening currently vs what do you want to happen

lost matrix
honest badge
#

whenever i craft my custom chestplate with 2 types of my custom block,
and take the chestplate out of the table, the blocks dont get removed from
the crafting table, making it a duper.
What i want it to do, is remove one of each block every craft

river oracle
lost matrix
river oracle
young knoll
#

No

#

RecipeChoice.ExactChoice

#
  • doesn’t work with stack size tho
river oracle
#

wtf I swear I was always told Materials only for recipes

honest badge
#

same here

eternal oxide
#

if you want to make a recipe which requires multiple of an item, instead have them craft X amount of the required item into a custom item. Then use that in your recipe

#

no need to listen to events then

honest badge
river oracle
honest badge
river oracle
#

what do you mean byt hat

kind hatch
honest badge
#

so do i just create a shapeless recipe except add itemstacks as ingredients?

young knoll
#

I believe the docs say ExactChoice doesn’t work with shapeless recipes

#

No idea if that’s still the case

lost matrix
kind hatch
honest badge
#

yea

river oracle
#

uhm recipes will help with that lol

#

dw about it

#

it wll all be dealt with by the recipe's no need to worry

honest badge
#

alr

river oracle
#

this is what I get

young knoll
#

Get with the future old man

river oracle
#

all these cool things I still haven't figured out yet

lost matrix
#

No several amounts for ingredients wont be respected.
Minecraft doesnt work that way. one recipe = one of each ingredient

river oracle
#

honestly if you want it to be harder to craft the item just add an annoying amount of sub recipe's

young knoll
#

Octuple compressed cobblestone

lost matrix
#

Thats how the mods solve it

young knoll
#

Or they make their own crafting system

honest badge
#

still in ShapelessRecipe var type?

bitter bone
#

Ayo can something help

kind hatch
kind hatch
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!

bitter bone
#

Anyone know how I'd go about making something happen when I item is thrown onto a block for my example I have it so that when I throw an item onto a gold block it sends a message to the player only problem I'm having is that it's wonky a bit

honest badge
#

does that seem right?

#

or is there any documentation

#

i could follow

lost matrix
bitter bone
lost matrix
#

You can also work the other way around if its a special gold block. Just let it fetch all items in a radius of 0.75 or something every 10 or 15 ticks.

young knoll
#

Doesn’t Item have an onGround

bitter bone
lost matrix
#

And this system can be used to quickly pump out machines. You can create item spawner, or blocks that heal nearby players, or blocks that shoot arrows at
zombies, or blocks that harvest crops and puts the crops in a chest. There is no real limit.

young knoll
#

And then you have slimefun4

bitter bone
#

Interesting I'll have to figure this out my main goal was for some type of spawn mob method thing

lost matrix
young knoll
#

At least you probably don’t store everything in a bunch of yaml files

bitter bone
#

My idea was a throw a special item onto gold block then some effects n stuff happen and boom mob spawns I'll check out what you were saying though

lost matrix
carmine nacelle
#

hey smile

lost matrix
#

hey

young knoll
#

Slimefun also loads everything on startup

#

shivers

carmine nacelle
lost matrix
#

Everything can be improved

carmine nacelle
#

true

#

but as far as efficiency goes, thats the best solution I can think of

lost matrix
#

First thing i would do:

        if(event.getEntity() instanceof Bee beeEnteredHive) {

to

        if(!(event.getEntity() instanceof Bee beeEnteredHive)) {
          return;
        }
carmine nacelle
#

fair

bitter bone
lost matrix
#

Same here

            if (blockAtLocation.getType().equals(Material.BEEHIVE)) {
carmine nacelle
#

I've started doing that more, whats that called?

#

just minimizing? or

lost matrix
lost matrix
carmine nacelle
#

Works the same as having the ifs but just cleaner to read I guess?

lost matrix
#

Yes

carmine nacelle
#

semantics

young knoll
#

It’s like

#

One whole less entry on the stack

lost matrix
#

Btw. I would approach it this way:

When a chunk loads -> get all tile states from that chunk, check if its a beehive and then load the CustomBeeHive into memory.
From then on you dont touch the pdc anymore. You work with your CustomBeeHive object (which contains the List<UUID> and everything else)
Then when the chunk unloads you store the CustomBeeHive in the pdc again.

#

This is much cleaner and also faster

carmine nacelle
#

The only reason I have the pdc is so I can check if the closest hive (the one it must've spawned from) had custom bees at one point

honest badge
lost matrix
honest badge
#

put with custom ingredients

#

and custom result

lost matrix
#

Custom ingredients are easy. But minecraft never uses the amount for any recipes.

honest badge
#

but it is able to be done in skript...

river oracle
#

if you want to two items to one slot your better off creating a nested recipe anyways

river oracle
honest badge
river oracle
#

they would be

carmine nacelle
#

@lost matrix Currently im using gson to load everything into a list of my CustomHive objects

kind hatch
#

A recipe will cover that case.

carmine nacelle
#

onEnable

kind hatch
#

Whether it's Shapeless or not.

honest badge
#

how would i go about creating that

lost matrix
#

I still dont understand what you want. Dont try to tinker with multiple amounts for a singe ingredient. Its really really hard to achieve.
And im almost certain that skript cant do that.

#

Skript is just a hacky script kiddy layer over the java api

kind hatch
honest badge
#

alright thank you

lost matrix
kind hatch
honest badge
#

throwing error on Bukkit.registerRecipe

young knoll
#

Isn’t it addRecipe

lost matrix
kind hatch
#

That's not what I was referring to.

kind hatch
river oracle
kind hatch
lost matrix
carmine nacelle
#

Smile, how would you recommend loading them on chunk load? I have them just stored in a json file as a list. I mean.. on chunk load, I could loop through the file again and look for ones with a location inside the loaded chunk but that seems even worse

young knoll
#

Database

lost matrix
river oracle
kind hatch
carmine nacelle
#

Would you recommend sqlite or mysql

river oracle
#

I speed craft and still didn't get it

lost matrix
young knoll
#

Ah this is PDC stuff

carmine nacelle
#

Yeah but im loading it all in my onEnable right now.

young knoll
#

Yeah chunk has a getTileEntities

carmine nacelle
#

If I load from my json, it loads them all

#

not just the ones in the chunk

#

If I switched to a database I could do the chunk thing

lost matrix
#

No need to load hives which are not even loaded on the server

lost matrix
carmine nacelle
#

im not moving everything to pdc id rather kms

#

I already tried that once and it was a huge headache

#

so I switched it back to what i got now

lost matrix
#

You can do the chunk thing with files, a database or pdcs

carmine nacelle
#

It's a list.

young knoll
#

One file per chunk

#

Kappa

carmine nacelle
#

I'd have to get the list and iterate over the list from the config every chunk load

lost matrix
#

For files you can just have a folder per world and name the files after their block position.
📁 CustomBees
- 📁 Worlds
- 📁 world
- 213#90#-1455.json
- 133#92#900.json
- 📁 nether

carmine nacelle
#

I mean realistically though... that would try to load a file every time a chunk loads and if you do like /speed 10 and fly, you could be accessing the file multiple times a second

#

I thought that was bad?

young knoll
#

I mean

lost matrix
#

Then chunk load -> get the hives -> get their location -> check if file exists and load it

young knoll
#

Where do you think chunks themself get loaded from

winter scarab
#

am i able to check if an entity exists in the world with the specified uuid by using Bukkit.getEntity(UUID) != null

real blaze
#

public void mineSpawner(BlockBreakEvent e){
  if(e.getPlayer() instanceof  Player){
    if(!e.getBlock().getType().equals(Material.SPAWNER))
      return;
    if(e.getPlayer()
      .getInventory()
      .getItemInMainHand()
      .getItemMeta()
      .getLore()
      .contains(ChatColor.GOLD + "Spawner Touch"))
       e.setDropItems(true);
    }
}

Intent: Make a spawners drop with specific pickaxe
Problem: It still doesnt drop

carmine nacelle
#

Can you define "get the hives"?

#

Oh

#

ok nvm

lost matrix
carmine nacelle
#

think ik what you mean... chunk load, loop through tile entities in the chunk

#

check their type..

winter scarab
#

yes thats correct

#

does that mean i can use that statement as said?

kind hatch
winter scarab
#

i am trying to see if that uuid is a valid entity uuid within the loaded entities

lost matrix
#

?pdc

winter scarab
#

if not, return

quaint berry
#

Sorry to cut in but When some one runs the command below it always returns /clearrtp in the minecraft chat

if (command.getName().equalsIgnoreCase("clearrtp")) {
            boolean isPlayerCommand = false;
            if (!(sender.hasPermission("wildTP.clearrtp"))) {
                sender.sendMessage(ChatColor.RED + "Insufficient permissions");
                return true;
            }

            if (args.length != 1) {
                sender.sendMessage("Invalid args length, 1 needed, " + args.length + " we're given");
                return true;
            }
            Player chosenPlayer = Bukkit.getServer().getPlayer(args[0]);
            for (Player player : Bukkit.getServer().getOnlinePlayers()) {
                if (player == chosenPlayer) {
                    isPlayerCommand = true;
                    break;
                }
            }
            if (!isPlayerCommand) {
                sender.sendMessage(ChatColor.RED + "Args 1 is not a player!");
                return true;
            }
            playerCooldown.put(chosenPlayer.getUniqueId().toString(), 0L);
            sender.sendMessage(ChatColor.GREEN + chosenPlayer.toString() + " has had they're cooldown set to 0!");
        }
lost matrix
quaint berry
#

Oh ok

carmine nacelle
#

Something like this, smile?

    @EventHandler
    public void chunkLoad(ChunkLoadEvent event) {
        Chunk chunk = event.getChunk();
        
        BlockState[] tileEntityList = chunk.getTileEntities();
        
        for(BlockState tileEntity : tileEntityList) {
            if(!(tileEntity instanceof Beehive)) continue;
            //Check file for hive at location
        }
    }
young knoll
#

Returning false will send the command usage

kind hatch
kind hatch
real blaze
lost matrix
lost matrix
river oracle
#

PDC > Any other identifier you could use

carmine nacelle
#

So how would I save to the file as a list of custom objects, but only load one at a time?

#

I mean..

#

efficiently

#
            List<CustomHive> hives = gson.fromJson(reader, new TypeToken<List<CustomHive>>() {}.getType());
            for(CustomHive hive : hives) {
                cadiaBees.hiveManager.addHive(hive);
                cadiaBees.hiveHoloManager.setupHiveHolos(hive);
                ParticleUtil.createHelix(hive.getHiveLocation().clone().add(0.5, 0, 0.5), 1, hive);
            }
lost matrix
#

One object per file

carmine nacelle
#

I could just modify this to not actually add them to the list 🤷

#

oh right

#

you said that.

lost matrix
#

To be honest. It wouldnt bee too bad if you loaded all the data into memory when the server starts.
Whats 50mb more or less anyways? (Unless this is a public plugin and you want to please the aternos kids)

carmine nacelle
#

It's not public rn

lost matrix
#

2 years back i was on a server where we decided to simply reserve 8 gb for caches.
We had the whole 2k playerbase loaded at all times and didnt even use 200mb

carmine nacelle
#

Yeahhh data doesnt really take that much in memory.

lost matrix
#

No comment on that statement...

river oracle
#

thats why I add memory leaks to all my plugins

#

just to spice things up

carmine nacelle
river oracle
#

I like to be running my server log on and then get an out of memory error

carmine nacelle
#

simply get more memory

compact haven
#

please don’t load a google data center into memory

#

I assure you do not have enough to complete that operation

river oracle
real blaze
lost matrix
river oracle
#

how much data does google store and are there any motherboards that support that level of memory if not would it be possible to wire them together or something

river oracle
lost matrix
compact haven
#

I guarantee 10tb of memory is not enough for a google data center

compact haven
#

that’s like one hard drive on one server in a single rack xd

lost matrix
river oracle
compact haven
#

so unfortunately true lmao

lost matrix
river oracle
#

I can't download 100gb i get 1mbs

kind hatch
#

That's only like a day to download.

real blaze
#
@EventHandler
    public void mineSpawner(BlockBreakEvent e){
        if(e.getPlayer() instanceof  Player){
            if(!e.getBlock().getType().equals(Material.SPAWNER))
                return;
            if(e.getPlayer()
              .getInventory()
              .getItemInMainHand()
              .getItemMeta()
              .getPersistentDataContainer()
              .has(new NamespacedKey(plugin, "spawntouch"), PersistentDataType.INTEGER))
                e.setDropItems(true);
        }
    }

well this also doesnt work

river oracle
#

1mbs if its good otherwise around 500kbs

real blaze
#

wait, this item has exactly 1 durability

#

is it due to it breaking?

lost matrix
kind hatch
#

if(e.getPlayer() instanceof Player) Bro

rain mason
#

confusion

river oracle
compact haven
#

What

earnest forum
real blaze
rain mason
#

it's literally getPlayer

#

not .getEntity

#

or something

earnest forum
#

getPlayer

#

it will never not be a Player

compact haven
#

there’s a getPlayer that returns an entity

young knoll
#

Sometime you gotta double check

earnest forum
compact haven
#

Unless that’s been fixed since 1.8 xd

real blaze
#

sometimes its HumanEntity

earnest forum
#

im pretty sure human entity is also always a player

kind hatch
#

I think it depends on what event you are listening to.

#

Player extends HumanEntity, sooo.

young knoll
#

Afaik HumanEntity is always a player

#

Game’s weird

river oracle
lost matrix
# real blaze ```java @EventHandler public void mineSpawner(BlockBreakEvent e){ if...
  @EventHandler
  public void onBlockBreak(BlockBreakEvent event) {
    ItemStack tool = event.getPlayer().getInventory().getItemInMainHand();
    Block brokenBlock = event.getBlock();
    if(brokenBlock.getType() != Material.SPAWNER) {
      return;
    }
    ItemMeta meta = tool.getItemMeta();
    if(meta == null) {
      return;
    }
    PersistentDataContainer container = meta.getPersistentDataContainer();
    if(container.has(new NamespacedKey(plugin, "spawntouch"), PersistentDataType.INTEGER)) {
      event.setDropItems(true);
    }
  }

Keep in mind that this will not drop the spawner! setDropItems only enables the vanilla behavior.

river oracle
quaint berry
winter scarab
#

since Bukkit.getEntity() cant return null and instead throws an IAE error, i can just try catching for the exception and return if so right?

kind hatch
winter scarab
#

wait maybe my ide was wrong then

real blaze
lost matrix
real blaze
winter scarab
kind hatch
lost matrix
kind hatch
#

You'll have to drop the spawner manually.

real blaze
#

guess i'll just write a quick add to inventory

lost matrix
# real blaze man aint i a bad reader

Here.

    PersistentDataContainer container = meta.getPersistentDataContainer();
    if(container.has(new NamespacedKey(plugin, "spawntouch"), PersistentDataType.INTEGER)) {
      brokenBlock.getWorld().dropItemNaturally(brokenBlock.getLocation().add(0.5, 0.5, 0.5), new ItemStack(Material.SPAWNER));
    }

!! 𝐉𝐮𝐬𝐭 𝐛𝐞 𝐚𝐰𝐚𝐫𝐞 𝐭𝐡𝐚𝐭 𝐭𝐡𝐢𝐬 𝐰𝐢𝐥𝐥 𝐚𝐥𝐰𝐚𝐲𝐬 𝐝𝐫𝐨𝐩 𝐚 𝐩𝐢𝐠 𝐬𝐩𝐚𝐰𝐧𝐞𝐫 !!

river oracle
#

Makee sure you give them the correct spawner type

#

Shit 7smile7 beat me too it

kind hatch
real blaze
young knoll
#

BlockStateMeta iirc

lost matrix
# kind hatch Bottom text not noticeable enough.
 █████╗ ██╗     ██╗    ██╗ █████╗ ██╗   ██╗███████╗    ██████╗ ██████╗  ██████╗ ██████╗ ███████╗    
██╔══██╗██║     ██║    ██║██╔══██╗╚██╗ ██╔╝██╔════╝    ██╔══██╗██╔══██╗██╔═══██╗██╔══██╗██╔════╝    
███████║██║     ██║ █╗ ██║███████║ ╚████╔╝ ███████╗    ██║  ██║██████╔╝██║   ██║██████╔╝███████╗    
██╔══██║██║     ██║███╗██║██╔══██║  ╚██╔╝  ╚════██║    ██║  ██║██╔══██╗██║   ██║██╔═══╝ ╚════██║    
██║  ██║███████╗╚███╔███╔╝██║  ██║   ██║   ███████║    ██████╔╝██║  ██║╚██████╔╝██║     ███████║    
╚═╝  ╚═╝╚══════╝ ╚══╝╚══╝ ╚═╝  ╚═╝   ╚═╝   ╚══════╝    ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚═╝     ╚══════╝    
                                                                                                    
██████╗ ██╗ ██████╗     ███████╗██████╗  █████╗ ██╗    ██╗███╗   ██╗███████╗██████╗                 
██╔══██╗██║██╔════╝     ██╔════╝██╔══██╗██╔══██╗██║    ██║████╗  ██║██╔════╝██╔══██╗                
██████╔╝██║██║  ███╗    ███████╗██████╔╝███████║██║ █╗ ██║██╔██╗ ██║█████╗  ██████╔╝                
██╔═══╝ ██║██║   ██║    ╚════██║██╔═══╝ ██╔══██║██║███╗██║██║╚██╗██║██╔══╝  ██╔══██╗                
██║     ██║╚██████╔╝    ███████║██║     ██║  ██║╚███╔███╔╝██║ ╚████║███████╗██║  ██║                
╚═╝     ╚═╝ ╚═════╝     ╚══════╝╚═╝     ╚═╝  ╚═╝ ╚══╝╚══╝ ╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝
kind hatch
#

Thank you!

desert frigate
#

Would it be possible to have a block get the breaking animation?

lost matrix
young knoll
#

Yes

young knoll
desert frigate
#

Oh really? what's the method

real blaze
rain mason
#

does anzone know how to fix this

young knoll
kind hatch
#

Update your server version. ¯_(ツ)_/¯

rain mason
alpine urchin
#

show pom xml

lost matrix
kind hatch
#

How old is your code?

rain mason
#

1-3 weeks

young knoll
#

Your api version almost certainly doesn’t match your server

rain mason
#

my server's on 1.19 aswell

lost matrix
#

How do you compile?

rain mason
lost matrix
#

So you are building artifacts?

rain mason
#

uhh im guessing

lost matrix
#

Let me guess. You manually added a spigot jar to your project.

desert frigate
rain mason
#

in intellij

lost matrix
#

Nah im going to sleep... bye guys

desert frigate
young knoll
#

No, you need a player to show the damage to

rain mason
#

and my server's running on 1.19

desert frigate
vestal moat
#

how can i create a new world with the api that is void, completely empty

rain mason
#

Bukkit.createWorld afaik

vestal moat
#

ye but how to make it superflat and the only block is air

opal epoch
#

Hey in really really new to this and i just wanted to setup a simple private server with dynmap

#

When i try to join my own server this error code happens

real blaze
#

is there some kind of gamerule where spawners placed by survival players are always pig spawners?

rain mason
#

no, not gamerule

#

is there a way to prevent an item dropping into the end dimension? i know how to prevent it using PlayerTeleportEvent, but that doesnt work for entities/items

real blaze
#

oh, is it just a general rule of minecraft that survival players placing spawners will always be pig spawners, and we have to override this manually?

rain mason
young knoll
#

Huh

#

TIL

real blaze
rain mason
#

i guess so

young knoll
#

EntityPortalEvent

rain mason
#

alr thanks

chrome beacon
#

It's not

#

Don't call getDisplayName in the switch. Create variables

quaint berry
#

I have a while loop that runs and it stops the server for 7 seconds, How can I use another thread in bukkit?

quaint berry
undone axleBOT
chrome beacon
#

getDisplayName can return anything. It doesn't guarantee to be the same value

#

Therefor it's not constant

young knoll
#

Strings can be changed

real blaze
#

alright so im trying to prevent an action if a player's non-armor/offhand inventory slots are full while in viewing a shop inventory

young knoll
#

Inventory#getFirstEmpty

real blaze
quaint berry
#

Is it possible to do this synchronically

#

*Not async

#
new BukkitRunnable() {
                    @Override
                    public void run() {
                        boolean worldLoading = true;
                        while (worldLoading) {
                            if (finalLocation.getChunk().isLoaded()) {
                                ((Player) sender).teleport(finalLocation);
                                sender.sendMessage(ChatColor.GREEN + postTpMessage);
                                ((Player) sender).addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 10, 5, false, false, true));
                                worldLoading = false;
                            }
                        }
                    }
                }.runTask(myPluginInstance);
#

This doesn't end well

rough drift
#

How could I mirror an inventory? (so slot 0 to 8, slot 1 to 7, and vice versa)

compact haven
#

Uhm.. basic math?

#

you loop 0 to 8 and subtract that number from 8 to get the mirror slot

rough drift
#

for each row

compact haven
#

then get the item at that slot and set it to the mirrored slot

#

yes

#

for each row

rough drift
#

yeah I know the mirroring of a row

compact haven
#

There is no method Inventory.mirror() that’s ridiculous

rough drift
#

my deadass brain wasn't able to figure out the multi row

gritty sierra
#

Hi I am working on a /nick command for my 1.19 spigot server. I want that when you type /nick the players skin get changed with the PlayerTextures.setskin, but the method wants a textures.minecraft.net link where do i get those links? or is there an alternative changing a players skin?

eternal oxide
#

lol I just finished writing a skin/naming plugin and now it gets added to the API 🙂

iron glade
#

What exactly gets added?

eternal oxide
#

the whole PlayerTextures

iron glade
#

Like Paper already has?

eternal oxide
#

No clue, I don;t use Paper

#

I was just finishing up a multi module plugin for skins

gritty sierra
#

but how to i get the link needed?

eternal oxide
#

mineskins usually

gritty sierra
iron glade
#

Just get it from there with player url

eternal oxide
#

yes, mineskins will give you a minecraft texture

iron glade
#

UUID *

shadow zinc
#

how can I cancel the inventory close event from being fired when I open an inventory for a player who already has an inventory open?

iron glade
shy saffron
#

this is the spigotmc server, not paper

#

why are you here?

drowsy helm
#

If i call an event within an event will it execute all listeners before the subsequent listeners for the initial event are fired?

iron glade
#

Chill Chad, was a simple question, didnt Tell anybody uSe PaPeR, hOw DaRe YoU tO UsE sPiGot

real blaze
#

does EnchantItemEvent include anvil enchants? if not, what does?

iron glade
#

Why would you cancel it though?

drowsy helm
#

just code it in a way where you arent opening an inventory for someone who has it open in the first place

#

much simpler than cancelling the close event

gritty sierra
eternal oxide
gritty sierra
#

thx

eternal oxide
#

each skin has a minecraft link

#

eg http://textures.minecraft.net/texture/3c19d78f366e2e83feec4b20e8c5f1287df8b3880c56523bc739a615760f6666

gritty sierra
#

yeah ok then the problem is solved

real blaze
#

say I wanted to prevent a player from enchanting/anvil-ing a specific item, i can see how to intercept the enchantitemevent, but not the anvil craft event

supple elk
#

Does anyone know how I can update the position of a vehicle driven by a player using packets?

supple elk
#

This is my code

#

currently I can move slowly in the boat

#

and after maybe 10s of moving, I will be warped back along with the boat to the correct position

#

That suggests to me that there is a way for the server to update the position of the boat to the client

shadow zinc
# iron glade Why would you cancel it though?

Because if the player opens a new inventory it calls the inventory closed event if they have an inventory already open, the means that opens the previous inventory and they cant go anywhere

supple elk
#

Any ideas? Also maybe setting the movement of the boat to counteract the movement thee player is creating?

vivid cave
#

I don't know for your answer but here you are only using client bound packets
So it's just visual on their client but not happening in server
(I think)
Isn't there a serverbound packet as well for that ?

shadow zinc
#
    @EventHandler
    public void onInventoryClose(InventoryCloseEvent event) {
        Inventory inventory = event.getInventory();
        InventoryManager inventoryManager = InventoryUtil.getInventoryManager();
        if (!inventoryManager.isGUI(inventory)) {
            return;
        }
        InventoryGUI gui = inventoryManager.getInventoryGUI(inventory);
        if (gui == null) {
            return;
        }
        Player player = (Player) event.getPlayer();
        if (gui.getOpenOnClose()!=null) {
            new BukkitRunnable() {
                @Override
                public void run() {
                    player.openInventory(gui.getOpenOnClose().getInventory());
                }
            }.runTaskLater(NeoUtils.getInstance(), 1L);
        }
    }```
formal bear
#

Im trying to find the row, i cannot switch to BLOB from longtext Data too long for column 'item' at row 526, anyone?

supple elk
#

things are functioning correctly on the server side

#

that's why the boat eventually gets warped back to the correct position

#

or if I dismount it gets warped back

#

I'm just trying to sync the client back up

vivid cave
#

Yes that's why I would advise to send serverbound packets 😛

#

But idk if it's possible

supple elk
#

don't server bound packets update the server?

vivid cave
#

They should I think ?

supple elk
#

so why would I want to update the server if the server is already correct?

vivid cave
#

But here you are sending client bound packets so only visual on player client but not sync with serv

supple elk
#

Currently the client has wrong information, server has correct information

shadow zinc
#

?paste

undone axleBOT
supple elk
#

so I need to send packets to the client to tell it to move the boat back to the correct position

vivid cave
#

Oh

supple elk
#

Or at least that's my understanding

shadow zinc
vivid cave
#

By sending a ClientBoundBlablaPacket you aware that you are sending information to the player that is not present in the server

supple elk
#

how so?

real blaze
vivid cave
#

Basically ClientBound packets are bound to the players Minecraft client. A packet is just a bunch of information. So you are basically telling the player, I would like your client to update the placement of the boat, but the server itself hasn't changed the state of the placement of the boat
The data that is stored on the server doesn't get affected by the ClientBound packets you send to players

supple elk
#

yes

#

correct

vivid cave
#

For example, if you send a ClientBound paxket to player A but not player B, player A will see different stuff than player B on their client

#

Although player B is the one synced with actual state of the server

supple elk
#

yes

#

I am aware of all of this

vivid cave
#

import net.minecraft.network.protocol.game.ServerboundMoveVehiclePacket; maybe? (idk) (so server thinks that its the correct placement as well as client)

shadow zinc
#
    @Override
    public void action(InventoryClickEvent event) {
        if (inventoryGUI != null) {
            Player player = (Player) event.getWhoClicked();
            player.getOpenInventory().getTopInventory().setContents(inventoryGUI.getInventory().getContents());
            return;
        }
        throw new IllegalArgumentException("Inventory GUI does not exist.");
    }```
#

Is doing this okay?

supple elk
#

The current situation: Server has the correct location of the boat. 1 player has become out of sync, I need to sync the position of the boat on the client back up with the server

supple elk
#

client has become out of sync

#

so I need a client bound

vivid cave
#

ah sorry then, i misunderstood

supple elk
#

it's ok

#

I've heard the vehicle stuff is done client side or some bs

vivid cave
#

ah, i'm unaware of the technical aspects of vehicles

supple elk
#

so am I 😔

supple elk
#

This is the code I'm running

#

well, not all the packets at once

#

that's just different stuff I've tried

vivid cave
#

ahh

supple elk
#

for whatever reason, the boat can still be driven by the client

#

but every 10s it teleports back to the right pos

#

so the server clearly thinks that the boat hasn't moved

#

but the client has

#

if I dismount the boat it warps back to the original position

cunning canopy
#

is it just me or is location.getBlock().setType real messed up?

supple elk
#

As to why this desync occurs, I couldn't possibly tell you

#

but it looks as if there is way to fix it, since it eventually syncs back up again on a dismount, or after enough time

#

so I'm just looking for the right packets to send

#

This packet maybe though

#

the clientbound of what you had sent

vivid cave
#

what if u spam the packet (like send one new packet every 1 second or even less) cuz i feel like this happens BECAUSE the server does send these packets ur sending but not only, maybe it sends other packets automatically. (or the client does this idk)
Other idea: So have you tried listening to all the packets that arrive with protocollib or whatever, and cancel those that are not sent by you (or modify their information so they match for sure what's on the server) before they are sent to player

young knoll
supple elk
#

I get the feeling there's something simpler though

#

but I could try doing something like that if worse comes to worst

vivid cave
#

good luck i cant really help u more on that cuz i don't really know

supple elk
#

ty

cunning canopy
# young knoll I have a feeling it’s just you

might be, but I call this function twice ```java
public void setCageBlocks(Location spawnLocation, Material material) {

    // Floor
    Location block = spawnLocation.clone();
    block.add(0, -1, 0).getBlock().setType(material);

    // Wall 1
    block = spawnLocation.clone();
    block.add(1, 0, 0).getBlock().setType(material);
    block = spawnLocation.clone();
    block.add(1, 1, 0).getBlock().setType(material);

    // Wall 2
    block = spawnLocation.clone();
    block.add(-1, 0, 0).getBlock().setType(material);
    block = spawnLocation.clone();
    block.add(-1, 1, 0).getBlock().setType(material);

    // Wall 3
    block = spawnLocation.clone();
    block.add(0, 0, 1).getBlock().setType(material);
    block = spawnLocation.clone();
    block.add(0, 1, 1).getBlock().setType(material);

    // Wall 4
    block = spawnLocation.clone();
    block.add(0, 0, -1).getBlock().setType(Material.AIR);
    block = spawnLocation.clone();
    block.add(0, 1, -1).getBlock().setType(Material.AIR);

    // Top
    block = spawnLocation.clone();
    block.add(0, 2, 0).getBlock().setType(Material.AIR);
}
supple elk
#

The final code

shadow zinc
#

what is the best way to open an inventory when there is already an inventory open?

#

I need to avoid the inventory close event from being fired, and make it as seamless as possible.

cunning canopy
shadow zinc
#

Because I have a open when closed option for inventories

#

and you can see that will be a problem

cunning canopy
#

sounds like bad design to me

shadow zinc
#

So if they click to open a new inventory, avoid the close event

#

thanks

cunning canopy
#

add an if statement in the event

shadow zinc
#

Okay, if you don't know how to help me please don't confuse me

cunning canopy
#

it would help if you show some code

shadow zinc
#

my current action is this

#
    @Override
    public void action(InventoryClickEvent event) {
        if (inventoryGUI != null) {
            Player player = (Player) event.getWhoClicked();
            player.getOpenInventory().getTopInventory().setContents(inventoryGUI.getInventory().getContents());
            return;
        }
        throw new IllegalArgumentException("Inventory GUI does not exist.");
    }```
vivid cave
#

so like flying white horses

supple elk
#

lmao

vivid cave
#

xd

#

is the animation smooth on client tho or sometimes a lil lag or sth

eternal oxide
#

Do NOT open nor close inventories in teh InventoryClickEvent

#

read teh javadoc on the event

shadow zinc
#

Then what do you propose I do?

eternal oxide
#

if you have an inventory open already and you want to open another, you open it in a runTask

#

you will get a close event

#

you can not avoid that

supple elk
shadow zinc
#

so how will I do what I am trying to do?

supple elk
#

if you do move then it's a little jerky but not too bad

shadow zinc
supple elk
#

actually it's really good

#

the camera doesn't move at all

#

the boat kinda vibrates

#

but not the player

#

so it's as good as you're gonna get realistically

vivid cave
#

niice

shadow zinc
#

solved, the solution was to check if the inventory opened after 1 tick was an InventoryGUI, or apart of the util

#
        if (gui.getOpenOnClose()!=null) {
            new BukkitRunnable() {
                @Override
                public void run() {
                    //Make sure it wasn't just another inventory being opened.
                    if (!InventoryUtil.getInventoryManager().isGUI(player.getOpenInventory().getTopInventory())) {
                        player.openInventory(gui.getOpenOnClose().getInventory());
                    }
                }
            }.runTaskLater(NeoUtils.getInstance(), 1L);
        }```
hasty obsidian
#

does anyone know how to remove only one item from a players inventory, because if I use p.getInventory().remove(RerollToken.token); it removes all of the same item

young knoll
#

removeItem

#

Removes up to the stack size of the ItemStack you pass

weary stirrup
#

Hi, I have these lines of code to execute on player death, the problem is theyre not teleporting, I cancel the event then try to tp them to world spawn but they just survive and stay in the same spot where they got "killed"

#

the first if executes but they just don't tp

shadow zinc
weary stirrup
#

i have no idea

ivory sleet
#

They might be on paper

weary stirrup
#

yeah i am

#

it still works tho

upper vale
#

I think paper deprecates if you’re not components for message-related stuff

ivory sleet
#

Yes but its subject to removal once paper hard forks iirc

weary stirrup
#

am I doing something wrong when it comes to the tp tho?

#

i feel like it should work

#

I tried Bukkit.getWorld("world").getSpawnLocation() as well but it did the same thing

#

nevermind it seemed to work after I did the teleporting before I cancelled the event

supple elk
#

Any better ideas on how to check if an entity is within an area?

rain mason
#

how would I run this particle command? particle flash ~ ~ ~ 0.1 0.1 0.1 0 1

#

i tried this:

#

but .spawnParticle is literally so confusing and I have no idea what to do

opal juniper
#

look at what your ide is saying

rain mason
#

yeah, I am

opal juniper
#

hover over the linting

rain mason
#

there's like 100 different syntaxes for it

obsidian drift
#

Your parameters are in the wrong place

opal juniper
#

?jd-s

undone axleBOT
opal juniper
#

yeha maybe look at the syntax of the vanilla command and try and look what those args mean

rain mason
#

sorry it took me so long to respond

#

my pc literally just crashed

#

no BSOD, just a restart

rotund junco
#

hello! Does anyone know how to edit a plugin with missing imports?

#

What I normally do is to add the plugin in the build path, recreate the classes that I need and add them back to the original plugin

#

However, this plugin I'm trying to edit is missing a couple of imports (I have no idea how does it function anyway)

real blaze
#

quick quesiton, if i set a value in config.yml, do I have to save() it right after setting?

real blaze
#

yeah its pretty much just checking the latest player to purchase an item from the shop and saving that

#

also, for what reasons should i not be using /reload to reset my plugin?

rain mason
#

honestly no idea, reloading works all the plugins I use

real blaze
#

thanks for the two conflicting answers

#

alirght then

young knoll
#

Don’t use it on a production server

real blaze
#

will do

#

or rather not do

#

anyways, this produces nothing in the config.yml

young knoll
#

Add a default config in your jar

#

And then use saveDefaultConfig

real blaze
#

i mean config.yml does exist

#

or wrong config huh

#

yep i did

#

huh, so i cant generate defaults by code, it has to be defined in the resources/config.yml?

#

then what is the purpose of config#addDefault?

young knoll
#

Iirc if a value isn’t present that will be used instead

real blaze
#

ah, but it wont be written into the config.yml?

#

tbh that's what i wanted it to do so thats good

peak depot
#

who can I get the player that moved the item in InventoryMoveItemEvent

quiet ice
#

?jd-s

undone axleBOT
peak depot
quiet ice
peak depot
quiet ice
#

.getSource() or .getDestination() and then .getHolder()

#

Make Sure that it is actually a Player Holding it though

#

It can be a Plugin-created Class or be null

#

There is No catch-all Method however

young knoll
#

The move item event is for hoppers

#

No players involved

quiet ice
#

I was confused why that Event exists (as in I know that there are millions of inventory interact Events)

#

But yea makes Sense now

real blaze
#

any idea why this wouldnt work?

young knoll
#

saveConfig

rain mason
#

me again, how would I put loot (with random slots) into a chest? /loot insert ~ ~ ~ loot minecraft:chests/end_city_treasure

onyx fjord
#

is using scanner in my plugin a good idea?

#

i want user input on first load basically

onyx fjord
gritty sierra
#

Trying to change the skin but i don't work ist something wrong on it?

real blaze
#

if a command is entered with no args, is args null or empty?

quiet ice
#

Scanner for Sysin (or using jline) is usually a Bad idea, for other streams it is a mediocre solution

young knoll
supple elk
#

if I'm modding by the size of the list shouldn't it always be in bounds?

gritty sierra
young knoll
#

Use the players existing profile

gritty sierra
grim ice
#

how to add fake players to the server list menu

young knoll
undone axleBOT
grim ice
#

uh so

#

i wanna add fake players to the server list menu

#

so it doesnt say 0/100, but instead maybe 50/100

#

and in the taablist

#

it shows random, real minecraft accounts there

#

the actual players arent online

#

but it shows them there

#

how to do that?

supple elk
#

why is -1 % 3 still -1?

#

shouldn't that be 2?

tardy delta
#

cuz you cant divide -1 by 3?

supple elk
#

it's modulus 🤔

grim ice
#

it'll result in -0.33

tardy delta
#

then its -0.3...

#

not an int

supple elk
#

but this isn't a regular divide...

grim ice
#

it would get rounded to 0

#

plus it's a modulus

supple elk
#

is % not modulus?

grim ice
#

so you're wrong anyways

young knoll
#

Nope

#

In java % returns the remainder

supple elk
#

ah

grim ice
#

a

tardy delta
#

tf are people saying lol

supple elk
supple elk
tardy delta
#

what do you even want?

#

ik lol

supple elk
#

I want -1 modulus 3

young knoll
supple elk
#

kk

#

ty

grim ice
#

so um

#

i wanna add fake players to the server list menu
so it doesnt say 0/100, but instead maybe 50/100
and in the taablist
it shows random, real minecraft accounts there
the actual players arent online
but it shows them there
how to do that?

tardy delta
#

update the playerlist when they leave maybe?

#

not sure

grim ice
#

no

#

i wanna add players to tablist

#

that never ever joined

#

but the name has to be real

#

so like if my ign is 2Hex

#

and i never joined that server

#

itll still show that im there

onyx fjord
#

how do i execute code after all plugins have loaded

#

is there override for it?

young knoll
#

Schedule a task in onEnable

#

Iirc the task executor doesn’t start until all plugins are loaded

onyx fjord
#

o

supple elk
#

actually

#

probably not packets

#

spawning a fake NPC perhaps?

#

I know how to add a player to the tablist on client

#

but I'm not sure about the server

#

Maybe fake a player log in?

grizzled oasis
#

a question how i can make a simple world generator like for a moon world (some git or idk)?

grim ice
#

its just vsual

#

i dont care if the server doesnt have it

#

i only want the client to see it

#

and i want so when ur browsing servers

#

and u see the server

#

the player count is the same as tablist

quaint mantle
#

yo guys

#

the part where all mobs get sucked

#

but arent killed

kind coral
#

Hello, I am trying to make a custom anvil crafting with enchantments, like I want to go over the enchantment limit like 2 pickaxes of efficiency 5 make efficiency 6 etc, everything works fine the result is there and is good but I cannot actually anvil theese two items, I cannot get the result out of the anvil

grim ice
#

lol i remember when that update wasnt released yet

grim ice
quaint mantle
#

but the blocks part

#

is da problem

#

here look

#

I made a few points

#
if (entity instanceof LivingEntity && !(entity instanceof ArmorStand))
Because armorstands count as living entities
So if its a living entity and not an armor stand you pull it
Oh also make sure you cannot pull yourself
Btw you need to teleport mobs slowly towards middle, applying velocity is not a good idea
Because friction in minecraft is infinite if the applied vector is 100% horizontal and the mob is on a block i believe
Atleast when applying a vector on a player
So you need to teleport slowly towards the middle
In order to teleport slowly towards the middle you can use vectors from bukkit 
Vectors are basically objects which contain 3 integers: x, y, z
What you can do is take the block gyro was used on
Take its location
Convert it to a vector
And then subtract from it transformed location of an entity to a vector
This way you get a vector representing a line from entity towards the middle of gyro formation
Then you can use a normalize function on a vector which makes it so the angle of the vector line stays the same but its length is reduced to 1
Then multiply it by the distance you want the vector to have
And then every 5 ticks or whatever amount you want just teleport the entity by the amount of blocks this vector has```
#
multiply the vector by Math.max(length, x) where length is the length of the original vector between middle and entity and x is the number you normally want to multiply by
otherwise the entity may skip the middle```
errant narwhal
#

hmm

#

how to refresh inventory player?

#

i have using player.updateInventory() but not working

drowsy helm
#

is your item not showing?\

slim brook
#

Hello guys, someone know why i have this when i remove an object from my list Task #38 for NefarionEvent v1.0 generated an exception java.util.ConcurrentModificationException: null at java.util.ArrayList.forEach(ArrayList.java:1513) ~[?:?] at fr.snapcoze.plugins.nefarionevent.tasks.TaskCooldown.run(TaskCooldown.java:20) ~[?:?] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot.jar:git-Spigot-21fe707-741a1bd] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [spigot.jar:git-Spigot-21fe707-741a1bd] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [spigot.jar:git-Spigot-21fe707-741a1bd] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-21fe707-741a1bd] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-21fe707-741a1bd] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-21fe707-741a1bd] at java.lang.Thread.run(Thread.java:833) [?:?] ?

tardy delta
#

saving user in json be like

tardy delta
slim brook
#

So i need use an for I ?

tardy delta
#

could you show your code

warm dagger
#

what is the latest version of the spigot api is it 1.19.2-R0.1-SNAPSHOT or 1.19.1-R0.1-SNAPSHOT?

tardy delta
#

maybe you could use an ArrayList::removeIf

slim brook
#
    public void run() {
        if (!plugin.getItemCooldowns().isEmpty()) {
            plugin.getLogger().info("isEmpty");
            plugin.getItemCooldowns().forEach(itemCooldown -> {
                plugin.getLogger().info("itemCooldown");
                if (itemCooldown.getTimeCooldown() <= 0) {
                    plugin.getLogger().info("if");
                    plugin.getItemCooldowns().remove(itemCooldown);
                } else {
                    plugin.getLogger().info("else");
                    int i = itemCooldown.getTimeCooldown() - 1;
                    itemCooldown.setTimeCooldown(i);
                }
            });
//            for (Iterator<ItemCooldown> it = plugin.getItemCooldowns().iterator(); it.hasNext(); ) {
//                Iterator<ItemCooldown> itemCooldownIterator = it.next();
//            }
        }
    }```
tardy delta
#

in this way it seems better to use an iterator

slim brook
#

k will try it 😉

#

Thx

eternal night
#

removeIf crying

slim brook
#

The error disappeared

tardy delta
eternal night
#

what ?

tardy delta
#

itemmeta has pdc

#

assuming getItemInHand returns an ItemStack

oblique geyser
#

Hey How Can I create sub commands?

tardy delta
#

plain api i guess

#

if you wanted to make something like /shop open then create a shop command and in the onCommand method of it, check if the args.length == 1 && args[0].equals("open")

eternal oxide
#

oops there FB

tardy delta
#

?

eternal oxide
#

shop is the command, its not in args

tardy delta
#

ah i meant "open"

eternal oxide
#

so length == 1

#

and args[0]

tardy delta
#

fuck

#

im using acf for too long

#

really thought args.length would return the size lmfao

eternal oxide
#

I have never use any framework. Just didn;t see the point

oblique geyser
eternal oxide
#

in teh TabCompleter you simply check args.length

oblique geyser
#

it's not any other method

eternal oxide
#

return a List of all acceptable options

oblique geyser
tardy delta
tardy delta
#

then use some kind of command framework if thats the problem?

oblique geyser
#

it's difficult to read a code with a lot of if or switch cases

#

Do u know some framework?

eternal oxide
#

then store a Map of String subCommand, Consumer

tardy delta
#

i ended up doing that

oblique geyser
#

that's a good idea

#

thanks

tardy delta
#

anyways, anyone who uses acf and knows what @Flags is for? i thought it was to tell the framework how to obtain some kind of object, like
void command(Player sender, @Flags("data") UserData data)

commandManager.getCommandContexts().registerContext(UserData.class, context -> {
  User user = userMap.get(context.getPlayer().getUniqueId());
  return user.getData();
});```
arctic moth
tardy delta
#

immutable list ig

arctic moth
#

oh

#

idk how it would be immutable

tardy delta
#

the descrription

arctic moth
#

oh

#

so would i just do List.of() or smth like that

#

nvm im stupid

#

just new ArrayList<>(); and add it

tardy delta
#

i'd just use Arrays.asList for the description and the rarity

#

hoping bukkit doesnt expect an mutable list as lore

ivory sleet
#

nope

#

It just reads it iirc

arctic moth
#

anyone know how im getting "Index 29696 out of bounds for length 172" in maven? (its after adding the shade plugin, the dependencies weren't being found) https://paste.md-5.net/semogurina.xml

tardy delta
#

hmm hate it when my old code starts to put a knife in my back

arctic moth
#

?

#

what happened

#

or is that a joke about my issue lol

tardy delta
#

aah gson moment

arctic moth
#

oh lol

tardy delta
#

no i wont make it mutable

onyx fjord
#

how did you check if command sender is console

arctic moth
#

i noticed that these poms are still missing for whatever reason

#

my pom is very broken

arctic moth
tardy delta
arctic moth
#

nice

#

consone

tardy delta
#

!player could be rcon too

#

or commandblock

eternal night
#

upgrade your maven shade plugin

#

I don't think I ever saw 2.1 😂

arctic moth
#

lol

#

whats the latest version

tardy delta
#

3.3.0 if im correct with maven-shade-pluginhttps://mvnrepository.com/artifact/org.apache.maven.plugins/maven-shade-plugin

eternal night
#

3.8.1 I wanna say ? or 3.10

#

lemme check

tardy delta
#

:o

eternal night
#

3.3.0

#

yes

#

3.10 is compiler then ?

#

indeed it is

arctic moth
#

omfg i hate this why does it exist i have to restart my ide every time to get rid of the caches like it works without the jar so i genuinely do not care Failure to find net.dv8tion:JDA:jar:4.3.0_293 in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigot-repo has elapsed or updates are forced

tardy delta
#

lol

arctic moth
#

like why tf did they have to add that

#

now i have to wait like 10 seconds for my ide to restart

arctic moth
eternal night
#

It looks in any repo

#

Until it finds it

arctic moth
#

oh

#

yes ik how to spell oh

eternal night
#

How would it know what repo your stuff is in

#

Lol

arctic moth
#

idk, they never provided any repo

#

it should be automatically added from essentialsx but it doesnt for whatever reason

#

bc it cant find the pom

tardy delta
#

lets write another deserializer smh

eternal night
#

I have doubts

#

Unless they are in maven central

arctic moth
#

at least thats what the gradle import says

sterile token
tardy delta
dull whale
#

how to make client side entity invincible

tardy delta
#

invulnerable?

arctic moth
#

it also happens with bstats

#

another thing used by essentialsx

#

that didnt actually work

tardy delta
#

it has?