#help-development

1 messages Β· Page 942 of 1

wet breach
#

Yeah well its a private hospital so they get to make the rules lmao

#

Public hospital would not even be able to charge that much

icy beacon
#

Let's say you were to suffer a cardiac emergency suddenly (e.g. cardiac arrest). How much would you be billed and how much would you end up paying? Just an approximate number

#

Particularly in your case with your insurance etc

wet breach
#

Depends, but you could easily expect $2k-$5k on the low end and no more then $10k

#

For me its free since i have the VA

#

If i used my jobs insurance i would probably only pay $500

icy beacon
wet breach
#

A good majority yes. So as i said just before you replied i would probanly have to cover $500

#

General rule is your insurance will cover something like 70%-80% of the bill. The rest would be on you. Lowest you could expect or most is you are covering half but thats like dirt cheap insurance lmao

icy beacon
#

I see. That's kind of a relief then

#

Though I was browsing my brain and a topic of housing prices came up 😬😬

#

They are an atrocity across the entire world rn

wet breach
#

Most people are not ending up in the hospital either. So medical stuff is only a worry if you are a frequent flyer

icy beacon
#

But from what I know it's really prevalent in the US

wet breach
#

Housing prices vary wildly on state and where in that state lmao

icy beacon
#

How about yours?

lilac dagger
#

but not by much

wet breach
#

I currently pay $1,500 for a one bedroom apartment. Its like almost 900sq ft

#

And my utility bill is usually no more then $140

lilac dagger
#

that's nice

#

but buying is a different case

icy beacon
#

I'm struggling to visualize 900sq ft lol

icy beacon
tender shard
lilac dagger
#

the houses start at like 500k

icy beacon
wet breach
#

83.6 sq meter

#

Oh alex beat me

tender shard
wet breach
#

Lmao

icy beacon
#

Well that's long lmao

#

Well would 83sq meters be sustainable for, for example, a small party? Like idk 7 people celebrating new year and goofing

tender shard
#

sure

lilac dagger
#

of course

icy beacon
#

For some reason I find it hard to visualize 83 sq m sorry lol

wet breach
#

My apartment is almost a perfect square. 30ft x30ft

icy beacon
#

That's true

#

Well frostalf you have succeeded in breaking a thick layer of my bias xD

wet breach
#

9.1m x 9.1m

lilac dagger
#

i assume it has walls

tender shard
#

i just googled "80m^2 apartments" and this eg is one

icy beacon
#

Yo that's plenty of space

#

Nice

wet breach
lilac dagger
#

yes i know, we do the same here

#

i'm talking if your perfect square is separated by walls

wet breach
lilac dagger
#

like here

wet breach
#

Bedroom?

lilac dagger
#

bedroom has to of course

tender shard
icy beacon
wet breach
#

Oh interesting

tender shard
#

I'm just upset that carlos doesnt show up

icy beacon
#

Yeah I've heard some good things about life in Germany

icy beacon
wet breach
#

To be fair alex is rich like me

icy beacon
#

Flexing on us peasants xD

tender shard
icy beacon
#

Ah

#

That's very punctual of him

tender shard
wet breach
tender shard
icy beacon
wet breach
#

It broke

tender shard
#

there is no door

#

there used to be a normal wall

icy beacon
#

Ah yes, the most convenient door. No door

wet breach
#

But alex didnt break it this time.

icy beacon
#

European walls are no shit

#

They will not break at a punch of a fist xD

tender shard
#

the idea is to have a "walk through" kitchen with no walls

#

erm

#

no doors

icy beacon
#

Living room to kitchen

tall dragon
upper hazel
#

ArrayDeque is it synchronized by bakkit?

#

or cannot be combined with bukkit task and asynchrony

#

I'm deleting the chunk if necessary

gentle nexus
#

if i want to start plugin dev
where should i start from ?

lilac dagger
#

write a simple plugin

upper hazel
lilac dagger
#

you can see all forms of tutorials by search on youtube google duckduckgo

#

i don't know if rtp is the best

#

he'll end up tp into some chunk

upper hazel
#

simple rtp plugin

#

not one that uses a lot of math, but just a teleport

minor junco
gentle nexus
#

i dont know kotlin tho

minor junco
minor junco
gentle nexus
#

any useful links ?

minor junco
#

It's just another language that compiles to the JVM

minor junco
#

Maybe this helps

tender shard
#

it doesnt explain the API though, only the project setup

minor junco
minor junco
gentle nexus
#

i should use maven over gradle right ?

fallen lily
chrome beacon
#

Use what you're most comfortable with

#

if you've never worked with neither of them then start with maven

tender shard
fallen lily
#

javac go crazy

wet breach
#

That is because they dont bother learning build systems. One of the disadvantages of not having formal education in such things

fallen lily
#

Hey, minecraft didnt use a build system

wet breach
#

But now they know so hopefully they will take time to learn and research things

wet breach
#

The common build system that most IDE's default to is the ant build system

#

Exception is eclipse they always done their own thing lol

fallen lily
gentle nexus
#

jdk version 17 for mc 1.20.4 ??

fallen lily
#

Manually added to compilation classpath

fallen lily
#

.minecraft/libs

#

except they have been flattened down to include group, name & version sub-folders

wet breach
gentle nexus
#

ill have to create a server to test my plugin right ?
is there any place where i can run a server for a short period of time for free ?

remote swallow
#

your own computer

gentle nexus
#

my pc isnt very strong

glad prawn
#

dont worry

agile berry
#

gguyys how to properly exclude meta-inf from jar in maven?

#

can't fix sertificate error for a week :<

chrome beacon
#
<configuration>
    <filters>
        <filter>
            <artifact>*:*</artifact>
            <excludes>
                <exclude>META-INF/**</exclude>
            </excludes>
        </filter>
    </filters>
</configuration>
#

I believe

icy beacon
#

Sniped

upper hazel
#

what is the name of the antivirus jar plugins that 1 person created and posted on spigotmc

#

we talk with him

#

long time ago

remote swallow
#

optic?

glad prawn
#

cats

upper hazel
#

this name start with A

#

Ad... Aw somentihg like this

remote swallow
#

no clue then

#

the only antiviris i know of on spiot is made by optic

upper hazel
#

person say what this plugin should have been paid

glad prawn
#

bro are u ask the owner name or the plugin name

upper hazel
#

both

#

for find name

remote swallow
upper hazel
#

like yes

gentle nexus
chrome beacon
#

I used to run Intellij + 2 clients + server on my i5 3470

upper hazel
#

how to put head in tab with skins in the license server

lost matrix
upper hazel
#

without tab plugin heads exists

lost matrix
upper hazel
#

why do some plugins remove the heads on the tab when enabled?

chrome beacon
#

If you're talking about flickering extra heads that could be because of plugins like Citizens

#

That's due to a limitation of Minecraft

#

The packets required to spawn an NPC with skins is the same as adding it to the tab

#

so what they do is add it and then remove it again

upper hazel
lost matrix
#

In newer versions this doesnt happen anymore becuase you can make a client aware of another player without adding him to the tablist

upper hazel
#

you mean heads removed or tab plugin remove this

lost matrix
#

You gonna end up accidentally summoning a demon if you dont stop with that gibberish...

upper hazel
#

sorry I don't understand English well

upper hazel
lost matrix
#

I think i get what you mean.
What they do is fill the tablist with empty profiles.
No skin, no tab name.
After that you can simply update the tab entries.

#

You want to know how those empty slots are made, right?

upper hazel
#

I want to know how to make a plugin on a tab so as not to remove the head from the tab

upper hazel
#

soryy

#

like NOT premium tab

lost matrix
#

Idk what premim tab is

chrome beacon
#

Probably talking about an online mode server

#

still no idea what they're trying to do though

upper hazel
#

premium tab removes heads from the tab when using the plugin and I want to create my own so that it does not remove heads from the tab

chrome beacon
#

??

upper hazel
chrome beacon
#

so it's not online mode

#

No idea what premium tab is then

upper hazel
#

or tabs plugins not remove heads?

chrome beacon
#

It shouldn't do that

#

if you're having issues ask their support

upper hazel
#

oh this mean someone lie me

chrome beacon
#

I mean it could be a setting

#

It's been a while since I last used it

upper hazel
#

how to make own plugin not affect the head in the list of tabs

chrome beacon
#

ask the tab support

ocean hollow
#
        RayTraceResult rayTraceResult = player.getWorld().rayTraceEntities(getLocationInFront(player, 1.2), player.getLocation().getDirection().multiply(1), Bukkit.getViewDistance(), 1f);
        if(rayTraceResult == null) {
            Bukkit.broadcast(Component.text("RTR = null"));
            return;
        }

        Entity entity = rayTraceResult.getHitEntity();
        if(rayTraceResult.getHitEntity() == null) {
            Bukkit.broadcast(Component.text("entity = null"));
            return;
        }
        if(entity == player){
            Bukkit.broadcast(Component.text("entity = player"));
            return;
        }

        if(!(entity instanceof LivingEntity)){
            Bukkit.broadcast(Component.text("entity is not living"));
            return;
        }

        Bukkit.broadcast(Component.text(entity.getType().toString()));
        ((LivingEntity) entity).damage(damage);
    }```

```     private Location getLocationInFront(Player player, double distance) {
        Vector direction = player.getLocation().getDirection().normalize();
        Vector offset = direction.multiply(distance);

        Location locationInFront = player.getLocation().add(offset);

        return locationInFront;
    }``` i wrote this, but it doesn't work. the result of raytrace is player.  but player is looking on sheep, i was trying to add to location distance, so as not to count the player, but it didn't help
eternal night
#

You'll want the eye location

#

Additional, you also can just pass a predicate to the raytrace method and filter out the source player

quaint mantle
#

can u send packets async?

#

erm i will j test it

eternal oxide
#

yes

gentle nexus
#

do i need to make my command class in the same folder as my plugin class
or somewhere else ?

chrome beacon
#

it's up to you

lost matrix
echo basalt
#

In short I'd make a package for commands

ocean hollow
#
    public void fire(Player player, ItemStack item){
        playFireSound(player.getLocation());

        damageUsingRayTrace(player);

        if(item == null) return;
        if(item.getType() == Material.AIR) return;
        if(item.getType() != material) return;

        ItemMeta itemMeta = item.getItemMeta();
        itemMeta.setCustomModelData(fire[0]);
        int nowBullets = item.getItemMeta().getPersistentDataContainer().get(MoreBullets.WEAPON_BULLETS, PersistentDataType.INTEGER);
        item.getItemMeta().getPersistentDataContainer().set(MoreBullets.WEAPON_BULLETS, PersistentDataType.INTEGER, nowBullets-1);
        item.setItemMeta(itemMeta);

        Bukkit.broadcast(Component.text(item.getItemMeta().getPersistentDataContainer().get(MoreBullets.WEAPON_BULLETS, PersistentDataType.INTEGER)));
    }
``` why pdc is not updating
young knoll
#

Because you are calling item.getItemMeta each time

#

Which returns a copy

#

Use the ItemMeta instance you already have

ocean hollow
#

ohh, okay

upper hazel
#

in bukkit api exists event which check in which location or block the dropped item fell?

#

oh wait i find

gentle nexus
twin venture
#

Hi i have a question , how i can make it so when player do /link , it will give him the rank he have in game to the discord server the bot in?

#

i don't want to use extra 3rd plugin

gentle nexus
lost matrix
twin venture
#

for now iam using JDA library

gentle nexus
lost matrix
echo basalt
#

itemtype rework maybe?

lost matrix
#

Wait, is that merged?

#

?stash

undone axleBOT
echo basalt
#

no but ppl keep coming up with development builds

gentle nexus
echo basalt
#

Ah I see

#

Generics

#

Remove the generic on your CommandKit class

lost matrix
#

🀨

gentle nexus
#

oh

#

my ide added it there idk how

#

no errors now thx

twin venture
lost matrix
#

When the player types /link then you can just send him a code he has to enter on discord.
In the backend you store <TheKey : MinecraftUUID>.
Then you wait for the player to use a command on discord with the same key.

There are more sophisticated ways, but this is a trivial approach.

echo basalt
#

muh time limit

lost matrix
#

You could also send the player a link with metadata attached. This way he only has to click on the discord link and is attached automatically

echo basalt
#

send a button

#

or sumn

#

on discord

#

tell him to press it at the same time trol

lost matrix
#

Within 500ms or he is not human

echo basalt
#

same tick

twin venture
#

who linked

lost matrix
#

So you are asking how to send data from one application to another?

twin venture
#

possible?

#

for example i use luckperms , get the rank player have and assign it in discord

lost matrix
#

Yes, ofc. That how the entire internet works...

twin venture
#

after he do /link

lost matrix
#

There is a million different ways you can do that.
Just use whatever you are familiar with. RPCs are an option. I think discord has those.

twin venture
#

alright thanks , gonna see how i can do it

lost matrix
#

Webhooks work.
Opening a rest endpoint on your bot works. (It uses those anyways).
Sockets work.
Redis or RabbitMQ works.
RPCs (as mentioned before)
SQL update hooks are also ok

lost matrix
twin venture
#

i decided not to make the fake armorstand with protocollib , i will use a lib for that ..

#

to much work to support 1.8 - 1.13.2 , 1.16.5 , 1.19.4 , 1.20.4

river oracle
#

Lol bro what is that version support xD

#

You need mental help?

tardy delta
#

no 1.19.2?

slender elbow
#

why would you lol

quiet ice
#

1.13.2 is a rather interesting one. And why no 1.12.2?

#

so yes, mental help may be needed

smoky anchor
#

I believe 1.12 is within the range 1.8 - 1.13

slender elbow
#

1.8 ≀ 1.12 ≀ 1.13

#

1.2.5 ≀ 1.20.4

quiet ice
tired star
#

Im experiencing weird issue thats related to BukkitTask. I want to execute a task after a delay. However my code seems to run only when the delay is set to 0.

            logger.info("Now inside BukkitTask Task");
            new TridentHandler(player, trident, logger).runTask(plugin);
            cooldowns.put(player.getUniqueId(), System.currentTimeMillis() + cooldown);
        }, cooldown);```
#

is there something im missing here? 'plugin' variable is defined before task and pointed to my main class that extends JavaPlugin

tawdry echo
#

You using ticks or seconds?

smoky anchor
#

You should not be using Player in tasks iirc
Always use UUID and get the player when the task is run
For your actual problem, idk sadly

tawdry echo
#

I gues seconds

kind hatch
#

Bukkit stuff uses ticks

smoky anchor
smoky anchor
#

I'll let someone smarter explain that, I am not even sure you are supposed to do that here
But I believe it was something with keeping the Player in memory if player already left

tired star
#

i actually have the cooldown calculations in different function that returns the value in milliseconds

meager hollow
#

true

tired star
#

yea gonna do that :D thanks

smoky anchor
blazing ocean
#

havent experienced UB in spigot yet, ill test it

meager hollow
#

but why stores Player πŸ€”

blazing ocean
tired star
#

ive been a fool. thank you guys for help

icy beacon
#

looking at old code of mine πŸ’€

river oracle
#

does the name of AttributeModifiers matter?

icy beacon
#

let's dive in πŸ‘€

#

well this caught me off guard

#

is that a curly bracket or are you just happy to see me?

#

every beginner java dev 🀝 static abooz

#

i'll carry on coding πŸ‘‹

quiet ice
icy beacon
#

wtf was i cooking 😭😭😭😭

#

i couldn't come up with this if i wanted to these days

quiet ice
#

well at least it was minecraft:clear and not just clear

icy beacon
#

xd

quiet ice
wet breach
blazing ocean
icy beacon
blazing ocean
#

πŸ”₯

icy beacon
#

why are you doing this while in Main 😭

blazing ocean
#

listen

#

it was my first plugin

#

and my first time ever "properly" using java

icy beacon
valid burrow
icy beacon
#

well we get to cyberbully each other on the basis of our first plugins

#

isn't that the bonding experience we all need

tough prairie
#

can someone help me my server keeps crashing at net.minecraft.nbt.MojangsonParser.g(SourceFile:189) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]

blazing ocean
icy beacon
valid burrow
#

ill make hotkeys soon for it

tough prairie
quiet ice
#

Okay the worst infraction I did in my first plugin was making my fields be uppercase for the first character

quiet ice
#

I never touched C# funnily enough

blazing ocean
#

kinda goated honestly

quiet ice
#

And I won't ever touch it either

valid burrow
icy beacon
blazing ocean
minor junco
icy beacon
#

im not getting any work done with this shit 😭

valid burrow
icy beacon
valid burrow
#

i spend most of my day looking at shity code

icy beacon
icy beacon
#

and it's horror

blazing ocean
valid burrow
#

wanna see one of my old plugins? xd

echo basalt
#

ew

valid burrow
#

ive got a better idea

icy beacon
icy beacon
valid burrow
#

i can send u a project i used to teach fresh beginners java/spigot

icy beacon
#

dont ask

#

it came to my head and i was like oh that's brillinnt!

#

then i made it

#

and like

blazing ocean
#

what the fuck

icy beacon
#

well it exists now

valid burrow
icy beacon
#

i can do 9.million instead of 9000000

#

so cool

echo basalt
#

hey, psst

blazing ocean
icy beacon
#

we are sharing SHITTY code rn illusion

echo basalt
#

oh mb

icy beacon
echo basalt
#

got it

blazing ocean
icy beacon
#

nice conventions drvosss lol

blazing ocean
valid burrow
#

i let them have their freedom

icy beacon
#

long exists too

#

short and float eh

valid burrow
valid burrow
blazing ocean
#

wait guys

#

i have an even better one

#

not open source

young knoll
#

I've seen those team names before

#

somewhere

blazing ocean
#

hmmmmm

valid burrow
#

anyways

blazing ocean
#

listen

#

i was really shit back then

valid burrow
#

too bad

#

ive seen so much shity code now

#

that every time i see that fish

echo basalt
#

you probably still are mcci hasn't been a thing for that long

valid burrow
#

i will think of it

blazing ocean
#

that was actually an mcc recreation

#

before mcci was a thing

#

πŸ€“

echo basalt
#

same shit

blazing ocean
#

so were just ignoring the fact that it exists for like 5 years or so

echo basalt
#

yeah that's not long

blazing ocean
#

true i havent been doing plugin dev for long

#

i just wanted to check the first commit and then realised there was no git repo in there 😭

#

my plugin.yml can time travel

tardy delta
#

you havent seen what i wrote

echo basalt
#

ow

tardy delta
glad prawn
#

Builder!!

tardy delta
#

thats some of the better code in my first plugin

blazing ocean
#

lol

glad prawn
#

lol

gentle nexus
#

Error occurred while enabling pluginname v${project.version} (Is it up to date?) java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.sendMessage(String)" because the return value of "org.bukkit.Bukkit.getPlayer(String)" is null
when im running my server then im getting this error in the console
i added some events and listerners to my plugin btw

tardy delta
glad prawn
#

null check then

tardy delta
gentle nexus
tardy delta
#

because one doesnt exist with that name?

#

print out all player names or smth

gentle nexus
#

do i need to add my player name or somin ?

tardy delta
#

no just make sure its valid, idk where you got that name from

gentle nexus
#

i need my player name
iv made some baisic code that broadcasts stuff when the player joins the server

#

public void onPlayerJoin(PlayerJoinEvent event) { event.setJoinMessage("Welcome to this server!"+ event.getPlayer().getName()); }

glad prawn
#

yeah?

gentle nexus
# glad prawn yeah?

ye
so then im getting this error in console

Error occurred while enabling pluginname v${project.version} (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.sendMessage(String)" because the return value of "org.bukkit.Bukkit.getPlayer(String)" is null

tardy delta
#

show surrounding code

gentle nexus
#

its in this class
public class MyListener implements Listener {the methord}

#

nd some imports thats it

valid burrow
#

thats doesnt really make sense

valid burrow
#

how did you setup your main?

#

i think you didn’t register the listener properly

scarlet gate
#

I'm trying to boost a player's fortune enchantment on their tool by 1 when breaking certain blocks if possible (eg. Fortune 1 gives the drops of Fortune 2)
I currently have tried cancelling the drops and then using Block#getDrops(ItemStack) to spawn new drops but am realising that this would break compatibility with custom drop plugins
Any ideas?

valid burrow
#

u dont need to cancel and replace

#

u can edit existing ones

#

and by making your listener get called last you can make sure that other plugins apply their custom drops first

#

(event priority)

scarlet gate
#

That solution is definitely possible but I'm not sure how I would calculate the enchantment increases for this

valid burrow
#

get the drops and do x2

#

or what ever your multiplier is

scarlet gate
#

So manually calculating the fortune for any extra drops is the best way?

gentle nexus
valid burrow
#

i wouldnt know any other way

near crypt
#

how can i check if the player has no inventory opened

valid burrow
#

cant

#

at least for their own inventory

#

you can only check chests and stuff like that

near crypt
#

i want to check a custom inv

valid burrow
#

p.getInventory

#

is null

near crypt
#

oh get inventory, ok

valid burrow
#

wait no

#

one sec

near crypt
valid burrow
#

that would get the contents of their imv

#

yh wait

#

1 sec

#

im slow

#

getOpenInventory @near crypt

near crypt
#

its also never null

valid burrow
#

uhh

#

i mean

#

u can cache when ever they open and close their inv ig

near crypt
#

thats what i want to do, but how can i check when the inventory is closed.. this is my problem

valid burrow
#

InventoryCloseEvent

near crypt
#

hmm ok

#

the thing i want to do is just to stop a runnable when the inventory is closed by the player

gentle nexus
#

wait ima reask my question
It was completely wrong
so my code is
` public void onPlayerJoin(PlayerJoinEvent event) {
event.setJoinMessage("Welcome to this server!"+ event.getPlayer().getName());
Bukkit.broadcastMessage("Welcome to the server!");

}` 

and in my main class
public void onEnable() { getServer().getPluginManager().registerEvents(new MyListener(), this);}

#

im my chat nothin shows

#

same as the console

dry hazel
#

you need an EventHandler annotation on the listener method

#

@EventHandler

gentle nexus
#

oh

#

so for every event methord i need that annotation ?

dry hazel
#

yes

scarlet gate
# valid burrow probably yh

At what point should I be modifying the drops - I was looking at BlockDropItemEvent and saw that I shouldn't be adding drops through it
"It is not legal however to add new items to the list"

gentle nexus
#

even tho my code is in the other way

#

im just wondering whats the reason behind that

hazy parrot
#

I would assume event is called before player actually join

#

And join message is sent later

#

While your broadcast fires instantly

inner mulch
#

why cant they just let me do it πŸ˜”
java.lang.IllegalStateException: Asynchronous player kick!

lost matrix
lost matrix
young knoll
#

Why do you need to run a kick method async anyway

inner mulch
chrome beacon
#

It still needs to be done sync

#

what happens after it's done has nothing to do with the problem?

lost matrix
# inner mulch the player isnt sync after the kick either way, so?

He is registered in lists, he has an attached entity in the world that needs to be removed sync, the PlayerQuitEvent needs to be called sync.
There are just so many parts that could cause the current tick to throw an exception if you where to force an async kick.

inner mulch
#

ok

icy beacon
#

one can say that

#

calling it async will violate ocp

#

iykiyk

inner mulch
#

how do i establish a ManyToOne relationship in hibernate, with just the uuid (primary key for the OneToMany object)

rough drift
scarlet gate
rough drift
#

that was everything I'll say

lost matrix
solemn meteor
#

how does player.getInventory.getItem(int i) work, like what number do I have to put to get the item of a specific spot

#

is it 0-35 or 1-36, and does it start the count on hotbar or the top

inner mulch
#

i only have the uuid

lost matrix
lost matrix
solemn meteor
echo basalt
#

0-8 is hotbar

#

and then it does 9-35 top left -> bottom right

#

36 is boots iirc

#

40 is offhand

urban kernel
#

for required args should i use [] or <>

in my usage

solemn meteor
#

thank you

lost matrix
# inner mulch i only have the uuid

Relationships can exclusively be define between two entity classes.
UUID is not an Entity class so you cant define a relationship with it.

inner mulch
#

the UUID is referenced in both entities

lost matrix
#

I mean you can just create a table for your UUIDs. And let them be stored for your objects without a relation contract:

    @ElementCollection
    @CollectionTable(name = "entity_uuids", joinColumns = @JoinColumn(name = "entity_id"))
    @Column(name = "playerIds")
    private List<UUID> playerIds = new ArrayList<>();
inner mulch
solemn meteor
#

btw i kinda forgot this part, if you get a slot's item and its empty, does it return null or an itemstack of air?

urban kernel
lost matrix
lost matrix
solemn meteor
inner mulch
lost matrix
inner mulch
#

to the bandata so i have all of them in a set

#

i dont know if there is a getall method in hibernate

#

i dont know how to get alle references of a uuid

#

so i just tried it like that

thick oracle
#

Hey,
I'm spawning some Mobs with my plugin, but when I spawn a Mob with EntityType.ZOMBIE it catches on fire.
I know so far this sounds like the normal behaviour, however I have disabled visual fire, so I'm unsure of what to do

Mob mob = (Mob) player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE);
mob.setInvulnerable(true);
mob.setVisualFire(false);
mob.setSilent(true);
chrome beacon
#

I assume visual fire doesn't override the regular fire

#

Just give it fire res or smth

valid burrow
#

set fire ticks to 0

chrome beacon
#

Won't help

valid burrow
#

it should if you do it after visual fire is turned of

chrome beacon
#

It makes sure the changes to the mob are applied before it's spawned

#

instead of after

#

Could change the result assuming what DrVosss said is true

lost matrix
thick oracle
# chrome beacon Could change the result assuming what DrVosss said is true

All the other methods apply apart from the fire (unless I'm misunderstanding the method)
I'd honestly assume that the consumer just passes the created mob, I wouldn't see any reason for it not to

Edit: yea the method seems to just toggle whether visual fire should be always visible, so I'm using the method wrong

tardy delta
#

not even an erd, or a very shitty one

inner mulch
dawn flower
#

can u custom color a potion while still having a specific effect

inner mulch
#

i havent gotten one to work

blazing ocean
dawn flower
#

nvm i found setColor in potionmeta

dawn flower
thick oracle
chrome beacon
#

?

#

Fire resistance should stop zombies from burning

#

Show your code

thick oracle
#

fire resistance only makes them not take damage tho, no?

chrome beacon
#

should also stop them from starting to burn

#

if they aren't burning

#

or so I remember it at least

#

can check

thick oracle
# chrome beacon Show your code

Same code as before essentially. I tried fireResistance before using the method that takes a Consumer<Entity>

Mob mob = (Mob) player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE);
mob.setInvulnerable(true);
mob.setSilent(true);

PotionEffect fireResistance = new PotionEffect(
        PotionEffectType.FIRE_RESISTANCE,
        Integer.MAX_VALUE,
        1,
        true,
        false
);
mob.addPotionEffect(fireResistance);
chrome beacon
#

interesting it doesn't stop them from starting to burn

#

Does your code require it to be a zombie

thick oracle
#

I need to work with all hostile mobs pretty much

chrome beacon
#

oh well ig you could use nms

wary harness
#

So I got a problem with one of my plugins is getting flagged as trojan

wary harness
#

how can I resolve that problem

wary harness
#

and it is pain in ass to explain to each of them that there are false positives

lean pumice
#

?paste

eternal oxide
#

generally if you use straight Java with no reflection/tricks you will not be flagged

undone axleBOT
lilac dagger
chrome beacon
lilac dagger
#

or this

lean pumice
chrome beacon
#

If it's Windows Defender they have their own page for that

quaint mantle
#

what am i doing wrong here

playerInventory.first { it != null && it.isSimilar(ItemStack(Material.getMaterial("COPPER_BLOCK")!!)```
echo basalt
#

BedWars.getInstance().getArena().getConfigFile().getFileConfiguration().getStringList

lilac dagger
lean pumice
lilac dagger
#

you can't remove elements from a collection without traveling

quaint mantle
#

it.type == material.Copper_Blcok doesn't work

lilac dagger
#

however there is the iterator form that allows you that

lean pumice
#

is a simple steam

#

idk why get error

#

i mean get error team.getPlayers()

#

but idk how resolve

minor junco
#

what's the error?

lilac dagger
#

it might be your team.getPlayers, what do you do inside?

lean pumice
#

is a list

eternal oxide
#

?paste a stacktrace

undone axleBOT
minor junco
lilac dagger
chrome beacon
lilac dagger
#

i really think the bug is elsewhere

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.

eternal oxide
#

yeah CME

lost matrix
minor junco
#

what kind of list is your .getPlayers() returning

quaint mantle
lean pumice
minor junco
minor junco
#

implementation

chrome beacon
minor junco
#

WeakList?

quaint mantle
lean pumice
minor junco
#

well u have to mutate it somewhere while iterating

#

maybe asynchronously

lean pumice
thick oracle
chrome beacon
#

ngl I forgot that existed too

lean pumice
#

it give problem when i remove it on death

#

(the victim)

lost matrix
minor junco
#

not iterate over it asynchronously, tho that also can give issues

lean pumice
chrome beacon
#

Are you making a plugin?

eternal oxide
#

check for startup errors

urban spire
scarlet gate
#

Does Block#breakNaturally call BlockDropItemEvent

chrome beacon
#

I believe so

lost matrix
scarlet gate
#

Ahh ok, I was just trying to use it but couldn't work out why it wasn't calling

#

I had assumed I made a mistake with my listener, what would be the best way to replicate a player breaking a block?

chrome beacon
#

try this

#

Additionally, a BlockDropItemEvent is called for the items dropped by this method (if successful).

#

in javadoc note

scarlet gate
#

Ooh very handy

acoustic pendant
#

is there any way to make so entities (armor stands for example) does not interact when placing blocks or hitting?

chrome beacon
acoustic pendant
#

thanks

onyx fjord
#

how do sound categories work, do they change anything related to the sound name when trying to play it?

kind hatch
#

Sound categories are tied to the user sound settings.
They are basically sound channels.

onyx fjord
#

i see

kind hatch
#

Select the channel you want to play the sound on and then it’ll go through the user filters for volume.

scarlet gate
#

Is there a way to do #getDrops on a block state / material?

chrome beacon
#

Not recommended

#

use the BlockDropItemEvent

scarlet gate
#

I'm unsure how that would help?

chrome beacon
#

It depends on what you're trying to do

urban kernel
#

i use Java 22, selected in my project settings.

When I compile I get this error.

Unsupported class file major version 64

(I use Maven)

#

How do I fix this error?

chrome beacon
#

Use Java 17

urban kernel
#

I did before, but I got an error with classfile major 65

scarlet gate
chrome beacon
#

Something you're depending on requires it

urban kernel
#

I'm using 22, which should backport 65?

dapper flower
#

is there an event that gets called when an anvil operation happens?

chrome beacon
urban kernel
#

Yes.

chrome beacon
#

Send your pom

#

and the entire build log

#

?paste

undone axleBOT
lost matrix
chrome beacon
#

and the click event

#

^^ and if you're using mojmaps make sure the special source plugin is up to date

urban kernel
lost matrix
#

Yeah its the shade plugin thats throwing. Pretty sure.

urban kernel
#

ignore C\Users\\, that's where i removed my name

dapper flower
lost matrix
#

Compiler as well

dapper flower
#

saw that already

urban kernel
chrome beacon
#

Why do you have 3 shade plugins

#

4*

tender shard
urban kernel
lost matrix
chrome beacon
lost matrix
#

Wait i didnt scroll down

chrome beacon
lost matrix
urban kernel
#

how do i combine them

#

i assume just move all of the <relocation> into one <relocations>

#

?

lost matrix
#

Yep

urban kernel
#

ok

#

how do i deal with
<filter>

lost matrix
urban kernel
#

ok

lost matrix
#
<filters>
  <filter></filter>
  <filter></filter>
  <filter></filter>
</filters>
urban kernel
#

i see

#

same issue

Unsupported class file major version 64

lost matrix
#

Send pom

urban kernel
lost matrix
#

Same solution

urban kernel
#

i have combined it all tho

urban kernel
#

my ide seems to think it doesnt exist

lost matrix
#

reload your mvn project

urban kernel
#

it seems to have the same issue

lost matrix
#

Send your pom again

urban kernel
lost matrix
#

Same solution

#

Im going to bed now

urban kernel
#

have i not added mvn-ctrl?

urban kernel
lost matrix
#

This is your fix

#

Im out

urban kernel
#

it says that it doesn't exist

lost matrix
#

Reload your maven project

urban kernel
#

i have

#

is there a specific repo that i need to add?

lost matrix
#

No, its on maven central. Its always visible to every maven project.

#

Ive just double checked with terminal and polled the resource. Its reachable.

urban kernel
#

i've added maven cenral to my pom and it picks it up now

lost matrix
#

When you use intellij: Click shift twice, and then search for "invalidate caches" and restart...

urban kernel
#

cool, it's worked

#

thanks!

acoustic pendant
#

How can you set a skin to a head by its value? I haven't find anything on internet

tender shard
# acoustic pendant How can you set a skin to a head by its value? I haven't find anything on intern...

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

acoustic pendant
#

thanks!

acoustic pendant
acoustic pendant
young knoll
#

No

#

Only authlib

acoustic pendant
young knoll
#

It's Authlib

#

Part of the game, but open source

acoustic pendant
#

hmm

acoustic pendant
acoustic pendant
#

k ty

#

oh lol

lost matrix
#

Man the new snapshot is wild...
Any Item can be anything now. You can make gunpowder consumable and red dye a tool for breaking wood.
And anything can have durability now. And we finally have custom durability values and stack sizes (up to 99 i think).

eternal oxide
#

nice

lost matrix
#

But one thing that caught my eye was this: Completely data driven item predicates

#

This would allow for recipe choices like *[damage~{durability:{min:3}}]
=> any item which has at least 3 uses left
and even for custom data predicates (since that also just a component now).

If we where to add an API layer for it

quaint mantle
tall dragon
lilac dagger
#

how does that work?

#

or is it a flag?

lost matrix
#

Customizing items will be actually wild now.
Just a random idea: Creaft a ton of bonemeal together, get a Bonemeal ItemStack thats not stackable and has a durability of 100 or so,
on use it loses durability and you actually see the green bar on the item going down

tall dragon
#

components

tall dragon
lost matrix
#

Or a "Deep water bucket" where you can actually store dozens of source water blocks

#

With a bar filling up

tall dragon
#

& custom food will be alot easier as well

lost matrix
#

This enables so much...

lost matrix
#

Custom expensive combat food that can be instantly eaten smileybolb

tall dragon
#

yea this choice is actually really nice by minecraft

lost matrix
#

I love all of this data driven stuff. We gonna have a blast with it.

sand spire
orchid trout
#

dont people still use versions like 1.17

#

i feel like this is gonna take like 5 years for people to start using

inner mulch
#

i will use it :)

tender shard
wet breach
sand spire
#

fr

tender shard
#

yeah i like that

sand spire
#

where is 1.8.9 i thought that was the version most 1.8 pvpers played

tender shard
#

IIRC latest server version is 1.8.8

wet breach
#

that is a client update

#

not a server update

#

one of the few instances where the client version didn't match the server version or didn't need to anyways

young knoll
silent slate
#

Hey, i am coding a plugin rn that lets players switch between inventories per world. Now i get errors that an item does exist.

My codes does this:

  1. Take inventory and encode to base64
  2. save that string using yaml.
  3. Get the string and decode it and set it into the players inventory

My yaml looks something like this:

uuid + "." + world + "." + "buildinventory" has the string of the "buildinventory" stored in it

uuid + "." + world + "." + "normalinventory" has the string of the "normalinventory" stored in it

and 

uuid + "." + world + "." + "buildmode" has a boolean wheater or not the player is in the buildmode, true meaning he is in the buildmode, false meaning he is in normal mode

This is my code:
https://pastebin.com/1sfCPx6S

If you need more details im open to vc or tell u more, its very "complicated"

tender shard
#

stacktrace?

lost matrix
inner mulch
silent slate
tender shard
#

send the stacktrace pls

inner mulch
silent slate
#

im not english

lost matrix
young knoll
#

Kek

sand spire
#

lol

#

with the pig sound effect

tender shard
silent slate
#

ohhh

#

ok

tender shard
#

in line 123 you're calling toString() on offHandItem, even when offHandItem is null

silent slate
#

yep, but offhandItem should never be null

#
            if(offHandItem == null) {
                dataOutput.writeObject(new ItemStack(Material.AIR));
            } else {
                dataOutput.writeObject(offHandItem);
            }```
tender shard
#

are you using an old config that still contains null for offhand?

silent slate
#

i am using the newest version

#

i can recompile and check again

tender shard
#

and delete your config

silent slate
#

my config is also empty

#

thats also weird

#

it says it changed it a minute ago but the file is empty

#

I am german to btw, is it ok for you to vc?

#

ello?

tender shard
#

Im already in bed:p

silent slate
#

ok gute nacht

#

im working on it tomorrow

lilac dagger
#

10% on legacy stuff nice

lilac dagger
orchid trout
#

1.8 pvp is superior

lilac dagger
#

not really

#

you just jitter spam and that's it

#

what a mouse killer strategy

orchid trout
#

knockback items

#

w tapping

#

bow boosting

#

it just doesnt feel the same

#

youre forced to play slow

sand spire
#

I prefer 1.9+ pvp with a sword but items like shields, end crystals and now the mace kinda ruin it for me

#

good thing as a programmer I can bend pvp to how I like it πŸ‘

orchid trout
#

even without shields you just end up trading hits

sand spire
#

trust me combos exist in 1.9 pvp

raw epoch
#

Hello everyone!
I've a problem on my proxy/spigot server and chat validation message.

lost connection: Chat message validation failure

Do you know how to desactivate it?

silent slate
#

Are you using nms/packets?

sullen wharf
#

Is there any way to forcibly render an entity when it is high up?

rough ibex
#

Pretty sure thats client side

#

The client decides what to render

tall dragon
rough ibex
#

That despawns

#

But I don't think you can force the client to render anything

young knoll
#

Only an option for display entities

torn shuttle
#

whoever said chatgpt will outright replace programmers is smoking some fine crack

#

had a long day today that consisted of looking at chatgpt output and shaking my head

vocal cloud
# torn shuttle whoever said chatgpt will outright replace programmers is smoking some fine crac...

It's also making people dumber
Exhibit A: https://hackerone.com/reports/2199174

young knoll
#

Ah man can’t wait to make up vulnerabilities to claim bug bounties

quiet ice
#

the curl guy posted a rant about that

rough ibex
#

I remember reading that

ember dew
#

I'm losing braincells doing this, I've spent an unreasonable amount of time troubleshooting and give up.

I'm trying to add this a user into a hashmap and it simply won't output the the user I've just added to the hashmap and instead returns it null

HashMap<String, Boolean> map = new HashMap<>();

            Player p = (Player) commandSender;
            map.put(p.getName(), false);
            System.out.println(map.get(p.getName()));
eternal oxide
#

nothing wrong with that tiny section of code you posted.

ember dew
#

Give me a moment

#

I'll just post the entire thing

#
    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {

        if (commandSender instanceof Player) {
            Player p = (Player) commandSender;
            Boolean active = false;
            try {
                active = QillaPlugin.godMode.get(p.getName());
            } catch (NullPointerException exception) {
                QillaPlugin.godMode.put(p.getName(), false);
            }
            if (!active) {
                QillaPlugin.godMode.put(p.getName(), true);
                p.sendMessage(ChatColor.GREEN + "You have been made invincible.");
            } else {
                QillaPlugin.godMode.put(p.getName(), false);
                p.sendMessage(ChatColor.RED + "You are no longer invincible.");
            }
        } else if (commandSender instanceof ConsoleCommandSender) {
            System.out.println(currentCommand + " cannot be run by console.");
        } else {
            System.out.println("There was an error running " + currentCommand);
        }
        return true;
    }
#

This is in a different directory

    @EventHandler
    public void OnDamage(EntityDamageEvent e) {
        Entity entity = e.getEntity();
        if(entity instanceof Player && QillaPlugin.godMode.get(entity.getName())) {
            e.setCancelled(true);
        }
    }
#

And this is the hashmap setup in the main directory

public static HashMap<String, Boolean> godMode = new HashMap<>();
#

It gives me null at the first if statement "if (!active) {"

eternal oxide
#

active is a Boolean so can be null

#

it will never throw an NPE at the get

echo basalt
#

Isn't a set a better data structure for this?

#

And shouldn't we use player ids instead of their username?

ember dew
#

Yeah

#

This is just a proof of concept for myself

#

I just got into java a week ago

eternal oxide
#

use boolean not Boolean

echo basalt
#

Still good to learn good habits from the beginning

ember dew
eternal oxide
#

no

#

the active variable

ember dew
#

Jesus christ

ember dew
#

Appreciate it, I would've overlooked that a million times

ember dew
eternal oxide
#

a Set can't have duplicates.
You only add a players UUID to the Set if they are in god mode.

young knoll
#

Mapping something to a Boolean -> just checking if a set contains that something

eternal oxide
#

if (godMode.contains(p.getUniqueId()))...

ember dew
#

Yeah that totally makes sense

eternal oxide
#

names can change, The Player object can change. UUID is unique.

ember dew
#

I'm fully aware, I was just too lazy to find a way to pull a uuid from the Player object rn

agile anvil
#

HashSet internal uses a HashMap iirc

agile anvil
eternal oxide
#

it does, and just uses the KeySet

ember dew
agile anvil
agile anvil
young knoll
#

When you plug the guava concurrent map with weak keys into Collections.newSetFromMap

#

Massive brain

ember dew
#

Idk how I overlooked that

eternal oxide
#

easy to do as everyoen talks about UUID not UniqueId

ember dew
#

Would it be better to put lists inside of the main file, inside the listener for godmode or a completely separate file

eternal oxide
#

depends where you need to access it

ember dew
#

But in this case, for performance

eternal oxide
#

if multiple listeners need it then it has to be at a higher level in yrou design

#

performance makes no difference

ember dew
#

Alright

#

Should I be converting the uuid to a string before putting it into the set?

eternal oxide
#

no need

#

its a comparable object

#

Set<UUID>

ember dew
eternal oxide
#

you could rotate around Y

young knoll
#

It’s also probably in radians

eternal oxide
#

ah yeah it's not goign to account for a non 45

#

just calculate teh pitch +90

#

does CB cap pitch at 0?

#

in location

#

CraftBukkit

#

thats 2d, but not hard to 3d it

echo basalt
#

isn't that the cross product?

agile anvil
#

Rotate of 90 degrees in a 3D space doesn't mean anything. What you want is the orthogonal (in 2D orthogonal = perpendicular) of a plan

#

So you need two vector defining your plan. You already have one (the direction)

eternal oxide
#

you need the blue line

echo basalt
#

Problem is that you're dealing in 3 axis

eternal oxide
#

from the existing white one

#

nah not hard.

#

take a look at this. it will draw a half circle based upon the players eyeLocation

#

apply it to your stand, and you'll be able to work out what step you need

#
    public static void halfVertical(Player player) {

        double radius = 3;
        double every = Math.PI / 30;
        Location loc = player.getEyeLocation();

        for (double rad = 0; rad <= Math.PI; rad += every) {
            double x = radius * Math.cos(rad);
            double y = radius * Math.sin(rad);

            double rotateZ = Math.toRadians(loc.getPitch() + 90);
            double rotateY = Math.toRadians(-loc.getYaw() + 90);

            Vector rotate = new Vector(x, y, 0);
            rotate.rotateAroundZ(rotateZ);
            rotate.rotateAroundY(rotateY);

            Location finalLoc = loc.clone().add(rotate);
            player.spawnParticle(Particle.FLAME, finalLoc, 1, 0, 0, 0, 0);
        }
    }```
#

you just need to find the rad to plugin in

agile anvil
#

So there is actually an easier method

#

To define the "plan of your direction" you can just use two vectors:

  • The direction vector that you have
  • An arbitrary vector like (1, 0, 0)
#

Once you have those two vectors you can do the cross product between those two

#

You should get the resultant orthogonal vector

#

(don't forget to normalise)

#
Vector direction = yourDirection;
Vector plan = new Vector(1, 0, 0);

if (Math.abs(direction.dot(plan)) > 0.999) {
    plan = new Vector(0, 0, 1);
}

Vector orthogonal = direction.getCrossProduct(plan).normalize();
#

There is maybe a shorter way but I'm on my phone

#

You have to use Vector#getCrossProduct

#

Because Vector#crossProduct changes the original vector

young knoll
#

Is that even a thing

agile anvil
#

Yes, vec = orthogonalVector in that case

young knoll
#

Pretty sure all the methods mutate

#

So you should clone

eternal oxide
#

getCrossProduct returns a new vector. where crossProduct mutates

agile anvil
#

Don't forget to check the dot product between your arbitraryVector and the direction vector. If those two vectors are colinear it will not work

young knoll
#

Huh

#

Like the only method that has a non mutating version

#

Man vectors are my biggest annoyance atm

#

There’s so many different ones to convert between

#

You’ve got vector, then joml’s vector, minecrafts vec3, minecrafts blockpos

agile anvil
#

Yeah this is a pain

young knoll
#

And they are basically all the same, but not directly interchangeable

#

😩

agile anvil
#

Yeayy

#

That's why I love maths

#

I said I love maths, not physics πŸ₯²

young knoll
#

Just steal sethblings datapack :p

#

And javaify it

#

This is why display entities are better

#

Boo

#

I refuse to acknowledge anything before 1.19.4 anymore

agile anvil
#

You have to account the head base to do some projections I'm afraid

#

And this

#

is a real pain

#

bro wants to get unreal engine cars into mc

#

This is a really interesting project indeed. But I'm very scared of high ping players lmao

rough ibex
#

vectorile dysfunction

young knoll
#

I feel like I should ban you just for that

obsidian plinth
#

Do it

agile anvil
#

Does it get you a vector pointing down?

rough ibex
#

hah

#

wish I knew the answer

obsidian plinth
#

If (vector == dysfunctional) {
Make not dysfunctional
}

agile anvil
#

what the

minor garnet
#

boy

agile anvil
#

(0, 1, 0) coul'nt work end that's normal

#

But the others are acting weird

#

Let met think about it

astral scroll
#

can i get help? My BlockBreakEvent isnt being executed

#

it has @EventHandler

#

and the listener is registered

#

and SpawnManager is being used

remote swallow
#

double check the init function is called

astral scroll
#

im checking that

#

im opting for smth better

rough ibex
#

better? such as?

astral scroll
#

i was storing the whole SpawnManager lol

#

so id just

#

created a data class

#

with the data i needed

#

world, region and spawnpoint

#

and stored it apart

#

from the spawn manager

#

so i assure init is being called

#

and yet still not working the way i want lol

#

but yeah

#

i think that it is my adapters

#

lol

#

there it is

rough ibex
#

Is there a reason you escape < >

astral scroll
rough ibex
#

you write \u003c

astral scroll
#

idk

#

is gson

#

lol

wintry lynx
#

Anyone know how i'd get the "charged-projectiles" from this item. This item being written as item.
I tried metadata but I got no clue how to grab it from there.

remote swallow
#

cast meta to crossbot meta