#help-development

1 messages · Page 1161 of 1

winter zenith
#

How can I download a specific versions mappings from that site

river oracle
#

Right click it yeah than send the packet to play the effect and particles then just apply all the effects

river oracle
desert aspen
#

https://paste.md-5.net/uhagacuqiq.cs trying to make a code when a skeleton hit u with an arrow it teleports to your location and you teleport to their location, but nothing seems to work

violet blade
desert aspen
#

yes

violet blade
#

try without the if(s.getCustomName().equals(ChatColor.ITALIC + "" + ChatColor.AQUA + "Switcher") part first to debug it

desert aspen
#

i did that

#

by other way

#

and that seems to be the problem

#

i will make that every time a player get damage it teleport to the damage location to see if that is

young knoll
#

You should identify them with PDC

violet blade
#

well dont compare custom entities by name

young knoll
#

Names can be changed

#

?pdc

desert aspen
#

how could i make that zombies don't have cooldown attacking a player

quaint mantle
#

is there a way to "tag" namespacedkeys?

#

i want to get some namespaced keys from an item

#

for example those that contain "keyword", would it be possible doing a toString()?

fading drift
#

what does knockback friction actually mean

violet blade
quaint mantle
violet blade
#

well you can retrieve the namespacedkey with get getPersistentDataContainer().getKeys() then pass that to a string

quaint mantle
#

ty

fading drift
#

is there ways to edit code before its compiled in the minecraft source

#

or like replace a method entirely or something

#

within EntityLiving

#

I'm not looking to fork spigot

worthy yarrow
#

How would I derive a cardinal direction from the vector produced by for example player.getLocation.getDirection?

sly topaz
#

but what are you trying to do, perhaps there's a way to go about it that doesn't require rewriting a method

sly topaz
worthy yarrow
#

mmmm right

#

thanks mate

nova notch
#

there is no way to directly modify mob attack cooldowns

nova notch
#

...you can do that without rewriting everything?

sly topaz
sly topaz
nova notch
#

maybe idk

sly topaz
#

oh, there's also the attack speed attribute isn't there

#

you can probably just use that

nova notch
#

thats only for players

#

it wont actually change the attack interval of mobs

sly topaz
#

is it?

sly topaz
#

just fork spigot bro

nova notch
#

im gonna say it
almost a DECADE

sly topaz
#

that's your only choice

fading drift
#

I found this

nova notch
#

anyway why cant you just like use velocity or some shit

sly topaz
#

Ignite does that

#

however Ignite doesn't work for 1.8.8

#

don't know if that one does

fading drift
nova notch
#

ok? so do that

fading drift
#

and thats called after some of knockback is modified (the part when you sprint hit)

sly topaz
#

your other best bet is to ask the pandaspigot guys nicely to add the API

fading drift
#

pandaspigot?

sly topaz
#

that's the only 1.8.8 fork that is somewhat active isn't it

sly topaz
#

your other option would probably be just modifying the velocity packets directly

fading drift
#

code goes
on attack
damage entity
if sprinting or using kb modifier, adjust kb
PlayerVelocityEvent

sly topaz
#

PlayerVelocityEvent existed in 1.8?

#

why not use that

#

even if knockback is modified in attack damage, the bottom line is whatever you set in that event

fading drift
#

ill give it a shot

sly topaz
#

sure, you won't be able to affect the knockback of other entities other than players but I assume you don't want that anyway

nova notch
#

i mean cancelling the damage event and implementing it yourself is always an option

worthy yarrow
#

When it comes to implementing Cloneable, are there any nuances in which would cause the .clone method to throw CloneNotSupportedException?

fading drift
nova notch
#

why would cancelling the event still deal knockback?

#

that doesnt make any sense

fading drift
#

I think it does just by reading the code

#

ill try it tbh

#

oh wait it wont

#

cus damageEntity will return false

#

fuck I cant use playervelocityevent cus I'm not able to access the attacker which is where the direction is pulled from and shit

nova notch
#

this is what happens when you use a decade old version

fading drift
#

oh shit pandaspigot has built in kb config

fading drift
#

its really frustrating for sure

fading drift
#

yeah

#

and the culture for the server i’m developing for will not accept an update

#

is there an event that triggers for ground state changes

smoky anchor
#

Don't believe so
Also, you should not rely on it as it is a client-controlled property.
It can be very easily spoofed.

#

If you mean the OnGround variable for players

fading drift
#

I see

obtuse hedge
fading drift
#

would it be unnoticeable for the user on the frontend though?

obtuse hedge
#

with enough configuration, yea

shell willow
#

Hello, there is nowhere else to go so I came here to ask my question. I downloaded auction house 1.20.4, I am on version 1.20.1. I have luckperms, I have vault, and it shows red when I do the /plugins command in game. I have deleted the plug-in and reinstalled it like 20 times, downloading a brand new file each time. I don't know what I'm doing wrong

shell willow
#

Ok

#

Ty

#

Hello, there is nowhere else to go so I came here to ask my question. I downloaded auction house 1.20.4, I am on version 1.20.1. I have luckperms, I have vault, and it shows red when I do the /plugins command in game. I have deleted the plug-in and reinstalled it like 20 times, downloading a brand new file each time. I don't know what I'm doing wrong

smoky anchor
#

Don't just spam the same question when there are ppl already explaining stuff to you in other channel

shell willow
#

I was told to come here dude.... chill out

#

what is your issue

#

im just looking for help

#

an d you are being beyond rude to me

smoky anchor
#

The fact that I can still see the question two messages above it.
And you're in the wrong channel.
Who told you to come here

rough drift
#

I also replied to you there, if you want to read it

shell willow
#

you obv cant read... olivia posted the # for this channel to me

chrome beacon
#

hm? you refering to me?

#

because I never did that

rough drift
smoky anchor
#

If you are talking about this message, that is not to you
Not only is it not from Olivo but it is part of different conversation

rough drift
#

they left

#

pog

smoky anchor
#

calling me clown, this guy....

silent slate
#

How do you rename a world?

rough drift
#

unload, rename folder, load

silent slate
#

thanks

#

next question

#

how do i unload and load xD

rough drift
#

Bukkit.unloadWorld(World, boolean), new WorldCreator(String).create();

silent slate
#

ok i found it thanks

magic schooner
#

Any good library for GUIs?

pseudo hazel
#

a million

#

it depends on what you want

#

i made my own because I wanted to

#

but existing ones are pretty good too

quaint mantle
#

I saw something on a server, the hunger and health bars were hidden in the lobby, they came when I entered the game.
Do they install a different resource pack when you enter the game?

umbral ridge
#

hey

#

is there an event where YamlConfiguration has been modified by user

young knoll
#

You might be able to do some file watcher stuffs

#

Since it’s just a file

umbral ridge
#

🤓

young knoll
#

Don’t you nerd emoji me

umbral ridge
#

nerddd

#

!!

#

where does the snake yaml occur? in what class

#

which method throws exception

chrome beacon
#

??

ivory sleet
#

Exceptions can happen in a lot of methods from both snake yaml and yaml config

umbral ridge
#

which method validates yaml

chrome beacon
#

There's most likely more than one method in snakeyaml that throws something

ivory sleet
#

its a class rather than a method in snakeyaml (spexx.dev)

umbral ridge
#

ty

#

XD

ivory sleet
umbral ridge
#

you can't catch it right?

#

because loadConfiguration in YamlConfiguration doesnt throw an exception

ivory sleet
#

loadConfiguration is goofy

#

It catches the exception

#

And prints it to the bukkit logger

umbral ridge
#

fuck off loadConfiguration

#

XD

ivory sleet
#

you can use new YamlConfiguration().load(file);

#

If u so would like to handle it urself

umbral ridge
#

thats more like it

#

ty nerd

#

xd

ivory sleet
#

Init

umbral ridge
#

im making a really fancy configmanager

ivory sleet
#

Dope

#

Aren’t you the nerd then?

umbral ridge
#

we are both nerds

#

but you are bigger one

ivory sleet
#

😔

umbral ridge
#

but load() doesnt return YamlConfiguration

#

XD

ivory sleet
#

Yes you’ll have to use ur config instance

#

like

umbral ridge
#

so basically I can do new YamlConfiguration().load(file) and then YamlConfiguration.load() ?

#

that means i have to load it twice

shadow night
blazing ocean
#

Jaml

shadow night
ivory sleet
#

FileConfiguration config = new YamlConfiguration(); //my glorified hashmap

config.load(file); //load from file to my glorified hashmap

config.get(key); //yayyyy

blazing ocean
#

glorified hashmap

umbral ridge
#

Niiice okay

blazing ocean
#

con is the nerd

ivory sleet
#

Naaa

#

everytime I see rad, he always drops insane inline higher ordered functions in kotlin

blazing ocean
#

CON WHY YOU DELETING MY MESSAGSE

ivory sleet
#

Truly

#

Oh frick

#

rad I feel like you could be a haskell enjoyer

blazing ocean
#

NO

ivory sleet
#

it’d make you so much more humble

blazing ocean
#

I'm not a smelly haskell nerd like steel

ivory sleet
#

Yet you almost write functors and natural transformations in kotlin

#

Ye suree buddy

blazing ocean
#

I'm gonna transform you to a kotlin user

ivory sleet
#

Oh I am one already

blazing ocean
#

oh based

ivory sleet
#

but kotlin is C tier though

#

runs

orchid gazelle
#

Kotlin is F- tier

ivory sleet
#

Lol

blazing ocean
#

Feist

#

1.12.2 is F--- tier

orchid gazelle
#

it's beyond F tier

#

it's not measurable how bad it is

blazing ocean
#

caught in 4k

ivory sleet
#

spexx check its parent

umbral ridge
#

yes

ivory sleet
#

dont nerd me

#

Thats common sense

#

Sooo

umbral ridge
#

its directly from Exception class

#

nerd

shadow night
umbral ridge
#

🧒

blazing ocean
#

the fuck happened to that guy

#

that is like

blazing ocean
#

fucking terrifying

blazing ocean
umbral ridge
#

XD

umbral ridge
#

😂

cold pawn
#

Does anyone know how I could get the dimension types of a world? I need it for a respawn packet; it's one of the parameters. I am using protocol lib to write the packet.

trail cargo
#

Bungeecord
What events I use to listen all player count change

slim elbow
trail cargo
#

If I use it,
I need ServerShutdownEvent, LoginEvent, DisconnectEvent, etc....

#

Bungee has many event.
I need server shutdown, player join any server, player quit server.

#

all of player count of server changing

wide coyote
#

has anyone checked the source of the new "pause-when-empty-seconds" setting? how does it work?

#

is it just /tick freeze or what

umbral ridge
#

fancy stuff

#

@ivory sleet uwu 🥴

#

sorry for tag

ivory sleet
#

Nicee

#

Tho using File is a shame

umbral ridge
#

I know right

#

I cant do it.. without it

#

can i

ivory sleet
#

You can

umbral ridge
#

yes?

#

with Files class?

ivory sleet
#

Myea

#

And Path

umbral ridge
#

Hmm

ivory sleet
#

I’m not saying u have to

#

But File is a bit meh just

umbral ridge
#

it would make my life much easier without File

#

but then i have to rewrite some things

#

and i dont have energy

#

I've also done some of filewatcher stuff

#

but its commented out because it doesnt work

ivory sleet
#

Path and Files work good with javas file watcher api as wel

umbral ridge
#

I'll try to change it to Files

#

btw do you know if there is a constant for "".. Nothing? Like in c# there is String.Empty

ivory sleet
#

the empty string?

umbral ridge
#

ye

ivory sleet
#

Yea

#

I think it gets pooled more or less

#

Except if u choose to invoke the string constructor explicitly

umbral ridge
#

ooo

#

yeah

#

instead of new String("")

slender elbow
#

what

umbral ridge
#

Emily

#

fix your BetterJails

#

!

slender elbow
#

oh yeah i need to release the patch

umbral ridge
#

will it support the latest version

sly topaz
#

love the polarized reviews lol

slender elbow
#

it works fine on the latest version

#

i mean if you have an error you can, y'know, send it lol

umbral ridge
#

😂

native wing
#

Is there a kind of guide for Spigot?

eternal oxide
#

guide?

native wing
#

yas

#

Just like at PaperMC

slender elbow
#

guess why they're asking for a guide for spigot lol

umbral ridge
#

because

#

i dont know

brittle geyser
#

Hello, i have problem with intellij i think.
I have multiple projects
Imports not works, here is my gradle:

plugins {
    id("java")
    id("io.github.patrick.remapper") version "1.4.2"
}

// Library versions
val spigot: String = "1.21-R0.1-SNAPSHOT:remapped-mojang"

// Project version and group
version = property("projectVersion") as String
group = "kz.hxncus.mc"

dependencies {
    compileOnly("org.spigotmc:spigot:$spigot")
    compileOnly(project(":bukkit"))
}

tasks {
    remap.get().version.set("1.21")
    compileJava.get().options.encoding = Charsets.UTF_8.name()
    javadoc.get().options.encoding = Charsets.UTF_8.name()
    compileJava.get().dependsOn(clean)
}

tasks.jar {
    finalizedBy(tasks.remap)
}
#

first and second compileOnly methods not works

#

I have 1.21 version in my .m2 directory

sly topaz
#

why are you getting the tasks each time

#

use the configure scope

rough ibex
#

Also what a font

remote swallow
#

dont you use it

#

all good mc devs use it

rough ibex
#

no

#

i use jetbrains mono

remote swallow
#

woah same

#

guess we just arent good devs

rough ibex
#

hahah

brittle geyser
#

how

blazing ocean
#

my dyslexic ass cannot read all that

sly topaz
# brittle geyser what
tasks {
  remap {
    version = "1.21"
  }
  compileJava {
    dependsOn(clean) // why?
    options.encoding = "UTF-8"
    //options.release = 21
  }

  assemble {
    dependsOn(remap)
  }
}

// Ideally you'd do also do it this way for JavaCompile tasks, but since you're depending on clean...
tasks.withType<Javadoc>() {
  options.encoding = "UTF-8"
}
brittle geyser
#
Could not find spigot-1.21.1-R0.1-SNAPSHOT-remapped-mojang.jar (org.spigotmc:spigot:1.21.1-R0.1-SNAPSHOT:20241014.010741-2).
Searched in the following locations:
    https://repo.dmulloy2.net/repository/public/org/spigotmc/spigot/1.21.1-R0.1-SNAPSHOT/spigot-1.21.1-R0.1-20241014.010741-2-remapped-mojang.jar
blazing ocean
#

Well it's not gonna be in there

#

you need to add maven local

brittle geyser
#

already

sly topaz
#

there's too much garbage in that build.gradle.kts

brittle geyser
#

im so sorry

#

i dont know how gradle works

sly topaz
#

you're fine lol, I mean it in the way that we can't realistically find the issue from that

blazing ocean
#

huh? 😭

brittle geyser
#

what am I supposed to do

blazing ocean
#

I don'T think I want THAT in my manifest 😭

sly topaz
#

well, for the most part anyway, there's some special ones there

blazing ocean
#

I don't think people need to know who compiled it on what OS

sly topaz
blazing ocean
#

Did you run BT with --remapped?

#

?bt

undone axleBOT
sly topaz
#

and if it is, are you sure IntelliJ is pointing to the correct maven user home?

brittle geyser
inland hemlock
#

Does anyone know how to rotate a sleeping serverPlayer NPC properly to a given yaw value? Im using the ClientboundMoveEntityPacket and it is changing the direction with different yaw values, but I feel like its random..

                    (byte) (player.getLocation().getYaw()),
                    (byte) (0),
                    false));```
Goal is that he is sleeping in a straight line where the player is facing.
deep herald
worldly ice
#

in the protocol that byte is from -128-127 (0-255) where each unit is 1/256 of a full turn

#

Location#getYaw returns an angle in degrees so the range is off

inland hemlock
#

I tried it with (byte) ((player.getLocation().getYaw() % 360) * 256 / 360) which worked, but only when the npc wasn't "sleeping".

worldly ice
#

?notworking

undone axleBOT
#

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

inland hemlock
# worldly ice ?notworking
npc.setPose(Pose.SLEEPING);
        this.npcServerEntity = new ServerEntity(npc.serverLevel(), npc, 0, false, packet -> {
        }, Set.of());


        SynchedEntityData synchedEntityData = npc.getEntityData();
        synchedEntityData.set(new EntityDataAccessor<>(17, EntityDataSerializers.BYTE),
                (byte) (0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40));

        Bukkit.getOnlinePlayers().forEach(all -> {
            ServerGamePacketListenerImpl allps = ((CraftPlayer)all).getHandle().connection;

            allps.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
            allps.send(npc.getAddEntityPacket(npcServerEntity));
            allps.send(new ClientboundAddEntityPacket(npc, npcServerEntity));


            allps.send(new ClientboundRotateHeadPacket(npc, (byte) ((player.getLocation().getYaw() %
                    360) * 256 / 360)));
            allps.send(new ClientboundMoveEntityPacket.Rot(npc.getBukkitEntity().getEntityId(),
                    (byte) ((player.getLocation().getYaw() % 360) * 256 / 360),
                    (byte) (0),
                    false));

            player.sendMessage(npc.getBukkitYaw() + "");


            //allps.send(new ClientboundAnimatePacket(npc, (byte) 0));

        });

I kept out the nms spawning stuff as the message would be too long, if you think there could be a mistake ill add it.

worldly ice
#

found this one the protocol wiki

#

try sending a synchronized player position packet instead

inland hemlock
worldly ice
#

yeah it looks like you're right, i don't see any way to specify a specific entity

#

how is the sleeping npc rotating

inland hemlock
#

How, you mean in relation to the players yaw? I have no idea.. Im spawning it rapidly while turning just a single bit. In some ranges it is changing in relation to my turn but in others it just turns like 80-180° or sometimes even not at all.

#

https://ibb.co/yXCz55g I tried to turn in 90° angles (idk if im allowed to post links as im not able to post pictures in here, if not tell me, dont click, ill delete it.)

worldly ice
#

?img

undone axleBOT
#

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

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

inland hemlock
#

I will do a small circle and check if there are gaps

worldly ice
#

and you can confirm that the rotation works as expected when the npc isn't in the sleeping position?

inland hemlock
#

No, I only looked at the head but as I see now the body rotation isn't always the same

#

I don't know if you can change the body rotation..

#

Sometimes it's right and sometimes it isn't.

worldly ice
#

i believe body rotation is client-sided?

inland hemlock
#

Yeh

worldly ice
#

it looks like you can either just send a bunch of rotate packets one after another

#

or you can make the npc perform the arm swing animation

#

which should set its body rotation to its actual rotation

inland hemlock
#

i tried that but i dont know in which order i have to send the packets

#

it didnt work sending it last

worldly ice
#

have you tried sending it a tick later?

#

or is that what you did in the first place

inland hemlock
#

you mean the hit animation?

#

no havent

#

but i just tested with a second account, the angle of the sleeping position is the same for everyone

#

Just tried it, doesnt work.

#

ill send code

#

wait

worldly ice
#

while in the sleeping position or not?

inland hemlock
#

yes

#

ok ill try before

#

Can I just send the dataPacket later or do I have to call .setPose after the hit animation?

#
            ServerGamePacketListenerImpl allps = ((CraftPlayer)all).getHandle().connection;

            allps.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
            allps.send(npc.getAddEntityPacket(npcServerEntity));
            allps.send(new ClientboundAddEntityPacket(npc, npcServerEntity));
            allps.send(new ClientboundSetEntityDataPacket(npc.getId(),
                    synchedEntityData.getNonDefaultValues()));
            allps.send(new ClientboundRotateHeadPacket(npc, (byte) ((player.getLocation().getYaw() %
                    360) * 256 / 360)));
            allps.send(new ClientboundMoveEntityPacket.Rot(npc.getBukkitEntity().getEntityId(),
                    (byte) ((player.getLocation().getYaw() % 360) * 256 / 360),
                    (byte) (0),
                    false));

            player.sendMessage(npc.getBukkitYaw() + "");

            new BukkitRunnable() {
                @Override
                public void run() {
                    allps.send(new ClientboundAnimatePacket(npc, (byte) 0));

                }
            }.runTaskLater(Main.plugin,1);

thats it rn, ill change it up now.

#
        }, Set.of());


        SynchedEntityData synchedEntityData = npc.getEntityData();
        synchedEntityData.set(new EntityDataAccessor<>(17, EntityDataSerializers.BYTE),
                (byte) (0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40));

        Bukkit.getOnlinePlayers().forEach(all -> {
            ServerGamePacketListenerImpl allps = ((CraftPlayer)all).getHandle().connection;

            allps.send(new         ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
            allps.send(npc.getAddEntityPacket(npcServerEntity));
            allps.send(new ClientboundAddEntityPacket(npc, npcServerEntity));
            allps.send(new ClientboundRotateHeadPacket(npc, (byte) ((player.getLocation().getYaw() %
                    360) * 256 / 360)));
            allps.send(new ClientboundMoveEntityPacket.Rot(npc.getBukkitEntity().getEntityId(),
                    (byte) ((player.getLocation().getYaw() % 360) * 256 / 360),
                    (byte) (0),
                    false));

            player.sendMessage(npc.getBukkitYaw() + "");


            
            allps.send(new ClientboundAnimatePacket(npc, (byte) 0));


        });

        npc.setPose(Pose.SLEEPING);
        ps.send(new ClientboundSetEntityDataPacket(npc.getId(),
                synchedEntityData.getNonDefaultValues()));```
Still random..
#

Oh, forgot to remove the delay

worldly ice
#

well because you're setting the pose at the same time anyways

#

yeah

inland hemlock
#

still random

#

I did it now 2 seconds delayed but the body rotation seems to be irrelevant for the sleeping angle.

worldly ice
#

weird clientside jank then?

#

2 seconds delayed on the animate packet or the entity data packet

inland hemlock
#

npc.setPose and data packet.

inland hemlock
worldly ice
inland hemlock
#

No not exactly. The hit animation doesnt make it turn 100% where my body is rotated to

worldly ice
#

but it's close?

inland hemlock
#

Well sometimes its very close and sometimes id say still like 15° difference

#

but after applying the sleeping pos its wrong again.

#

btw im kinda new to packets, if I have sent the data packet once but change data again, I do have to send it again right?

worldly ice
#

yes

#

i believe you should be able to use #packDirty to only send the changed data

#

depends on how you modify that tho

#

and all of your debugging just makes me think the client doesn't know how to deal with rotated sleeping players

#

i do vaguely remember like villagers bugging out and moving while "asleep" but i think that was bedrock

inland hemlock
#

Hmm, im out of ideas. Unlucky.. Thanks for your help tho, do you think its possible to atleast find out in which direction the head is facing? I need the "middle" of the sleeping npc.

#

But the getBukkitYaw value is also kinda weird only goes from -2 or -4 up to 6.something max.

worldly ice
#

probably radians?

inland hemlock
#

no

worldly ice
#

idk then, maybe look at source code

inland hemlock
#

but shuold be, i only compared it to the player yaw radians maybe because of the inaccurate angles it is radians

worldly ice
#

you can also use a crawling pose instead since that should work much better with angles

#

why do you need to use getBukkitYaw in the first place?

inland hemlock
#

I want to have text above the body and it looks weird at the feet. Initially I wanted the body to "fall" where the player was facing, with that i would be able to just add half a block where the player is facing which would have been the middle of the body but now i need a different way to get to that.

worldly ice
#

can't you use the non-bukkit method to get the player's yaw?

#

there should be one, right?

inland hemlock
#

yes but not for serverPlayers

worldly ice
#

looks like #getBukkitYaw just returns #getYHeadRot

#

this is in 1.19.4 tho so might be outdated

inland hemlock
#

yeh, seems like ill end up with a few preset fall directions and switching through them for the text..

worldly ice
#

i did some more digging and #getYRot (in Entity) looks like it returns an angle in degrees

inland hemlock
#
 player.sendMessage(radiansToYaw(npc.getYRot()) + "§c|");


    }

    public static float radiansToYaw(double radians) {
        float degrees = (float) Math.toDegrees(radians);
        degrees = degrees % 360;
        if (degrees > 180) {
            degrees -= 360;
        } else if (degrees < -180) {
            degrees += 360;
        }
        return degrees;
    }

always returns 0.0.

worldly ice
#

y rot should already be in degrees but that doesn't explain why its always 0

#

curse you mc code

#

might be a bit jank but you can use #getBukkitEntity and get the yaw from there

#

i do remember some weird stuff about using that method versus just using nms

#

i think it had to do with visual fires where it would only display the visual fire if i used the method in the bukkit entity rather than the nms entity

inland hemlock
#

well.. even if I dont move at all the values are different everytime i spawn the npc

#

but the npc is always in the same position

worldly ice
#

classic mojank

#

if you only need the angle and it doesn't change you could just store it somewhere when you create the npc

inland hemlock
#

ye but i need the angle for what position he falls to and i havent yet understood any factor that relates to the falling position

worldly ice
#

oh you mean which direction the body is pointing?

inland hemlock
#

yes

#

but in the sleeping position

worldly ice
#

the only way would probably be to just summon it with the same yaw every time and figuring out what angle that is through trail and error then

inland hemlock
#

ye sadly..

#

I thought this was the easy part at thh beginning..

inland hemlock
worldly ice
#

yeah that seems to match up with the byte rotation

inland hemlock
#

any idea if the translation is wrong? (byte) ((player.getLocation().getYaw() % 360) * 256 / 360)

worldly ice
#

java doesn't have unsigned bytes so i believe by making the max value 256 it gets truncated

#

it should be mapping from 0-360 to -128-127

inland hemlock
#

Just tried using every single byte from -128 to 127 and spawn an npc, same problem.. the same part is missing. Seems like it is in fact IMPOSSIBLE.

sly topaz
#

what was the issue exactly? Trying to set the yaw of a NPC in sleeping position generating random results?

golden turret
#

lets say that i have a task running on my plugin and my plugin gets disabled by the plugin manager after some time. Will that task automatically end too?

slender elbow
#

yes

#

provided you aren't endlessly looping/blocking in that task

short pilot
#

clearMembers

feral fiber
#

I am a beginner spigot developer and I have a problem I am writing code I have a list like this:

ArrayList<String> list = new ArrayList<>();
list.add(EVENTPLAYERITEM("eventplayer", Material.DIAMOND_BLOCK,"name", "lore\nlore"));
list.add(ACTIONPLAYERITEM("actionplayer", Material.COBBLESTONE, "name", "lore\nlore"));
}

But it underlines in red I don't understand why it wants me to create

tawdry echo
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

proud badge
#

what is EVENTPLAYERITEM

quaint mantle
feral fiber
quaint mantle
#

that code doesn't look like you know java

feral fiber
proud badge
feral fiber
#

😭

quaint mantle
proud badge
#

the entire thing doesn't make sense, not just that

quaint mantle
#

oh, the static keyword

feral fiber
#

Damn, and for this you will oppress me, I only recently started studying plugins...

proud badge
#

start studying java then, not plugins

quaint mantle
#

oppress? 😭

magic raptor
#

i don't think that gradients work like this lmao

quaint mantle
#

you probably using legacy colors

magic raptor
#

(code's garbage still trying to get gradients working)

quaint mantle
#

just use § instead of translating

paper viper
#

Use Adventure + Minimessage 😭

magic raptor
magic raptor
quaint mantle
#

you can do

#

like

magic raptor
#

all ears

paper viper
#

Reinventing the wheellllll

quaint mantle
#

translate the string message first

paper viper
#

But anyways

quaint mantle
# magic raptor

i mean, do at the begining message = ChatColor.translateblablablablabla and then the logic

magic raptor
#

ah i see

#

okay time to try i guess

quaint mantle
#

maybe it works

#

and use §# instead of &#

paper viper
#

Seeing people use the legacy character still makes me wanna vomit 🤢

magic raptor
magic raptor
paper viper
#

Like it’s just a horrible system, Adventure uses a proper system by sending them via the proper format

magic raptor
#

i don't even like the way it works

magic raptor
#

instead of using unnecessary complicated stuff

paper viper
magic raptor
paper viper
#

How is this complicated

#

Anyways…

magic raptor
#

anyway should be good

#

nah same thing

#

it's not doing the gradient thing

inland hemlock
echo basalt
#

Did you do the *256/360 thing

inland hemlock
#

Yes

echo basalt
#

F

inland hemlock
#

(byte) ((player.getLocation().getYaw() % 360) * 256 / 360)

#

it does work for the head rot.. but not body rot..

nova notch
sly topaz
#

why not just use ClientboundRotateHeadPacket if that works tho

inland hemlock
sly topaz
#

I mean, wiki.vg explicitly states that the x, y, z from the movement packet is ignored when in sleeping pose, maybe the pitch and yaw too in this case

#

can you even move your head while sleeping?

inland hemlock
#

I don't knot, don't think so but changing the head rotation is no problem. The problem only lies with how the body is rotated when in sleeping pos. If trying to spawn them in a circle for every possible yaw, there is a gap.

sly topaz
#

did you just send a bunch of rot packets

inland hemlock
#

No i created new ones for every single byte. Send it in dms or here?

vital ridge
#

Any1 has a good idea on how to get a player object with Bukkit.getPlayer() on offline players?

#

For some reason, when I use #getPlayer and provide the uuid, it returns null

sly topaz
vital ridge
#

owner is null.

#

But I printed out the uuid, the uuid is not null

#

course.getOwner() returns an uuid

inland hemlock
#

and does the player have to be online

vital ridge
#

I mean I suppose the player doesnt have to be online

#

No he doesnt

#

Actually

inland hemlock
#

does Bukkit.getOfflinePlayer still exist?

vital ridge
#

an uuid*

#
Player owner = Bukkit.getOfflinePlayer(course.getOwner()).getPlayer();
#

ill try this

inland hemlock
#

I dont know if it accepts a string

#

UUID.fromString or something like that exists

vital ridge
#

course.getOwner is an uuid

inland hemlock
#

ok

vital ridge
#

and bukkit.getoffline player accepts an uuid

#

Still doesnt work

#

idk why doe

inland hemlock
#

compare the uuid with [] around it to the actual one from the player (idk yourself) and check if there is any mistakes, maybe a spacing? ig you get it from a config?

vital ridge
#

I'm using the same method to print a bunch of items for another gui

#

and it works there perfectly

inland hemlock
#

OfflinePlayer owner = Bukkit.getOfflinePlayer(course.getOwner()).getPlayer();

sly topaz
#

I have many questions about your code, but I can't ask them right now since I'm trying out the lukas stuff lol

#

if someone doesn't point it out before me, I'll check out later

vital ridge
inland hemlock
#

Even when offline?

vital ridge
#

Yea

#

No wait

#

I rreplaced

#

The Player at the beginning

#

with OfflinePlayer

#

And then removed getPlayer from the end

short drift
#

Updating Spigot to latest 1.21.1 - I was 43 versions behind - broke my database framework, which I need for everything.
Is there any way to revert back to previous builds inside a version (1.21.1) using BuildTools?

chrome beacon
#

🤔 you sure you updated to 1.21.1 and not .3

short drift
#

I updated to 1.21.3. It broke everything. Then I reverted back to 1.21.1 latest version.

#

And the database is broken there.

#

So, I would like to try one of the earlier builds in 1.21.1.

#

To see if it makes a difference.

chrome beacon
#

The --rev command does allow you to enter version numbers

short drift
#

Because I already deleted the config and I deleted the database and I tried earlier versions of the database and nothing works. So I can only conclude something changed in Spigot.

vital ridge
#

?paste

undone axleBOT
short drift
#

Because I haven't written any code in 6 months.

short drift
vital ridge
#
MultiverseWorld mvWorld = multiverseCore.getMVWorldManager().getMVWorld(voidWorld);
        mvWorld.setGameMode(GameMode.CREATIVE);
        mvWorld.setKeepSpawnInMemory(false);
#

this seems to fail for some reason

#

It works at the beginning I think

#

but when I log in with my alt

#

and try creating a world

#

It fails

chrome beacon
short drift
chrome beacon
#

yes

short drift
#

Okay, thank you. I will test it out.

sly topaz
#

rev 4329 should work just fine

#

then again, it'd be better if you told us what exactly did Spigot break of your database, since right now you're just pushing the problem into the future

chrome beacon
#

is your db lib using ASM?

short drift
chrome beacon
#

because that's the only change I would see breaking it

#

(just looking at changelog)

short drift
spiral light
#

Is it possible to create a small lib in remapped-mojang and use it with maven in others projects and compile everything together from remapped-mojang to the standard mapping ?

sly topaz
#

because it is trying to access it before load

#

either that or you're using the lib in onLoad which I think also may cause issues

short drift
sly topaz
#

are there any errors before that one in the issue? Could you send the full log?

short drift
#

No errors.

sly topaz
#

does NDatabases show up green in /plugins?

short drift
#

What does that mean?

sly topaz
#

if the plugin NDatabases is green in the list returned by the /plugins command

chrome beacon
#

NDatabase does log startup errors so I feel like there'd be one

#

odd if there isn't

short drift
#

It is an odd issue.

sly topaz
#

doesn't look unsolveable tho, just requires some digging

#

then again, it's your choice whether you want to deal with this now lol

chrome beacon
#

Use a couple of breakpoints

#

should help trace the issue

sly topaz
#

oh, they are using guice

#

I don't like this plugin tbh, there doesn't seem to be much of a compelling reason to not just use a proper ORM instead

#

it setups a global database if anything, but that's pretty much it

short drift
#

With zero previous experience on Java that's what I chose to use and that's what I integrated everything around.
Are there better options? Probably.

sly topaz
#

Oh I don't blame you for that one, it is a fine way to go about it, I just don't personally see its benefit over say, Ebean however if you haven't worked with java ORMs before then everything may as well be one and the same

#

you're trying to use a proper database and not a yaml configuration so you're better off than a majority around here lol

#

that said, if you do get the chance to refactor in the future, I would recommend straying away from it considering that it looks quite feeble in nature. Anything that implements the Java Persistence API will be a step in the right direction

#

you'll have to do a little bit more of manual work which that library does for you, but hopefully not enough for it to become an issue, and your code will be more resilliant that way

short drift
#

Well, I tried to revert all the way back to revision 4306. And it didn't work.
So now I'm thinking it must be something in my build environment. I updated to Java 23 and then moved back one step to Java 22.

#

It's such a weird issue.

sly topaz
#

make a MRE

#

start a fresh minecraft server, preferably on latest, and only put criticalfixes and ndatabases on the server

#

if it doesn't load, then it is definitely something with spigot

#

well, it could possibly be the java version as you say so try that too, but ruling out that, it just leaves out spigot changes

#

then again, reverting not making it work does make the whole thing weirded, but it could be that the issues compounded and you just didn't notice (that is, both changes in environment and the spigot version itself)

cosmic elk
#

are there any reasonable ways i could stop fall damage from being taken by a player only once, and not take any at all if they touch the ground before they can? the solution i have in place for this sort of thing right now is a crap one so i wanna know if there are any better ways i could do this because the ones ive seen online havent worked for me :/

young knoll
#

Set some sort of flag and then remove it when they next touch the ground

inland hemlock
#

abt npc

fading drift
#

are scoreboard objectives server wide

blazing ocean
#

And you can have multiple scoreboards so, depends

#

*only one of them is persistent though

fading drift
#

I'm having an issue where if I set a scoreboard objective for a player

#

and then remove all objectives from a completely different player

#

itll remove objectives from all players

blazing ocean
fading drift
#

this is with player.getScoreboard

#

should I create a new scoreboard for every player and just keep a map in my plugin?

proud badge
#

What do yall think is the best file type for a list of things (in my case IPs)? txt, json, yml?

slender elbow
#

by default all players will have the main scoreboard

slender elbow
#

if you want that to not happen you need to setScoreboard to a new one in join event or something

pseudo hazel
proud badge
#

yes

pseudo hazel
#

yml

proud badge
#

also in intellij when generating getters, how would I select multiple options? Its only letting me choose one

blazing ocean
#

ctrl click

proud badge
#

thx

river oracle
#

Bukkit#getOfflinePlayer(UUID) doesn't do a web request for player information, but if the player has never joined the server before is there a way I can query the player with the UUID instead of the Name?

eternal night
river oracle
#

alright thank

river oracle
eternal night
#

in a proper language, probably

river oracle
#

kekw

river oracle
eternal night
#

it does use the usercache

river oracle
#

or do I need to make my own loading cache

#

kay

eternal night
#

but eh

#

if you wanna use this for large amount of players, your own layer might be advised

river oracle
#

I'll throw my own layer at it for good measure

#

I don't want any exploits here lol

#

this'll be loaded with a GUI so the more caching the marrier

remote swallow
#

smh

river oracle
#

I prefer CF

blazing ocean
#

fake kotlin user

river oracle
blazing ocean
#

library it

remote swallow
#

who shades kotlin stuff

river oracle
#

why library it when CF is built in

#

and its goated

remote swallow
#

because its designed for kotlin

eternal night
#

facts

#

CF goated

river oracle
#

legit who cares

blazing ocean
#

me & ebic

river oracle
#

I don't want syntax sugar when CF is already great

remote swallow
#

me and rad

blazing ocean
#

fake kotlin user

river oracle
#

mmk

#

I don't care if I'm fake i'm most productive in kotlin!

orchid trout
#

@blazing ocean

blazing ocean
#

what

orchid trout
#

what

blazing ocean
orchid trout
#

what do you mean

blazing ocean
#

are you stupid

orchid trout
#

i cant stop coming

desert aspen
summer scroll
chrome beacon
#

When spawning a modified entity use the spawn method that accepts a consumer

#

and modify it there

desert aspen
chrome beacon
#

Add some debug messages

desert aspen
#

i'll try that

chrome beacon
#

also don't create a new random instance everytime

desert aspen
#

how could i

#

can i put a random instance on the main to not create any other more?

chrome beacon
#

Just having it in the listener class is fine

young knoll
#

You could also just use ThreadLocalRandom.current

winter zenith
#

does anyone know what im supposed to pass into bit set params of PacketPlayOutLightUpdate

slender elbow
#

probably

#

not me tho

desert aspen
#

https://paste.md-5.net/ijibiwuwic.cs trying to make when a player interact with a certain item it gives attribute + of attack speed during 2 minutes, and when that timer runs up it gives the player the default attribute value, slowness and summon a lightning on the player, everything works except giving the player the normal attribute, slowness and a lightning once the timer run out

upper marlin
#

Hello there, I'm new at this server. If my message it's out of place please make me know. Also forgive my english.
I'm working on a minigame plugin, in order to simplify furnace usage, the player only has to right click on the furnace with an item in hand to introuduce it into the furnace.
When furnace smelts, I make the furnace drop the result item so the player would pick it up. After that the result slot must be cleared for the next item to be smelted.
However, the result slot is not clearing in the FurnaceSmeltEvent.

@EventHandler public void onFurnaceSmelt(FurnaceSmeltEvent event) {
        Furnace furnace = (Furnace)event.getBlock().getState();
        ItemStack item = event.getResult();

        furnace.getWorld().dropItem(
            furnace.getLocation().add(new Vector(0, 1, 0)),
            new ItemStack(item.getType())
        );

        // Furnace is not clearing result slot.
        // Let's smelt when the next item is the same
        // as the last smelted item, because will be stacked in the
        // result slot. But when a new item is different, furnace won't
        // cook it due the result slot still has the previous item.
        furnace.getInventory().setResult(null);

        Messenger.msgToConsole("Furnace smelted and cleaned!");
    }

Is there something I'm doing wrong?
In other method I use the same .setResult() and it works fine.

halcyon hemlock
#

i think

#

not sure

#

is there a setinventory or some shit

young knoll
#

It doesn’t

#

getSnapshotInventory does

#

My first guess would be to delay it a tick

slender elbow
halcyon hemlock
#

100% out of 101%

#

what can I say

upper marlin
#

Okay, I made it work!
This is what I changed:

@EventHandlerpublic void onFurnaceSmelt(FurnaceSmeltEvent event) {
        Furnace furnace = (Furnace)event.getBlock().getState();
        ItemStack item = event.getResult();

        furnace.getWorld().dropItem(
            furnace.getLocation().add(new Vector(0, 1, 0)),
            new ItemStack(item.getType())
        );

        // After dropping item, execute a task
        // with FurnaceInventory#setItem()
        // after 1 tick. C:

        // Furnace result slot gets successfully cleared.
        Bukkit.getScheduler().runTaskLater(OverCrafted.getInstance(), () -> {
            furnace.getInventory().setItem(2, new ItemStack(Material.AIR));
        }, 1);

        Messenger.msgToConsole("Furnace smelted and cleaned!");
    }

Just like @young knoll suggested, I delayed it a tick.

#

Thanks for the help! C:

ancient dust
#

Hello,
quick question, does anyone know why I can't find the dependency of minecraft 1.12.2 spigot api. I have not made any changes.

Execution failed for task ':bukkit:bukkit-common:compileJava'.

Could not resolve all files for configuration ':bukkit:bukkit-common:compileClasspath'.
Could not find org.spigotmcspigot1.12.2-R0.1-SNAPSHOT.
Searched in the following locations:
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/spigot-1.12.2-R0.1-SNAPSHOT.pom

chrome beacon
#

If you want access to nms and such you need to run BuildTools

#

?bt

undone axleBOT
ancient dust
chrome beacon
#

You have two options:

  1. Run BuildTools
  2. Switch to spigot-api rather than spigot
river oracle
#

?bootstrap too :3

undone axleBOT
#

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

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

chrome beacon
#

🔫

#

They're on 1.12.2 so that's not relevant

#

also they're already using gradle

ancient dust
#

Why did that change earlier?

chrome beacon
#

wdym?

#

It changing from spigot-api to spigot

#

?

ancient dust
#

Hi,
I have read a few articles about buildtools, I understand that you have to run buildtools for the version (1.12.2), then it creates a jar for me, I have to import it into my plugin project and then I have access to nms again. Is that correct? Since I still don't have access to it after importing....

eternal oxide
#

`?nms

obsidian plinth
#

!paste

eternal oxide
#

?nms

obsidian plinth
#

?paste

undone axleBOT
obsidian plinth
#

https://paste.md-5.net/iluvohihes.php

anyone know why when im sending that
com.comphenix.protocol.wrappers.Vector3F
to a TEXT_DISPLAY it kicks viewers for

java.lang.IllegalStateException: Invalid entity data item type for field 11 on entity class_8123['Text Display'/1000003,

slender elbow
#

just use a real text display

obsidian plinth
#

I like the control of the packet version

slender elbow
#

just use a real text display

#

they are cheap asf

obsidian plinth
#

helpful 100% XD

slender elbow
#

they are easier to control

#

and clearly the packet approach is not working

obsidian plinth
#

bc i plan to use the packets

wet breach
obsidian plinth
#

Does it really matter why i wanna use packets?

wet breach
#

indeed, it gauages whether its worth helping or not

#

we are not servants

obsidian plinth
#

not to sound mean but if u dont know how to fix the pakcets i dont really need ur help

worthy yarrow
#

Why would you not use the api when you can...?

obsidian plinth
#

XD

slender elbow
#

you're gonna get told the same things in the paper discord

worthy yarrow
#

Paper is better because they have an api... just like spigot?

wet breach
unreal sky
#

you are so rude

wet breach
wet breach
#

lol

warm mica
wet breach
#

its fine, they are more then welcome to go to paper 🙂

#

they are probably using paper anyways

unreal sky
wet breach
#

but what I find ironic, is they are using a heavy lib, to offload a cheap thing to only the client

#

when they could just use the api which provides what they want at a cheap cost to begin with

worthy yarrow
#

He left lol

young knoll
eternal oxide
#

Its not the first time he's demanded answers without answering ours. I doubt it will be the last.

blazing ocean
#

but muh packets

eternal oxide
#

lol true

worthy yarrow
floral drum
#

this guy was a "ceo" of a team that I'm apart of... damn

worldly ingot
#

"i like the control"

#

> can't get it to work

young knoll
#

Harness the power of AI to craft a Minecraft experience shrouded in gothic mystery. Our tools blend ancient aesthetics with futuristic technology.

#

That’s certainly a description of all time

floral drum
#

he could have literally used this in protocollib

#

maybe if he looked into the api's he's using he'd get it

#

I found it so fucking fastr

slender elbow
#

from the couch, to turn the tv on

#

(is that a thing people do nowadays?)

eternal oxide
#

^ me right now

blazing ocean
nova notch
#

who watches tv in 2024 that shit is too damn expensive

wet breach
nova notch
#

i get that for free

wet breach
#

cheaper then cable if that is what you mean

wet breach
nova notch
#

dont need a tv when i got a perfectly good pc

#

also fuck cable

wet breach
#

oh you must be single

#

shame

nova notch
#

ok

wet breach
#

not meant as an insult, just that it makes sense why you only need a pc

golden turret
#

im trying to run BuildTools for 1.21 but it keeps using 1.21.1. How can I change that?

golden turret
#

i need it

blazing ocean
#

no you don't

golden turret
#

yes i do

blazing ocean
#

1.21 has critical bugs

golden turret
blazing ocean
#

why do you believe you need it then

#

that's because you should not be using it

#

just use 1.21.1

#

it's just some dupe and bug fixes

golden turret
#

say that to the protocollib maintainers then

blazing ocean
#

i mean like

blazing ocean
golden turret
#

i think that explains it

rough ibex
#

is this a question or an acknowledgement

unborn berry
#

I'm stuck while creating a new custom enchant. Can someone help me pls...

slender elbow
#

that is not how you do custom enchantments

#

not that they've ever been supported really, but nowadays you can do custom enchantments via data packs

#

or nms

#

but data packs is the only supported way

unborn berry
#

is there anyway to make a custom enchant without nms ?

slender elbow
#

not with a plugin

#

with a plugin, nms
without a plugin, data pack

unborn berry
#

where can i find a example of nms plugin ?

slender elbow
#

?nms

slender elbow
#

to start with ^

sly topaz
#

you can bundle it with your plugin and install it if necessary, though I'm unsure if the API allows for dynamically loading datapacks, you could just force a minecraft:reload

unborn berry
sly topaz
sly topaz
#

when dealing with NMS, you have to be aware that it is outside the realm of the API so you'll be solely relying on your knowledge of internals

slender elbow
sly topaz
#

tl;dr: good luck, have fun

sly topaz
slender elbow
#

on a high level, you have to unfreeze the enchantment registry, construct your custom enchantment instance with all the details and definitions and configurations you want, and then add it to the registry

slender elbow
unborn berry
#

danm custom enchantment plugin doesn’t exits in 1.21 anymore

slender elbow
#

i'm sure EcoEnchants exists

#

but like, that is overabstracted and overengineered enchantments plugin loll

sly topaz
#

that plugin doesn't use true custom enchantments, since these didn't exist when it was made

#

well, I don't know if it does now, but it definitely didn't last time I checked

#

it just uses the good ol' trick of essentially just replicating enchantments with the lore and shenanigans I can't be bothered to explain

slender elbow
#

they do seem to add entries to the registry

#

obviously the enchantment definition is a dummy, but it still has the key for them to identify, and it can be properly added as an enchantment to items i guess

sly topaz
#

oh, they do registry the enchantments now

young knoll
#

We love a little registry abuse

#

If the registries aren’t meant to be unfrozen then why do I have a blowtorch?

slender elbow
#

you mean thawed 🤓

sly topaz
# slender elbow you mean thawed 🤓

Ashcktually, the linguistic register (no pun intended) for the word unfreeze would be more appropriate than thaw, given the technical context 🤓 ||(oops, didn't mean to ping, sorry)||

rough ibex
#

thaw implies over time

#

unfreeze can be immediate

#

🤓 🤓

restive mango
#
        String falseTeamString = UUID.randomUUID().toString();
                            Team mobTeam = Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("STARTEAM" + falseTeamString);

                            mobTeam.allowFriendlyFire();
                            mobTeam.setColor(ChatColor.BLUE);

                            Entity ent = Bukkit.getPlayer("Aesopian").getWorld().spawnEntity(Bukkit.getPlayer("Aesopian").getLocation(), EntityType.COW);
                            mobTeam.addEntry(ent.getUniqueId().toString());
                            ent.setGlowing(true);
#

Why does a cow spawned with this code and set to be glowing not glow blue? It just glows white...

quaint mantle
#

Hello

#

How much do I have to pay to get a custom minecraft plugin made?

tired mountain
sweet pike
#

why does the true scale not reflect on the client until i relog?

ItemStack head = new ItemStack(Material.PLAYER_HEAD);

ItemDisplay display = player.getWorld().spawn(player.getLocation(), ItemDisplay.class, itemDisplay -> {
    itemDisplay.setItemStack(head);
    itemDisplay.setInterpolationDelay(5);
    itemDisplay.setInterpolationDuration(100);
});

Transformation transformation = display.getTransformation();
transformation.getScale().mul(25);

new BukkitRunnable() {
    @Override
    public void run() {
        display.setTransformation(transformation);
    }
}.runTaskLater(this, 1L);```
#

it'll do as much as it can in the 100 tick duration, but then after that the item just stops transforming. after i relog, it will show the true x25 scale

#

nvm, seems to be an rendering issue with the client i am using. works completely fine on vanilla...

proud badge
#

hi is it possible to somehow cancel a ServerListPingEvent? Like make the server not respond

#

the class does not implement cancellable and I couldnt see any methods to do this

lilac dagger
#

not sure you can

#

i think you need to modify the server for that

buoyant viper
#

why would u... not want to respond to pings?

#

could probably use PacketEvents or ProtocolLib to do it tho idk

proud badge
ripe wolf
proud badge
#

it's an optional config option for the plugin im making to not respond to pings made by VPNs (because of server scanners)

buoyant viper
#

personally would not join a server that blocks vpns but i digress, check packetevents or protocollib to see if it has the packet tht u can cancel

lilac dagger
#

i think it's too early

#

not sure if the ping is a packet

ripe wolf
proud badge
#

everything sent between the client and the server is a packet

unborn berry
#

anyone have any idea?

unborn berry
#

i used 1.21.1 and that lead me to an error while doing this:

Component component = Component.literal("Custom Enchantment");
java.lang.NoClassDefFoundError: net/minecraft/network/chat/Component
eternal oxide
#

why nms?

unborn berry
quaint mantle
feral fiber
#

What to do if it doesn’t install?

quaint mantle
#

Just use gson

feral fiber
#

??

#

json > gson?

remote swallow
#

Gson is the name of the library, it still uses json files

feral fiber
#

Wait, do I need something like gson?

unborn berry
kindred valley
chrome beacon
unborn berry
#

yes

chrome beacon
#

Send your pom

#

?paste

undone axleBOT
chrome beacon
#

Use the paste

unborn berry
chrome beacon
#

That looks like the old pom still depending on 1.21 and not 1.21.1

unborn berry
#

when i use this pom i got this error:

Could not find artifact org.spigotmc:spigot🫙remapped-mojang:1.21-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
chrome beacon
#

Like rad told you

#

Use 1.21.1

unborn berry
#

when i use this pom: https://paste.md-5.net/viwiwatoma.xml
i got the error:

java.lang.NoClassDefFoundError: net/minecraft/network/chat/Component

and i see no redline while coding, it just apear when i enabling the server

chrome beacon
#

Send the entire error and how you are compiling

unborn berry
#

i used maven clean and install to compiling

upper hazel
#

I can't find the attribute type of the player's natural regeneration can you tell me what they are called?

chrome beacon
chrome beacon
upper hazel
#

then what this?

#

just effect?

chrome beacon
#

I don't understand the question?

upper hazel
#

how to change player regeneration if it is not an attribute

unborn berry
#

Olivo thanks for your help and i have another question that where can i find java doc or something of net.minecraft ?

blazing ocean
#

HOWEVER

#

yarn has javadocs

#

90% of names will be different to mojmaps tho

shadow night
blazing ocean
#

wdym

shadow night
#

you could probably generate a mojmap javadoc for personal use

blazing ocean
#

you're not allowed to make them public

shadow night
#

or even better, a parchment javadoc (parchment is just mojmaps with paramter names and javadoc)

shadow night
#

that assumes you do not make them public

#

in current context

#

oops I think I accidentally deleted IJ configs and plugins when cleaning up space

#

happens Ig

unborn berry
shadow night
#

gimme a minute, I'll try doing that

#

sadly, all my gradle caches have despawned magically, so it'll take a while

unborn berry
#

feel free ❤️

shadow night
shadow night
#

Do you think it gets rid of decompiler artifacfs?

#

But I doubt there is a parchment one, so no javadoc

#

If not it, I could have generated jd

#

Might try with fernflower a bit later

fading drift
#

is there a way to set a block state without updating lighting

summer scroll
#

Not sure tho.

desert aspen
#

how could i check when a entity it starts EXPLODING

#

bc, entityprimeevent call when the entity explode

#

and entityexplode the same

fading drift
#

ty

shadow night
fading drift
#

is there a way to allow players to bow through eachother with nms?

chrome beacon
#

You don't really need nms for that

#

teams with friendly fire disabled should work

mellow edge
#

I still can't really make entities invisible (not transparent) to spectators, specfically armor stands.
I've tried:
-team seeFriendlyInvisibles (doesn't work, it works for normal gamemodes like creative, surival)
-custom EntityArmorStand implementation - here I cannot really change anything so I assume it is either client-sided or in any parent class
-destroy packets (destroys the whole armor stand)
-giving it invisible effect

Any new ideas?

sly topaz
#

why did destroy packets didn't work

#

the entity literally wouldn't be there so there's no way it wouldn't work

mellow edge
#

yeah but I must keep the custom text of the armor stand

chrome beacon
#

Just use a text display

sly topaz
#

^

mellow edge
#

this is needed for backwards compatibility in spigot 1.20 iirc+ I can use it but what for older versions?

sly topaz
#

you don't even have to do the destroy/spawn packets directly btw, Player#hide/showEntity essentially does that for you

chrome beacon
#

yeah but that would hide the nametag

#

which is what they don't want

sly topaz
#

yeah but the solution is a text display

chrome beacon
#

There's not much you can do, just let the armorstand be there

mellow edge
#

hypixel somehow hides it, that makes me wonder if the entity is even an armor stand

chrome beacon
#

Actually what you can do is use teams

sly topaz
#

HP doesn't do spectator mode though, does it

chrome beacon
#

but only send the team data when in spectator mode

sly topaz
#

they just do creative with custom stuff

chrome beacon
#

or does that also remove the nametag?

sly topaz
#

because spectator mode is too unreliable

mellow edge
chrome beacon
#

Does Hypixel even use spectator mode

sly topaz
#

I don't think it does

chrome beacon
#

Last time I played they didn't

sly topaz
chrome beacon
#

but that was a couple years ago

mellow edge
#

ok it is like that:
-when respawning or spectating a specific player you are in spectator
-when actually in spectator you are in survival