#help-development

1 messages · Page 695 of 1

remote swallow
#

thats correct, what did you use to run buildtools

#

just double clicking or java -jar BuildTools.jar --rev 1.8.8

tawdry pilot
#

i made a batch file and ran java -jar BuildTools.jar --rev 1.8.8

remote swallow
#

did it finish

tawdry pilot
#

i think?

#

the program isnt open anymore

remote swallow
#

it should say something like "copied jar to xxx"

tawdry pilot
#

ill run again sec

chrome beacon
#

Also there should be a spigot 1.8.8 jar in the folder where you ran BuildTools

tawdry pilot
#

yea its there

remote swallow
#

reload maven again

#

maven tab on the right side, first button at the top

#

looks like a circle

tawdry pilot
#

oh it finally worked

#

tyvm

smoky oak
#

actually i just realized something - woudln't obfuscators think @EventHandler methods are dead?

lilac dagger
#

yes but you can keep them

celest notch
#

!unverify

#

!verify RunTellObama

undone axleBOT
#

This account is already verified!

celest notch
#

f

lilac dagger
#

catch md5 when he's around

#

or rejoin

#

if you're already okay

#

prolly the bot is dead

celest notch
#

are you allowed to dm md5?

remote swallow
#

no

#

email

#

or ask him when hes here

mellow pebble
#

is there a way of making sort of "custom projectiles" for example can i extend class like Fireball and then just edit values and somehow change the itemstack of fireball and just pass that class in launcProjectile()

lilac dagger
#

no

#

but you can make a custom fireball

#

you just can't use launch projectile to launch it

mellow pebble
#

how can i then launch it (i mean mob should launch it)

lilac dagger
#

add it to the world plus loc and velo

#

and assign it to a mob

distant wave
#

is it possible using spigot to see the boundaries of certain areas like you can do with structure blocks

tribal quarry
#

Any help with this new error? (happens randomly and Im sure world & chunk is loaded), I hope if someone helps, I think those errors are directly related to getBlockAt thing or idk

tender shard
#

you are casting something to chest that is not a chest

#

or sth similar

smoky oak
#

it says type chest

tender shard
#

what's Team line 355

tribal quarry
#

The weird thing is, it is saying a chest is not a chest lol

Caused by: java.lang.IllegalStateException: CraftChest is not a chest but is instead CraftBlock{chunk=CraftChunk{x=3z=3},x=51,y=100,z=48,type=CHEST,data=5}
tender shard
#

what's team line 355

tender shard
#

how am I supposed to know which is line 355 now

tribal quarry
#

hm, first switch case, applySharpnessToSwords

#

info.getChest().getState() thing

#
    public Inventory getInventory() {
        int x = getX();
        int y = getY();
        int z = getZ();
        // The logic here is basically identical to the logic in BlockChest.interact
        CraftInventory inventory = new CraftInventory(chest);
        if (!isPlaced()) {
            return inventory;
        }
        int id;
        if (world.getBlockTypeIdAt(x, y, z) == Material.CHEST.getId()) {
            id = Material.CHEST.getId();
        } else if (world.getBlockTypeIdAt(x, y, z) == Material.TRAPPED_CHEST.getId()) {
            id = Material.TRAPPED_CHEST.getId();
        } else {
            throw new IllegalStateException("CraftChest is not a chest but is instead " + world.getBlockAt(x, y, z));
        }

That's where it throws the exception, getBlockTypeIdAt is probably mismatching with getBlockAt, not sure why

tender shard
#

ughm why don't you just Materials directly

lost matrix
#

Tha fk is getBlockTypeIdAt ??

tender shard
#

no clue

tribal quarry
tender shard
#

why do you even need to check the material? can't you just check if the BlockState is instanceof Chest / Container / InventoryHolder?

tribal quarry
river oracle
#

Don't blind cast

#

That's the only reason you'd get an error do your checks properly

tribal quarry
river oracle
#

Send the error

#

?paste

undone axleBOT
river oracle
#

Please send it in a paste

#

I'm on my phone

river oracle
#

Your casting a block to a chest

#

Team line 355

#

Chests are block states not blocks

tribal quarry
river oracle
#

What are you doing on line 355 of team

kindred trellis
#

PermissionAttachment pa = p.addAttachment(this); i get error with "this" im supposed to provide plugin there but i dont know what to put there in my plugins main class onEnable "this" works but this one is in events what should i put there?

lost matrix
tribal quarry
#

I don't throw that, I just pasted that code from CraftChest.java

lost matrix
#

Might be one of those 1.8 errors that never got, and never will be fixed

tribal quarry
#

Well anyway, thats 1.8, I shouldn't expect any support then (its one of those ancient versions), Thanks btw 👍

tender shard
lost matrix
#

If you are changing a block in the interact event, try delay the interaction by a tick

gilded granite
#

can som1 tell me how i can add npc players

tender shard
# kindred trellis PermissionAttachment pa = p.addAttachment(this); i get error with "this" im sup...

You often need a reference to your main instance (the instance of your class that extends JavaPlugin) in some of your other classes. There’s two basic concepts for this. Choose whichever you like more. Method #1: Static Getter First way is to create a static method called getInstance() or similar in your main class. You...

tribal quarry
lost matrix
tribal quarry
# gilded granite can som1 tell me how i can add npc players

You can either go with depending on citizens or build your own npc framework by just doing some researches about faking players with packets and scoreboard team stuff, but it'll take time to stablize it for sure (understanding packets surely takes a quite time to practice and work with)

tawdry pilot
#

java.lang.ClassNotFoundException: org.bukkit.craftbukkit.v1_8_R3.entity.CraftHumanEntity 🤔

kindred trellis
kindred trellis
#

oh wait i may be just dumb

#

yeah im dumb nvm thanks!

tawdry pilot
#

what site should i use to upload the stacktrace

hazy parrot
#

?paste

undone axleBOT
tawdry pilot
#

ty

chrome beacon
tawdry pilot
#

ah i see

misty ingot
#

guys what are some of the best libraries that you almost always use to make your work easier?

#

like for ex theres acf-bukkit which I use for making commands much easier

remote swallow
#

lombok

kindred trellis
#

PermissionAttachment pa = p.addAttachment(Fernv2.getInstance());
if(!(p.hasPlayedBefore())) {
pa.setPermission("zaza.helpzaza", true);

i set permisson to a player using this code but when i use the command i still dont have the permission

smoky oak
#

you cant just name yourself lol

kind hatch
smoky oak
#

thats not making your work easier thats doing the work elsewhere

kindred trellis
tender shard
smoky oak
#

i
fair

grave drum
#

think this is the proper channel

#

so I'm using placeholder api for a scoreboard.

it's showing everything which is good, but i need it to show Team Points. cause it can show player's individual points but not team points. i'm wondering if there would be an addon or something? i'm a bit stuck
i need something to like rank the teams like mcc, top 3 highest for example

olive linden
#

I make plugins (i prefer smaller ones) is anyone interested?

undone axleBOT
olive linden
#

thanks :)

hazy parrot
smoky anchor
#

What event should I listen to if I want to check for an item being burned in lava ?

kindred trellis
#

maybe itemonground event and if the ground is lava? idk rlly shouldnt take my advice haha

smoky oak
#

not sure if melting in lava counts as a entity death

#

oh actually

#

itemstacks on the ground might not be entities in the definition of spigot

smoky oak
#

well all the entitiy events seem to have to do with mobs

#

so im not sure

#

honestly

smoky anchor
#

Items on ground are 100% entities

smoky oak
#

just make a void world, listen to Event and print em all out

smoky anchor
#

Don't think combust event will work, sounds like "entity begins to burn" not "entity burned to death" but idk

echo basalt
#

They're entities

kindred trellis
echo basalt
#

Most likely EntityDamageEvent

#

Lava does damage which is how they die

#

Same for tnt

smoky anchor
smoky anchor
echo basalt
#

time to think about how I'd implement a command tree

smoky oak
#

ah i see

grim hound
#

oh wait the conversation was longer

#

my bad

near mason
#

ty

near mason
remote swallow
#

init {} is kotlin

near mason
#

ik

#

im new in kotlin

#

i hate the syntax of kotlin

remote swallow
#

so dont use it

#

use java

near mason
#

ye but it has more features

#

like unnamed class

worldly ingot
#

For the record, Java has init blocks too

#

You just don’t prefix the {} with init

near mason
#

i didnt know that too

#

thank you

smoky oak
#

isnt {} just short for 'public this'

worldly ingot
#

Not quite

near mason
#

it applies for all constructors

worldly ingot
#

Code inside of an init block gets executed for every initialisation regardless of the constructor used

smoky oak
#

wait really

worldly ingot
#

Ye

smoky oak
#

like the java public class c { {/this/}}

worldly ingot
#

Seldom useful but it has its cases from time to time 🙂

#

Ye

smoky oak
#

does that also happen if you write it out?

near mason
#

what is seldom

smoky oak
#

'rarely'

worldly ingot
#

Rarely

smoky oak
#

:D

worldly ingot
#

And no, there’s a difference between a no-arg constructor and an init block

remote swallow
#

choco get off discord

worldly ingot
#

BRO

#

GET OFF MY DICK

round finch
#

roasted

near mason
#

ayo chill

remote swallow
#

are you on aeroplane

worldly ingot
#

Nah I’m laying in bed. Just woke up from a nap

smoky oak
remote swallow
worldly ingot
smoky oak
#

huh

worldly ingot
#

{} will run AND your default constructor will run

smoky oak
#

both will always run if present? weird

worldly ingot
#

{} runs regardless of the constructor used

worldly ingot
remote swallow
#

go take ur gf to lunch

worldly ingot
#

She’s finishing her shift at work

#

We’ll go out to lunch here shortly. She’s on her way home

remote swallow
#

okay your fine to be on discord

#

for now

worldly ingot
#

:)

river oracle
remote swallow
#

you will never know

gilded granite
#
public void onBlockBreak(Player player, Block block) {
        if (block.getType() == Material.BIRCH_LOG || block.getType() == Material.BIRCH_LOG) {
            int count = 0;
            BlockFace[] directions = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP,BlockFace.DOWN};
            for (BlockFace direction : directions) {
                Block connectedBlock = block.getRelative(direction);
                if (connectedBlock.getType() == block.getType()) {
                    connectedBlock.breakNaturally();
                    
                    count++;
                    if (count >= 10) {
                        break;
                    }
                }
            }
        }
    }```

In that how can i make the it breakByPlayer instead of breakNaturaly so it triggers the BlockBreak event
sage patio
#

any idea why?

gilded granite
remote swallow
#

also use data.getKeys()

tender shard
sage patio
#

basicly it just creates a list

#

from the sections

remote swallow
#

show the yaml

sage patio
#

all of them are the same with different section name

distant ridge
#

I'm creating a YAML file in Java. It creates "Home.unofficial" and "Home.costChanged" but it only saves the last setting under Home when its written to a file. Any reason why?

                                YAMLHandler yaml = new YAMLHandler(file.getName());
                                yaml.loadConfig(file);

                                        english.set(newKey + "." + key, messages.getString(key));

        try {
            english.save(English);
        } catch (Exception ignore) {}```
gilded granite
#
public void onBlockBreak(Player player, Block block) {
        if (block.getType() == Material.BIRCH_LOG || block.getType() == Material.BIRCH_LOG) {
            int count = 0;
            BlockFace[] directions = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP,BlockFace.DOWN};
            for (BlockFace direction : directions) {
                Block connectedBlock = block.getRelative(direction);
                if (connectedBlock.getType() == block.getType()) {
                    connectedBlock.breakNaturally();
                    
                    count++;
                    if (count >= 10) {
                        break;
                    }
                }
            }
        }
    }```

In that how can i make the it breakByPlayer instead of breakNaturaly so it triggers the BlockBreak event
remote swallow
#

List<String> turfs = new ArrayList<>();
for (String turf : config.getKeys(false)) {
  if (!name.equalsIgnoreCase(config.getString(turf + ".gangCaptured"))) continue;
      turfs.add(turf);
}
#

ur issue is calling getString on a config section

remote swallow
gilded granite
#

thx

hazy parrot
near mason
#

there was a thing like lateinit

#

try that maybe

hazy parrot
#

yeah this isnt lateiniting, im initing it when object is made

gilded granite
#

I got a big error

#

1gb log file wtf

half swan
#

crazy piramid 👀

near mason
#

weird

gilded granite
remote swallow
#

update

#

or use the startup flag

gilded granite
#

wich?

kind hatch
#

or just update

remote swallow
#

-DIReallyKnowWhatIAmDoingISwear

gilded granite
#

ok lets update

near mason
gilded granite
#

is there any Asychronioly break block

#

but like not remove but break

tender shard
lilac dagger
#

it's much more readable then regex for sure

humble heath
tender shard
#

I just have both versions included now. if someone finds a bug in the NaiveParser I just replace it with the regex one until it's fixed

humble heath
#

schemer validation property not allowd

#

can some one help fix

gilded granite
#
public void onBlockBreak(Player player, Block block) {
        if (block.getType() == Material.BIRCH_LOG || block.getType() == Material.BIRCH_LOG) {
            int count = 0;
            BlockFace[] directions = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP, BlockFace.DOWN};
            for (BlockFace direction : directions) {
                Block connectedBlock = block.getRelative(direction);
                if (connectedBlock.getType() == block.getType()) {
                    player.breakBlock(connectedBlock);

                    count++;
                    if (count >= 10) {
                        break;
                    }
                }
            }
        }
    }```

its creating a stack overflow each time i mine Birch
tender shard
humble heath
#

in a yml file

tender shard
distant ridge
#
private static void MigrateToLanguage() {
    // Create English file if it doesn't exist
    File EnglishFile = new File(instance.getDataFolder() + "/Languages/English.yml");
    if (!EnglishFile.isFile()) {
        try {
            EnglishFile.createNewFile();
        } catch (Exception ignore) {
        }
    }

    YAMLHandler englishYAML = new YAMLHandler(EnglishFile.getName());
    englishYAML.loadConfig(EnglishFile);

    // Loop all folders in plugin.getDataFolder() and then loop all files in each folder
    File[] folders = instance.getDataFolder().listFiles();
    if (folders != null) {
        for (File folder : folders) {
            if (!folder.isDirectory()) continue;
            File[] files = folder.listFiles();
            if (files == null) continue;

            for (File file : files) {
                if (!file.isFile()) continue;
                // Load file as YAML config
                YAMLHandler yaml = new YAMLHandler(file.getName());
                yaml.loadConfig(file);

                ConfigurationSection messages = yaml.getConfigurationSection("messages");
                if (messages == null) continue;
                // Loop all messages in the file
                for (String key : messages.getKeys(true)) {
                    // Check if the message is in the English file
                    String englishKey = file.getName().replace(".yml", "") + "." + key;
                    englishYAML.set(englishKey, messages.getString(key));
                    Methods.log("Setting " + englishKey + " to " + messages.getString(key));
                }
            }
        }
        try {
            englishYAML.save(EnglishFile);
        } catch (Exception ignore) {
        }
    }
}

In the debug info I see:

[10:33:52 INFO]: [EpicCore] Setting Home.costInvalid to §7? §7Cost needs to be a whole number
[10:33:52 INFO]: [EpicCore] Setting Home.costChanged to §7? §7Changed §f%home%§7's public warp cost to §f%cost%```

But in the new YAML file under Homes there is only 1 value:
```yaml

Home:
  costChanged: '&7▌ &7Changed &f%home%&7''s public warp cost to &f%cost%'```

Its only saving the last item that was set in each section. Can someone help me with this?
tender shard
quaint mantle
ionic terrace
#

Does anyone know if it's possible for a plugin to host a website? I've only ever found one example that does it but it's Fabric so I was wondering if you could do it with Spigot

near mason
quartz elbow
#

how can i block the rain?

near mason
quaint mantle
near mason
quaint mantle
#

have you heard of variable shadowing?

near mason
quaint mantle
near mason
#

i asked the name of the name of the val in the init method bec of that

quaint mantle
#

im saying to goksi

hazy parrot
near mason
#

weird

quartz elbow
#

and how can i block the spawn of animals?

hazy parrot
#

im trying to init variable inside of init block

quaint mantle
#

you are shadowing a variable outside the function

#

duh

hazy parrot
#

?

quaint mantle
#

that's thy you use this.

#

like in java

hazy parrot
#

that doesn't matter lol

quaint mantle
#

it matters

hazy parrot
#

i don't have two variables named mapping

quaint mantle
#

well you do

hazy parrot
#

?

quaint mantle
#

you have mapping variable inside the init function and outside it

hazy parrot
#
val mapping: Any
init {
  mapping = "A"
}
remote swallow
#

the mapping inside the init isnt defined as a variable

hazy parrot
#

that is one variable, not two

quaint mantle
#
val mapping: Any
init {
  val mapping =...
  mapping = "A"
} 
``` but from your code i see this
hazy parrot
#

where do you see that name of first variable inside of init block is mapping ?

#

its not

hazy parrot
#

dude, im saying its not

onyx fjord
#

can i somehow dynamically parse String to Integer or Double or anything else using generics?
without making a method for each type

quaint mantle
#

or you can use old method of Object

kind hatch
# ionic terrace .

I mean, you can run a local webserver with a plugin, but I don't know about a full blown website.

hazy parrot
# hazy parrot

just did this at the end, but i would really like to understand that warning lol

ionic terrace
#

Like something just to display statistics or something. Nothing major, something like dynmap

quaint mantle
onyx fjord
quaint mantle
hazy parrot
#

he asked if he can determine if string is int, double, float or long

#

and parse it acordingly

quaint mantle
#

instanceof

hazy parrot
#

?

tender shard
#

a string will not be instanceof Integer lol

rotund ravine
#

Jk

quaint mantle
#

also what do you want to parse?

tender shard
#

I'd do it like this

public class StringToNumber {

    private static final Pattern INTEGER_PATTERN = Pattern.compile("^-?[0-9]+$");

    public static Number parse(String numberString) {
        try {
            if (!INTEGER_PATTERN.matcher(numberString).matches()) {
                return Double.parseDouble(numberString);
            }
            Long asLong = Long.parseLong(numberString);
            if(asLong >= Integer.MIN_VALUE && asLong <= Integer.MAX_VALUE) {
                return asLong.intValue();
            } else {
                return asLong;
            }
        } catch (NumberFormatException ex) {
            return null;
        }
    }
}

slender elbow
#

\d 🤔

austere cove
#

you saying +1 is not an integer smh

wary remnant
#

NumberFormat.getInstance().parse(String)?

onyx fjord
#

well the thing is

#

i dont wanna do it for specific type

#

but thru generics

quaint mantle
#

instanceof

#

or you could implement union type to java

gilded granite
#
public void onJungleAxeBlockBreak(Player player, Block block) {
        if (block.getType() == Material.BIRCH_LOG || block.getType() == Material.BIRCH_LOG) {
            int count = 0;
            BlockFace[] directions = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP, BlockFace.DOWN};

            List<BlockFace> shuffledDirections = Arrays.asList(directions);
            Collections.shuffle(shuffledDirections);

            for (BlockFace direction : shuffledDirections) {
                Block connectedBlock = block.getRelative(direction);
                if (connectedBlock.getType() == block.getType()) {
                    if (count >= 10) {
                        break;
                    }

                    Bukkit.getScheduler().runTaskLater(plugin, () -> {
                        player.breakBlock(connectedBlock);
                    }, count * 10);

                    count++;
                }
            }
        }
    }```
i have an issue it breaking all conected blocks instead of just 10 can any1 help?
lilac dagger
#

count is never incremented

#

nvm

outer pond
#

Player#breakBlock() will call a BlockBreakEvent, did you account for that?

gilded granite
#

ik

onyx fjord
#

even tho i give it an Object not a String

#

it always gives me null

wary remnant
#

What exactly do you want to accomplish?

#

simply casting an instance of String to Object will not make it assignable to numeric types, it is still a string

#

You can use one of the mentioned methods to convert a String to a numeric value

tender shard
austere cove
#

yea but the other way around it is a valid parsable number

#

didn't really read the context so I don't even know what the issue is

tender shard
#

yes, sure. maybe they should specify why they have numbers as strings in the first place / where they come from lol

quaint mantle
#

it is already null safe

tender shard
#

Lol my own parser is slower than using regex lol

austere cove
#

what are you trying to do

gilded granite
#
public void onJungleAxeBlockBreak(Player player, Block block) {
        if (block.getType() == Material.BIRCH_LOG || block.getType() == Material.BIRCH_LOG) {
            int blockBreakCount = 0;
            BlockFace[] directions = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP, BlockFace.DOWN};

            List<BlockFace> shuffledDirections = Arrays.asList(directions);
            Collections.shuffle(shuffledDirections);

            for (BlockFace direction : shuffledDirections) {
                Block connectedBlock = block.getRelative(direction);
                if (connectedBlock.getType() == block.getType()) {
                    if (blockBreakCount >= 10) {
                        break;
                    }

                    Bukkit.getScheduler().runTaskLater(plugin, () -> {
                        player.breakBlock(connectedBlock);
                    }, blockBreakCount * 10);

                    blockBreakCount++;
                }
            }
        }
    }```
i have an issue it breaking all conected blocks instead of just 10 can any1 help?
austere cove
#

also regex does some pretty smort stuff under the hood iirc

tender shard
onyx fjord
#

oh wait

#

lets see

#

'String (or object)' cannot be safely cast to 'T'

outer pond
gilded granite
#
    public void onBlockBreak(BlockBreakEvent e) {
        Player p = e.getPlayer();
        ItemStack item = p.getInventory().getItemInMainHand();
        if (ignoreEvent) return;
        if(!isApplicable(item)) return;

        ignoreEvent = true;
        onJungleAxeBlockBreak(p, e.getBlock());
        ignoreEvent = false;
    }```
tender shard
#

You must set ignoreEvent to true right before you call breakBlock in the task

gilded granite
#

Thx

rare rover
#

is displaying particles in NMS even worth it?

tender shard
#

No

#

The API also just sends a packet

rare rover
#

shoot, setup NMS

#

alr

tender shard
#

Check CraftPlayer#spawnParticle

#

You‘ll see that it simply creates a particle packet and sends it

rare rover
#

yeah i see that

#

alrighty

#

ty

gilded granite
#

any1 have a tutorial for nms

remote swallow
#

what part of nms

#

or doing what in nms

gilded granite
#

anything

#

like learn nms

remote swallow
#

doesnt exist

gilded granite
#

i want to sspawn npc

remote swallow
#

nms is internal code so wont be documented

gilded granite
#

with player skill

remote swallow
gilded granite
#

skin

#

or i want to spawn holorgrams

near mason
gilded granite
#

wat codered?

tender shard
#

there are no "general NMS" tutorials

#

did you even set up your project to use NMS yet?

#

If not, you should start with that

gilded granite
#

I think

upper hazel
#

I have seen many plugins that list the Jar version but how do I do the same? And to make it convenient to change versions and not change the name of the class

gilded granite
#

?link

upper hazel
#

@gilded granite nice photo

gilded granite
#

?verify

gilded granite
upper hazel
#

what:

gilded granite
#

how to link forum

upper hazel
north nova
#

u mean a plugin supporting different versions

#

?

upper hazel
#

no

north nova
#

oh

#

mb

upper hazel
#

display the plugin version on the plugin name but change the version if desired without changing the class name

kind hatch
#

You got an example? Cause you're not making sense.

north nova
#

so u wanna change the name of the output jar to contain the version?

#

iirc maven does that by default lol

upper hazel
#

no

#

idk

#

i not have

north nova
#

👍

kind hatch
#

Start making sense then.

upper hazel
#

i have <pluginname|>.jar

#

this all

north nova
#

you motherfucker

upper hazel
#

a....?

gilded granite
kind hatch
#

PluginName-VERSION.jar?

upper hazel
#

if I update the plugin then I need to change the version and display it like from 1.0 to 2.0 and so on

upper hazel
kind hatch
#

Display it in-game or in the file?

upper hazel
#

in file

north nova
#

that makes

#

no sense

#

what

#

what are you trying to do

#

how can u know what u wanna do but cant give an example of what u wanna do

upper hazel
#

"if I update the plugin then I need to change the version and display it like from 1.0 to 2.0 and so on"

north nova
#

display it where

upper hazel
#

bruh

sterile token
#

Internal issues with spigot?

org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.player.PlayerEvent. Static getHandlerList method required!

north nova
upper hazel
#

myPlugin-2.0.jar

sterile token
upper hazel
#

in this displayName

north nova
#

oh

#

lol

sterile token
#

what what

north nova
#

when is that being

#

thrown

sterile token
#

Yeah PlayerEvent is noe mine

#

spigot gets weird some times

#

💀

kind hatch
sterile token
kind hatch
#

What?

sterile token
kind hatch
#

????

sterile token
#

Sorry discord ig going too shity

kind hatch
#

You're missing the getHandlerList() method.

sterile token
#

Its also points to line 25, thats is the register

sterile token
#

Its internal server code

#

It happen when i register my listener

kind hatch
#

You can't just not include them

upper hazel
sterile token
sterile token
#

Im not even listening to custom events, im listening to bukkit events

#

That error doesnt make sense

#

Look shadow

kind hatch
undone axleBOT
upper hazel
kind hatch
sterile token
#

So he mainly trying to do relocations from what i understand ?

kind hatch
sterile token
kind hatch
#

It'd also help if you pasted the full stacktrace

upper hazel
#

this need set?

#

oh waut

upper hazel
#

wait

#

not

sterile token
kind hatch
upper hazel
#

i use

#

?paste

undone axleBOT
upper hazel
sterile token
kind hatch
upper hazel
#

do I need to replace the word in brackets with the version?

kind hatch
#

Look at how the other sections are formatted.
<key>value</key>

sterile token
upper hazel
#

oh nice

#

thenks

sterile token
upper hazel
#

yes

sterile token
#

If you mean that you add build tag and then the finaNname tag

#

And then you close the build tag, with </build>

kind hatch
upper hazel
#

now this work

sterile token
#

okay restarted IDE and worked perfect

tender shard
#

very, very weird. on my macbook, my NaiveParser is about 4 times faster than the regex parser. on Windows, the regex parser is faster. ??

subtle folio
lilac dagger
#

i can understand why regex parser can be faster for some situations since it can do work on the og array and not a copy

#

weird that regex is faster

tender shard
#

I'm currently running the benchmarks again, I'll post results here later lol

lilac dagger
#

it's a lot more generic

subtle folio
#

¯_(ツ)_/¯

vital ridge
#

I have this code: https://paste.md-5.net/egudalixab.java
This should calculate the dot product between the player and the zombie and according to the maths, give me a number close to 1 if I'm looking at the zombie and a number closer to 0 or a negative value if I'm looking away from the zombie. For some reason the output sometimes makes sense and sometimes doesn't and I mostly get wrong values. This is my NuxVec class:
https://paste.md-5.net/fafaxutize.cpp

tender shard
#

Is your code maybe expecting a yaw between 0 and 360 while its actually between -180 and 180?

#

Or vice versa

vital ridge
#

I mean yeah dot product in maths is normally -180 to 180 by default

echo basalt
sturdy heron
#

im switching to gradle but for some reason all references of variables from other classes are errors now

echo basalt
#

Lombok thumbsup

#

Add an annotationProcessor line in your build.gradle

tender shard
#

yikes

#

no

#

use the official plugin

echo basalt
#

I do use the official plugin

#

still trips sometimes

#

This is the fix

tender shard
#
plugins {
  id "io.freefair.lombok" version "8.2.2"
}

No additional dependencies required

echo basalt
#

ehh

#

that's icky

tender shard
echo basalt
#

No clue this is what works for me

sturdy heron
#

ok it builds now but why is that all red

tender shard
#

because you haven't git added those files

sturdy heron
#

oh that makes sense

tender shard
#

you shuold definitely upload those too

sturdy heron
#

🤦‍♂️

remote swallow
#

Why do you have a build.gradle.kts and a pom.xml

tender shard
#

that's a good question lol

#

would be funny if the project is neither in java nor kotlin but sth else

vital yacht
quaint mantle
tender shard
#

yeah I also always run both at the same time mvn clean install & && gradle build &

hushed spindle
#

anyone know of the best way to get the Item entity from a BlockDispenseEvent because getItem() returns an ItemStack

#

delay a tick and look for the closest item to the dispenser?

prisma sedge
#

Yo is a block display considered an entity?

hushed spindle
#

yes

kind hatch
tender shard
hushed spindle
#

oh so it also does that, damn

#

would make more sense for the event to display an entity then wouldnt it

prisma sedge
tender shard
kind hatch
tender shard
hushed spindle
#

welp, hacky shit it is then

tender shard
#

oh and there also won't be an entity always

#

Buckets -> place water/lava blocks

#

I think best you can do is wait a tick, then get the entities at the block the dispenser was facing

#

you can also apply a custom PDC tag to the ItemStack being dispensed, then identify the Item one tick later through that

#

hacky but that's the only solution I can think of

hushed spindle
#

its not a huge deal if not all use cases are covered in this case, i got like cauldron recipes where i want the player to be able to throw shit into it and have it produce some item and now i want it to work for dispensers as well

#

if players are dumping a bunch of entities in front of their cauldron recipe thingy thats their fault lmao

vital yacht
tender shard
#

time for a PR i guess

vital yacht
#

There should be

hushed spindle
#

an item spawn event could work, though the spawn event doesn't have spawn reasons which would be useful in this case

eternal night
#

BlockDispenseEvent is sobbing in a corner ?

hushed spindle
#

well yeah thats what im using but it doesnt provide sufficient info

vital yacht
#

Yeah I was about to say SpawnReason should be added to EntitySpawnEvent and not just
CreatureSpawnEvent

hushed spindle
#

it would be better if BlockDispenseEvent#getItem() was getEntity() instead

vital yacht
#

It can't be that because it won't always dispense an item

eternal night
#

the event is way too early for that

hushed spindle
#

ah right

vital yacht
#

Maybe if it was split into BlockDispenseEntityEvent and BlockDispenseBlockEvent

hushed spindle
#

then what alex suggested would be nice

#

or that

#

both methods should still have getItem() so we can know what item was dispensed

#

if you could modify the blockdispenseevent's block that could be a neat simple way to allow other blocks to be placed with the dispenser

tender shard
hushed spindle
#

if this were to be added would this only affect future spigot versions or would existing minecraft versions also be updated to support this

#

im not sure how this works

tender shard
#

ofc only for future versions

eternal night
#

I mean, simple PDC tag, read in ItemSpawnEvent seems pretty straight forward

tender shard
#

Well it could also be a block that's gonna be placed

eternal night
#

I mean, BlockDispenseEvent cannot do either

tender shard
#

applying a PDC tag, then waiting a tick to loop over all existing Items would ofc work, but it's a pretty weird hack

eternal night
#

it can also just not dispense anything

#

e.g. instantly apply the item as armor

tender shard
#

yeah but for that, there's an event

#

BlockDispenseArmorEvent

hushed spindle
#

i dont think i actually wanna fuck with the items being dispensed because that could interfere with other plugins, think simple item detection would be sufficient

vital yacht
tender shard
#

yes but having a real method in the event would be better

hushed spindle
#

i could always compare entities in the front facing block before and after and see which one, if any, popped up

eternal night
#

you are never going to have full info for the dispenser ¯_(ツ)_/¯

#

it has so many different piece of behaviour

#

Like, hey it spawned an armor stand. Should we be exposing the armorstand instance too ?

tender shard
#

armorstands are normal entities?

vital yacht
#

Why not do what was already suggested:

  1. Listen for dispense event, add PDC with location of dispenser
  2. Listen to ItemSpawnEvent, and check for PDC
  3. Now you know
tender shard
#

as I said, there could just be getBlockState() and a getEntity() method, both Nullable

vital yacht
#

Obviously it's a workaround, but it should work

#

And there doesn't seem to be a better way in the current version

eternal night
#

yea but getEntity on that event would be the item dispensed no ?

hushed spindle
#

yea

eternal night
#

at least, that is what it does rn

hushed spindle
#

no

tender shard
#

an Item, or an ArmorStand, or a Boat, whatever it has spawned

tender shard
hushed spindle
#

right now it only outputs the item being dispenced, which is an ItemStack

#

not an Item or Entity

eternal night
#

but the stuff it spawns depends on the item ??

#

like

hushed spindle
#

yea

eternal night
#

you can set the item

#

how are you going to provide me the armorstand instance if I can just

#

change the item

tender shard
#

there could be separate BlockDispensedEvent

eternal night
#

yea

#

presumably the more sane solution

vital yacht
#

An even more sane solution would be to remove dispensers from the game

tender shard
#

yeah I didnt htink about it, I'll update my jira thingy

eternal night
#

non cancellable, non mutable itemstack

#

just, it dispensed this entity from this itemstack

#

or this blockstate from this itemstack

#

question is, do you call this after the respective spawn events

hushed spindle
#

remove crafting tables while we're at it we dont need em

eternal night
#

I mean, another alternative for this would be expanding the spawn reason API

tender shard
eternal night
#

idk, dispensers are absolutely fucked

tender shard
#

can dispensers also set stuff on fire?

eternal night
#

I mean

#

it can fucking light tnt

tall dragon
#

with lava i guess

hushed spindle
#

flint and steel ig

#

fire charges too

tall dragon
#

right dispensers can shear shit too

eternal night
#

like yea, idk

tall dragon
#

thats alot to take into account 😄

eternal night
#

you are just never getting everything shat into that event

hushed spindle
#

i wanna put a knife into one and take it into london

tall dragon
#

interestingly for shearing an event already exists

eternal night
#

Yea, I mean the per action event approach seems to somewhat most reasonable

tall dragon
#

yea i agree

eternal night
#

its just bleh when there is already existing events

#

that don't allow for the context of the dispenser/item used

tender shard
#

my benchmark is done. seems like my parser is faster than regex after all lol

dark jolt
#

Is this for spigot plugins help?

tender shard
#

no

#

but you should rather look for the actual plugins' discord if you got questions about a specific plugin

dark jolt
#

Na its a plugin I'm making but having errrs

tender shard
#

oh a plugin you are making? yes then you're correct here

dark jolt
#

ITs a dependcy err

tall dragon
#

then ur in the right place

dark jolt
#

Alr,

tender shard
#

if you get verified you can send screenshots btw

#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

lilac dagger
trim lake
#

I just create plugin with intellij and get this:

java.lang.IllegalArgumentException: Plugin already initialized!```
#

wtf?

tall dragon
#

is ur plugin in the folder twice?

tender shard
trim lake
tall dragon
#

or are to trying to create an instance of your main class?

tender shard
trim lake
#
public class Meteors extends JavaPlugin {

    private static Meteors inst;
    public static ConsoleCommandSender console;

    @Override
    public void onEnable() {
        // Plugin startup logic
        inst = this;
        console = getServer().getConsoleSender();

        this.getCommand("meteor").setExecutor(new Meteors());
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    public static Meteors getPlugin() {
        return inst;
    }
}```
tall dragon
#

ye u are

trim lake
#

But I have this code in others plugins and it works 😄

tall dragon
#

just pass this

tender shard
trim lake
#

ouu..

#

Im stupid

tall dragon
#

that woulnt ever work

trim lake
#

CommandExecutor

#

line

tender shard
#

it expects a Plugin object - you already have one. this

trim lake
tender shard
#

no, you can create any object you like, except a new instance of your main class

#

use this isntead of new Meteors()

#

your class extending JavaPlugin is a singleton

trim lake
#

this.getCommand("meteor").setExecutor(new MeteorCommandManager()); this is what I changed and its working

#

there was linked bad class 😄 Im blind

tender shard
#

yeah well MeteorCommandManager() does not extend JavaPlugin, hence you can create as many of those as you like

hushed spindle
#

reckon you should look more into how objects work because if i have to guess you probably dont want several new instances of your command manager

trim lake
#

btw. In some videos, I saw code like this to get instenc of plugin. But Im getting error

private Meteors inst;
public static Meteors getPlugin() {
        return inst;
    }

hushed spindle
#

well yeah you havent made inst static yet

#

you cant pass non-static variables into static methods

tender shard
# trim lake btw. In some videos, I saw code like this to get instenc of plugin. But Im getti...

You often need a reference to your main instance (the instance of your class that extends JavaPlugin) in some of your other classes. There’s two basic concepts for this. Choose whichever you like more. Method #1: Static Getter First way is to create a static method called getInstance() or similar in your main class. You...

dark jolt
hushed spindle
#

static methods you can see as behaviors of the class as whole whereas non-static methods are behaviors specific to the class instance, you cant pass on class instance-specific information to general class behaviors. there's no way for the program to know which information you could possibly be referring to

tender shard
#

but I'm not staff, so what do I know, I don't care lol

tender shard
grim ice
#

yeah uh

#

anyone has an idea

#

of how to reverse this

#
uint32_t a=genrand_uint32(self)>>5, b=genrand_uint32(self)>>6;
    return PyFloat_FromDouble((a*2^26+b)*(1.0/2^53));```
#

💀

trim lake
grim ice
#

it's how python generates random.random() using random.getrandbits(32)

tender shard
grim ice
#

@tender shard thought it would be worth asking so uh

#

do u know how to reverse

#

random.random()

#

not reverse actually

#

but to predict future outcomes

#

based on previous outcomes

minor fox
#

Is there a reason as to why the metadata packet is sent twice for the same item when invoking World#dropItem?

trim lake
# tender shard https://blog.jeff-media.com/getting-your-main-classes-instance-in-another-class/

Im doing same way but getting error. Like this was in the video https://youtu.be/MbsI0bNxDEc?si=SfUROubzx72aIHLb Trying to find some time where he use it.

In this episode of the Spigot series, I show you how to make your first plugin that connects to and uses a MySQL Database to store player statistics. It uses JDBC to connect and execute SQL statements upon the database. #Spigot #Minecraft #SQL

(Adding video timestamps soon)
Code: https://github.com/Spigot-Plugin-Development-Tutorial/plugin-with...

▶ Play video
tender shard
#

well you should learn basic OOP principles

#

?learnjava

undone axleBOT
trim lake
#

Im using same way but is not working thats my problem

#

Probably

hushed spindle
#

whats the error

#

if making inst static did not solve it

trim lake
#

It did, but in video is not static and still can accesit in other class. Probably I miss something

#

what ever

#

I just makeit static

tender shard
#

exactly as described in method 2 of my blog post

#

it's called "Dependency Injection"

trim lake
#

Thats what I missed proably. It depends withc method I use? Its problem if I make it static and use like that?

hushed spindle
#

you should learn java if you dont know this

tender shard
#

as I mentioned, your plugin instance is a singleton anyway, so you can use a static getter just fine

hushed spindle
#

difference between static and non static

trim lake
#

Yep.. I just jumped in spigotAPI whit soem rly small knowleage of programing.

hushed spindle
#

static = properties or behaviors ALL instances of the class shares, nonstatic is properties or behaviors only that one instance has

tender shard
#

usually online tutorials all suck. I'd rather read a book about java

hushed spindle
#

thats why utils methods are all static because they're always the same

tender shard
#
public class Person {
  public static int MAX_AGE = 150; // No person can be older than 150

  public String name; // Every individual person can have a different name
  public int age; // same for age
}

Imagine this.

You can now do Person.MAX_AGE because it's static, it belongs to the Person class itself. But you cannot do Person.name because every Person can have a different name, hence you can only call "name" on a SPECIFIC person object

hushed spindle
#

could technically make an instance of your utils classes, but really why would you

#

gonna need to bump that max age number up after a few with billionaires and their baby blood diet 😔😔😔

tender shard
#

dw it's not final lol

hushed spindle
#

you rite

trim lake
#

Oke I see. Gonna need learn some java OOP, thanks anyway

lilac dagger
#

Person.MAX_AGE = 250; //watch me

tender shard
#
public void setAge(int newAge) {
  while(newAge > MAX_AGE) {
    MAX_AGE++;
  }
  // ...

ez fix

lilac dagger
#

public void setAge(int newAge) { while(newAge != new Random().nextInt(MAX_AGE) + 1) { } MAX_AGE = newAge;

#

this is cooler

#

gotta implement bogo sometimes too

#

and also instantiate the random every time

tender shard
#
public enum PrettyBoolean {
  VERY_MUCH,
  MORE_OR_LESS,
  NOT_SO_MUCH
}
#

i once worked for a company that used fuzzy logic all over the place

#

it was quite annoying

#

well I didn#t work there, I only did an internship

lilac dagger
#

what for?

tender shard
#

they made a time management system and stuff for employees/employer, e.g. people could enter when they wanted to have vacation and which times they wanted to work, and then it generated the plan who has to work when, who got vacation when, who works on which project, and so on

lilac dagger
#

i see

tender shard
#

it was very boring

#

especially those stupid "meetings"

tall dragon
#

boolean foo = maybe

#

😂

pseudo hazel
#

sometimes

#

if_the_computer_feels_like_it

tall dragon
tender shard
#

sometimes should be a java keyword

#

public sometimes synchronized void waitMaybe();

#

throws FellAsleepException

tall dragon
#

lmfao

tranquil beacon
#

I would like an amongus keyword

sturdy heron
#

Hm how do you export the jar automatically to a local server directory?

onyx fjord
#

With gradle using custom copy task

#

That runs build + copy

sturdy heron
#

this?

    from jar
    into '/path/to/server/directory'
}```
onyx fjord
#

Looks good

#

Then you can make it depend on build

#

tasks.copyJar.dependsOn

#

Something like that

tender shard
tender shard
sturdy heron
#

i don't know how to code that i just used chat gpt

tender shard
#
tasks.register("exportToTestServer", Copy) {
    dependsOn build
    from shadowJar.archiveFile
    into '/c/mctest/plugins/'
}

Eg like this if you use shadow

#

Otherwise use „from jar“

tender shard
pseudo hazel
#

exactly, when can I have my boolean with a 100 possible values

sturdy heron
twilit roost
#

I have bungee project
and api project for that bungee project

the api needs the bungee as dependency
but bungee needs the api also as dependency

how should I organize my project structure so maven can compile it?

tender shard
# twilit roost I have bungee project and api project for that bungee project the api needs the...

https://blog.jeff-media.com/maven-multi-module-setup-for-supporting-different-nms-versions/ this for spigot+nms but the basic idea applies to every multi module project

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

#

You can also just use normal separate projects

twilit roost
#

tysm

tender shard
twilit roost
tender shard
#

They cannot depend on each other!

#

A can depend on B or B on A, but not both

twilit roost
#

riight

#

what makes more sense?
api depending on the plugin
or plugin on api

#

i think api on plugin?

tender shard
#

Plugin depending on API, 100%

twilit roost
#

is it bad project structure when the API consists of just ClassName extends ClassName ( but from the plugin )?

if that even makes sense :d

#

never made API before
soo

tender shard
#

That makes little sense. Usually the api would be mainly interfaces that the plugin implements

smoky oak
#

is it possible to spawn in the explosion rays tnt causes and declare their strength, or do i have to fake it with ray traces?

tender shard
#

Np

smoky oak
#

so apparantly i cant find the stash for the tnt explosion and only get some JIRA entries :/ dafuq

shy forge
#

I'm trying to disguise a player as a block. I'm using an un-expiring falling block that TPs to the player upon move. However, it only teleports after about a second. I read on this discord that it may be to do with how often Minecraft renders falling blocks. Is there any way to get around this?

young knoll
#

What version

shy forge
#

1.20.1

young knoll
#

Use a block display with a translation

#

And stack it on the player

restive mango
#

Is there any way to get a list or array of blockstates from a Worldedit clipboard or schematic without getting the maximum and minimum points and iterating through all possible blocks within the cuboid defined by those points?

shy forge
young knoll
#

Use an interaction entity to add a hitbox

shy forge
#

Ah, cool

#

Didn't know you could stack a block display on the player. Sounds a lot smoother than TPing every move. Thanks!

dark jolt
#

My plugin isn't like recognizing the json dependency

quaint mantle
#

doesnt spigot have that

#

maybe dependency clash

#

or ur not shading it

lost matrix
dark jolt
#

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230618</version>
</dependency>

#

Also I kinda can't cause the plugin generates files in a datapack unless minecraft can read it.

young knoll
#

Why wouldn’t it be able to

dark jolt
#

Doesn't datapack need to be .json for minecraft to read it?

young knoll
#

Json from gson is the same flavour

#

Yes? And

#

Gson can generate json files

#

Gson is just the name of the library

dark jolt
#

alr

#

Ill switch to that then

#

Thank you for telling me about that.

shy forge
#

Can't find it on google

lost matrix
opal carbon
#

Am I the only one who thinks that you need to submit your home address to pr to spigot is wierd?

shy forge
#

Only thing is now, no idea what the ride height is for players

#

So IDK by how much I should be translating down

static plover
#

Am i allowed to ask people for a favour

smoky oak
quaint mantle
#

why are u typing like that

smoky oak
#

im making a joke

#

money
you need money.

quaint mantle
#

or give something in return like

opal carbon
#

it really depends what you mean by favor like

quaint mantle
#

like uh cough head

#

jk

opal carbon
#

is it really a favor or a massive pain in the ass

#

i clicked here from a different channel

#

and only saw the words "gag reflex"

smoky oak
#

welcome to hell

limpid axle
#

where would i start with coding plugins with java?

smoky oak
#

uh theres good series on youtube, and i believe spigot.net has a basic tutorial somewhere
if you're asking in terms of 'what' instead, like... start with things like making blocks/entities appear. The api is massive
Do also take a look at events. 99% of plugin code starts with either commands or events

limpid axle
#

yeah im trying to recreate a minigame that used to be on mineplex

glad prawn
smoky oak
#

shuddup

#

my memorys cheese

limpid axle
#

figured that one out

smoky oak
#

:D

opaque scarab
#

How do I set custom model data of net.minecraft.world.item.ItemStack?

smoky oak
#

should be in itemmeta

#

yea it is

opaque scarab
smoky oak
#

uh there is

#

its literally named getItemMeta

opaque scarab
smoky oak
#

ah

#

but, do you need to use that?

opaque scarab
#

For NMS purposes

smoky oak
#

no like

#

wheres the difference between NMS and spigot custom model data

#

cuz if you can do it with the api you really should lol

opaque scarab
#

I need to display an item in an item-display. The item-display does not exist, thus I need to use the net.minecraft.world version of it to show it to the client only, without spawning it in the actual world. The API for net.minecraft.world.entity.Display.ItemDisplay has a method to set the ItemStack, but it takes a net.minecraft.world.item.ItemStack as an argument. This version has no metadata method

river oracle
#

wdym ItemDisplay is a thing

#

why dive into NMS when you could use the spigot version? unless you're planning to spoof

shy forge
#

Anyone know if there's a way to rotate a block display?

opaque scarab
shy forge
#

The transformation method is so overcomplicated, surely there's gotta be a way to just set facing west or something?

river oracle
#

use the Api then translate it after

#

CraftItemStack#asNMSCopy

#

if you do edit them raw I reccomend looking at NBT structure it'll be needed for some things such as lore

smoky oak
#

actually it doesnt use vectors in the teleport method

shy forge
smoky oak
#

no clue

shy forge
#

Yh, I would assume it would teleport it off

smoky oak
#

only way i see to do it is to teleport it to the same location with pitch 270 and yaw 0

shy forge
#

Hmm

#

Eyo, just figured it out

#

Literally, blockDisplay.setRotation(yaw, pitch);

#

Totally didn't just spend an hour trying without trying the most obvious method in the world

#

Rotates around the centre and everything ffs

oak bolt
#

In mcmmo, I am trying to access the database in my code, but the tables are confusing. Does anyone have a guide to the tables created by the db?

rough bear
#

Hello, I have a survival server. the lobby is in a world apart from survival, but every time someone enters the nether in the survival world, they are automatically teleported to the nether of the lobby, Does anyone know how to change this so that the nether and end world lobby are no longer used?

upper hazel
#

help by what criteria to evaluate the cost of the plugin if there is no clear technical specification

sweet sonnet
#

how many features, is it unique, quality, etc?

tender shard
distant wave
#

how would you guys get all air blocks in cuboid?

odd adder
#

hello , i got a problem in development.
is the way i use multiply correct?
why i get zero after multiplied a number(0<number<1) to a vector?

System.out.println(arrow.getVelocity().clone().multiply(1));
System.out.println(arrow.getVelocity().clone().multiply(1/2));```

[15:10:42] [Server thread/INFO]: 3.035488808816186,0.09096469190424816,-0.5375180709861463
[15:10:42] [Server thread/INFO]: 0.0,0.0,-0.0```

echo basalt
odd adder
echo basalt
#

1/2 is integer division and results in 0

distant wave
echo basalt
#
Cuboid cuboid = new Cuboid(one, two);
World world = ...;

for(BlockVector vector : cuboid) {
  Location location = vector.toLocation(world);
  Block block = location.getBlock();

  ...
}
#

This is the dumbest approach

#

The smart approach if you're working with a huge area is to make chunk snapshots n stuf

distant wave
echo basalt
#

Yea

#

Pretty much

gilded granite
#

any1 has a nms packets tutorial

chrome beacon
#

Just use Protocollib or PacketEvents

eternal oxide
#

depends on why you believe you need packets

gilded granite
#

to make player npcs

eternal oxide
#

YOu first need to decide if you really want to do all that yourself instead of using Citizens

tender shard
#

I wouldnt mess with ProtocolLib.
Either NMS packets or simply use Citizens

#

Citizens is great

gilded granite
#

I need custom pathfininding

tender shard
#

That has nothing to do with packets

eternal oxide
#

Using Citizens to create/manage all your NPC's means you don;t need any NMS

tender shard
#

But does citizens support custom pathfinders?

#

Or only their builtin stuff eg walk from x to y?

eternal oxide
#

You can make them wander and set a range limit

#

You can probably do more with the API directly

tender shard
#

Nice, but I wonder if they support a totally custom nms pathfinder

eternal oxide
#

Doing NPC's yourself is a little difficult as you have to update for every single release of Spigot.

tender shard
#

Like an actual GoalSelector thingy

eternal oxide
#

probably not

tender shard
#

Sad

gilded granite
#

That's why i need that

eternal oxide
#

why?

tender shard
#

What does your pathfinder do?

gilded granite
#

Anything

#

I didnt coded it for now

eternal oxide
#

We no longer believe you need pathfinding

gilded granite
#

i need atleast player npc for now

eternal oxide
#

Citizens

echo basalt
#

Citizens is starting to lose rep

gilded granite
#

Does it means i have to install the plugin?

echo basalt
#

But its pathfinders are good

eternal oxide
#

You can set NavigatorParameters by the looks

tender shard
eternal oxide
#

It supports callbacks too

echo basalt
#

It's hacky and constantly respawns entities

#

getEntityId changed throughout time

#

Nameplates are weird armorstands that you have no control over how often they spawn

#

And no idea if they've spawned or not

eternal oxide
#

Sounds like it bloated over the years

austere cove
#

tbh npcs have always been pretty jank code wise

lilac dagger
#

i've made npcs but they're client sided

ivory sleet
#

well... if we just had mixins :)

quasi flint
#

Well there is this

#

Not saying it's good, but it's possible

ivory sleet
#

ye think I saw this 2 years ago

quasi flint
#

But I think it still works like a charm

#

As it's just a launch wrapper

#

Using a probably old version of mixin but who cares lol

ivory sleet
#

ik there's another 1 i used

quasi flint
#

Ignite prob

#

I think that also bootstraps mixins

#

Mixins in spigot, would be hilarious

eternal night
ivory sleet
#

ye well it doesnt make sense to have here with the api but ntl would b nice

quasi flint
quasi flint
#

Or just straight up raw dogging asm

#

That would be master class

ivory sleet
quasi flint
#

I don't think

#

It would get merged

#

Insta closed pr

ivory sleet
#

lol ye

quasi flint
#

Just use raw asm

#

Better for compatibility 💀

ivory sleet
#

im not that masochistic but drastic measures call for drastic changes

quasi flint
#

Now I wanna make that possible

#

Asm`s your plugin

#

Just make every method public😩

ivory sleet
#

just make every field public also Troll

quasi flint
#

Every class

#

Get publiced

#

Or make everything privateuwu

#

I am a mad man

quaint mantle
#

sponge

quasi flint
#

I now wanna do this when I get out of brussels

quasi flint
ivory sleet
#

so much easier to callback inject in fabric when theres a setter/getter

quasi flint
ivory sleet
#

acc idk, maybe its possible to callback inject fields

quasi flint
#

That transformation will prob take ages with all the method and fields Minecraft contains💀

ivory sleet
#

fr lol

quasi flint
#

But everything for no more private methods

#

Multiple threads

ivory sleet