#help-development

1 messages · Page 2129 of 1

echo basalt
#

you can wipe the pathfinders to make it braindead

rich inlet
#

How?

echo basalt
#

Every EntityInsentient has 2 pathfinder controllers

#

one for movement and one for attack IIRC

#

they're basically a fancy list<WrappedPathfinderGoal> which consists of:

  • The pathfindergoal
  • The priority
#

so yeah just wipe that list

rich inlet
#

Okay, i will try, thanks

rugged cargo
#

if i wanted to save a list of items to an items nbt, how might i go about doing that?

#

store an entry for each slot, and give it a value as to what is in it?

#

im used to having compoundNBT but that's not in spigot

rich inlet
echo basalt
#

try it and see

rich inlet
#

Okay :D

#

Does work, thanks!!

coarse finch
#

@chrome beacon any idea how to make the command switching work

rugged cargo
#

for item storage i can think of using persistant data with each slot having an entry. could be a thing i could do

#

also is there any downsides to using persistant data containers?

midnight shore
#

Use mfnalex’s API for data types .. there is an ItemStack_Array data tyle

fleet pier
#

maybe check for your uniqueid instead

crimson scarab
#

how do i use the filter function on get nearby entites

rugged cargo
maiden acorn
#

hi folks! looking to get a concept of the resources people use when developing plugins... I know for Forge Mods it's pretty typical for mod authors to use some standard libraries written by others... outside of the Spigot API itself, are there "plugin libraries" that are commonly used? or do most people build everything from scratch?

hexed hatch
#

Packet libraries such as ProtocolLib use is commonplace because working with packets is miserable

crimson scarab
#
    @EventHandler
    public void onRightClickAxe(PlayerInteractEvent event)  {
        if (event.getAction() == Action.RIGHT_CLICK_AIR && event.getPlayer().getInventory().getItemInMainHand().getType() == Material.STICK) {
            List<Entity> entList = event.getPlayer().getNearbyEntities(30, 10, 30);
            if (entList.size() >= 1) {
                for (int i = 0; i < entList.size(); i++) {
                    entList.get(i).getVelocity().add(new Vector(0, 10, 0));
                }
            }


        }
    }
#

any ideas why this isn't worknig

kindred valley
#

how can i remove spawning items on essentials

rugged cargo
kindred valley
#

sword axe pickaxe

crimson scarab
rugged cargo
#

seems like it. but are you sure?

crimson scarab
#

well im pretty sure because when i do entlist.get(i) i can perform various entity operations intelijsense lets me atleast

rugged cargo
#

i meant what it actually gives you. try logging the list

#

entList.size() could be zero for all we know, but if its not then you know what your problem isn't.

crimson scarab
#

this is the result of printing the list

rugged cargo
#

ok, perfect. narrowed that down

#

maybe applying velocity in that manner isn't right?

crimson scarab
#

i think your right

#

lemme try some operation on the entites to see if its just the velocity

rugged cargo
#

sounds good.

crimson scarab
#

yes i can do that

rugged cargo
#

so it works fine now?

crimson scarab
#

no change

worldly ingot
#

getVelocity().add() doesn't do anything.

crimson scarab
#

no errors just has no effect

worldly ingot
#

You want to get velocity, change it, and setVelocity()

#
Vector velocity = entity.getVelocity();
velocity.setY(velocity.getY() + 10);
entity.setVelocity(velocity);
rugged cargo
#

i guess getVelocity() gives a copy. the more you know

worldly ingot
#

It does, yes

#

A good chunk of things in Bukkit will give you clones

hexed hatch
rugged cargo
#

in general, i can't seem to get my head around when you get a reference vs when you get a copy. lol

ivory sleet
#

usually when there's a set method as well, thats the sign

rugged cargo
#

the sign of a copy getter, i see. sort of, but i meant more on a java level

ivory sleet
#

yeah

rugged cargo
#

ill go search around. got something to look up now :)

ivory sleet
#

if you have a setter along with a getter that usually means the getter provides a context/snapshot object

#

if not, then it probably implies that getter returns a modifable (or sometimes unmodifiable) view

rugged cargo
#

i think ive seen the context before.. huh

#

ok

worldly ingot
#

Well-written Javadocs tend to state whether or not its mutable, immutable, or a copy

ivory sleet
#

that too

worldly ingot
#

In this case it doesn't, getVelocity() is very old (probably 11 years old at this point). Though most modern methods will state mutability

rugged cargo
#

hm. ok, i guess a method as simple as getVelocity() doesn't need to change too often, so the docs don't get updated. interesting.

#

so this extra nbt type is cool, but the toString is lackluster at best

#

contents=[B;-84B,-19B,0B,5B]

#

what does that even mean

worldly ingot
#

B = byte presumably

#

The first entry in that array is just denoting array type, suffixes on the numbers reinforcing that

#

Minecraft does something similar. Their array types are zero-indexed with type. e.g. UUIDs are stored with [I; first_int, second_int, third_int, fourth_int]

#

iirc

rugged cargo
#

hmm. ok, so its printing the bytes of the itemstacks. oh yeah thats supposed to be an array of itemstacks

#
container.set(new NamespacedKey(SpigotTools.getPlugin(), "contents"), DataType.ITEM_STACK_ARRAY, holder.getInventory().getContents());`

...
PersistentDataContainer container = backpackItem.getItemMeta().getPersistentDataContainer();
inventory.setContents(container.get(new NamespacedKey(SpigotTools.getPlugin(), "contents"), DataType.ITEM_STACK_ARRAY));```
#

i don't know what good pasting this here does, but whatever

crimson scarab
#

how can i add a entity to a list

#

nvm

#

actually no how do i define a list 😢

echo basalt
worldly ingot
#

I dunno. Blame Mojang

#

It was a weird decision on their part

worldly ingot
echo basalt
#

mojang doing some weird things to represent uuids

#

reinventing the wheel

#

presumably segmenting the long's bits into 2 ints?

rugged cargo
#

why not use a long long at that point? do it all in one variable. lol

ivory sleet
#

they use 2 longs in some parts actually

echo basalt
#

huh

ivory sleet
#

but yeah not everywhere

#

I believe for the optional uuid for entity data sync 2 longs are used

#

?services @uneven dock

undone axleBOT
uneven dock
#

Well, guess I can't post there... I have never posted on the Spigot forums in the like 5 years I've had the account 🤣 Thanks anyways

worldly ingot
rugged cargo
#

oh... thatll do it

#

what happened to compoundNbt?

worldly ingot
#

Nothing. It still exists. Just depends on what mappings you're using

#

If you're using Mojmaps, it's CompoundNBT. If you're using CraftBukkit mappings, it's NBTTagCompound

rugged cargo
#

hm. i have neither one of those it appears. investigation time

worldly ingot
#

Suppose it depends on the .jar you're depending on as well. The one provided by BuildTools is a bundler jar so it doesn't have any NMS in it

rugged cargo
#

i think i used the intellij plugin for this one

worldly ingot
#

Mmm. Don't know how that one works and what it depends on

rugged cargo
#

could i find which jar i depend on in the pom.xml?

worldly ingot
#

Presumably, yeah

#

If it ends in -api, NMS isn't present

rugged cargo
#

spigot-api?

worldly ingot
#

If you've run BuildTools for that version, you can remove -api and it should pull from your local Maven repo

#

Yeah

rugged cargo
#

alright, well thatll do it

#

ill look into the build-tools thing

#

dont think i did that

worldly ingot
#

?bt

undone axleBOT
worldly ingot
#

Bear in mind that only the names of classes are CB mapped. Method names are pretty much entirely lost. There's some info on that on the forums to use Mojmaps if you want. Sec

rugged cargo
#

so changing to spigot-api ill lose a bunch of information about spigot methods?

worldly ingot
#

No no, I mean just NMS

#

spigot-api contains just API classes from Bukkit and Spigot

rugged cargo
#

derp i mean spigot

worldly ingot
#

spigot includes Bukkit, Spigot API, CraftBukkit, Spigot Server, NMS, and all its dependencies

rugged cargo
#

i guess ill just try removing the -api and see if ive run build tools that way

fleet pier
#

you do you man

rugged cargo
#

well i got all the nbt stuff

rich inlet
#

Can someone explain to me what the three parameters in Player#getNearbyEntities(double, double, double) mean? Is it just the distance in X, Y and Z coordinates where it should look for near entities and not outside?

river oracle
#

how do you reverse the exponential growth equation trying to find the Y value from an X value and I haven't gone far enough in math for this shit

return (int)(baseCost*Math.pow((1.0+(increaseCostModifier/100.0)), sampleLevel));
hybrid spoke
#

like this?

river oracle
#

need the reverse of that equation instead of getting the Level value which would the in the Y position on the graph I need the X aka the Experience value. Its based off the exponential equation f(x) = a(1+r)^x I found a semi-reliable way with logarithms, but I couldn't nail anything down as I don't quite understand those mathmatical concepts

hybrid spoke
#

so like a formular to reverse the level to its experience form

river oracle
#

yes

#

any basic reversal of the a(1+r)^x exponential growth equation will work

#

I tried google but it was full of a bunch of people not knowing how to do an exponential growth problem not really what I need

hybrid spoke
#

wait i got confused. so rn you have the formular for level to experience but now you need the vice versa way

hybrid spoke
#

im shit in math as well

echo basalt
#

By doing pow(num/basecount - 1, 1/sampleLevel)

river oracle
#

afaik the propper way to do this would be a logarithmic

#

I'll probably keep looking because the logarithmic I had was only slightly off

slow thunder
#

Just a random question, is java better or kotlin?

vocal cloud
#

Whichever works better for you. At the end of the day it's java bytecode

river oracle
rugged cargo
#

ive found a promising thing about the MorePersistentDataTypes lib

#

when i save then load my array of ItemStacks, the loaded array is of the correct length

#

got it

#

yaay

arctic moth
#

how do i check if an armor stand's equipment is empty

#

besides individually checking every slot

worldly ingot
#

I mean... could get creative with ArrayUtils.isEmpty(armorStand.getEquipment().getArmorContents())

#

Though I don't think that checks hand slots

arctic moth
#

sure

#

it didnt owrk

#

even on normal armor stands

worldly ingot
#

I'd personally opt to just create a method

public static boolean hasNoEquipment(ArmorStand armorStand) {
    EntityEquipment equipment = armorStand.getEquipment();

    for (EquipmentSlot slot : EquipmentSlot.values()) {
        ItemStack item = equipment.getItem(slot);
        if (item != null || !item.getType().isAir()) {
            return false;
        }
    }

    return true;
}```
dusk flicker
#

wouldn't it be air, not empty?

worldly ingot
#

No. getArmorContents() returns null in slots with no armor

dusk flicker
#

ah

worldly ingot
#

Bukkit inventories are very inconsistent

#

but using the method I wrote above would check for nullability and air

#

(I think getItem(EquipmentSlot) returns both lol)

worldly ingot
#

Then I probably wrote it wrong 😛

arctic moth
#

lol

worldly ingot
#

That or you're doing some other weird fuckery that is preventing it from being called

arctic moth
#

its not that

#

it gets called

#

i did debugging with the log method

rugged cargo
#

can you cast an ItemStack[] to an Inventory? since Inventory extends Iterable<ItemStack> or is that not allowed?

#

that would be a no

sweet pike
#

is there any documentation available for LightAPI? i'm trying to workout how to make an object 'glow' (have the light move with them, and with this, also set the light level to 0)

arctic moth
#

lol mc make good code?

#

literally doing /summon item is an uncaught exception

dusk flicker
#

fun but might also be fixed

#

considering you are a: on a fork, b: 1.18.1

rugged cargo
#

no i don't unfortunately, but i do know thats something im going to end up needing someday :)

#

i'd assume you'd just use the api with the player's location in a PlayerMove event or something though

#

right. well i think that api physically changes the data of the blocks somehow

#

so its not actually setting light "sources". it more like simulating them in a way. i doont understand it well enough to say 100% though

arctic moth
#

how would i update the block after cancelling BlockFromToEvent

#

trying to make it not work at certain times, but work after

rugged cargo
#

i feel like a queue data structure would be useful for this. not sure though

arctic moth
#

lol im making an antilag plugin but when i try to test this thing that triggers at low tps, i cant even get the tps to lower

#

ive tried everything

#

like all the types of lag machines

delicate lynx
#

antilag plugins are placebo

arctic moth
#

ik

#

how do i get tps

#

the nms method is deprecated

maiden acorn
#

what do folks usually use for the backing DB for their plugin? spigot doesn't provide like an sqlite or anything, right?

dusk flicker
#

it does sqlite afaik

#

but you really arent limited, you can just get drivers / add dependencies

maiden acorn
#

I'm sorry, I'm confused

#

ah

#

the edit made sense

dusk flicker
#

Lol just saw my mistake

maiden acorn
#

I'd rather just use sqlite provided by spigot if it's built in... do you know of any good examples of that use?

dusk flicker
#

just found that off of a google seartch

arctic moth
#

what does the "cannot resolve method" error mean

#

ive invalidated caches and restarted intellij, still there

#
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>text-api</artifactId>
            <version>3.0.4</version>
        </dependency>
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>text-adapter-bukkit</artifactId>
            <version>3.0.6</version>
        </dependency>
#

they didnt provide a shade, but the thing is only happening with the TextDecoration enum

#

nvm im dumb

delicate lynx
#

it's okay, we are all dumb somtimes

#

I still would share those 2 dependencies

maiden acorn
#

does anyone know the best way to force the player's client to reload an entire chunk?

arctic moth
#

anyways, how do i get the key for an environment/world?

#

like minecraft:the_end

summer scroll
#

Is there any alternatives to check player is on ground? I just read that on the javadocs Player#isOnGround is deprecated and I just want to know If there are any alternatives.

quasi stratus
#

Can one load .json loot_table files into a plugin?

vocal cloud
#

Could you? Yes. For what purpose that a regular config wouldn't suffice? Idk

quasi stratus
#

I have a datapack with pretty complex loot tables pre-made that I'd just like to load into my plugin.

spare marsh
#

Quick question as a begginer. How do I create a maven dependency? Like for example from my github or something...

quasi stratus
vocal cloud
vocal cloud
spare marsh
#

I've looked but get lost I don't find a clear answer.

kindred valley
#

hello i have an api but i dont know how to get its dependency

#

on maven

quasi stratus
#

Is there any way to get the NBT data (for custom NBT usage) of an ItemStack? If so, how would I accomplish this?

kindred valley
#

how can i set an items durability on 1.16.5

golden kelp
#

I think u should use the Damageable class

quaint mantle
#

how can I make it like it gives the helm to a specific player
like /spacehelm <player>
for exmaple - /spacehelm lol123
anyone can help me?

earnest forum
#

check if the Bukkit.getPlayer(arg) is null

#

where arg is the first argument

#

if it is null that means its not a real player

#

if it isnt then it is a player

quaint mantle
#

huh

#

me? or?

earnest forum
#

yeah

#

do you know how to do args?

river oracle
#

?learnjava

undone axleBOT
river oracle
#

It's an array

quaint mantle
# earnest forum yeah
  if (args.length >= 1){

            String playerName = args[0];
            Player targetPlayer = Bukkit.getPlayer(playerName);

            return true;
        }
earnest forum
#

check if targetplayer is null

#

because its nullable

quaint mantle
#

hoe?

#

*how?

earnest forum
#

if u put in a wrong name

#

targetPlayer == null

#

this is basic stuff

quaint mantle
#

so I add the code?

earnest forum
#

if (targetPlayer == null)

quaint mantle
#

so now

#

if I do /spacehelm <player>

#

it will give the helm to that player?

earnest forum
#

not with just that code

#

please just learn how to make basic plugins

#

plenty of youtube tutorials

#

and then come ask us how to make specific stuff

river oracle
#

You need to learn Java arrays before you continue

quaint mantle
earnest forum
#

coded red

#

i learnt off him

quaint mantle
#

but

#

like which video?

earnest forum
#

i think in his command video he shows how to give items

#

to players

quiet ice
#

If the quality of YT Tutorials are still as Bad as I remember them I would Not bother

earnest forum
#

atleast u learn the basics

granite owl
#

whats the reason for PlayerPreLoginEvent being deprecated?

chrome beacon
#

Read the deprecation note

granite owl
#

is it possible to open a custom prompt like the resource pack one?

#

could also be a resource pack prompt in disguise, i just need the option for a forced yes/no dialogue box

dark arrow
#

can we set position of blocsk

earnest forum
#

with clickable text kinda like how hypixel does it

granite owl
#

yea but then i could also just make a custom UI for that purpose

#

i was looking for the ability to force a simple yes no button prompt tho

crimson terrace
midnight shore
#

Does anyone have a good tutorial for MongoDB and Spigot

rotund pond
#

Hello !
I have a little Java question:
If I do something like

Material.valueOf("ITDOESNTEXIST");

What will it return ? "null" ? Or will it handle this error by himself ?
Ty

earnest forum
#

probably null

crimson terrace
#

valueOf() throws an illegal argument exception when the name does not exist i believe

#

hover over the method and read the doc

rotund pond
#

Ah, I've forgot this feature, ty !

crimson terrace
#

np

digital hazel
#

Hello. Does anyone know why my dependency not working? I want to use NMS.

digital hazel
#

It says this:

tender shard
#

np! Your problem was that you didn't run BuildTools. but please read the full blog post, because you definitly should use mojang mappings if you use 1.18 NMS, so yeah, it's all explained in the link I sent 🙂

hushed spindle
#

ive been stuck on this issue for a solid day now and i was wondering if anyone knew how to solve this

DROP PROCEDURE IF EXISTS addColumnToTable; 
CREATE PROCEDURE addColumnToTable() 
BEGIN 
  IF (NOT EXISTS( 
    SELECT NULL
      FROM INFORMATION_SCHEMA.COLUMNS
      WHERE table_name = 'tableName'
      AND table_schema = DATABASE()
      AND column_name = 'test') )
  THEN 
    (ALTER TABLE BANKS_PROFILES ADD COLUMN test SMALLINT DEFAULT 0;)
  END IF
END; 
CALL addColumnToTable();

i got this sql query to add a column to a table if the column doesn't exist, but I get a syntax exception at the ALTER TABLE line and i really can't tell what's wrong with it

#

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ALTER TABLE tableName ADD COLUMN test SMALLINT DEFAULT 0' at line 9
here's the error, not really helpful

#

i know there's a simpler query available for mariadb, which works, but i'd like this query to work for mysql in general for accessibility

digital hazel
tender shard
digital hazel
tender shard
#

?bt

undone axleBOT
tender shard
#

download buildtools, then put it into some folder

#

then go into that folder and run

java -jar BuildTools.jar --rev 1.18.2 --remapped
tender shard
digital hazel
#

okay

tender shard
#

?ask

undone axleBOT
#

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

lusty magnet
quiet ice
#

Just decompile it yourself

#

Otherwise, BT also decompiles mc for patching, you can use that. But there isn't really a neat automated way of getting the decompiled version

#

Though given that spigot only uses a lightly patched fernflower, it is more advisable to use your own decompiler

lusty magnet
#

so BT just give me the source code for the patch, am I right?

quiet ice
#

It probably does not do it automatically, you will likely need to configure your IDE to use the source

#

And at that point, I recommend using a decompiler that produces "nicer" output like forgeflower or quiltflower

lusty magnet
#

damn that's quite an info

#

Thank you guys! much appreciated

quiet ice
#

Also if you are using intelliJ your IDE should automatically decompile classes with no attached source

lusty magnet
quiet ice
#

For eclipse you'll need to have the decompiler plugin and it isn't that great to be honest

golden kelp
#

eclipse needs a ton of extensions to match with intellij

#

not even a proper projetc wizard

quiet ice
#

I generally prefer using Recaf over it - it is much nicer

granite owl
#

if i tempban a player using the banlist java Bukkit.getBanList(Type.NAME).addBan(p.getName(), banReason, banTime, ((sender instanceof Player) ? ((Player)sender).getName() : "Console")); and that player logs in first time after the ban expired, there is a null error like ```txt
07.05 09:22:13 [Server] INFO java.lang.NullPointerException: Cannot invoke "net.minecraft.server.players.GameProfileBanEntry.f()" because the return value of "net.minecraft.server.players.GameProfileBanList.b(Object)" is null

#

p is an instance of OfflinePlayer that is prior confirmed to be existing

#

reason and time are parsed correctly

digital hazel
#

And I don't know if it is okay

quiet ice
granite owl
#

JDK 17

#
[
  {
    "uuid": "25ec173a-0c50-4bd9-848f-67676b531533",
    "name": "TheTimeee",
    "created": "2022-05-07 09:21:35 +0000",
    "source": "TheTimeee",
    "expires": "2022-05-07 09:21:45 +0000",
    "reason": "Because that"
  }
]
```just to confirm whats in the banfile
digital hazel
quiet ice
#

Also if you are using the git CLI, make sure to reconfigure git afterwards, buildtools is a bit stupid and overrides your git config

granite owl
#

hm?

spare prism
#

Hello. Why doesn't this method find a command? It exists on the server.

    public static void initializeCommandDistances() {
        for(String command : Main.getInstance().getConfig().getConfigurationSection("Commands").getKeys(false)) {
            PluginCommand cmd = Bukkit.getPluginCommand(command);
            if(cmd != null) {
                double distance = Main.getInstance().getConfig().getDouble("Commands." + command + ".Distance");
                int targetArgumentNumber = Main.getInstance().getConfig().getInt("Commands." + command + ".TargetArgumentNumber");
                if(targetArgumentNumber <= 0) targetArgumentNumber = 1;
                commandDistances.put(cmd, new CommandParameters(distance, targetArgumentNumber));
            } else {
                Main.getInstance().getLogger().warning("Couldn't find the command with the name " + command + ". Skipping it...");
            }
        }
        System.out.println("commands: " + commandDistances);
    }

Output:

[12:35:18 INFO]: [CommandDistance] Enabling CommandDistance v1.0
[12:35:18 WARN]: [CommandDistance] Couldn't find the command with the name ru. Skipping it...
[12:35:18 INFO]: [CommandDistance] commands: {}
harsh totem
#

how do you kill every entity of 1 type like /kill @e[type= pig]

harsh totem
#

or the main

quaint mantle
#

that's what I do 👀

harsh totem
quaint mantle
#

...?

spare prism
#

I can use it on the server

harsh totem
# quaint mantle ...?

i meant how to make my spigot plugin kill every entity of 1 type but not the vanila command

quaint mantle
#

oh

spare prism
#

And save it to a Map

somber hull
#

Are you getting a command from your plugin

#

Or external plugin

spare prism
#

No

#

External

somber hull
#

Shouldn’t matter but that could be it

#

Lemme check the docs

spare prism
#

ok

midnight shore
somber hull
#

There’s some weird finicky stuff like that

#

Sometime

somber hull
#

Oh

#

Wait

#

I’m dum

#

Idk

#

Loon througb every entity

#

Check if ping

#

Pig

#

@spare prism

#

Make some checks

#

Have them print stuff to the console

#

See where exactly the problem is

#

Cause it could find the command

midnight shore
#

for(World w : Bukkit.getLoadedWorlds()){
for(Entity ent : w.getEntities()){
if (ent instanceof Pig){
ent.remove();
}
}
}

somber hull
#

But one of your checks could be wrong

spare prism
somber hull
#

L

#

That took me like a whole day to fix

#

I don’t remember how

#

I think I just had to update my java version or something

#

Make sure the java version you are using on your computer

#

Is the same java version your using in IntelliJ

#

For your project

mighty pier
#
        Player p = (Player) e.getWhoClicked();
        if (!e.getInventory().getName().equalsIgnoreCase("Kits")) return;
        e.setCancelled(true);
        p.sendMessage("1");
        if (e.getCursor().getType().equals(Material.STAINED_GLASS_PANE)) return;
        p.sendMessage("2");
        String itemname = e.getCursor().getItemMeta().getDisplayName();
        String kitname = itemname.replace("§d§lKit ", "");
        p.sendMessage(kitname);
    }``` it sends 1 and 2 but it doesnt send the kitname
somber hull
#

Any errors?

spare prism
# somber hull But one of your checks could be wrong
[12:54:37 INFO]: [CommandDistance] Enabling CommandDistance v1.0
[12:54:37 INFO]: [CommandDistance] cmd: null
[12:54:37 WARN]: [CommandDistance] Couldn't find the command with the name ru. Skipping it...
[12:54:37 INFO]: [CommandDistance] commands: {}
midnight shore
#

this is the one i have in intellih

spare prism
midnight shore
somber hull
#

Does it worn then

spare prism
#

ok

mighty pier
harsh totem
#

can I make my plugin use a vanila command through the console?

somber hull
mighty pier
#

String kitname is line 18

somber hull
#

?paste

undone axleBOT
mighty pier
spare prism
somber hull
#

One sec @harsh totem

somber hull
midnight shore
#

is that the same?

spare prism
# somber hull I’ll figure out how to find aliases in a sec

It's the basic command now:

[12:57:11 INFO]: [CommandDistance] Enabling CommandDistance v1.0
[12:57:11 INFO]: [CommandDistance] cmd: null
[12:57:11 WARN]: [CommandDistance] Couldn't find the command with the name rankup. Skipping it...
[12:57:11 INFO]: [CommandDistance] commands: {}
somber hull
dark arrow
#

how to get higest possibley blocks

midnight shore
somber hull
somber hull
#

@midnight shore what version are you using

somber hull
spare prism
somber hull
midnight shore
dark arrow
somber hull
midnight shore
#

1.17 server version

somber hull
#

Then idk what to tell you

#

It took a lot for me to@fox it

#

Fox

#

Fox

#

Fix

#

Try uninstalling other java versions

#

I did that

#

Idk how tho

#

It was a while ago

#

Look it up

midnight shore
#

i only have that version 😐

spare prism
somber hull
somber hull
#

?paste

undone axleBOT
midnight shore
#

like it the class doesn't exist

#

but it does

supple elk
#

I'm making a minigame map system, and I have an abstract class for a game type, e.g. skywars. I have a class, GameMap, which loads a world from storage. For each type of game however I want to extend this GameMap class, to store specific information needed. For example, for skywars I may need to store a list of possible chest locations as well as player spawning positions, where as it will be different information for each map for a different type of game

somber hull
#

I was thinking of a similar one

#

But that’s class version

supple elk
#

The question is that if all my game types extend some abstract game type, how do I make it so that they'll only take the specific type of map?

somber hull
#

Are you using any frameworks @midnight shore

supple elk
#

an example abstract type

midnight shore
#

sorry ... : (

somber hull
supple elk
somber hull
#

Are you using anyone else’s code ig

midnight shore
quiet ice
#

Generics

supple elk
# supple elk

and for a boat racing game I only want to take BoatMaps rather that any map

midnight shore
#

i have the maven dependency

#

in the IDEA i get no error

somber hull
somber hull
#

You want to have a way to make sure that the map is the subtype that you want?

#

Like instanceof?

midnight shore
somber hull
#

Send the error again

midnight shore
supple elk
#

so I want to make it so that a Boat racing game has to take a sub-class of GameMap in the method

#

specific to that type of game

quiet ice
#
abstract class X<T extends GameMap> {
 public abstract void startGame(T map);
class Z extends X<BoatMap> {
public void startGame(BoatMap map)
somber hull
#

Ye you need to shade the mongodb dependency @midnight shore

#

Idk I’m on mobile

#

And can’t show you rn

#

Also it’s 3 am

somber hull
#

Look it up

midnight shore
#

so i have to put the jar file?

somber hull
#

Shouldn’t be too hard

somber hull
somber hull
#

You have to add another thing to your Pom.xml

#

I just don’t wanna go and find it rn

#

Mongodb probably has a tutorial

somber hull
#

I think that’s got your answer

#

Idk why what your doing isn’t working

#

@spare prism

#

Actually

#

Bukkit.getCommandAliases

#

Then get the key being your main command

#

Only@problem

prime kraken
#

Hello team ! I have this error : java.lang.NoClassDefFoundError: org/bson/conversions/Bson do you know how to solve this ?

somber hull
#

Is you don’t actually get slides with that

somber hull
#

What*

prime kraken
#

Mongo*

somber hull
#

Did you shade mongo

#

Or vault

#

Idk if vault needs shading

prime kraken
spare prism
somber hull
granite owl
#

why do tempbans result in a null error unless i get the ban entry in the AsyncPlayerPreLoginEvent event first?

prime kraken
midnight shore
granite owl
#

@somber hull got a few secs?

granite owl
#

^^

somber hull
somber hull
midnight shore
granite owl
#

if i tempban a player using the banlist

somber hull
#

Like

#

Do you have any other dependencies

midnight shore
somber hull
#

Bro says yes and leaves

#

Anyway I have to go to sleep

#

Goodnight

midnight shore
golden kelp
#

why dont u just share the pom

dark arrow
#

how can i create a custom mobs with its speacial armor and summon it on a specific command

golden kelp
#

special armour?

#

and wdym custom mobs

#

u can only change the names of minecraft mobs and show them or the max, change their texture

dark arrow
#

with custom amour and tools

golden kelp
#

Custom Armour?

left swift
#

Is it good idea to create the maven/gradle dependency only for personal use? I want to use some same classes in the multiple projects, but idk what will be the best way.

earnest forum
#

you can give them tools armour

#

and even custom pathfinding

supple elk
#

@quiet ice

#

feels like my generics may be becoming slightly complicated lol

quiet ice
#

Still is rather okay, 3 or more generic types are more than normal

left swift
# golden kelp yea id do that

ok, so how can I use normal java project as the dependency? I heard about jitpack and nexus, but I don't get it how it works.

cerulean jasper
#

when using ProcessBuilder, what is the default directory on Ubuntu/Linux? system default directory or location of Spigot/Paper jar?

#

I basically wanna go into my plugins folder and access a file

dark arrow
#

how can i remove a plyer from a list after a certain time

misty current
#

use a scheduler

dark arrow
#

i have createa a class

#

but i dont know

#

how can i use the list to that class

golden kelp
#

?learnjava

undone axleBOT
golden kelp
#

by learning java ^

misty current
#

does anyone know how can I display a line below an entity's name using packets?

#

i can't really use the api since i'm working on npcs

#

i know you are supposed to send scoreboard packets but i'm not having much success

midnight shore
#

You can create an armor stand move it down a bit make it invisible give it a name

#

Or also an area effect cloud

misty current
#

if you do it that way, i would have to teleport the entity if the npc moves and if the server lags it would desync pretty badly and also there is not enough space between the npc's name and head

midnight shore
#

You can also use scoreboards but that would implicate that you only add one line

#

Just make the name itself an armor stand so you can move it up and down

misty current
#
private void setBelowNameLine(int value, String string) {
    ScoreboardObjective objective = new ScoreboardObjective(NMSHelper.getNMSScoreboard(), string, IScoreboardCriteria.b);
    // 2 is belowName
    NMSHelper.getNMSScoreboard().setDisplaySlot(2, objective);
    ScoreboardScore score = new ScoreboardScore(NMSHelper.getNMSScoreboard(), objective, entity.getName());

    PacketUtils.playPacket(new PacketPlayOutScoreboardObjective(objective, 2), canSee);
    PacketUtils.playPacket(new PacketPlayOutScoreboardDisplayObjective(value, objective), canSee);
    PacketUtils.playPacket(new PacketPlayOutScoreboardScore(score), canSee);
}
#

that's the code i wrote

#

i just need a single line below the name

midnight shore
#

It should work shouldn’t it?

#

It seems quite right

misty current
#

NMSHelper.getNMSScoreboard() just returns the nms version of the main scoreboard and playpacket just sends the packet to every entity in canSee (canSee is a list)

#

im quite confused indeed

faint harbor
#

Does anyone know how to get a list of the advancements a player has?

midnight shore
thorny mountain
#

Hi I can make fork of bukkit with changes from spigot or paper?

dark arrow
chrome beacon
thorny mountain
#

With my additions

jolly glade
#

hello can anyone help me? I have this error!

/storage/emulated/0/PLUGIN/src/main/java/io/kettra/plugins/belly/Belly.java:[71,103] cannot find symbol
[ERROR]   symbol:   method isEmpty(org.bukkit.entity.Player)
[ERROR]   location: class io.kettra.plugins.belly.Belly

code:

for (Player p : Bukkit.getOnlinePlayers()) {
                 check.setString(1, p.getName());
			     ResultSet rs = check.executeQuery();
chrome beacon
#

it appears it can't find your isEmpty method

quaint mantle
#

does getData, setData include the durability of the item

grim ice
#

its still simple imo

grim ice
#

??

midnight shore
#

Now i get this error https://paste.md-5.net/yizoyenuvo.nginx and i have the dependencies directly into intellij idea into the global libraries ( i tried also normal libraries [same error]) could anyone help me?

harsh totem
#

When I add ingredients to a recipe like this recipe.setIngredient('N', Material.NETHERRACK); is there a way to make this ingredient be more than just 1 netherrack? like 32 or 64?

glossy venture
#

nah

midnight shore
#

i'm just becoming crazy

harsh totem
glossy venture
#

nope not using the bukkit recipe api

eternal oxide
#

in 1.8

eternal oxide
#

Orby already answered you

harsh totem
eternal oxide
#

If you want quantities you have to manually handle the matrix and crafting

#

he said no, and then not using the Bukkit API

karmic gate
#

Hey, I have such a problem that I did the check for available updates according to the tutorial. My current plugin version is 1.0.2, and when I check the version from the link (https://api.spigotmc.org/legacy/update.php?resource=), I can still see 1.0.

Can someone help with this?

glossy venture
#

never said i didnt know

#

oh

glossy venture
summer scroll
#

How can I detect if player collides with an entity?

quaint mantle
#

ty for helping me with the recents thing

#

one more thing

#

can I make it like the edition updates

#

after giving each player 1

#

?

golden kelp
summer scroll
summer scroll
safe notch
summer scroll
#

Simple loading and saving into a file configuration.

safe notch
#

^^

summer scroll
quaint mantle
#

any example?

lusty cipher
#

is there some way to make a specific Anvil not fall? For performance reasons I don't want to cancel the gravity event every few ticks, I want it to just never be considered to be able to fall.

golden kelp
#

Spawn a block and then change it to anvil i think, if there's any method to place with no update

shut solar
#

any idea what event fires when player clicks an item in their inventory? cuz InventoryClickEvent doesnt work for me

summer scroll
#

It's InventoryClickEvent

#

I don't get it why it doesn't work, show your code

shut solar
lusty cipher
summer scroll
shut solar
#

my other events work fine, its just this one

shut solar
summer scroll
lusty cipher
#

are you sure you registered the event and recompiled the plugin and properly restarted the server?

shut solar
#

bruh my other events in this same class work just fine

#

these work

#

and some others

summer scroll
#

idk then, but I can only assure you that you want to use InventoryClickEvent for that.

harsh totem
#

Sorry i misunderstood

jolly glade
crisp steeple
#

bro what

#

how do you even compile that

chrome beacon
#

Java can run on your phone without issues

#

It's quite easy if you're on Android

crisp steeple
#

really?

jolly glade
crisp steeple
#

that’s cool i guess

#

but like how do you actually test the plugin lol

jolly glade
chrome beacon
#

You can run Minecraft on your phone 🙂

crisp steeple
#

java edition?

chrome beacon
crisp steeple
#

never heard of this

jolly glade
#

Bedrock Also

#

I still can't fix my code :(

lusty cipher
chrome beacon
crisp steeple
#

welp apple is just cringe i guess

lusty cipher
#

use Geyser

jolly glade
#

For those who know how to program and study, you can do everything from your cell phone!

quaint mantle
lusty cipher
jolly glade
#

That's right?
for (Player p : Bukkit.getOnlinePlayers()) {

grim ice
#

yes

#

Still though that determination

#

people like you deserve a computer more than anyone imo

quasi patrol
#
              List<String> yrequests = DataManager.getFriendsConfig().getStringList(player.getUniqueId() + "_friendrequests");
                yrequests.remove(Bukkit.getOfflinePlayer(args[1]).getUniqueId());
                DataManager.getFriendsConfig().set(player.getUniqueId() + "_friendrequests", yrequests);
                DataManager.saveFriendsConfig();``` for some reason it isn't removing their UUID from the list. I ofc made sure the uuid id of the player I am trying to remove is actually in the list.
jolly glade
# grim ice yes

Ahh so the error here ,-, I don't know how to solve it ahhh hate

if (getConfig().isList(product + "commands")) {
					// Verificar se é necessário estar com o inventário vazio
					if (getConfig().getBoolean(product + "empty-inventory") && !(isEmpty(p))) {
					    
						p.sendMessage(getConfig().getString("msg-inv").replace('&', '§'));
						continue;
jolly glade
eternal oxide
#

you have no method with that signature

jolly glade
#

I removed the If it worked ,-, puts without an if

jolly glade
#

I couldn't solve

eternal oxide
#

You do not have a method called isEmpty which accepts a Player object

grim ice
#

You should learn english and java

#

you need both of these if you wanna code spigot plugins lol

crisp steeple
rough drift
crisp steeple
#

yes

summer scroll
#

How can I launch player upwards? I've tried this but nothing happened.
player.setVelocity(new Vector(0, 10, 0));

pine forge
#

hey, is there a way to set the worldborder color to i.e. yellow or orange or is it only possible to set red, green and blue?

hasty prawn
summer scroll
hasty prawn
#

Still too high

pine forge
#

try 1 or 2

hasty prawn
#

Even 2 is gonna be really fast

golden kelp
pine forge
#

Thatd be cool

#

How would i do that?

summer scroll
#

I want it fast anyway but let's try lowering the value.

golden kelp
pine forge
#

Only red, green and blue

#

Yellow or other colors dont seem to work

summer scroll
#

Bruh, I even tried 1 and it doesn't launch player upwards.

crisp steeple
#

are you sure that its even getting triggered at all?

#

whats your full code for it

summer scroll
#

I triggered it in PlayerInteractAtEntityEvent

crisp steeple
#

and you're sure that event is triggering?

#

add a print statement or something

summer scroll
#

But, when I do this, it works

Vector vector = caster.getLocation().getDirection().multiply(1.8);
vector.setY(7);
crisp steeple
#

well then just use that i guess

summer scroll
#

The thing is I only want to launch upwards, so I'll try to set the multiply to 0

#

Yeah not working, I need to add a little bit x and z too I guess.

crisp steeple
#

shouldnt have to

#

try just setting x and z to 0 instead of multiplying it by 0?

summer scroll
#

I've tried too with new Vector(0, 7, 0)

crisp steeple
#

try player.setVelocity(player.getVelocity().add(new Vector(0, 1, 0))) maybe

summer scroll
#

Okay found new progression, apparently I cannot cast it to other player.

#

So I have like an item skill when you left click to player, it will do something to the left clicked player.

echo basalt
#

bruh

#

This might help

#

legit just launches blocks and players up whenever you click with the item

summer scroll
#
player.setVelocity(new Vector(0, 7, 0));
target.setVelocity(new Vector(0, 7, 0)); // Doesn't work in this part
echo basalt
#

probably because your target is null or something

hexed hatch
#

Getting any errors?

#

If so, show us

summer scroll
#

It's not.

#

No errors

#

I have a guess

echo basalt
#

or your target has a NoAI tag or NoGravity associated to it

summer scroll
#

Is it possible the velocity is directly modified because the target is getting knockback?

hexed hatch
#

Yes

#

Exactly that

echo basalt
#

you can modify knockback too

#

cancel the event, apply the damage manually and calculate kb

summer scroll
#

Like I want to launch the target if the target got hit.

hexed hatch
#

Try instead of setting that velocity, get their current velocity and add the new vector to it, then set it

summer scroll
#

Alright, will try that.

hexed hatch
#

Using Vector#add of course

echo basalt
#

will likely not work given kb is set after the event

hexed hatch
#

yeah true

#

In what situation do you need to apply two velocities to one entity at the same time

summer scroll
#

Would delaying by 2 ticks or so will solve the problem?

hexed hatch
#

Sounds like you need to combine the two

#

Unless it explicitly needs to be a delayed action

summer scroll
#

Ah yes, delaying it by 2 ticks work

#

smh

#

thank yo so much guys for the help!

echo basalt
#

you can also do it within the same tick if you cancel the event, apply the damage and the modified knockback

summer scroll
#

sure, but I don't want to cancel the event

jolly glade
#

Error: Asynchronous command dispatch!

green prism
#

Guys, I was creating a plug-in of banknotes and I was looking for a way to recognize them since you can make an infinite amount of them by default from the config. Do you have any ideas? I was thinking about saving the PersistentDataContainer String in the item of the note but thinking about it, maybe generating a lot of banknotes would be a small problem with this?

summer scroll
green prism
#

I mean, if I generate 80000 items of banknote X, it'll generate also 80000 strings of pdc

#

I think that this could be a little problem in the future

misty current
#

how much do you think 100k strings weight in ram/disk compared to a single world's data

#

close to nothing

green prism
#

oh okay

#

thanks

misty current
#

np

mortal hare
#

what type of encoding do we use

misty current
#

i am aware that it is more complicated than how i said it but the point was that adding pdc to items is not a concern

ivory sleet
#
  • chances are that the JIT compiler + JVM can optimize it a bit by using the internal string pool for instance
mellow edge
#

code to make an knockback stick in spigot 1.8.8?

misty current
#

create itemstack

#

add enchant

#

give to player

mellow edge
#

nope

#

it doesn't work

ivory sleet
#

martin1000 I'm sorry to tell you but we rarely spoonfeed people here

#

however I can reassure you there are snippets on how to do this if you'd google that question of yours

mellow edge
#

look that is my code for now

#
window.setItem(23, new GUIItem(createEnchantedItem(Enchantment.KNOCKBACK, 1, new ItemStack(Material.STICK)), "Knockback stick", buyer(new ItemStack(Material.GOLD_INGOT, 5), createEnchantedItem(Enchantment.KNOCKBACK, 5, new ItemStack(Material.STICK)), p), ChatColor.GOLD + "5 gold ingots"));
#

and the exception:

safe notch
#

What Api is that even

misty current
#

^

ivory sleet
#

their own presumably

misty current
#

also all in a single line

mellow edge
#
Caused by: java.lang.IllegalArgumentException: Specified enchantment cannot be applied to this itemstack
        at org.bukkit.inventory.ItemStack.addEnchantment(ItemStack.java:440) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        at com.martin.shop.VillagerShop.createEnchantedItem(VillagerShop.java:98) ~[?:?]
        at com.martin.shop.VillagerShop.createWeapons(VillagerShop.java:93) ~[?:?]
        at com.martin.shop.VillagerShop.lambda$defaultLook$2(VillagerShop.java:48) ~[?:?]
        at com.martin.gui.GUIItem.invokeClick(GUIItem.java:30) ~[?:?]
        at com.martin.gui.GUIListener.onInventoryClick(GUIListener.java:23) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_322]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_322]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_322]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_322]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21
misty current
#

unreadable

mellow edge
#

my own

ivory sleet
#

and its just some functions

safe notch
#

Yea

mellow edge
#

but that is not the problem

ivory sleet
#

wouldnt call it an api but ye

#

you might wanna apply it as an unsafe enchantment

misty current
#

wherever you call the addenchantment method

#

change it with unsafeenchantment

mellow edge
#

k

misty current
#

or whatever the name was

crimson terrace
#

Any Idea why this won't set the zombie pigman targetted to be angry? It just doesn't I have it running on a timer every 10 ticks

mellow edge
#

something like that? ```java
public ItemStack createUnSafeEnchantedItem(Enchantment e, int i, ItemStack stack) {
stack.addUnsafeEnchantment(e, i);
return stack;
}

ivory sleet
#

mye

#

try that

mellow edge
#

it works

#

thanks

chrome beacon
crimson terrace
#

but yeah it works with the target setting

chrome beacon
#

Alright :)

mellow edge
#

just one more question

#

lol

#

how can I get the first slot in the inventory here

#

is it getContents...

crisp steeple
#

getItem(0)

mellow edge
#

oh p.getInventory().getItem(0).getType()

green prism
#

Guys, one last question, in your opinion why the latest version of Vault makes me an override of Spigot/Paper putting its version of bukkit 1.13?

chrome beacon
#

It doesn't do that

green prism
#

thanks

chrome beacon
#

Alright :)

trail oriole
#
    @EventHandler
    public void onSnowballHit(EntityDamageByEntityEvent event){
        Entity damaged = event.getEntity();
        Entity damageEntity = event.getDamager();
        Snowball snowball = (Snowball)damageEntity;
        if(damaged instanceof Player) {
            if(damageEntity instanceof Snowball) {
                
                LivingEntity entityThrower = (LivingEntity) snowball.getShooter();
                if(entityThrower instanceof Player) {
                    Player playerHit = (Player)damaged;
                    //if (entityThrower != playerHit) return;
                    playerHit.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 1, 10));
                    playerHit.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 3, 10));
                }
            }
        }
    }```
#

why won't that work

crisp steeple
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

trail oriole
#

sorry

#

there is no error although it doesn't apply the potion effects on snowball hit

crisp steeple
#

add a print statement then after every if statement

#

and see where it gets up to

#

also you're casting the snowball before you check if it is an instance of a snowball

#

which will exception everytime the damager isnt a snowball

trail oriole
#

LivingEntity entityThrower = (LivingEntity) snowball.getShooter();

remote badge
#

kakaka

#

duration in ticks

#

read the method

#

add more time

trail oriole
#

oh it's in ticks

#

frick

remote badge
#

yes

trail oriole
#

alright thanks a lot

trail oriole
#

yep I did

#

thanks

crisp steeple
#

alr

oblique thunder
#

Im having issues detecting an inventory on click it send me a regular placed chest inventory but not the player's internal inventory or the custom one i open to the player

@EventHandler
    public void onInvClick(InventoryClickEvent invEvent) {
        Player player = (Player) invEvent.getWhoClicked();
        ItemStack clickedItem = invEvent.getCurrentItem();
        Inventory invClicked =invEvent.getClickedInventory();
        player.sendMessage(invClicked.toString());
    }
regal dagger
#

Is there a way to load a schematic for each player? A bit like Hypixel's Limbo?

echo basalt
regal dagger
crude estuary
#

It's a Proxy Packet Thing

#

Right?

echo basalt
#

The way to do it on spigot is to just paste a single schematic and hide everyone else

echo basalt
crude estuary
#

it's only on the Client

#

not on the Server

echo basalt
#

I've messed with it on the past, you gotta reimpl the entire server running on minecraft's protocol

#

if they send a login packet, you gotta respond with whatever else

crude estuary
#

oh

#

Now i get it

midnight shore
#

Hi, does anybody know how can i translate a number to a string with dots? Like if i have 1000 i want it to translate to 1.000

echo basalt
summer scroll
#

How can I get the ItemStack of the item that players trying to move in inventory with hotbar keys?

echo basalt
#

gotta refactor that code a bit but that's the idea

summer scroll
#

Ah, thank you so much

sterile token
#

An out of context question, Java socket are blocking right?

ivory sleet
#

myes

#

altho you have some non blocking variants

sterile token
#

Yeah

#

ServerSocketChannel and SocketChannel

#

right?

ivory sleet
#

ye

#

the channels can be non blocking if you choose em to be

sterile token
#

Yeah of course

ivory sleet
#

Socket and ServerSocket iirc are always blocking

sterile token
#

Its possible to open a NIO on a free host?

ivory sleet
#

idk

#

like a server socket?

#

theyd probably block the port and what not so I dont think so

#

but worth a try

sterile token
#

Sockets can be open on host without knowing a open port

ivory sleet
#

myes but Id imagine that they end up blocking undesired connections etc

sterile token
#

A friend has tested opening a local socket for connecting lobby server to bedwars and worked

ivory sleet
#

lol

#

thats nice

sterile token
#

His goal is to do a simple local network, so he can sync his servers

#

Because he cannot pay a host for having redis

ivory sleet
#

myes

sterile token
#

Is a new american trend using "myes"?

ivory sleet
#

tho genuinly Id stay away from javas socket lib

sterile token
#

😂

ivory sleet
#

idk

#

but like if you can, use netty

glossy venture
#

is the hashcode of an int x; equal to the value of x?
because if so, you can lookup things in a map by hashcode
which might be useful for what im trying to do

sterile token
glossy venture
#

maybe the duration is too longn

ivory sleet
#

orbyfield theres no notion of hashcode when it comes to primitive types

#

but if you mean Integer then yeah

glossy venture
#

yeah

#

oh

#

is the first or second parameter the duration?

ivory sleet
sterile token
ivory sleet
#

Verano I should mention, ServerSocketChannel as well as SocketChannel still use underlying Socket and ServerSocket implementations

sterile token
ivory sleet
#

hm

sterile token
#

@ivory sleet Because our first goal in a host was we cannot open port, so let try to catch current netty instance and register a separate handler to design our cross-server system

summer scroll
echo basalt
summer scroll
#

Ah you're right.

#

So I should listen to InventoryDragEvent too?

echo basalt
#

yes

dense geyser
#

do scheduler operations definitely run on different threads? im getting issues where when a scheduler operation is made and that runnable locks, it locks the thread it was called from too

summer scroll
echo basalt
#

should be it

echo basalt
#

if it's async, there is probably a threadpool (might just be 1 thread) made for async tasks

dense geyser
#

its sync going async

dense geyser
#

hopefully that gives me some luck

echo basalt
#

redis' subscribe method locks the thread entirely btw

ivory sleet
#

depends on what redis lib they use

dense geyser
#

jedis

echo basalt
#

jedis

ivory sleet
#

ah

#

so you're borrowing a connection from the pool and then invoke subscribe on it? I mean from what I've seen people just throw that in a daemon thread

#

no particular thread pool or anything

#

well ig single thread executor

dense geyser
#

I mean whats happening currently is that i've got a pubsub that sends 2 reqs every 30 secs which works fine, received fine, yay. I send a publish of something else, nothing happens (it locks), then when the thread that tries to handle those 2 repeating reqs tries to do it, the server permanently hangs and crashes when jedispool.getresource() is attempted

ivory sleet
#

but that scarcely counts

#

how do you configure your jedis pool btw?

#

because iirc it allows a maximum of 8 connections concurrently

dense geyser
#

that might be the issue lol, all I do is new JedisPool(), it has no other conf options

#

yeah, the pool has 8 by default

#

but ive tried logging them, and there's always 6-7 free when the 3rd publish is attempted

ivory sleet
#

oh okay

dense geyser
#

it'd be better if I could figure out what is actually causing the issue

ivory sleet
#

mind sharing some code?

dense geyser
#

not easily, its too deeply routed in a big project

ivory sleet
#

though, don't you keep your jedis stuff locked up in a package behind some interface?

dense geyser
#

I do not : 'D

ivory sleet
#

ah rip

dense geyser
#

actually

#

fuck it

#

im going to recode all my jedis stuff and see if the issue persists

ivory sleet
#

if you have the commitment to, Id suggest using lettuce instead

#

it has a better design and supports sync and async flawlessly

dense geyser
#

and with that, phase out the bukkit scheduler in it

echo basalt
#

lol

dense geyser
#

oh?

ivory sleet
#

yes it has pub sub and pooling as well

dense geyser
#

interesting

echo basalt
#

adding a potion effect for 5 ticks won't be that apparent

tardy delta
#

llooks like a pyramid

echo basalt
#

also wtf is this

dense geyser
tardy delta
#

its the magic of java

ivory sleet
#

ye

dense geyser
#

alright, ill have a look, thank you ❤️

ivory sleet
#

good luck :3

echo basalt
#

you do some very cursed lore checks too

trail oriole
#

How do i pass an arraylist containing players from my command executor to my listener ?

#

I don't want to put event handlers in my listener

echo basalt
#

?di

undone axleBOT
echo basalt
#

uhh

#

barely

#

don't do lore checks btw

#

just like

#

nbt

#

or an isSimilar check also works

agile sand
#

Hello! How I can get list of serializable objects?
Use section#getList(string), stream it and map, or how?

echo basalt
#

If they're all configurationserializable, you can just cast the objects from the list

quaint mantle
echo basalt
#

PDC is 1.14+

#

could be an issue

agile sand
echo basalt
#

You're casting a list to MySerializable

agile sand
#

yep, i got it :D

#

Okay, thanks!

midnight shore
quaint mantle
#

is there any way to get the type of entity and if it's a player get the name of it when ur getting a palyer's last damage cause and seeing if it's entity_attack

granite beacon
#

What did the MojangsonParser get changed to in the remapping's on 1.18?

trail oriole
#

why can't addEnchant add knockback 3 on an item ?

midnight shore
golden kelp
#

Idk why having item meta matters

golden kelp
trail oriole
#

but does addUnsafe also adds normal enchants ?

tardy delta
#

do people know that early returns exist?

golden kelp
#

Yes, it adds normals

#

As well

golden kelp
#

Un*

trail oriole
#

wait

#

you can add enchants to the item and not the item meta

#

my bad

#

it does

golden kelp
#

o

trail oriole
#

sorry for pinging you btw

golden kelp
#

Np

kindred valley
#

who can help me setup this maven shit pls

#

im struggling for 3 days