#help-development

1 messages Ā· Page 754 of 1

storm crystal
#

well j will always be 1 and i will be 0, 1, 2, 3, 4

quaint mantle
#

ooffff

#

i think u and that bald guy need to rekindle

glad prawn
#

bro took the time to try the code 😭

ivory sleet
#

DuskTaler, focus on learning object orientation instead, not this goofy arithmetics stella is quizzing you on lol

quaint mantle
#

goofy arithmetics

#

ok but he’ll actually need for loops in spigot plugins (maybe)

ivory sleet
#

true

young knoll
#

Yandere dev had entered the chat

livid dove
#

Stella u be hurting me stoop.

Just chuck him.at John and call.it a day lol

ivory sleet
#

still you just throw everything at the poor man

livid dove
quaint mantle
#

i threw two compilation errors at him

wet breach
#

that may be true, but they don't need to learn these caveat exceptions quite yet

young knoll
#

You’ll get faster compile times if you manually unroll loops

quaint mantle
livid dove
quaint mantle
#

real

#

who needs indentation anyway

young knoll
#

I do hate misplacing my code

#

It always ends up in the last place you look

ivory sleet
#

Tbh I would’ve despawned at this point if I were him, just learnt variables and now |

quaint mantle
#

despawned 😭😭

wet breach
livid dove
young knoll
#

Bitwise or

ivory sleet
#

Yeah fair, revolutionary usage tho

livid dove
#

You know not.of pain

quaint mantle
#

| isnt even the or sumbol

storm crystal
#

what else is supposed to be here

glad prawn
quaint mantle
#

look at the for loop syntax more closely

young knoll
#

tbf I’m not certain what that code would output

storm crystal
#

it sets j to 0 and adds 1 everytime

quaint mantle
#

it wouldnt

ivory sleet
#

Btw frost did you test gen zgc any?

storm crystal
#

it starts from i = 0 and adds 1 until i = 5 but then the loop breaks so it only prints i up to 4

ivory sleet
#

I ran some iterations with it

young knoll
#

Oh does it actually just not compile

livid dove
#

All in favour of a pseudo compiler for the server say aye 🤣

wet breach
ivory sleet
#

Its better than zgc, but prob needs a lot of manual tuning

young knoll
#

I thought the bitwise or would cause some shenanigans

wet breach
#

and I pretty much slept last weekend I think

ivory sleet
#

ah nice, enjoy weekend then :)

wet breach
#

I don't quite remember

ivory sleet
wet breach
#

I mean sure you can tune the other gc's but its like limiting though

ivory sleet
#

Yeah true

young knoll
#

Gotta be honest, never really had a use for the bitwise operators

storm crystal
#

I really dont get what I did wrong

ivory sleet
#

Apparently it is released, but they had some flags that are still in beta

wet breach
quaint mantle
storm crystal
quaint mantle
#

thats what we’ve been talking about this entire time babes

storm crystal
#

but how am I supposed to know wether it was intentional or you were a lazy ass

quaint mantle
#

oop

quaint mantle
#

now that sounded really bratty

wet breach
#

but when you start getting into lower level stuff of the programming hierarchy like when dealing with protocols, networking related things, or maybe some hardware api stuff you kind of need. There is other areas too, like compression or maybe you are switching between different bases

ivory sleet
#

Yeah

storm crystal
#

dont get me wrong but you sound like that from the beginning

young knoll
#

šŸæ

quaint mantle
#

smhh

ivory sleet
#

Its pretty much essential at low level

young knoll
#

Take it from me, learn java before touching plugins

storm crystal
#

I didnt really have any problems understanding anything from like first 3 videos of Kody (the ones where he actually programs not where he says how to set up IntelliJ etc.), so am I really that lacking?

young knoll
#

I made that mistake like 11 years ago and it was painful

ivory sleet
#

In terms of object orientational knowledge yes @storm crystal

#

especially since you’re new to this entire programming branch

quaint mantle
storm crystal
#

but plugins dont even seem to take it to extreme

quaint mantle
#

plugins ARE oop

#

thats their whole thing

ivory sleet
#

I can give you a real plugin lol

storm crystal
#

why simple correlates to bad in this case

young knoll
#

You mean you don’t use ASM in every plugin?

storm crystal
#

what if my point was to make simple plugins

#

does that mean that its bad

ivory sleet
#

But you will guaranteed have trouble to fix things on ur own if u limit urself

quaint mantle
#

luckperms is so bad šŸ˜®ā€šŸ’ØšŸ™„

ivory sleet
#

which one?

#

bad as in bad, or bad as in the other bad

young knoll
#

Is the code too enterprise for you

ivory sleet
#

It manages permissions

#

Just that

#

In principle

#

🄲

storm crystal
#

im not in any super need to make such thing myself

#

wasnt there a thing called essentials or something like that

#

which makes it for you

ivory sleet
#

I mean depends on what level you want to take things to

#

But programming as a whole is very good for your thinking

storm crystal
#

idc about permissions cuz ill be the only one on the server

ivory sleet
#

It combines theory and practice, also helps with ur ability to think abstractly

#

I mean you gotta think about the future as well

#

Like if you find entertainment in programming, maybe that’s what u wanna do in the future

storm crystal
#

hell no programming is my least favourite IT thing out of all

ivory sleet
#

Oh

#

Thats not a very great start

storm crystal
#

but my courses forces me to take it

#

luckily its python

ivory sleet
#

🤢

quaint mantle
#

frl

#

what do you want to make in a plugin dusktaler

storm crystal
#

2nd semester is gonna be script oriented programming though

#

no idea what about this one

young knoll
#

What does that mean

#

Like JavaScript

quaint mantle
#

so why are you learning spigot

#

i doubt spigot is on your curriculum

storm crystal
#

good point, I can only give you the context that my course is cybersecurity, maybe that could ring some bell

#

and on 2nd semester we have a thing called script programming but no details yet

ivory sleet
#

University?

young knoll
#

Unis love to give fancy names to shit

#

ā€œEmerging web technologiesā€

#

It was node

quaint mantle
#

Machine Learning

storm crystal
#

sadly

ivory sleet
#

That’s nice tho

storm crystal
#

its either that or starve with lowest wage job so I dont have much wiggle room

ivory sleet
young knoll
#

Nah

storm crystal
#

I like telecommunication though

young knoll
#

There are tons of good jobs that don’t need uni

#

Skilled trades are big ones

storm crystal
#

anyway

young knoll
#

Hottub coding stream

quaint mantle
#

omg

#

why didnt we tell dusk to

#

?learnjava!

undone axleBOT
storm crystal
#

I guess ill just continue Kody's course until I approach some big problem

quaint mantle
#

his spigot course?

ivory sleet
young knoll
#

It’s a classic

storm crystal
quaint mantle
#

his spigot tutorials stop at liek episode 9

#

the rest are just miniprojects he makes

storm crystal
quaint mantle
#

you dont need spigot tutorials to learn

#

experiment

#

ask for help

storm crystal
#

What

#

Without this tutorial I wouldnt know how to even set up plugin making

quaint mantle
#
public interface CharacterItemSet {

    @NotNull List<@NotNull ItemStack> getItems();

    @NotNull ItemStack getHelmet();

    @NotNull ItemStack getChestplate();

    @NotNull ItemStack getLeggings();

    @NotNull ItemStack getBoots();

}

If this will also be the implementation of the item set, should I make this implement Listener or make that a seperate interface

quaint mantle
#

oh I cant post imgs

#

wtf

#

ok here

#

characterwar.character.impls.SupermanCharacter <- extends AbstractCharacter, item impls
characterwar.character.Character <- getters to get all the items and names descriptions, etc.
characterwar.AbstractCharacter <- Has impl of the character
characterwar.CharacterManager <- register character

ivory sleet
#

uh sure?

mint meadow
#

Anybody know of a way to make it so you can combine enchantment books that have higher enchantment levels with items that can normally be enchanted. If I combine a sharpness 7 book with a sword it defaults to sharpness 5

quaint mantle
#

because idk I feel like this heavily violates srp

#

the SupermanCharacter class provides all the items for the character and the implementations for them

hybrid spoke
#

not sure where you see a srp violation there

quaint mantle
#

oh

#

alr

#

lol

#

what

#

do I do about this

#

bro

#

ok wait let me verify

hybrid spoke
#

šŸ¤”

quaint mantle
#
    @Override
    @NotNull
    public CharacterVerse getVerse() {
        return CharacterVerse.DC;
    }

    private final ItemStack chestplate = new ItemBuilder(Material.LEATHER_CHESTPLATE)
            .setName("<red>Superman's Chestplate")
            .setColor(Color.BLUE)
            .setUnbreakable(true)
            .build();
    private final ItemStack leggings = new ItemBuilder(Material.LEATHER_LEGGINGS)
            .setName("<red>Superman's Leggings")
            .setColor(Color.BLUE)
            .setUnbreakable(true)
            .build();
    private final ItemStack boots = new ItemBuilder(Material.LEATHER_BOOTS)
            .setName("<red>Superman's Boots")
            .setColor(Color.RED)
            .setUnbreakable(true)
            .build();

    @Override
    @NotNull
    public ItemStack[] getArmor() {
        return new ArmorSetBuilder().setChestplate(chestplate).setLeggings(leggings).setBoots(boots).build();
    }```
#

cause if I provide the item impls I dont wanna call getArmor() and stuff like that all the time

#

it will create new instance if I dont have those fields

#

idk what java does but I feel like it's gonna be crazy on performance

hybrid spoke
#

no idea what you are on about

quaint mantle
#

if i do this instead

    @Override
    @NotNull
    public ItemStack[] getArmor() {
        return new ArmorSetBuilder()
                .setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE)
                        .setName("<red>Superman's Chestplate")
                        .setColor(Color.BLUE)
                        .setUnbreakable(true)
                        .build())
                .setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS)
                        .setName("<red>Superman's Leggings")
                        .setColor(Color.BLUE)
                        .setUnbreakable(true)
                        .build())
                .setBoots(new ItemBuilder(Material.LEATHER_BOOTS)
                        .setName("<red>Superman's Boots")
                        .setColor(Color.RED)
                        .setUnbreakable(true)
                        .build()
                )
                .build();
    }```
#

then whenever I want to lets say check the cooldown for the boot's ability

#

I would need to getArmor()[0] for example

#

and it would create a new object

hybrid spoke
#

i wouldnt expect to create new armor for the character everytime you get their armor

hybrid spoke
hybrid spoke
hybrid spoke
quaint mantle
#

oh I deleted that

#

this class extends AbstractCharacter, which extends Character, which has getArmor() and getCustomItems()

hybrid spoke
#

then either give it the methods back or create another interface which gives them the other methods

#
  • getArmor for clarity
quaint mantle
#

what

#

here's my charcter interface

#
public interface Character {

    @NotNull
    String getReferenceName();

    @NotNull
    String getDisplayName();

    @NotNull
    String getDescription();

    @NotNull
    CharacterVerse getVerse();

    @NotNull
    ItemStack[] getArmor();

    @NotNull
    ItemStack[] getCustomItems();

}
#
public interface Character {

    @NotNull
    String getReferenceName();

    @NotNull
    String getDisplayName();

    @NotNull
    String getDescription();

    @NotNull
    CharacterVerse getVerse();

    @NotNull
    CharacterItemSet getItemSet();
}```
#

@hybrid spoke

#

do you mean something like that

ruby scarab
#

Brb 1 Question

#

Is mentioning my plugin on someone else review section is against the ruels ?

lavish flower
#

I would argue that it depends on the context, but if you interpret the rules literally, then it's a violation of the general forum rule of no advertising outside of the services and recruitments section

quaint mantle
#

why is this happening

#

im using it in this

message.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, new URL(URL)));```
river oracle
#

because

#

you

#

you need to give it a string

quaint mantle
#

oh

#

so "" + URL ?

river oracle
#

no just pass in a string

#

you don't need to wrap anything in the URL object

quaint mantle
#

still says the same thing

eternal oxide
#

you are passing a URL into your URL constructor

quaint mantle
#

oh

eternal oxide
#

so you are doing new URL(new URL("string"))

quaint mantle
#

i deleted it now it works

#

no

#

im doing Open_url, new url(string)

eternal oxide
#

you are not passing a string in there

quaint mantle
#

yeah i figured it out

eternal oxide
#

you are passing the variable URL

quaint mantle
#

thanks

drowsy helm
ruby scarab
fallen lily
#

good luck creating a plugin

quaint mantle
#

sorry

floral field
#

can anybody help me how to add the support of color tags like <hexcolor>string</hexcolor>

#

my question link

echo basalt
#

so basically minimessage

#

but broke edition

floral field
echo basalt
#

??

#

that message makes no sense

#

just parse your messages with minimessage

#

It's what ppl do

#

has all the tags you want

quaint mantle
grim hound
slate tinsel
#

Can I make display blocks fit together such as the glass and "wall"

blazing ocean
#

hello, currently I have an event handler like this: java @EventHandler public void onPlayerMovement(PlayerMoveEvent e) { if (e.getTo().getBlockY() < tgttos.currentMapConfig.deathYlevel && e.getTo().getWorld().equals(tgttos.currentMap.getWorld())) { e.getPlayer().teleport(tgttos.currentMap.spawnPoint, PlayerTeleportEvent.TeleportCause.PLUGIN); TeamPlayer p = MCInfinite.getPlayer(e.getPlayer().getName()); Bukkit.broadcastMessage(p.getDisplayName() + ChatColor.RESET + " died."); } }
but I get this error: [10:05:16] [Server thread/ERROR]: Could not pass event PlayerMoveEvent to mc-infinite v1.0 org.bukkit.event.EventException: null at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?] ... Caused by: java.lang.IllegalArgumentException: location at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?]

eternal oxide
#

invalid world

blazing ocean
hushed spindle
#

anyway i gotta ask again, but i got a multi module project and when i build it the server cant find plugin.yml and i don't know what to change to make my sort of "core" module the main module containing said plugin.yml

#

the other modules are shaded into it and in the project's pom.xml

#

?paste

undone axleBOT
hushed spindle
#

here be the pom.xml

halcyon hemlock
blazing ocean
rough drift
#

you can tell a wall block that it is connected on X side without another block there by editing it's blockdata

shadow night
# echo basalt but broke edition

Isn't mc bedrock for phones basically mc broke edition because it costs less than all other mcs and is kinda uhh, yk, bugrock edition

young knoll
#

Bedrock is jank

#

You gotta buy it separately on each platform

wet breach
young knoll
#

I mean I did get it for free

#

But only the windows version

shadow night
#

I bought bedrock for 2 platforms and 1 I got for free

#

Why? Because I can

#

At this point it's just a useless flex

chrome beacon
#

2x Java accounts 2x Free win 10 + 1x Bedrock for Ipad

#

I don't think the ipad is powerful enough to launch it anymore

young knoll
#

Lol

chrome beacon
#

It's an ipad 2 from 2011 so šŸ¤·ā€ā™‚ļø

#

I used to play pocket edition before getting Java edition in 2013

young knoll
#

My iPhone 7 could run minecraft earth

chrome beacon
#

iPhone 7 isn't that weak though

#

the ipad 2 has 512MB of ram

young knoll
#

Oof

#

Amazing the difference 5 years can make

chrome beacon
#

It got almost unusable when updating it

#

That was a mistake

#

Should have kept the old OS

shadow night
young knoll
#

Back in my day we only had 512mb of storage

chrome beacon
#

My wii only has 512mb of storage

young knoll
#

To be fair

#

Nintendo

chrome beacon
#

Nintendo always sells weak hardware I'm aware

young knoll
#

But they make good games

chrome beacon
#

^^

young knoll
#

Damn you shigeru

chrome beacon
#

Played some a few days ago, games are running great

young knoll
#

I only have win 10

chrome beacon
#

Controllers are starting to have issues though

young knoll
#

Tbf I don’t like bedrock edition so meh

quaint mantle
#

average minecraft bugrock user when they travel too much and fall into void

young knoll
#

It’s so predatory towards kids

chrome beacon
#

Pocket Edition was great but then it turned in to Bedrock šŸ’€

quaint mantle
#

average minecraft bugrock when cross command calling is still possible

young knoll
#

Micro transactions for god damn everything

quaint mantle
#

(it was patched in 1.8.9)

hybrid turret
#

Is it possible to just cast OfflinePlayer to Player?
Like (Player) Bukkit.getOfflinePlayer(UUID.fromString(<uuid from file>))?

(Iā€˜m trying to handle (custom) inventory stuff onEnable which generally needs an online player but i donā€˜t have online players onEnable)

quaint mantle
#

no

young knoll
#

Only if they are online

quaint mantle
#

offline player is cached player

hybrid turret
#

Fuck

#

Damn it how tf is this possible them?? AAH iā€˜m going crazy

young knoll
#

Sounds like

#

?xy

undone axleBOT
chrome beacon
hybrid turret
chrome beacon
#

^^ It does if you pass a name

young knoll
#

Well

#

Depends on which one

hybrid turret
#

But iā€˜m guessing itā€˜s still not possible right?

quaint mantle
#

but like, you cant really do anything with offline player, just store its data

young knoll
#

The uuid version doesn’t need to do an api call

#

If the player isn’t online

#

Ya can’t cast em to player

hybrid turret
# young knoll Sounds like

Still the Vault system. I tried mapping the Vault instances for handling the id of the vault but to create an instance, I need a player

young knoll
#

Sounds like a design issue

fathom siren
#

I need help in perworldplugins

quaint mantle
#

yeah

young knoll
#

Should really only need a uuid

hybrid turret
#

Wait u might be right

#

Imma keep this in mind thanks!

topaz cape
#

like world player data

young knoll
#

Depends

#

An offline player may have joined the server before

#

But they also may not have

hybrid turret
#

If i understood offlineplayer correctly itā€˜s making a call to the api and it also knows if the player has player before (hence → offlinePlayer.hasPlayedBefore())
Anything else wouldnā€˜t make sense

#

Or ig it looks into local files first

#

Then calls the api

young knoll
#

It only makes an api call if you use the string version

#

If you get an offline player by uuid it won’t make an api call

hybrid turret
#

Which i still donā€˜t understand how that would work. E.g. if you have a ban system and do /ban (player) u wonā€˜t let the staff typenout the uuid

topaz cape
hybrid turret
#

*type out

young knoll
#

Since forever

#

The api call is to get the uuid

#

If you already have a uuid then ya don’t need it

#

Generally you’d let staff type out a name and just make the web request for it

topaz cape
#

i call the api manually

young knoll
#

I… okay

topaz cape
wispy flicker
#

Hi guys struggling with config stuff- its probably really simple but im just starting out.

In one of my classes im getting Cannot resolve method 'getConfig' in 'ShopCommand'
however everything i try doesnt fix this... ive watched tutorials, checked other code. my config.yml is where it is supposed to be as far as im aware

hybrid turret
lost matrix
#

?di

undone axleBOT
wispy flicker
#

and thanks, ill look into that

lost matrix
#

You need your JavaPlugin object because it has the getConfig() method in it.
Your command class doesnt have the getConfig() method so you cant just call it randomly there.
Thats all it is.

wispy flicker
#

i see

#

is that because its not in the main class or something?

#

sorry if these are dumb questions im trying to wrap my head around and stuff

chrome beacon
#

Your ShopCommand class doesn't have a method called getConfig

brazen badge
#

I'm trying to ge the base64 from a skull when clicked with PlayerInteractEvent, but idk how to get it. Can anyone help me? Pls

wispy flicker
#

to understand why the issues happen instead of just knowing the fix

chrome beacon
#

JavaPlugin does

#

so you need to get your "main" class which extends JavaPlugin

#

to access that method

brazen badge
lost matrix
lost matrix
chrome beacon
lost matrix
#

Wait

#

I read 1.12.2

chrome beacon
#

API contains all you need

wispy flicker
#

I see, so am i like. referencing the JavaPlugin object (main class) ?

lost matrix
wispy flicker
#

to use the method

brazen badge
lost matrix
chrome beacon
#

Get the PlayerProfile from the skull and then the skin url. Then add the url to:
{"textures":{"SKIN":{"url":"<URL GOES HERE>"}}} and convert that to Base64

lost matrix
#

This is missing a few checks but you get the general idea

    Block block = ...;
    BlockState state = block.getState();
    Skull skull = (Skull) state;
    PlayerProfile owner = skull.getOwnerProfile();
    PlayerTextures textures = owner.getTextures();
    URL skinUrl = textures.getSkin();
chrome beacon
#

^^

lost matrix
#

And then you can either extract the URL from your Base64 value or do it the other way around
and insert the url into what olivo sent, then Base64 encode it and check for equality.

brazen badge
#

ok.. thanks

topaz cape
hybrid turret
#

U call that api urself? Lol

#

Damn

#

The true gamer way. Nothing prebuilt

brazen badge
lost matrix
brazen badge
lost matrix
#

It puts the URL into the string or else it gets the hose again

chrome beacon
#

If you want to encode it use the Base64 class

lost matrix
#

Meaning {"textures":{"SKIN":{"url":"<URL GOES HERE>"}}} is just a String in which you replace the <URL GOES HERE> with your URL.
After that you Base64 encode the String.

chrome beacon
#

Base64.getEncoder().encodeToString(string.getBytes());

lost matrix
# brazen badge the url

I would recommend you to do the following:

  • Get your Base64 string
  • Use the Base64 class to decode it into a readable String
  • Print out the readable String

This should make things clear

chrome beacon
#

I don't think they have a Base64 String

#

They just want to get one from a skull

lost matrix
#

They have one in a config, right?

brazen badge
chrome beacon
#

ah

#

Must have missed that part

#

Now why do you want to do that?

#

If you want to detect your plugin skulls you probably want to attach a PDC tag instead

lost matrix
#

This code

#

results in

{"textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/d0daf5a346a2e805c5203540925e3984fd20e6be12a74eca355fd7bf996c09dd"}}}

Process finished with exit code 0
brazen badge
lost matrix
#

I would recommend you to scrap the base64 String and just let the user input a skin url...

lost matrix
#

How so? Are textures always shown in base64??

brazen badge
#

I converted it but it's not equals

#

my base64: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWMyMWViYzAwMzAxMmIxMjhjNTEwYTg1OThlMTM5ZjUxZjBlYzg4YmE1Y2VhNTg1ZWYwMDdlZDc1NDgzN2ZlMyJ9fX0=
converted:
eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6aHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8xYzIxZWJjMDAzMDEyYjEyOGM1MTBhODU5OGUxMzlmNTFmMGVjODhiYTVjZWE1ODVlZjAwN2VkNzU0ODM3ZmUzfX19

lost matrix
#

Print out both decoded strings and check for diff

chrome beacon
#

One has " " and the other one doesn't

#

(around the url)

lost matrix
chrome beacon
#

Now watch them try to find that

brazen badge
lost matrix
#

I mean... its right below the base64 on head database

chrome beacon
lost matrix
lost matrix
brazen badge
chrome beacon
#

Yeah it's missing the " "

sick edge
#

If I do Scoreboard.Team and then getEntries() how do I cast it back to players?

lost matrix
#

Missing escaped marks

chrome beacon
#

You can't escape that one

#

You need to add a new one

lost matrix
peak depot
sick edge
lost matrix
sick edge
#

Just seems a bit weird due to Name not really being a great identifier but I guess its enough

peak depot
#

is there a wait to load a world and then on its load teleport a player to it

lost matrix
peak depot
tall dragon
#

or u could rely on WorldLoadEvent ig

peak depot
#

yeah that makes sense thanks

lost matrix
#

This my daily reminder that spigots world management system is very outdated... I think a callback would be nice.

sick edge
#

hidePlayer is my best bet from having multiple Player tab lists on the same server without using Packets right?

chrome beacon
#

So there's no difference

mortal hare
#

does any of you know how to changes sources jar base name in gradle?

#
jar {
  archivesBaseName = "your name"
}

only changes the jar file that's being built

chrome beacon
#

Set archiveBaseName in the top of your gradle file

#

instead of only in the jar scope

mortal hare
#

there's no such thing

chrome beacon
#

project.archiveBaseName

#

does exist

mortal hare
chrome beacon
#

oh it's archives not archive

#

project.archivesBaseName

mortal hare
#

nope

chrome beacon
#

Do you have the java plugin?

lost matrix
#

Isnt that a jar prop?

mortal hare
#

gradle 8.4

#

im using java-library

chrome beacon
mortal hare
#
plugins {
    id("java-library")
    id("maven-publish")
}
chrome beacon
#

add the java plugin

#

id("java")

mortal hare
#

but isnt java-library plugin recommended

#

instead of java one?

chrome beacon
#

No idea what the difference is

#

but I assume Java is what you want since that's what it defaults to

#

Default with java plugin:
project.archivesBaseName

mortal hare
chrome beacon
#

Gradle jank as usual

mortal hare
#

ok its a complimentary plugin

#

so basically you use java as a core, and then java-library if you want additional features

#

nvm

#

even with java plugin installed it doesnt work it throws the same

mortal hare
chrome beacon
#

Try skipping the project. part šŸ¤·ā€ā™‚ļø

chrome beacon
#
plugins {
    id 'java'
}

group = 'io.github.olivoz'
version = '1.0-SNAPSHOT'

project.archivesBaseName = "abc"

This works for me

#

That's my entire build.gradle

#

Intellij can't find the archivesBaseName but it does run and work as expected

mortal hare
twin venture
#

Hello , i need help with mongodb, i have it installed on my vps , where the server is running , but for some reason it does not connect :

#

i created new db with a user , pass and added them

chrome beacon
#

Everything is red

#

it does work though

#

(not the basename)

#

Kotlin is pain

#

Deleting .idea folder fixed it

#

šŸ¤·ā€ā™‚ļø No idea how to do it in Kotlin

#

and this why I use groovy with Gradle

chrome beacon
#

I don't think it is

twin venture
#

mm can you send me an example one?

chrome beacon
#

oh wait are you hosting MongoDB yourself?

twin venture
#

yes

#

on my oracle free cloud vps :p

chrome beacon
#

Are you running the server or MongoDB in a container

twin venture
#

minecraft server using pterodactyl panel .

#

and mongodb i don't use container

chrome beacon
#

Then the answer is yes

#

Server is in a docker container

twin venture
#

what i must do to fix the issuse :p

chrome beacon
#

You can't use localhost as the ip

twin venture
#

public ip?

chrome beacon
#

If it's exposed

#

but you probably don't want to do that

twin venture
#

what i should do then :L

chrome beacon
#

Try host.docker.internal as the ip

twin venture
#

Alright

dry hazel
#

(that changes it for all tasks of the Jar type; if you want only a specific one, tasks.named<Jar>("sourcesJar") { /* ... */ } should work)

sick edge
#

How can I hide a death message from some players? IS ther something like viewers like with async chat event?

mortal hare
twin venture
mortal hare
#

by encountering random google's kotlin build.gradle.kts

#

on kotlin

#

works perfectly now

quaint mantle
#

Do you guys know where we could learn more about the configuration section? because I'm not clear on how it works

chrome beacon
#

?jd-s

undone axleBOT
clever lantern
chrome beacon
remote swallow
#

anyone know what these are called, they show infront of variables in methods

chrome beacon
clever lantern
chrome beacon
#

What code did you change?

#

also did you rebuild your project

remote swallow
remote swallow
#

i dont see anything in it hiding same named ones which i wouldve thought is a setting

storm crystal
#

why I get null when im trying to get block that's hit by XP potion?

quiet ice
#

Javac inlines constants even in methods right? So

static final int A = 0;
static final int B = 1;

method() {
  doSomething(A ^ ~B);
}

Would inline the constant?

quiet ice
lilac dagger
#

Yes

#

I found that out when i used my decompiler

#

I thought i was a smart ass from saving my string as a constant

#

Just to find out that in the code it was a constant and inlined

#

Probably the constant was to keep reflections working

quiet ice
#

Yeah I recall bstats having to go to great lengths to prevent constant inlining working

#

Now that I think of it, my question was completely unnecessary... oh well.

young knoll
#

Reminds me of CraftBukkit main

slender elbow
#

mfw they could have used String.join instead of whatever they did with a byte array lol

storm crystal
quiet ice
#

You can also smash an XP Potion against a player iirc

storm crystal
young knoll
#

Yeah you can smash it against any entity

storm crystal
#

blockNaturally just doesnt break

#

even if I smash it directly on block

young knoll
#

Debug out what the block is

#

Print the type

storm crystal
#

always null

quiet ice
#

?jd-s

undone axleBOT
quiet ice
#

It cannot not be null

#

The constructor doesn't support it

#

Probably a bug though. Might be worth reporting it to JIRA (I won't do it though as I have yet to sign the CLA)

storm crystal
young knoll
#

Wait

#

The constructor doesn’t even take a block

#

Or am I blind

quiet ice
#

It is always null

#

As the constructor does not support setting the block

young knoll
#

Or the entity

quiet ice
#

And there is no setter method as far as I can see

young knoll
#

Idk why it extends projectile hit event if it doesn’t include the hit block or entity

#

That’s kinda silly

quiet ice
#

This is entirely spigot's fault and there is nothing you can do outside of hacky workarounds.

young knoll
#

I can look into making a PR

storm crystal
#

so its been an issue for a long time

quiet ice
#

PotionSplash seems to have a similar issue

storm crystal
#

cuz it happened to Kody the same way 2 years ago

quiet ice
#

Yeah they will not simply remove some fields without replacements

#

But not adding fields is nothing new.

storm crystal
#

I expected more from spigot lol

quiet ice
#

I've taken a look and paper doesn't seem to support it either

young knoll
#

Tbf

#

I didn’t even know there was an event for this

shadow night
#

Who did

lost matrix
#

ExpBottleEvent derives from ProjectileHitEvent

young knoll
#

Yes but it’s constructor doesn’t take a block

#

Or an entity

lost matrix
#

Show the CraftBukkit impl. Doesnt it derive the hit target from the bottles location?

young knoll
#

Doubt it

lost matrix
#

If not then Booo

young knoll
#

Otherwise projectile hit would do the same

mortal hare
#

why is it so hard to develop such simple thing in gradle

#

everything

#

works

#

now for some reason intellij doesnt detect sources.jar

#

inside .m2 folder

#

i want to have source files for comments proper argument names and .jar file for compiling against it

#

it exists it just doesnt detect for some reason

slender elbow
#

click that + button

quiet ice
#

And this is why I love eclipse's maven integration

slender elbow
#

can't say I've had that issue though usually refreshing intellij fixes that stuff

quiet ice
#

It automatically detects from which project individual dependencies come from and links the projects together

slender elbow
#

ok

quiet ice
#

But sadly that is not possible under gradle by design.

slender elbow
#

this is not a gradle issue lmao

#

it's intellij being silly

mortal hare
slender elbow
#

it's a warning that it might not be

#

not that it'll be removed the second you click ok

mortal hare
#

there has to be a better way

slender elbow
#

yes refresh gradle from within intellij

#

it should pick it up

sick edge
#

Is there something in the API nowadays so that you can just link a new nether and end to a new world so that it can have its own dimensions?

quaint mantle
#

no

#

bukkit is outdated

#

deal with it

mortal hare
#

ok this is so weird

#

i clicked on to decompile

#

with fernflower right

#

when you ctrl + leftclick

#

and then clicked download

quaint mantle
#

use vineflower

mortal hare
#

and somehow it retrieved it

#

and now it works

#

it simply found the sources in the .m2 repository instead of download and it applied it

slender elbow
#

epic intellij moment

mortal hare
#

for some reason or another it didnt automatically

#

the fact that i even invalidated cache and it didnt work

#

is really messed up

#

i've wasted 3 hours

#

to fix this

#

nonsense

#

great

sick edge
undone axleBOT
tribal cypress
chrome beacon
#

You need to include the code somewhere

#

Either have it as a separate plugin or shade it (include it) in your plugin jar

tribal cypress
#

Well, how would one shade it?

tribal cypress
vagrant girder
#

I am using entity.setGravity(true); and the custom entities are still floating. Is there a method i have to call how some objects have the .update() method?

young knoll
#

what entities

vagrant girder
#

villagers, pigs, just about any of them

#

oh and it is in 1.20

lilac dagger
#

custom entities as in nms?

#

or just bukkit custom

vagrant girder
#

just bukkit custom

lilac dagger
#

then you should see changes as soon as you do them

vagrant girder
#

im using normal entity spawning then modifiing the data contaiuner to hold info

young knoll
#

They should have gravity by default

vagrant girder
#

would ai being false have to do with it?

lilac dagger
#

yes

young knoll
#

yea

vagrant girder
#

oh then how do i enable gravity without them pathing

young knoll
#

If you still want them to have gravity use setAware instead

vagrant girder
#

oh ok

vagrant girder
#

im glad it was something simple

hardy cairn
#

hey so i have made a custom item with a right click ability when it is on offhand, it works as intended but when i have the item in offhand and i want to do other right click actions like eating food it activates. i only want to activate it when it is offhand and when player right clicks and not when he is eating food open chest etc

#

sorry if this is hard to understqand what im saying

lost matrix
hardy cairn
#

can i show you my code?

slate tinsel
young knoll
#

Wall has it's own block data type

#

Called wall

hardy cairn
#

im kinda new at this so it would be nice if you explain it to me..

young knoll
#

Yoiu should use PlayerInteractEvent#getItem

hardy cairn
#

uh

#

uhm ok..

smoky oak
#
public void onFish(PlayerFishEvent event){
  if(! (event.getCaught() instanceof Item item)) return;
  ItemStack stack = item.get...
}

this about right? i havent worked with fishing before

lost matrix
#

Im on my Phone with not enough patience to read kaioken code rn.

tranquil beacon
#

?mappings

undone axleBOT
hardy cairn
#

okay

ocean hollow
#

I need to create a plugin for a private chunk system. I need to create entities around the perimeter of the private area and delete them when turned off. And then, when turned on, upon loading the chunk, create them.

What is the best way to store information?
Via PersistantDataContainer in chunks or MySQL?

smoky oak
#

depends how much data u need to store

#

if its something like 'chunk belongs to player x' just throw the players uuid into the chunk PDC

ocean hollow
#

The name of the kingdom, the coordinates of this chunk on the private map.

#

that is, 2-3 values

lost matrix
#

Entities get saved with the chunk. Why manually save them yourself?

ocean hollow
#

I don’t think it’s completely correct to save 12 entities for each chunk by uuid and then restore them

#

so it seems like it would be easier to recreate them

kindred sentinel
#

If i changed persistantDataContainer should I somehow set it to old itemMeta? Or something like that would work?

ItemMeta itemMeta = item.getItemMeta();
PersistantDataContainer itemTags = itemMeta.getPersistentDataContainer();
itemTags.set(key, PersistantDataType.LONG, value);
item.setItemMeta(itemMeta);
icy beacon
#

Sick fucking speeds

grim hound
#

How can I render some text

#

In a headless environment

icy beacon
#

Not loading

#

Welp

remote swallow
#

sorry that was me

icy beacon
#

What else?

remote swallow
#

my motivation

icy beacon
remote swallow
#

no can do

icy beacon
#

Not them

remote swallow
#

probably cloudflare issues

icy beacon
#

Lmao 5 minutes and it's still going

#

Not giving up

abstract totem
#

Is there any way to duplicate a world without messing directly with the files?

icy beacon
#

Yep cloudflare

remote swallow
#

thats not a cloudflare issue thats a paper issue

icy beacon
#

True

remote swallow
#

that screen means the repo is down and cloudflare cant access it

icy beacon
#

Yeah

remote swallow
#

if that screen didnt appear it was a cloudflare issue

#

with the fact that loads of stuff is down theres probably some ddos proection failing somewhere and its causing issues

icy beacon
#

Unfortunate

#

cloudlfldflfare

#

Yay, it finally gave up

lilac dagger
#

oof

eternal night
#

Wouldn't happen to build tools

smoky oak
#
dropItemStack(location,contents[i] = null);

this passes the value, then sets the array entry to null, correct?

eternal night
lilac dagger
#

better to use spigot api

lilac dagger
smoky oak
#

dammit

#

hm this is weird

#

i cant create an akward potion

lilac dagger
#

create a new object

smoky oak
#

like

#

litearally just 'potion'

lilac dagger
#

and i think it had create()?

smoky oak
#

dont think so

celest notch
remote swallow
#

show ur usage

celest notch
#

YamlConfig config = new YamlConfig("test/test.yml")

remote swallow
#

and you get a file called test/test.yml?

celest notch
#

no i just get a file named ColdForge in the plugins directory

rough drift
#

Ahhh

#

That's the plugin folder

#

So you see

celest notch
#

i know but it creates a file instead of a folder

#

like there is just an empty file called "ColdForge" in my plugins folder

rough drift
#

you should use Path.of and then call extend on getDataFolder().toPath() iirc

lilac dagger
#

then your configuration doesn't parse well /

rough drift
#

You convert the name to a path

#

And then you append it to the data folder path

valid burrow
#

whats a lightweight hologramm api

rough drift
#

It's called resolve

@celest notch

celest notch
rough drift
#

getDataFolder().resolve(Path.of(name));

#

No it has the same issue

celest notch
#

ok can u give me an example, like just the constructor

#

im a bit confused

rough drift
remote swallow
#

File dataFodler = JavaPlugin#getDataFolder();
dataFolder.mkdirs();

File customConfig = new File(dataFolder, path);
rough drift
#

And you should get the proper file

#

I mean not quite

#

That's what he's doing

young knoll
#

And?

#

That works fine

rough drift
#

It isn't working according to him

river oracle
#

pfff imagine not using java nio

celest notch
#

is there a reason why most people type # instead of .

rough drift
#

It's a documentation thing

#

Not actual code

remote swallow
#

saying JavaPlugin#getDataFolder refers to an instance of JavaPlugin, saying JavaPlugin.getDataFolder may infer that its static

rough drift
#

^

celest notch
#

like ideally i want to just input a string: "data/config.yml" and for the plugin to create it in the full path: ".../plugins/ColdForge/data/config.yml" how would i do that

lilac dagger
#

then inside your class make it so plugins coldforge is the default

#

and append the string above

hazy parrot
#

You get your "data" folder with new File(JavaPlugin#getDataFolder(), "data")

#

Then you can create dir if it doesn't exist

lilac dagger
#

this is perfect ^

hazy parrot
#

And get config.yml same way

celest notch
#

JavaPlugin#getDataFolder() will return the coldforge folder in my plugin

lilac dagger
#

that is exactly what you want

celest notch
#

how do i add the additional path

hazy parrot
#

Altrough idk why you want config to be inside data folder, spigot provide api for config already

hazy parrot
chrome beacon
lilac dagger
#

new File(parent, "data")

sick edge
#

Does player.teamDisplayName() only work with the MainScoreboard?

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

sick edge
#

My bad I assumed it exists in both

scenic onyx
#
public static boolean isLookingPlayer(Player player, LivingEntity playerToLook) {
        Vector playerDirection = player.getLocation().getDirection().normalize();
        Vector playerToLookDirection = playerToLook.getLocation().subtract(player.getLocation()).toVector().normalize();


        double dotProduct = playerDirection.dot(playerToLookDirection);


        return dotProduct > 1;
    }

gecause dont go?

lilac dagger
#

the dot product will be wrong if the other player is really close

#

not sure how you would properly fix that

grim hound
#

Mm

lilac dagger
#

because this only does the angle for 2 small points

grim hound
#

How can I draw a String on a 2d graphic in a headless graphic environment?

lilac dagger
#

and it only works if there's a bit of distance, otherwise you won't even see the point

scenic onyx
#

Is there any api that helps you do these things or do I have to do everything by hand?

lilac dagger
#

wait, hge

#

i don't know that

grim hound
#

Yep

grim hound
lilac dagger
#

i don't know how hge works to display stuff

grim hound
#

I

#

T

#

Doesn't

#

That's the thing

lilac dagger
#

oh

#

so then yeah

#

use my stuff

grim hound
#

But I don't display it

lilac dagger
#

you can get the size of the font this way

grim hound
#

It's for map image rendering

grim hound
#

All the other things work

#

Except the Font

scenic onyx
#

can i do it?

lilac dagger
river oracle
#

lol love the drawing

lilac dagger
#

1 for head, 1 for middle and 1 for feet

#

this way, you would cover most of the angles

#

but still not sure how well it would work if close enough

#

might wanna check the angles you're getting

scenic onyx
lilac dagger
#

i don't understand exactly

#

you have 5 points?

#

4 on some hitbox verticies?

#

and a player vector as in where he might be?

scenic onyx
lilac dagger
#

i see

#

what if he is close enough so he doesn't see neither hitbox verticies nor player look?

#

for example when he looks down when hitting a player with a sword

#

are the verticies calculated so they're always aligned this way towards the viewer?

scenic onyx
#

however it should see that it is inside the hitboxes, however the player is seeing the player

scenic onyx
# lilac dagger i see
public static boolean isLookingPlayer(Player player, LivingEntity playerToLook) {
        Vector playerDirection = player.getLocation().getDirection().normalize();
        Vector playerToLookDirection = playerToLook.getLocation().subtract(player.getLocation()).toVector().normalize();

        double dotProduct = playerDirection.dot(playerToLookDirection);

        BoundingBox hitBox = playerToLook.getBoundingBox();
        Vector playerEyeLocation = player.getLocation().toVector().add(new Vector(0, player.getEyeHeight(), 0));

        return dotProduct > 1 && hitBox.contains(playerEyeLocation);
    }

??? i dont know

lilac dagger
#

oh

#

so you're trying to check if the player is inside?

#

the dot will fail even if not inside the bounding box

#

so you can't do this sadly

scenic onyx
#

mmhhhh

#

bruh

lilac dagger
#

also, it has to be or instead of and

#

he looks at player or inside the hitbox

#

i recommend you try what i said

#

and try to see some dot products on a test server

#

so you can do it as best as you can

plush sluice
#

how do i get item meta of PlayerBucketFillEvent using getBucket()?
i need to check if bucket has customModelData and other

lilac dagger
#

it should be in the player hand i think?

#

you can check playerhand

plush sluice
#

i need to check item before event and after

mortal hare
#

is there any VarInt calculator or implementation that I can use to test my own implementation

#

of minecraft varint32's?

chrome beacon
#

wiki.vg has multiple implementations you can take a look at

lilac dagger
#

try getItemStack @plush sluice

#

it has the whole stack and not just the material

plush sluice
#

thats after

#

i need before

mortal hare
lilac dagger
#

oh

mortal hare
#

i've already written my own implementation it seems its working but im not sure

lilac dagger
#

but the event should be triggered after?

mortal hare
#

and i've written it in powershell lol

plush sluice
#

getBucket is before event but i cant get data from it

chrome beacon
lilac dagger
#

so you can use player/getiteminmainhand @plush sluice

#

in the event

#

this one should be before any change

mortal hare
lilac dagger
#

there's setcancellable

#

so i'm pretty sure the event changes only after

mortal hare
#
function Get-VariableInteger {
    param([int]$integer)

    $dataMask = 0x7F
    $signMask = -bnot $dataMask

    [byte[]]$data = @()

    while ($true) {
        if (($integer -band $signMask) -eq 0) {
            $data += $integer
            break
        } else {
            [byte]$fragment = $integer -band $dataMask -bor 0x80
            $data += $fragment

            $integer = $integer -shr 7
        }

    }
    return $data
}

function Read-VariableInteger {
    param([byte[]]$data)

    [int]$integer = 0

    $dataMask = 0x7F

    for ($index = 0; $index -lt $data.Count; $index++) {
        $integer = $integer -bor ([int]($data[$index] -band $dataMask) -shl ($index * 7))
    }
    return $integer
}

this is my impl of varint32 on powershell but im not sure if that's correct

chrome beacon
#

Why Powershell šŸ’€

mortal hare
#

im working on one mini project

chrome beacon
#

so?

mortal hare
#

and i need to implement it on powershell

#

i have uni assignment

#

and im looking forward to write code to do server ping

#

from powershell

#

to retrieve the server info from powershell

lilac dagger
#

is that actually power shell?

mortal hare
#

yes

lilac dagger
#

that's pretty cool

chrome beacon
#

Use bash šŸ™

mortal hare
#

also Powershell is not that bad

#

after learning it i've set it as a default in windows

chrome beacon
mortal hare
#

i have uni assignment

chrome beacon
#

ah

#

Forced powershell project

mortal hare
#

yas

chrome beacon
mortal hare
#

its seems deterministic i input any value with Get-VariableInteger and use Read-VariableInteger and it seems to return the same values

chrome beacon
#

wiki vg does provide that too

mortal hare
#

lets hope that it works

chrome beacon
scenic onyx
#
 public boolean playerAreBeingWatchedBy(Player player, Player targetPlayer) {
        Vector playerDirection = player.getLocation().getDirection();
        Vector targetDirection = targetPlayer.getLocation().toVector().subtract(player.getLocation().toVector());


        playerDirection.normalize();
        targetDirection.normalize();

      
        double dotProduct = playerDirection.dot(targetDirection);

       
        double threshold = 0.8; 

        return dotProduct >= threshold;
    }

go?

twin venture
#

trying to get a NEXT value from a list , for example

getNextRank(String rankName); ... [this is in RankManager]

and each player have a Profile Class , with kills , deaths , CurrentRank ..

so i can just do rankManager.getNextRank(profile.getCurrentRank)

iam trying to do that , but it seems to be not working , i tried LinkedList
but i think i used it wrong

#

this is how iam doing it , but i think iam doing it wrong , very wrong
any ideas?

#

what iam trying to achive is a /rebirth command , so when player reach last rank or Prestige , he can rebirth it will give him some benift ..

smoky oak
#

dunno who gave me this idea, but setting the material of a potion to Potion doesnt do anything to the potoin itself.
also i want to make it into a thick potion, but there's no such potionEffectType

#

wait is it potionType

#

yep it is

storm crystal
#

I have a question about making health bar plugin for enemies, do I just make a listener on entity damage and check if it's a mob and then add a health bar by getting their current and max health?

#

or is there something that I dont really get?

echo granite
#

What approach should I take about saving personal players' info in my plugin's folder, without the server owner being able to access the info?

#

I can't find a way to access players' PCD, but even if I do, how do I verify that a server owner won't be able to read the data?

#

I use spigot 1.8.8

#

It's a big problem because I want my plugin to be cross-version

river oracle
#

use NBT in old versions

#

but make sure to put it in the same format PDC is in

#

then you can begin Using PDC once you reach 1.14

#

?pdc

storm crystal
#

I am a bit confused, how can I get max health of entity?

#

or do anything in regards to their health?

young knoll
#

getAttribute(Attribute.GENERIC_MAX_HEALTH)

storm crystal
#

ah

#

wait why is it in red

#

did I get syntax wrong

chrome beacon
#

You need to check if it's a living entity (or just attributable) first

#

So do an instanceof check and cast

storm crystal
#

I didnt do it correct, right?

young knoll
#

do if (entity instanceof Attributable attributable) {

river oracle
#

instanceof indicating that if true the Entity is inherits Attributable

storm crystal
young knoll
#

Ah rip old java

river oracle
storm crystal
#

17

river oracle
#

like mc version

storm crystal
#

1.20.2

river oracle
#

upgrade to java 17

storm crystal
#

I have java 17

river oracle
#

are you using maven?

storm crystal
#

yes

river oracle
#

?paste

undone axleBOT
river oracle
#

send your mom

young knoll
#

kek?

storm crystal
#

what

river oracle
#

pom

#

lol

smoky oak
#

when a shulker is broken, and you're in it, it fires the inventorycloseevent. why is the inventory obtained through the event not accepting changes when the shulker box is broken? breaking it returns what appears to be a copy, but closing it appears to return a reference

#

yes i checked, both instances return an inventoryType of shulkerbox

storm crystal
river oracle
#

e.g. if you want to support java 17 you need to change it to 17

storm crystal
#

oh

kind hatch
storm crystal
#

do I just change it to 17 and thats it?

smoky oak
river oracle
#

you might need to reload your maven project

storm crystal
#

how do I do it?

#

i mean, properly

river oracle
#

do you see the maven button on the side

#

its just like a M

storm crystal
#

yes

river oracle
#

click it open then press the reload icon

kind hatch
smoky oak
#

bleh

#

i want to make an item not end up in a shulker

#

but right now its duping em

storm crystal
#

how can I get current health of entity?

young knoll
#

getHealth

#

Assuming it's a living entity

hushed spindle
#

Entity doesn't have getHealth()

#

LivingEntity does

#

check if entity is an instanceof a LivingEntity

#

then cast to LivingEntity

#

then you can get health

quaint mantle
#

instanceof can do short casting

hushed spindle
#

LivingEntity also extends Attributable so you dont need to do an unsafe cast to Attributable