#help-development

1 messages ยท Page 113 of 1

kind hatch
#

Writing plain old java code. :PP

quiet ice
#

Lombok on the other hand ...

#

Asking me to use lombok is like asking me to use kotlin gradle. I wont.

river oracle
#

lol your loss

echo basalt
#

There might be some concurrency inconsistencies but I can send 2k item frames and my mspt will still be 0

#

There's a bunch of processing though

river oracle
#

though if you use github copilot that essentially fills the use its just slower

river oracle
quiet ice
#

muhuhaha, my IDE can generate methods

kind hatch
river oracle
#

oh yeah lol

quiet ice
#

Used it once, bricked my eclipse install - never again

river oracle
#

sadge

quiet ice
#

Hence it is on the same level of kotlin gradle

river oracle
#

I've never used kotlin gradle whats wrong with it ๐Ÿคทโ€โ™‚๏ธ i see now reasont o use kotlin

quiet ice
#

While kotlin gradle does also support eclipse in theory, their integration is even worse

viscid fractal
#

does nms 1.19.2 exist?

vivid cave
river oracle
quiet ice
viscid fractal
#

hmmm okay then thanks. back to trouble shooting ๐Ÿ˜ฆ

quiet ice
undone axleBOT
#

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

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

quiet ice
#

probably your issue

#

(also applies to 1.19)

#

It might be better to provie the full stacktrace

#

In case of doubt use if (stack == null || stack.getType().equals(Material.AIR)){

viscid fractal
#

does anyone have a working maven file with nms I can't wrap my head around maven

viscid ember
#
public class AttackEvent implements Listener{

    private MagicMayhem plugin;

    @EventHandler
    public void onEntityDamaged(EntityDamageEvent event){

        double damage = Math.round(event.getDamage());

        Entity EventEntity = event.getEntity();

        Bukkit.broadcastMessage("Damage done " + damage);
        Bukkit.broadcastMessage(String.valueOf(EventEntity));

        EventEntity.setCustomName("โ" + damage);

        BukkitScheduler scheduler = Bukkit.getScheduler();
        scheduler.runTaskLater(plugin, () -> {
            Bukkit.broadcastMessage("Mooooo!");
        }, 20L * 30L /*<-- the delay */);



    }
}```
#

what is wrong with this scheduler

iron glade
#

do you want it to be 30 seconds delay?

viscid ember
#

well i was testing different delays to see if that was the problem

#

i want it to be 2 seconds

iron glade
#

2 * 20L then

viscid ember
#

i tried 20L * 2L still same

#

yh ik but it still doesnt work

iron glade
#

is there a reason you're creating a variable for the scheduler?

#

Are those broadcast messages above the scheduler being broadcasted?

#

/ did you register the event?

viscid ember
#

yes

#

im basically following the spigot offical guide

#

i just have the variable there for now

iron glade
#

your plugin is null

#

I don't see your constructor

viscid ember
#
            Bukkit.getScheduler().runTaskLater(plugin, () -> {
            Bukkit.broadcastMessage("Mooooo!");
        }, 2 * 20L /*<-- the delay */);
tender shard
#

wow wtf

#

gradle's "maven migration" thing is total bullshit

#

it ignores all the plugins and settings and only takes into account the dependencies ๐Ÿ˜„

iron glade
#
private final MagicMayhem plugin;

public AttackEvent(MagicMayhem plugin) {

this.plugin = plugin;
}```
#

and add a "this" when registering your event class

viscid ember
#

oh i forgot to actually set the plugin

iron glade
#

:)

eternal night
#

I mean

iron glade
#

are you switching to gradle?

eternal night
#

how the fuck would it not ignore plugnis

#

or half of the settings ๐Ÿค”

glossy lily
#

is there an event for a non-redstone block being powered

#

for example glass gets powered

iron glade
#

Can non redstone blocks be powered? lol

glossy lily
#

not sure

#

and if not is there a way to make them powerable

#

yea

tender shard
eternal night
#

don't start off with the migration xD

#

if you do a fresh start its pretty nice

tender shard
#

idk it's just so ugly

eternal night
#

no no no

tender shard
#

where is withjavadocJar coming form? where is it defined?

eternal night
#

that is just a method ?

#

das how kotlin works

#

you are inside a lambda

oblique geyser
#

I'm having trouble trying to import FastAsyncWorldEdit-Core 2.4.4 the IDE doesn't give any problem but when try to compile: is giving cannot find symbol in

ClipboardFormats.findByFile(file)
                cannot find symbol->.load(file)
tender shard
#

this is already upsetting me

eternal night
#

its just kotlin xD

tender shard
#

who the fuck thought "yeah I definitely need code to describe my build"

eternal night
#

I mean, "x as code" is getting more and more popular for everything

tender shard
#

well... hitler also became popular once...

eternal night
#

also just makes a lot of sense for builds in my opinion

#

like, if you are maintaining anything as code you can create completely custom build logic in a matter of seconds

tender shard
#

idk to me it just looks like gradle is maven with less features

eternal night
#

wat ?

#

I mean I guess your projects aren't complex enough ?

#

In the normal use case you don't

tender shard
#

they are complex enough for gradle to not understand anything

eternal night
#

but like, I half the time end up with a "I'd like to do this specific thing pre-build"

tender shard
#

?paste

undone axleBOT
eternal night
#

aight ๐Ÿ˜‚ I mean, not like you have to use it

#

staring at xml is also an option

terse ore
#

I have a config.yml with a string named BLACK_STAINED_GLASS_PANE, how can I pass that as argument in a function to be a Material object?

tender shard
#

it got rid of everything

tender shard
#

wheres the shade config

eternal night
#

๐Ÿ˜‚

#

how is maven's gradle conversion ?

tender shard
#

gradle docs claim that gradle init can migrate your pom.xml

eternal night
#

I mean, the basics of it yea

tender shard
#

it claims to migrate all "plugins needed"

eternal night
#

what ?

#

the appropriate plugins to build your code

#

literally with the "limited to" part right there

#

are we reading different things

tender shard
#

the specialsource plugin is needed to build my code

eternal night
#

they LITERALLY list what they can convert

tender shard
#

and its next to nothing

eternal night
#

Then don't use this feature ?!?

#

its a nice addition that they try

#

it is not the core of the build system

tender shard
#

well i dont know, it looks pretty useless to me if it ignores 99% of the pom and then congratz itself for being able to extract the repositories and dependencies

eternal night
#

I don't try maven and my judgement is "oh well it could not migrate my entire gradle build layout automatifcally"

#

Yes, the migration is absolutely useless

#

hence why I stated to please not use it

eternal night
#

and just do a propper fresh creation

tender shard
eternal night
#

to migrate basic projects ?

#

they clearly list the constraints

tender shard
#

idk I've never seen any project that doesnt at least define one or two plugins in the pom

eternal night
#

I mean, compiler plugin is not needed on gradle

tender shard
#

it is of course needed

eternal night
#

no

tender shard
#

but it's defined in the archetype thing

eternal night
#

the java plugin you got is everything that is needed there

#

getting hung up on a migration tool is such a weird thing

#

also believing that lossless conversion from maven to gradle would be possible is just

#

like, what is it going to do with maven plugins ๐Ÿ˜‚

#

magically invoke them ?

tender shard
#

yeah that's another thing

#

gradle doesn't even have most of maven's features

#

e.g. the official maven-shade-plugin

#

there simply is no official equivalent

eternal night
#

I mean, the shadow plugin exists

tender shard
#

and yes, I know, some random person on github wrote something similar, but it's not even officially part of gradle

eternal night
#

oh no, using open source software MonkaChrist

tender shard
#

I dont like my buidtool to depend on random third party people's plugins to be halfway usable

eternal night
#

especially one that is as maintained as that one

#

that software is so far from random

#

its wild

tender shard
#

but why isnt there just an official plugin for this, its just so weird

eternal night
#

ยฏ_(ใƒ„)_/ยฏ

#

why doesn't maven offer proper custom build caching

tender shard
#

I mean gradle just feels like a half-finished of maven

eternal night
#

like, nothing is perfect

tender shard
eternal night
#

how does gradle feel half finished o.O

#

like beyond the fact that the shadow plugin is not an official plugin

tender shard
eternal night
#

that is a literal design decision

#

same reason why spigot does not have a fully fletched command framework

tender shard
#

yeah and I don't like this decision, so I'm talking about it

eternal night
#

or inventory api framework

#

like, you are using stuff from the community anyway.

#

beyond that, what other plugin is third party

#

that you would actually need

#

looking at your pom, shadow is the only one

tender shard
#

many things

#

first thing that comes to my mind is e.g. wagon-webdav-jackrabbit

eternal night
#

a deprecated plugin ? xD

tender shard
#

oh didnt know, they moved it into the default http provider

#

so yeah now maven even has it built in without needing ANY plugin

#

huh am I stupid? where is this error coming from lol

iron glade
#

Love how everyone put the taskbar to the left again on windows 11 xD

alpine urchin
#

eminem

tender shard
#

it says "cannot find symbol" while the declaration is literally exactly there?

iron glade
tender shard
#

because all icons are at a different location all the time

#

like, if you open more windows, then explorer will move to the left

alpine narwhal
terse ore
#
        System.out.println(config.get("menu.normal.color"));
        ItemStack item = config.getItemStack("menu.normal.color");

        menu.setItem(1, item);```
#

Why it isn't setting as RED_STAINED_GLASS_PANE

kind hatch
terse ore
#

after

#

ping me btw

#

wait

#

I got it

#

I used Material.getMaterial()

torn oyster
#

i'm using pterodactyl and my plugin cannot connect to a database hosted on the same machine

#

"Communications link failure"

odd wedge
#

Show the whole method @terse ore

terse ore
tender shard
#

not even PS4 supports 1.8 anymore

opal juniper
kind hatch
#

Lol, wasn't PlotMe the standard back in 1.8?

cosmic pelican
tender shard
worldly ingot
tender shard
cosmic pelican
#

don't be a dick ๐Ÿคทโ€โ™‚๏ธ

#

all I can say

tender shard
#

I am not

quaint mantle
tender shard
quaint mantle
#

no/

#

almost all major servers are 1.8 mains

cosmic pelican
#

6% of servers are 1.8

tender shard
#

yeah 1.8 is dead

quaint mantle
#

ah yeah sure

cosmic pelican
quaint mantle
#

and we go by playerbase

tender shard
#

name one 1.8 server besides hypixel

quaint mantle
#

and wow

#

look at that

#

its almost like 1.8 has a lot more players

cosmic pelican
#

they emulate 1.8

echo basalt
#

hypixel is a modified 1.7

tender shard
#

wtf is wrong with those people

cosmic pelican
echo basalt
#

they use 1.7 nms because they already had a massive codebase around then

cosmic pelican
#

Good luck trying to run a profitable community on 1.8

echo basalt
#

and it was quicker to write your own 1.8 nms impl

#

Source: interviewed for hypixel, even their code challenges are written in 1.7

echo basalt
cosmic pelican
#

How you been man

tender shard
#

so Thunderin is there ANY "major" 1.8 server that you know?

#

because I don't know any

echo basalt
#

.

cosmic pelican
#

Viper, Cave, Palm, etc

tender shard
cosmic pelican
#

it's one of the largest factions server

#

1k+ concurrent

tender shard
#

well currently 622 players online, that's not "major" i guess

cosmic pelican
#

600 on EOTW

#

๐Ÿ’€ you idiot

tender shard
#

wtf is EOTW

cosmic pelican
#

ofc there is nobody on the map is ending

#

end of the world

#

the map is gonna reset

#

๐Ÿคฆโ€โ™‚๏ธ

eternal night
#

Smh Alex just maintain 1.8

tender shard
#

how am I supposed to know when some random outdated server resets their map lmao

eternal night
#

It's the best version

ivory sleet
#

:kappa:

cosmic pelican
#

if you only have dev experience in minecraft dont comment on server popularity or how to grow a playerbase

tender shard
#

I dont think I'm an idiot for not simping on some outdated server

eternal night
#

You are 1.8 is the best version

cosmic pelican
#

im not simping for it im being realistic

echo basalt
#

pro tip

cosmic pelican
#

I prefer modern versions

tender shard
echo basalt
#

charge 20% more for 1.8 plugins

cosmic pelican
#

I'm just defending the reality of the situation

cosmic pelican
tender shard
#

you're just being unfriendly all the time and Imma block you now I guess

vocal cloud
echo basalt
#

just for the extra time thinking about how janky the old api is

echo basalt
echo basalt
cosmic pelican
#

you cant even set entities invis

cosmic pelican
echo basalt
#

haven't done a single commission for you lmao

kind hatch
echo basalt
#

just on the team, chilling

quaint mantle
#

its massive my boy

#

it had 2k on start of the map

candid garnet
#

Hey just installed for myself not for a server. for it to work, I just drag the file into the .minecraft right?

cosmic pelican
#

didn't even accept the 40h/week job that was massive

#

point is

echo basalt
#

I have more to do with my life than being a nerd

eternal night
#

Massive

cosmic pelican
#

dont try and insult me if you are still a contractor under my company which makes more money than you

eternal night
#

The point is massive

echo basalt
#

for example, being depressed in a corner of my room

quaint mantle
#

sorry whats a big 1.19 server?

cosmic pelican
quaint mantle
#

crazy

candid garnet
quaint mantle
#

2k players?

echo basalt
#

hypixel hiring resource pack devs ๐Ÿ‘€

cosmic pelican
#

finally

tender shard
candid garnet
tender shard
#

didnt you buy mcmmo? the discord link is on the plugin page

cosmic pelican
#

I own AbyssDev an industry leader and the fastest growing minecraft service team

vocal cloud
#

Industry leader lol

cosmic pelican
#

We are.

#

We are an industry leader in spoofing.

tender shard
cosmic pelican
#

Hundreds of servers use our plugin, Spoof.

eternal night
#

I haven't heard of either ๐Ÿ˜…

iron glade
#

never heard of

cosmic pelican
#

๐Ÿคทโ€โ™‚๏ธ

tender shard
#

"hundreds of servers" is basically nothing, isnt it?

eternal night
#

LOLOLOL

cosmic pelican
#

when these are active servers with an average playerbase of 100-150 yeah

iron glade
#

I'm sure quite some people here made plugins that hundreds of servers use

vocal cloud
#

Honestly the term industry leader doesn't mean anything when it's not exactly an industry

cosmic pelican
#

considering its a monthly subscription for the plugin as well

eternal night
#

You are flexing with a plugin that spoofs the player count ?

vocal cloud
#

gag monthly sub

cosmic pelican
#

๐Ÿ™‚

kind hatch
#

Lmfao, it's just a product that fakes player numbers by using bots. You have to be fucking kidding me. This is the funniest shit I have ever seen.

eternal night
#

I am dying ๐Ÿ˜‚

tender shard
vocal cloud
eternal night
#

Maybe you are also spoofing your customer count

#

๐Ÿค”

cosmic pelican
#

LOL

#

Funny

iron glade
cosmic pelican
tender shard
echo basalt
#

I am a legal tax evader

iron glade
#

fbi open up

vocal cloud
#

Wait so in other words an industry leader is here among us plebs talking about how they're an industry leader we've never heard about. Indeed.

cosmic pelican
#

alex you are 27 years old man what are you doing with your life

#

in the spigot discord

tender shard
echo basalt
#

oo roasted

vocal cloud
#

Man for an industry leader you're super unprofessional

tender shard
eternal night
#

I mean they are in the "faking success" industry

#

What did you expect

ivory sleet
#

guys drop this non sense right now thanks

eternal night
#

Awwww

hasty prawn
#

Conclure you should honestly just get rid of Relocation LOL

#

All he does is be a dick here

ivory sleet
#

I mean at this point you guys are just throwing shit at each and another

kind hatch
#

Guys, I think I figured out why 1.8 still the "larger playerbase". These mfers are using bots to inflate their numbers. xD
This has been the funniest discovery ever.

ivory sleet
#

literally drop this rn

eternal night
#

Probably best to just drop this for sure

ivory sleet
#

sysdm

cosmic pelican
#

Why do you annotate finalized classes with @UtilityClass if the annotation already finalizes the class?

ivory sleet
#

thanks

quaint mantle
#

keep lying to yourself

#

im sure itll help

cosmic pelican
#

no point in doing it

tender shard
#

and because then intellij will stop complaining about "utility class is not final"

cosmic pelican
#

just seems to me like u didnt research lombok properly

#

Intellij doesn't do that

ivory sleet
#

Relocation you as well

cosmic pelican
#

at least not for me

cosmic pelican
ivory sleet
#

if you wanna debate code design choices, go to #general

tender shard
#

it does that for me

iron glade
#

2min seen this guy here and he already being annoyoing lol

vocal cloud
iron glade
#

sry my bad

ivory sleet
#

guys I wont mention it one more time

tender shard
#

you know what's weird

cosmic pelican
tender shard
#

that calling blockState.update() breaks inventory changes

ivory sleet
#

?kick @cosmic pelican

eternal night
#

Byeee

undone axleBOT
#

Done. That felt good.

hasty prawn
#

Thank god

iron glade
#

cringe guy

hasty prawn
#

Conclure prayge

iron glade
#

ty conclure

eternal night
#

Best conclure

hasty prawn
#

Relocation has his head 8 lightyears up his ass it's insane lol

echo basalt
#

on a side note, I've been working on making an image templating and caching backend for my canvas system

tender shard
#

mfn says Y

iron glade
#

One of those people looking down on others

echo basalt
#

the entire logic is loaded from a yml file

eternal night
#

Ohhh that looks cute

echo basalt
#

sure it's a bit big

#

but very versatile

eternal oxide
#

But can it play Youtube?

echo basalt
#

probably

hasty prawn
#

True it needs a type: Youtube

echo basalt
#

was thinking on making a html5 browser

quaint mantle
#

How would you do audio?

echo basalt
#

it was 4am

#

I don't care

quaint mantle
#

Does the minecraft client accept audio buffers from the server in some way?

echo basalt
#

this is just a test

echo basalt
quaint mantle
#

Yeah, so you wouldn't be able to play audio lol

echo basalt
#

by stacking frequencies

severe oak
echo basalt
iron glade
#

I wanna watch minecraft lets plays in minecraft

kind hatch
quaint mantle
echo basalt
#

make a texture pack with some sounds

#

and stack em and all

kind hatch
#

Oh, wait, that's smart.

eternal oxide
#

well I wonder what you could manage using noteblock packets

echo basalt
#

code-wise, it's simple enough

tender shard
#

there isn't even a plotsquared version for 1.8

#

well PS4 is 1.13+

eternal night
#

Maybe ask the plot square peeps

tender shard
#

yeah okay but that's unsupported and dead

#

I meant there is no supported version for 1.8

echo basalt
#

brother just use whatever you want

eternal night
#

Is anything even remotely maintained for legacy ?

echo basalt
#

it's your server, unsupported regardless

echo basalt
eternal night
#

Ig

tender shard
#

most plugins I know dont even support 1.16 anymore

echo basalt
#

your own api idk

delicate lynx
#

well first, this is spigot

tender shard
delicate lynx
#

2nd, use the ptero network interface IP

tender shard
torn oyster
#

Itโ€™s a spigot plugin I made

tender shard
#

it's not a spigot related question though

quaint mantle
tender shard
#

it's related to docker networking and / or your firewall

delicate lynx
#

ask in the ptero discord, that gets asked every day

#

use the network interface, whatever that IP is

kindred valley
#

Pjng me

tender shard
#

ping you

buoyant viper
tender shard
#

or lifesteal plugins ๐Ÿ˜„

buoyant viper
#

most primarily(hopefully) target latest mc but will still backport to old

kindred valley
#

Alex stop trolling man

#

I literally here for help

#

๐Ÿ˜ก๐Ÿ˜ก

tender shard
#

happy now

#

.<

buoyant viper
#

@kindred valley pong

tender shard
#

poof

kindred valley
buoyant viper
#

essentialsx my beloved

kindred valley
#

The best craftbukkit plugin is worldedit

#

Wd you think

buoyant viper
#

we and wg yea

iron glade
#

Is there a difference between getPluginManager().disablePlugin(plugin) and getPluginLoader().disablePlugin(plugin) ?

buoyant viper
#

fuck around and find out

#

๐Ÿ”ช

#

just check stash @iron glade and see what does what

#

?stash

undone axleBOT
iron glade
#

ty

buoyant viper
#

best case one is a shorthand to the other

#

worst case... idk they do stuff differently

iron glade
tender shard
#

PluginManager#disablePlugin calls PluginLoader#disableplugin

ivory sleet
#

PM deregisters stuff

#

like listeners, and what not

iron glade
#

ahh gotcha

viscid ember
#

So on the player screen i want to display some text

#

is there anyway to render this?

iron glade
#

sendTitle

#

or sendActionBar

viscid ember
#

?sendActionBar

#

is there a link to the api for it

tender shard
#

use Player.Spigot#sendMessage + ChatMessageType.ACTION_BAR

tranquil dome
#

What is the best way to despawn enderpearls after a player has died? Would it be to loop through all entities in the world and then kill the entities that are ender pearls that are thrown by the player, or should I look into PDC and give the item metadata to then determine whether I should kill it once it lands?

#

Or if any of you know a better way, what would you do?

tender shard
#

no need to use PDC

#

just use the thrower

#

and I wouldnt loop over all entities, I#d just store them in a HashMap<UUID,Set<Entity>> or sth like that

viscid ember
tranquil dome
tender shard
tender shard
#

i mean you could also just loop over all entities everytime when a player dies, it probaby doesnt change much

tranquil dome
#

But performance wise it would be better to use the hashmap?

tender shard
#

probably it would be a tiny bit better

tranquil dome
#

even if it is a slight performance increase

#

yea alright

#

ty

tender shard
#

you need to use the net.md_5.bungee.api.chat.TextComponent one

viscid ember
#

oh yh bungee

tender shard
tranquil dome
#

Oh right. That would effectively do the same lol but looks a lot cleaner

flint coyote
#

Does getEntitiesByClass return all Entities or only those in loaded chunks?

delicate lynx
#

the server only can see loaded entities, if they ain't loaded the server doesn't know they exist

flint coyote
#

Thought so. It's not mentioned in the javadoc

tender shard
#

yeah well

#

unloaded = not loaded, so where would it get those entities from? ๐Ÿ˜›

flint coyote
#

all != in loaded chunks imo

tender shard
#

yeah okay that's indeed a bit misleading

#

"currently residing in this world" is kinda not true

flint coyote
#

yeah should be changed to "currently residing in loaded chunks of this world" or something along those lines

tender shard
#

it's also kinda weird that it returns a Collection instead of a List

flint coyote
#

I mean I guessed that it would be loaded chunks only but with that description it sounded weird

flint coyote
tender shard
#

yeah and the javadocs also says "it returns a list"

#

and it DOES return a list, but it declares it "only" as collection lol

flint coyote
#

didn't even notice that lol

mighty aurora
#

I added this to my plugin and it stopped working. Their were/are no errors and everything appears to be fine(I changed only two other lines and I already verified that they are correct, this is the only one I am iffy on).
if (event.getPacketType() == PacketType.Play.Server.ENTITY_EQUIPMENT && (p.getScoreboardTags().contains("shadowhuntactive") || p.getScoreboardTags().contains("shadowsneakactive")))(there is more to the if statement but I didn't change anything else in it.)

tender shard
#

?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.

tender shard
#

am I stupid, or are these kotlin docs talking about "data classes" not explain at all on how to declare fields?

#

I mean you cannot really call it "data class" without any fields right?

mighty aurora
#

Sorry I guess I should have clarified. This plugin adds abilities to items that activate on right click of the item. Before modification of the system(basically remove everything past the && in the if statement) it was working but I needed to get the system integrated with my item abilities so I added that segment. When I compiled the plugin and then loaded it onto a server it gave no errors but it did nothing either. I double checked that I had the correct activation and it wasn't doing anything. I am in the development phase so I basically have a logger that tells me anytime anything is activated and nothing was being activated. It wasn't detecting item right clicks(whether or not they were the correct item) and it wasn't doing anything.

tender shard
#

copilot is meant for stuff like this

river oracle
flint coyote
tender shard
#

kotlin just adds nothing useful for me so it's useless to learn this weird new syntax

quaint mantle
#

Lol

flint coyote
#

Sad. Kotlin can do some great things. Data classes, extension functions, better lambdas, default finals, no checked exceptions, no setters and getters to name a few

tender shard
#

hm well

#

data classes and extension functions, I can do with lombok. better lambdas? what is different there? I dont know. No checked exceptions, I see this is an absolute downside. No setters and getters? Yeah that's also a horrible decision imho

#

also extension function sare basically just static methods that take in some arg

flint coyote
tender shard
#
public class Person {
  public void kill();
}

I mean an extension function would just do it like this:

public class MyClass {
  public static void killPerson(Person person);
}

not really any difference imho

tender shard
flint coyote
#

Lambdas are just cleaner

tender shard
#

it should either be declared in the actual class, or just be a static method

tender shard
flint coyote
tender shard
#

seems very weird to me to do those dirty hacks

#

e.g. "lets pretend kill is part of Person even though it isnt and that's also the reason why I have to pretend this in the first place"

quaint mantle
#

Java better imo

tender shard
#

I#d rather do PersonUtils.kill(person)

flint coyote
tender shard
tender shard
#

it should just be ClassName.methodName

flint coyote
#

I mean there's certainly a lot of personal preference in those differences. I use both

Kotlin at work
Java as a hobby

tender shard
#

I just dont like all those design decisions that kotlin made

#

for me, kotlin is like java with a weird syntax lol

#

with additional inconsistencies

flint coyote
#

And I prefer java. But I feel like that's because I'm using java since 7 years and Kotlin since 6 months

eternal oxide
#

Kotlin is the .Net of Java

river oracle
#

kotlin is just quirky and nothing more

tender shard
#

I mean just imagine you have a class with an "age" field as int

#

it's a public field, but you also declared a setter (because, e.g., for historic reasons, idk)

#

and now you do this:

#

MyClass.age = 3;

#

does it call the setter now?

#

or not?

#

in java it's straightforward. If you call the setter, it calls the setter, if you set the field, it sets the field

#

kotlin however does some "guessing" and calls this "conciseness" and that's just weird imho

shell finch
#

is there any way to set an entity to be in a riptide state?

flint coyote
tender shard
#

or lets say, it could be a protected or private field

flint coyote
#

if it's a private field it would call the setter

tender shard
#

yeah and isn't that extremely stupid?

flint coyote
#

idk what it does when it can access the field.

#

Means when inside the class it won't use the setter. When outside it would

#

I guess

#

Most of the time we just have data classes anyway since we are in Spring context and that's mostly Entities

tender shard
#
public class Person {
  int myAge;

  public Person(int age) {
    this.myAge = age;
  }

  public void setAge(int newAge) {
    if(newAge > myAge) throw new IllegalArgsException("You cannot become younger");
    this.myAge = newAge;
  }
}

So this would never work when doing new Person with an age above 0?

#

because obv the setAge method is meant to be used from outside, but not from inside

flint coyote
#

Yeah I would guess (again, only guess) Kotlin takes the field when it can access it (protected, public or inside the class) and the setter when it can't

tender shard
#

yeah that's what I think too, but that's the issue

#

we both don't know it, we literally have to guess what a programming language does, although programming languages should be desidned to do exactly what they are told to

#

and not just randomly insert their own logic

flint coyote
#

I mean if we would know it would do exactly that

tender shard
#

and that's what I don't like about kotlin

flint coyote
#

So if it does how I say it will always do how I said

#

then it isn't 'we don't know' anymore

tender shard
#

that is also so weird

#

like, imagine someone else does this

myPerson.age = 3;
#

and now I suddenly make the int field public

#

and now the behaviour of the other class changes

#

so weird

flint coyote
#

That's true but usually you don't want public fields. And if you want a public field you don't want a setter and would remove it.
You still might run into it with private vs protected but ye idk how you would resolve those issues. Never ran into that.

tender shard
#

it's literally not possible to explicitly say "I wanna use a method" or "I wanna set a field" in kotlin unless maybe with reflection

tender shard
desert frigate
#

idk if i can ask help for protocalllib here but how can i set the MetaData for a npc? basically set it to swimming

ProtocolManager manager = ProtocolLibrary.getProtocolManager();
           PacketContainer packet = manager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
           packet.getIntegers().write(0, npcEntity.getEntityId());
           packet.setMeta("18", 3);
tender shard
#

do you really need ProtocolLib for this?

echo basalt
tender shard
#

imho PLib just makes everything much more complicated

desert frigate
tender shard
#

lol wtf is this supposed to mean

tender shard
echo basalt
#
EasyMetadataPacket metadata = new EasyMetadataPacket(npcEntity);
packet.write(18, Whatever);
packet.getWatchableCollectionModifier().write(0, metadata.export());
flint coyote
#

ok after a short research on Stackoverflow it seems that
Kotlin always uses the setter and never accesses the property directly.

tender shard
#

even when I do it in the same class?

#

e.g. my Person "setAge" example above?

flint coyote
#

That's what the guy on SO said. Looking for something official atm

tender shard
#

because that would mean that the setter is limited to accepting values that are valid during constructing the object and cannot limit it further (e.g. not allowing a "younger than previous" age)

quaint mantle
tender shard
#

oh I really didnt understand the first part of the sentence lol

echo basalt
#

uhh

#

yeah I'm an idiot

#

but you get the flow of it

#

metadataPacket.getWatchableCollectionModifier().write(0, metadata.export()); // Exports and writes metadata into packet

flint coyote
tender shard
flint coyote
#

so you can add other values during class generation but not after that

tender shard
#

but yeah, this is so many random things, I'd rather just use java and know what it does exactly ๐Ÿ˜„

echo basalt
#

alex you seem to really struggle

#

I can imagine your brain just going like

#

public, no wait, private, int? actually it's a character

tender shard
#

yeah haha

desert frigate
# echo basalt `metadataPacket.getWatchableCollectionModifier().write(0, metadata.export()); //...

like this?

EasyMetadataPacket packet = new EasyMetadataPacket(npcEntity);
           packet.write(18, 3);
           ProtocolManager manager = ProtocolLibrary.getProtocolManager();
           PacketContainer packet1 = manager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
           packet1.getIntegers().write(0, npcEntity.getEntityId());
           packet1.getWatchableCollectionModifier().write(0,packet.export());
           try {
               manager.sendServerPacket(player, packet1);
           } catch (InvocationTargetException e) {
               throw new RuntimeException(e);
           }```
echo basalt
#

I mean

#

you gotta write the pose

#

not the ordinal

desert frigate
#

i did-

flint coyote
#

You get used to specialties of languages

tender shard
#

how are playing card suits called again? I only remember the german names lmao

#

e.g. spades, heart, and... the other two?

echo basalt
#

wrap it with EntityPose

echo basalt
tender shard
echo basalt
#

I struggle to remember sometimes because the only deck I got is a minecraft deck

desert frigate
echo basalt
#

that has gold bars, hearts, diamonds and shovels

echo basalt
tender shard
#

lol

echo basalt
#

You should probably rename some stuff

desert frigate
#
java.lang.IllegalArgumentException: argument type mismatch```
#

eee

tender shard
#

hm copilot claims it's called "clubs" ant not "clover"

echo basalt
#

then it's not entitypose grr

tender shard
#

but anyway, both is a C and thats good enough lol

echo basalt
#

actually no it should be

#

grr

desert frigate
#

grrr

#

i tried 3

#

same error

echo basalt
#

try passing null on the metadata constructor

desert frigate
#
java.lang.IllegalArgumentException: No serializer found for class com.comphenix.protocol.wrappers.EnumWrappers$EntityPose```
echo basalt
#

ahh

#

uhhh

#

pass the entitypose#getHandle

#

idfk

#

actually now that I think about it

#

you might need to add your own serializer for that

desert frigate
#

omfg

#

why is this so hard

#

grr

echo basalt
#

just add into the WriteData method

#

just copypaste but change the registry

#

I could've made it a lot better honestly lol

desert frigate
echo basalt
#

this stuff

#

that's just copypaste

#

add into it

#

for entity poses

#

nvm there's no entity pose serializer

tender shard
desert frigate
tender shard
#

wdym?

desert frigate
#

u tried to help me before

#

remember

#

and we both failed

tender shard
#

I dont remember

desert frigate
#

oh

#

lemme find msgs

tender shard
#

I write many, many, many messages here every day ๐Ÿ˜„

#

or were you the person who used ANT instead of maven?

echo basalt
#

I mean

#

nms has a serializer for poses

desert frigate
#

wait nvm it was from someone else

tender shard
#

hm well

#

what's the problem with using NMS then?

desert frigate
#

well

#

i cant get build tools or java to work

tender shard
#

wow wtf, some people really have a weird coding style lol

tender shard
desert frigate
#

nothing

#

nothing shows

#

i cant use like java -version

#

or stuff

tender shard
#

have you tried to install another JDK? E.g. switching from oracle JDK to Adopt-OpenJDK or whats it called again?

desert frigate
#

the messages from before

tender shard
#

hmmm

tender shard
#

well I'd probably try to get rid of java completely, then reinstall it from scratch. I mean it sucks anyway if your java doesnt work properly, not only for not being to run buildtools

tender shard
#

if(v.isEmpty()) return true

#

why didnt they just return v.isEmpty()

echo basalt
#

Im asking whomst the hell

tender shard
#

oh

#

wait

echo basalt
#

is writing such cursed code on this land

tender shard
desert frigate
#

and no luck

echo basalt
#

banger pfp

tender shard
#

lol yeah

#

I've looked at their Solitaire repo

#

because idk I wanted to code some card game

echo basalt
#

I like how my github activity is just an indicator of how depressed I am

tender shard
#

lol

#

yeah for me it's a bit the other way around

echo basalt
#

you can tell I got depressed in december and june

#

and last week too

tender shard
#

when I do many contributions, then my life is good. When I suddenly stop doing pull requests or commits, then Its because I got alcohol addicition problems again lol

echo basalt
#

yeah that

tender shard
#

for real why did this dude code so weird

#
    public Card popFirst()
    {
        if (!this.empty())
        {
            Card c = this.getFirst();
            v.remove(0);
            return c;
        } else
            return null;

    }
#

why not just like this? lol

    public Card popFirst() {
        return !isEmpty() ? cards.remove(0) : null;
    }
#

ugh how can I have "deprecated features" in my build.gradle.kts when I literally just created it with gradle init like 20 minutes ago

#

is there someone here who's good in reading bytecode? I have this very weird problem and have no clue why it happens

worldly ingot
#

Did your code even compile? lol

tender shard
#

the decompiled version also looks fine

#

no idea why it's crying about "Object cannot be an entity" since obviously I don't use any "Object" declaration :/ kinda weird

#

i don't even use Entity

#

what's weird is that line 115 tries to assign an EntityArmorStand to a variable that's defined as EntityAreaEffectCloud

#

but this error gets thrown even when I not call createHologram at all

worldly ingot
#

Was just going to point that out too

#

Yeah it's a classloading error

tender shard
#

I actually declare it as "entity" and not as AreaEffectCloud or whatever

#

probably I gotta message allatori support again ๐Ÿ˜„

#

damn I got it fixed

buoyant viper
lost matrix
tender shard
#

otherwise I couldnt declare it in the interface

#

I cannot make it return net.minecraft.....

lost matrix
#

Ok but createHologram is not exposed, is it?

tender shard
#

it kinda is

#

HologramManager.createHologram returns an "object" which is the actual hologram, and that calls my NMSHandler's createHologram method, shown above

lost matrix
#

So the api user calls createHologram and gets an Object...

tender shard
#

yeah well not exactly

#

they do new Hologram(...) and ofc get a hologram, but it also has a method like getNMSEntity() or similar, and that one returns the actual NMS entity

lost matrix
#

You have a Hologram interface which is returned to the api user.

tender shard
#

my whole hologram code is pretty shit. I wrote that when I only started to learn about how to do maven modules etc

#

I think it's a leftover thing from before I started to use modules and yeah that's why it returns an Object

lost matrix
#

Ok weird... and it actually spawns entities and doesnt work through sending packets.

tender shard
#

it's total shit ๐Ÿ˜„

tender shard
lost matrix
#

At this point i would consider using BetterHolograms...

tender shard
#

the ClientboundAddEntityPacket indeed needs an entity instance

lost matrix
#

Ah ok so they are not spawned. Nice.

tender shard
#

yeah I'm actually not even using my own hologram API. I just wrote it because I once thought it might be useful but yeah

#

it's now part of JeffLib without anyone using it lol

lost matrix
#

XD

tender shard
#

anyway, I got this weird "bad type on operand stack" thing fixed by telling allatori about the spigot dependency

#

adding those .jars to the classpath made allatori understand to not mess with this kind of things lol

gray merlin
#

I have added my dependency into a module of mine, with the shade plugin, but it for some reason isn't getting added to the final jar. I have done this 10 other times in the same way and it has worked... what could be the issue?

#

I'll share my POM

#

?paste

undone axleBOT
gray merlin
#

The dependency in question is the Commons one

#

there are no issues in the pom itself syntax-wise or dependency-wise

#

adding the compiled scope doesn't help

chrome beacon
gray merlin
#

yeah

chrome beacon
#

How are you using them?

#

If you're using reflection your classes probably got minimized

gray merlin
# chrome beacon How are you using them?

In a variety of ways... But to sum it up, they're vital for any version of my plugin to work. They contain interfaces for command registration, they contain common GUI code, reflection in a few, they contain enums, etc etc

#

In my main file I use one that handles my commands

gray merlin
#

Besides, it worked just fine in my other 10 versions

tender shard
#

minimizeJar will get rid of everything you not explicitly access

#

I use filters to avoid this from happening

lost matrix
#

Are you using a custom nms mob?

gray merlin
#

Define explicitly access?

tender shard
gray merlin
#

Oh I see

tender shard
#

if you do new Hologram(...) once, then it knows that you access it

#

but since you probably don't wanna do stuff like that, filters are the way to go

#

e.g. my com.jeff_media.jefflib.internal.nms.... stuff is only accessed by reflection, so I just add a filter for this

echo basalt
#

remapped:

nms.Creature#getNavigation().setTarget(nmsPlayer, speed) iirc

gray merlin
#

Yeah that's fine, I use every every class inside there, directly or indirectly

#

So it shouldn't be an issue...

echo basalt
#

yeah

#

should be a navigationabstract

tender shard
echo basalt
#

type deal

tender shard
#

or, better:

#

try to set minimizeJar to false, and see if it works now

#

if it still doesn't work, the problem is something else

lost matrix
#

Then just add ai goals

echo basalt
#

you can add AI goals for targetting a player

#

but you still gotta use navigation to make it move

tender shard
#

JeffLib also has a wrapper for goals so one could use them without any NMS, just wanted to mention ๐Ÿ˜›

echo basalt
#

so does my paper fork

tender shard
tender shard
lost matrix
#

Atrocious...

tender shard
#

whut

echo basalt
#

I mean mine has a wrapper for goals

tender shard
#

you shouldnt check canUse in your tick method

echo basalt
#

not just pathfinders

tender shard
#

tick() only runs when canUse() returns true anyway

#

the server will NEVER call your tick() method when canUse returns false

gray merlin
#

Nope, doesn't work without minimizeJar

#

Ehh, i'll figure it out tomorrow. It's 2AM now

tender shard
#

well then show all your pom.xml files pls

echo basalt
#

too early

#

continue coding

#

still hateful

#

tick() only gets called if canUse() returns true

#

and it stalls operations for all other following pathfinder goals

#

internals look like something basic like

List<Goal> sortedByPriority = ...;

for(Goal goal : sortedByPriority) {
  if(!goal.canTick())
    continue;

  goal.tick();
  break;
}
#

probably with timings code on top and all

#

when you register a goal

#

it has a priority

#

that's just a sorted list based on priority

lost matrix
#

And as soon as a goal is available to be ticked the rest arent ticked anymore.

echo basalt
#

the registry stores it as a Set<WrappedGoal> where a WrappedGoal is just a Data Class (goal, priority)

#

I'm too mentally deranged to explain it with simple words

#

wasted like 3 hours coding a .yml -> imageboard parser

#

that caches images and stuff

tender shard
#

yeah it just loops over all registered goals, sorted by priority, and then executes the first one that returns canUse() == true

#

it makes the mob move

#

you normally shouldnt call this yourself

#

moveTo basically sets a "destination" / "path" to the mob, and tick() checks every tick() whether there is any destination set, and if yes, it makes the entity move there

#

moveTo should better be called "setTargetDestination" or so

#

the server basically does this every tick:

for entity : all entities
  if entity has destination set (using navigation.moveTo... )
    make entity move towards destination
#

so it's pretty pointless to call tick() yourself

eternal oxide
#

you set flags on the mob to influence him. It then checks those flags in its tick()

tender shard
#

you try to make mobs move to the nearest player, right?

lost matrix
#

Or you just use ai goals and tell the mob to follow its target. Take a look at tameable animals and how they follow someone that has food.

tender shard
#

normally,. to make mobs move to the neearest player, you'd just do something ilke this:

in canUse()
check if a player is nearby, if so get the nearest player. check if the mob is already "near enough" that player. if they ar enot near enough, return true

in start() (optional)
get the nearest player's location and save it somewhere

in tick()
check if there's already a target location saved, if so moveTo(there). Otherwise, get the nearest player again and moveTo() there

#

probably not the optimal solution but should work fine

#

e.g. this

public class MoveToPlayerGoal extends Goal {
    
    private final Mob mob;
    private Entity nearestPlayer;
    
    public MoveToPlayerGoal(Mob mob) {
        this.mob = mob;
    }
    
    @Override
    public boolean canUse() {
        nearestPlayer = mob.getLevel().getNearestPlayer(mob, 100);
        return nearestPlayer != null;
    }

    @Override
    public void tick() {
        mob.getNavigation().moveTo(nearestPlayer, 1);
    }
}

#

everything there is NMS

#
package com.jeff_media.test;

import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.ai.goal.Goal;

public class MoveToPlayerGoal extends Goal {

    private final Mob mob;
    private Entity nearestPlayer;

    public MoveToPlayerGoal(Mob mob) {
        this.mob = mob;
    }

    @Override
    public boolean canUse() {
        nearestPlayer = mob.getLevel().getNearestPlayer(mob, 100);
        return nearestPlayer != null;
    }

    @Override
    public void tick() {
        mob.getNavigation().moveTo(nearestPlayer, 1);
    }
}

#

full class with imports ^

#

yes

#

i think everything in minecraft is measured in "blocks"

#

wtf is this new?

#

I've never seen this "notification" thing before

buoyant viper
#

not that new

tender shard
#

lol I've never seen it

#

I must be blind, idk

buoyant viper
#

had it for about 6 months now i thonk

#

i use community edition

dusk flicker
#

it might be in meters alex

tender shard
dusk flicker
#

yeah

tender shard
#

I somehow fucked up my whole stuff lol

dusk flicker
#

i got like fucking 10 windows defender notifications today for some stupid reason lol

#

oh really lol

tender shard
#

yes, that should work fine

dusk flicker
#

it was yelling at a file I had and finally I just said remove it

#

if it breaks my pc idc

tender shard
#

but @quaint mantle

#

you hardcoded 1 as speed now

#

1 is pretty slow for some mobs and pretty fast for others

#

I also have no idea

#

you wont find anything useful in the API I guess

#

I also looked for hours

#

you'd have to check in the NMS classes and see what speed values they use

lost matrix
#

Sometimes movement is applied as a percentage of the movement speed attribute.
So passing 1.1 sometimes makes the mob move at 110% speed.

tender shard
#

I think villagers use 0.5 as speed

#

for normal stuff

#

wdym?

#

you have to remove the already existing goals to stop that, I guess

#

yeah that will remove all other goals and only make the mob do what you tell it to

#

np!

#

yeah the whole goal logic is extremely simple

#

it basically just runs the tick() method of the first goal that returns canUse() == true

#

true

#

if you got everything working, you can start to put some logic into the start() method to not do math everytime in tick()

#

well normally entities have more than one goal

#

e.g. usually, mobs will just "stroll around". But if they were attacked, they run away, so canUse() for the runAway goal is only true when they were hit within the last 2 seconds or so, etc. And then they will also have some kind of "go to player if they have wheat in their hand" goal, etc, bla bla

#

so yeah the canUse() thing makes sense

#

you mean, go away from you?

#

or stop "going to you" if they are already close?

#

you return false in canUse() if they are already within 3 blocks to nearest player

#
    @Override
    public boolean canUse() {
        nearestPlayer = mob.getLevel().getNearestPlayer(mob, 100);
        double distance = mob.distanceTo(nearestPlayer);
        if(distance <= 3) return false;
        return nearestPlayer != null;
    }
#

oh ofc check whether nearestPlayer is null befoirehand

worldly ingot
#

mfw not just returning distance > 3 && nearestPlayer != null

tender shard
#

yeah

#

I just coded this as example

#

obviously it's not perfect ๐Ÿ™‚

#
    @Override
    public boolean canUse() {
        nearestPlayer = mob.getLevel().getNearestPlayer(mob, 100);
        double distance = nearestPlayer == null ? 0 : mob.distanceTo(nearestPlayer);
        return distance > 3;
    }
#

sth like this

#

oh yeah zombies etc will burn

#

but I dont know how to prevent this

lost matrix
#

You can just not make him burn in the sun... lol

tender shard
#

yeah but how? lol

#

it's not a goal, it's somewhere else

lost matrix
#

Just overwrite the method which makes the zombie burn in the sun. I think there is also a property for that.

echo basalt
#

override isSunSensitive

#

or cancel the event

tender shard
#

there's isSunBurnTick()

#

declared in the NMS Mob class

#

no idea if there's some better way but you could just override this and return false all the time

#

every months I wish that hetzner forgots to send the invoice but they never forget to do so D:

#

yeah, only your comment is wrong ๐Ÿ˜›

#

"Return true if the mob is within 16 blocks but not nearer than 3 blocks" lolz

#

but yeah, looks good

#

I just ctrl+B into the classes in intelliJ

#

ctrl+B shows the source

#

e.g. just write "Mob" somewhere, select it, then do Ctrl+B

#

then you have the source for the whole Mob class in IntelliJ

#

probably netbeans can do it doo

#

too*

#

oh that looks like the builtin decompiler is a bit shitty

#

the community edition is free and perfectly fine to use for 99.9% of things

#

it only lacks some special features like MySQL stuff

buoyant viper
#

what

tender shard
#

yeah I also didnt understand this sentence

#

that's not an IJ ultimate feature

#

this whole "tab thing for 2 projects" is a macOS feature

buoyant viper
#

yea

tender shard
#

on windows, neither IntelliJ CE nor ultimate can do it

#

on macOS, both CE and ultimate can do it

#

๐Ÿ˜„

buoyant viper
#

i got one :)

#

just a few years old

tender shard
#

I'm still waiting for the 16 inch macbook pro with m2 cpu

#

to replace my 2017 mbp

echo basalt
#

I might buy a m1 macbook just because I want a decent laptop for coding

buoyant viper
#

2013 mba ๐Ÿ’ช

echo basalt
#

still got a year of school left and my laptop got like 6 bit color and it's awful

tender shard
#

it's so awesome

#

but there's no point in buying an M1 now

echo basalt
#

it's still good

tender shard
#

either wait for the M2 to be released and buy an M2, or wait for the M2 to be released and buy the M1 for cheaper

echo basalt
#

I don't care about the battery life

#

but I'd like to tell the difference between the gray tones on intellij

tender shard
#

it's going to be released this months or next month or so

#

so yeah don't buy an M1 now

#

yes, but the code I sent will set distance to 0 anyway if nearestPlayer is null

echo basalt
#

I don't think that's gonna work

#

specifically because

#

people don't update every year here

#

half the mfs I know are using their laptops from like 2014

#

the laptops on the school's cisco-certified computer lab are IBM thinkpads

tender shard
#

I still got a macbook from 2007 lol

#

but I havent used it in years

echo basalt
#

running kali linux

#

that's how broke people are here

tender shard
#

thinkpads are quite expensive, arent they?

echo basalt
#

I was literally tasked with grabbing mediocre pcs, stripping parts and upgrading existing pcs

echo basalt
tender shard
#

true lmao

echo basalt
#

I hate this so much

tender shard
#

yeah you messed up the order

#

FIRST, set nearestPlayer

echo basalt
#

just look at the attack code for zombies smh

tender shard
#

THEN, get the distance

#

not the other way around

#

right now, nearestPlayer is always null

#

yeah that looks good

#

np

#

btw when something doesn't work - just add a ton of debug statements

buoyant viper
#

System.out.println("gay");

#

println("fuck")

#

println("addhfds")

tender shard
#
        @Override
        public boolean canUse() {
            // Return true if the mob is within 16 blocks but not nearer than 3 blocks
            nearestPlayer = myMob.getLevel().getNearestPlayer(myMob, 16);
            sout("Nearest Player: " + nearestPlayer);
            double distance = nearestPlayer == null ? 0 : myMob.distanceTo(nearestPlayer);
            sout("Distance: " + distance);
            sout("Distance > 3: " + distance > 3);
            return distance > 3;
        }
buoyant viper
#

imagine using debug msgs that make sense

tender shard
#

(where sout is System.out.println(...))

echo basalt
#

lmao imagine

tender shard
buoyant viper
tender shard
#

add those debug statements

echo basalt
tender shard
#

and check what it says

tender shard
# echo basalt

real chads throw IllegalStateExceptoin in such cases lol

echo basalt
#

the return null is supposed to worky as a feature

tender shard
#

yeah

echo basalt
#

I don't want to force people to use trycatch everywhere

tender shard
#

huh

#

where is the difference