#help-development

1 messages · Page 1229 of 1

lavish folio
#

Is there way how i could have two players on sever with only one minecraft account for plugin development and testing?

eternal night
#

turn the server to offline mode?

lavish folio
#

yes but i dont have two nicknames

smoky anchor
#

just make up one, any will do

chrome beacon
#

A launcher like Prism will let you launch offline accounts as long as you own a copy of the game

#

You can use that to launch as many as you need for testing

smoky anchor
#

An alternative can be an account switcher mod, some allow offline mode

quaint mantle
#

Does anybody know how i can set a text above the players nametag? I know u can use a scoreboard and use belowname but i want a text above the players nametag? I know a server that has that, but they also use a custom resourcepack. Is that a need to use a custom resourcepack for that?

young knoll
#

Display entity

#

TextDisplay specifically

quaint mantle
#

Yea thats what chatgpt said also, but then i need to teleport it everytime no?

young knoll
#

No

#

Make it ride the player

quaint mantle
#

Ohh

#

yea that makes sense ill try that thank you

warm mica
#

Remember that uuids change if you switch to offline mode and that can be paain

lavish folio
#

can i somehow run minecraft as offline client from jar

#

?

smoky anchor
#

I believe so, but nobody is gonna tell you how.
We gave you two alternatives if you don't have two accounts.

blazing ocean
#

just use a launcher lmao

muted dirge
#

Can you create custom patterntypes for banners??

smoky anchor
muted dirge
pseudo hazel
#

no

#

well maybe

muted dirge
#

How

smoky anchor
#

I'm sure there would be a way, but don't

blazing ocean
#

datapacks have to hook in somewhere

muted dirge
#

Im trying to recreate flags in minecraft

pseudo hazel
#

and youd want a rp for the client to actually have an effect for the pattern presumably

muted dirge
#

Thats too complicated now

#

I'll stick to vanilla patterns😔

smoky anchor
#

Oh ye that is also a part.
I think doing it nms would be too complicated and painful.

muted dirge
#

I'll do switzerland with a red background and a white cross

smoky anchor
muted dirge
#

Its wierd but thats all i can

muted dirge
#

And its just a experiment

blazing ocean
#

how else do you expect to display the flags

#

you need to have all flags somewhere at the end of the day lol

pseudo hazel
#

just make banners out of existing patterns and use those whole

muted dirge
#

I'll do that

#

Do i add switzerland or denmark

#

Cause i have to use red background and a cross for both

thorn isle
#

enderpearls and teleport commands will fail silently

blazing ocean
#

teleporting is definitely not better

#

what I do is just patch the server to not do that

thorn isle
#

it's fine as long as you also copy the velocity of the player and hide it from the player themselves

blazing ocean
#

it is not fine, no

#

it looks horrible

thorn isle
#

it is; a third party can't tell the difference

blazing ocean
#

incredibly stuttery

thorn isle
#

no

blazing ocean
#

I've tried it myself and you 1000% can tell a difference

thorn isle
#

you forgot to

  • set the velocity
  • set the teleport interpolation to 1 tick from the default of 0
#

if you do these it is indistinguishable from riding the player, because the client will interpolate the player and the text positions identically

#

with the exception of that player themselves, since they will see their own movement locally - hence hiding it from the player themselves

blazing ocean
#

this is what it looks like, not only for yourself but also for others

thorn isle
#

false

blazing ocean
#

not false

thorn isle
#

if it looks like that for others then you are messing something up somewhere

#

let's see code

blazing ocean
#

that's a clip from 7 months ago

#

we're just adding it as a passenger nowadays and don't have any problems

thorn isle
#

i'm using passengers for entities and teleporting for players

thorn isle
#

i would send a video but it doesn't seem like i'm permitted to send attachments

#

whatever

blazing ocean
#

?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

muted dirge
#

how to remove these information from lore

#

i mean the colors

small current
#

for some reason

slender elbow
#

now it's called HIDE_ADDITIONAL_TOOLTIP

#

HIDE_POTION_EFFECTS does not exist anymore

muted dirge
#

Thanks

upper hazel
#

Does anyone know why when adding a Jar file to a plugin's dependency works as if the dependency enabling later than the plugin itself?

#

i try use api and get list but this list empty

robust helm
#

?paste

undone axleBOT
upper hazel
robust helm
#

@Override
public void onDrag(InventoryDragEvent event) {
if (event.getInventory() == this.inventory)
event.setCancelled(true);
}

cuz shit like this doesnt work

robust helm
#

lemme try

thorn isle
#

let's see your entire inventory listener instead of just 1 event handler

#

you'll need to listen to both inventoryclick and inventorydrag

thorn isle
#

you'll also want to keep in mind that the clicked inventory could be the player inventory rather than your inventory, even if they're looking at an inventory view with your inv as the topmost

#

for more specific advice you'll have to ask something more specific than "why does shit like this not work"

#

e.g. how exactly and what exactly doesn't work

robust helm
#

it doesnt cancel item move events

thorn isle
robust helm
#

its handled by guiRegistry

thorn isle
#

you're implementing some gui interface from some gui library/framework i'm guessing

robust helm
#

?paste

undone axleBOT
thorn isle
#

for example the notifyGuis method might fail to find the guis to notify

robust helm
#

for the click event it works for sure

#

lemme try drageevent

robust helm
#

and it workedbefore

#

ig it fails cuz of 1. line with the inventory check

thorn isle
#

throw more sysouts at every step of the logic until you find where it goes wrong

#

alternatively plug the server into a debugger and step through it line by line, but sysouts are generally more approachable for beginners

robust helm
#

yea im working with some stupid @proven kite using code with me

#
    @Override
    public void onClick(InventoryClickEvent event) {
        Bukkit.broadcastMessage("1");
        if (event.getClickedInventory() != this.inventory)
            return;
        Bukkit.broadcastMessage("2");

1 is printed but not 2

#

when clicked in the opened gui

#

its soooo weird

thorn isle
#

is it an inventory created with Bukkit.createInventory

robust helm
#

yea

robust helm
#

uh actually less, cuz imports arent included

muted dirge
robust helm
#

true

pseudo hazel
#

its not needed

thorn isle
#

iirc you're not "supposed" to do that

pseudo hazel
#

for me it works

robust helm
#

nvm, i cant use that as i use both the players inventry and the opened inventory

pseudo hazel
#

try just getInventory instead of getClickedInventory

robust helm
thorn isle
#

try e.getview().gettopinventory()

robust helm
#

oooh

thorn isle
#

since the clicked inventory could be the player inventory

#

even if they're looking at your gui

pseudo hazel
#

yeah thats why you should use getInventory

#

which should always be the top inventory

#

or player inventory

#

if there is no top

robust helm
#
        Bukkit.broadcastMessage("1");
        if (event.getInventory().getHolder() != guiPlayer)
            return;
        if (event.getClickedInventory() != event.getView().getTopInventory())
            return;
        Bukkit.broadcastMessage("2");

this also didnt work

#

should have added a debug msg...

pseudo hazel
#

in the case of holder make sur you did set the holder when creating the inv

robust helm
#

yea no i didnt

#

i js realized too

blazing ocean
#

?gui

upper hazel
#

" EcoEnchant ecoEnchant = EcoEnchants.INSTANCE.getByName(id);"

robust helm
pseudo hazel
#

you can use the clicked slot to determine which inventory it is if you wanna be extra sure

smoky anchor
robust helm
#

its sooo weird. like my onMove(INventoryMoveEvent) debug msg doesnt work but the whole gui does

smoky anchor
blazing ocean
#

it's not that wildly different lol

#

if you just try a tiny bit you'll understand it

smoky anchor
#

I know, I think I could if I gave it a bit, but I'm too tired

echo basalt
#

type shit

robust helm
#

cuz all the other events work

#

wtv. everything works now so ill js stop thinking before i go insane

signal kettle
#

Any idea how to place blocks randomly within range instead on each block in range?

                            int radius = 5;
                            Location loc = b.getLocation();
                            World world = loc.getWorld();
                            for (int x1 = -radius; x1 < radius; x1++) {
                                for (int y1 = -radius; y1 < radius; y1++) {
                                    for (int z1 = -radius; z1 < radius; z1++) {
                                        Block block = world.getBlockAt(loc.getBlockX() + x1, loc.getBlockY() + y1, loc.getBlockZ() + z1);
                                        if (block.isSolid()) {
                                            Block air_checker = new Location(block.getLocation().getWorld(), block.getX(), block.getY() + 1, block.getZ()).getBlock();
                                            if (!air_checker.isSolid()) {
                                                if (leaf_litter_chance <= 25) { // 25% chance
                                                    if (leaf_litter_random == 1) {
                                                        if (b.getType() == Material.BIRCH_LOG) {
                                                            NexoBlocks.place("birch_leaf_litter", air_checker.getLocation());
smoky anchor
#

Take a look at Math.random()

smoky anchor
signal kettle
#

oh thank you, forgot that can use that for it, also will fix your mentions

torn shuttle
#

does anyone have a good guide on manifesting code

#

I'm tired of writing it the good old fashioned way and I heard people really swear by this whole manifesting thing

smoky anchor
#

For me its: get somewhat tired in the day, power through the evening and then at night, about 1AM you suddenly get a burst of energy and motivation to code.
You stop thinking about how to well design stuff and just get it done. It's horrible code, but it works, so long you don't want to extend it.

Is that what you're talking about ? :D

muted lake
#

ok

low field
#

is there a way to edit the vanilla tags with a plugin and without a datapack

eternal night
#

no

young knoll
#

Well…

#

Yes but it’s not pretty

robust helm
#

Is there any reason why bukkit chose to make a plugin parameter for BukkitRunnable#runTaskLater or PluginManager#registerEvents? Like they couldve just provided the plugin themselves

#

cuz im debatting whether i should make my generic core api for a spigot server network require passing in plugin instances aswell

#

why not js use the core plugin's instance tho?

thorn isle
#

if a plugin is disabled, all its scheduled tasks get cancelled by the scheduler

#

for this it needs to know which plugin the task "belongs" to

#

likewise, listeners will be unregistered on disable

#

generally anything anywhere that you pass to bukkit from your plugin will have a plugin parameter attached to it for housekeeping like this

quaint mantle
#

Hi does anybody know what the best way is to teleport a player with his passenger? I found out that i will need to remove the player's passenger, but how would i do that? Like remove his passenger before the teleport and spawn it again when the teleport is done? Because theres only one event. Any help appreciated!

Edit: Fixed using entity.teleport(location, TeleportFlag.EntityState.RETAIN_PASSENGERS);

eternal night
#

How would the server wide scheduler magically know what plugin is calling it

young knoll
#

JavaPlugin#getProvidingPlugin magic

slender elbow
#

didn't mean to ping

#

no regrets

eternal night
#

lynxplay[no-ping]

dry hazel
#

just walk the stack and check what plugin the caller class belongs to

eternal night
#

speed police wants to know your location

slender elbow
#

i will avoid it by loading classes into a custom cl

blazing ocean
#

what if you just don't load classes

eternal night
#

could indeed be implemented via a copy task

blazing ocean
#

so true

young knoll
#

Classes are overrated

#

Via the power of jshell I no longer need them!

blazing ocean
#

no

eternal oxide
#

You only ever need one class

young knoll
#

Well now I need 0

blazing ocean
#

anonymous classes be like

grim hound
blazing ocean
#

did you reload

#

sometimes fucks with statics

grim hound
#

it's a normal start

sullen marlin
#

Initialisation order likely

grim hound
#

how the hell did I make my classes init so badly

grim hound
#

oh I guess if I request itself from as a result in the constructor

grim hound
# grim hound

like if I did Messages.file in MessagesFile's constructor

grim hound
#

inner classes

eternal night
#

We love inner classes

grim hound
#

why the hell does this

remote swallow
#

because you can init a variable?

grim hound
#

need to be surrounded

#

in a try catch

#

a throw statement

remote swallow
#

just throw RuntimeException instead of throwing existing

#

allows you to give a nicer message too

grim hound
#

I know of that

young knoll
#

You’ve already logged an error message

grim hound
#

who designed java

#

lemme speak to him

thorn isle
#

checked exceptions have pros and cons

grim hound
#

nonono

young knoll
#

Pros: they force developers to deal with them
Cons: they force developers to deal with them

grim hound
#

who did this

remote swallow
#

also you never responded to the cat i sent you

young knoll
#

Cat

worthy yarrow
#

ebic show me the car

rough ibex
remote swallow
remote swallow
worthy yarrow
#

show me the car!

rough ibex
#

your 2 screenshots are of different issues

worthy yarrow
grim hound
#

does a throw statement

#

need to be surrounded

remote swallow
rough ibex
#

because it might fail

grim hound
#

in a try catch

rough ibex
#

What the fuck is e

grim hound
rough ibex
#

You never told what e is

worthy yarrow
remote swallow
#

nuclear look at ur pings

grim hound
rough ibex
#

okay theres no errors here

#

So you just rethrow e?

grim hound
rough ibex
#

give me a second

#

You gave me a ledge to stand on and not stumble off of

grim hound
#

and wtf is Unsafe throwException?

#

tf is he verifying

#

brotha you got an exception

#

call back

rough ibex
#

brother what are you doing

grim hound
rough ibex
#

Your rethrow is fine

grim hound
grim hound
grim hound
#

and why does netty use it

#

what is everything

rough ibex
#

I'm going to guess it throws checked as a bypass

#

Like a sneaky throws

grim hound
#

java uses it once

rough ibex
#

the verifier is probably the caller & jvm checking exceptions

#

But youre working with dark magic so I cant know for sure

grim hound
rough ibex
#

good

grim hound
#

nonono

rough ibex
#

fucking wizardry

grim hound
#

I had to get help from some literal wizard king

#

like brah wtf is this

grim hound
#

but wtf is the rest

#

dud was a wizard, I'd have taken way too long to come up with this

#

md I think is a master of asm

#

okay, gn magic people

golden turret
#

how can i change the type of a block data and discard the invalid data without an exception?

#

like, transforming a cake into a fence

young knoll
#

Block#setType?

#

Or do you want to actually copy any states the two materials have in common

golden turret
#

kinda

#

yes

#

and just discard the ones are are invalid to the new type

#

i dont want that exception

golden turret
#

omg ty

wet breach
# grim hound and wtf is Unsafe throwException?

The code that is invoked via Unsafe is not examined in the same way by the compiler as regular Java code. We can use the throwException() method to throw any exception without restricting the caller to handle that exception, even if it’s a checked exception

@Test(expected = IOException.class)
public void givenUnsafeThrowException_whenThrowCheckedException_thenNotNeedToCatchIt() {
    unsafe.throwException(new IOException());
}
After throwing an IOException, which is checked, we don’t need to catch it nor specify it in the method declaration.```
slim wigeon
#

I have a issue here. The inventory again. The add function works if the item amount is under the used slot size but after, things start messing up. Any fixes?

InventoryManager.java: https://paste.md-5.net/uwihipihax.java

#

You just looking at the add function, nothing else. I will focus on other functions after this is resolved

#

Wrong video

remote swallow
slim wigeon
#

I think the addItem acts the same way, I can be wrong

#

Wait, I cannot do it because its not a inventoryprivate List<ItemStack> inv = new ArrayList<ItemStack>();

remote swallow
#

might be worth to store it differently, instead of storing each stack store a single item as a copy and an amount of that item you can use to generate the inv

slim wigeon
#

I just converted the inventory to a normal inventory and it works, thanks. I don't know why I think its the same

slim wigeon
#

Wait, I see why I did the inventory like this. The first stack is 63 of the inventory. Like Wheat Seeds is 63

#

Any fixes?

#

I don't know if its safe to ignore, do items become lost because the addItem not setting stacks to 64?

slim wigeon
#

Ignore that, I seen what it was

fair rock
#

What was it, now im interested because i watched the entire video

upper hazel
#

is it possible to turn off the plugin correctly so that the user cannot interact with it when errors are detected. Without exception errors when user try interact?

sullen marlin
#

When what errors?

#

I mean yeah you can wrap everything in a catch block and disable

wary harness
#

Hey I am registering dinamicaly commands for my shops
User can set aditional commands to open gui shop
Problem which I incuter is that my command is pulling old instance of shop object after my reload command
I am registering command again each time on teload to command map I confirmed that instance is old by adding uuid to shop object
I am sure I am clearing and recreating all shops object
They are stored in shopmanager object which is getting recriated to on reload
I am so confused

dense falcon
#

Hello :), how do I open a kind of window on a player? I would have liked to set up a window where we have a warning from an admin etc. I know there are the titles but is there no other way?

pseudo hazel
#

a kind of window

#

can you be more specific?

dense falcon
misty ingot
#

is there a way to edit the 'enchantability' of an item?

misty ingot
#

that is actually surprisingly not what that term means (I also found this out today)
its a value that determines how good the enchants your item will get when you enchant it

so like gold items have better 'enchantibility' than stone or wood
its an actual value in the game
gold is like 22 or smth

#

so i wanna be able to edit that for my custom item

smoky anchor
misty ingot
#

wait wha

smoky anchor
#

The component that has this functionality is called "enchantable"
And its value controls the enchantability

misty ingot
#

oh wait

#

yeah i see it

#

well thats a sign to get glasses if anything

smoky anchor
#

The wiki link has more detail about the component

young knoll
#

Smh why isn’t it called setEnchantability

misty ingot
#

i checked the docs it should be ItemMeta#setEnchantable

smoky anchor
#

What version

misty ingot
#

1.21

smoky anchor
#

exactly

pseudo hazel
#

.0?

misty ingot
#

yes...

smoky anchor
#

now even dot releases have big features

misty ingot
#

so youre telling me

#

this got added in 1.21.smth

#

what happened to the thing after the dot being for maintainance updates

smoky anchor
#

1.21.2

smoky anchor
#

Anyways, update ::)

misty ingot
#

well i mightaswell just update it to 1.21.4

pseudo hazel
#

the biggest updates now happen on maintenance released

misty ingot
#

oh for fuc-

#

now everything else is broken

#

fuck you minecraft

pseudo hazel
#

while minor versions are just for new blocks and mobs seemingly

misty ingot
#

fuck you whoever changes the enum names every goddamn version

smoky anchor
#

just remove GENERIC_

misty ingot
#

yeye but still, annoying

smoky anchor
#

This really is not that big of a change

misty ingot
#

a nn o ying

smoky anchor
#

I love how 1.21.3 fixes like 3 bugs
And 1.21.4 added the Pale Garden
Really cool versioning there Mojank

pseudo hazel
#

its not minecrafts fault for bad names in the spigot api

smoky anchor
#

Well in this case, the enum is named after vanilla attribute name
And vanilla changed it and so did Spigot apparently

fallow violet
#

Is it possible to create your own enchantments or do i have to manipulate the lore and fake one?

smoky anchor
#

Yes, datapacks

fallow violet
#

wait fr?

smoky anchor
#

mhmm

fallow violet
#

but not via plugins?

smoky anchor
#

I mean, you could possibly with hacks
But Datapack is the official way
-# I really wish spigot does add datapack bundling or something one day

grim hound
#

it just requires a bit of hacking into

fallow violet
#

oohhh but how .... hahaha

grim hound
#

ah can't tell

#

don't know

smoky anchor
#

Hmmm I don't think you can use the unfreeze registry, put new entry and freeze again
As this is "experimental feature"
I think this would brick the world on server restart

grim hound
#

it's just that if something is possible with datapacks it's possible with just plugins

fallow violet
#

yeah but i cant find how

#

but ill search more

smoky anchor
misty ingot
#

sooo im using gradle for the first time because i need to update this plugin some other guy made
(my gradle https://paste.md-5.net/yiyaqibihi.rb)

and when i put the jar in the plugins folder and load it, it says NoClassDefFound for the ConfigManager dependency
the plugin was reportedly working fine before i made any changes, i did not change the gradle except the paper-api version
no errors when compiling

i used build

remote swallow
#

ur build doesnt depend on shadow jar

#

run the shadowJar task or make build depend on it

misty ingot
#

yep, first time using gradle

blazing ocean
#
tasks.assemble {
    dependsOn tasks.shadowJar
}
misty ingot
#

so thats why assemble didnt work either

fallow violet
#

How can i implement NMS with Gradle for 1.21.1? Do i have to use Buildtools for that? I forgot...

remote swallow
#

?nms

remote swallow
#

iirc that has a gradle part on it

fallow violet
#

thank you

misty ingot
#

alright everything works

#

back to never using gradle again

#

thanks

blazing ocean
chrome beacon
#

Good idea 👍

blazing ocean
#

nah

misty ingot
#

maven is love

#

maven is life

blazing ocean
#

no

#

@remote swallow get this guy

thorn isle
#

ant 💪

wary harness
#

hey

#

is this bad way to register command

#

I am trying to make dynamic command for opening shops

#

I got plugin which user can crate seperated shops and then command for them in shop.yml command

#

I got reload command in my plugin which loads new instance class

blazing ocean
#

I mean there isn't any other way

wary harness
#

of that command

#

but from some reason comamnd is puling old instance of the classd

#

like command is not replaced

blazing ocean
#

don't reload

wary harness
#

well point of whole thing is to be able to reload

thorn isle
#

consolesender.sendmessage()

#

use a logger

wary harness
#

do you got a min to hope in vc to show you

#

it is strange bug

blazing ocean
#

no

#

what is unregister(commandMap)

wary harness
#

no luck with it

blazing ocean
#

and have you considered printing a stack trace lol

wary harness
#

I even tried with reflections

wary harness
blazing ocean
#

because you are not printing a stacktrace if an exception occurs

wary harness
#

tried out right now

#

but there is no error

eternal night
#

quick question, how are you planning on reloading just one class

#

while this logic somehow remains?

blazing ocean
#

hotswap 🧌

remote swallow
#

pls dont use reflection to access the cmd map on every command

wary harness
#

here I just tired to unregister

#

to see what happens

#

but command still remains

blazing ocean
#

again, what does that method do

eternal night
#

is bt reload closing and re-opening a classloader?

wary harness
#

here

eternal night
#

why would just creating a new instance of your class "reload" it

blazing ocean
#

copy task

wary harness
#

and registered command again

#

what should I do then ?

eternal night
#

Yea but that isn't going to magically reload the class from disk

#

I presume you changed command code, rebuild your jar and replaced the plugin?

#

The JVM already has the old class loaded. You creating a new instance of it isn't going to prompt the JVM to go look for the new jar's content

blazing ocean
#

you want hotswap basically

wary harness
#

ok but it worked before and I am registering comamnd again with new instances which I am passing in constructor

eternal night
#

it certainly did not work before

wary harness
#

well I got one comamnd which work other not

#

that is dam strange

#

can you hope in vc

#

I will just share screen

eternal night
#

there is 0 way just calling new Command again will somehow reload it from disk

#

nah, sorry, no time

smoky anchor
#

Lynx, why are you trying to reload a class, am I just misunderstanding something ?
Guy is creating multiple instances of BiCommand, each with different "label", the thing after /
That gets loaded from a config filer or something if I understand correctly.

wary harness
#

so player can justr call /tokenshop

#

or what ever server owner sets in shop file

smoky anchor
#

Imo this is stupid, should never be its own command.
Always a command argument

wary harness
#

well people want is to be /BananaSplit

#

sometimes

eternal night
#

OH

#

are they not trying to reload from disk

smoky anchor
#

nope

eternal night
#

mb then

wary harness
#

can we speak human her what is reloading from disk

#

what you mean by that

smoky anchor
#

loading a .class file

wary harness
#

nah

#

I am trying simply give a option when server owner changes shop config and adds

#

plugin will register new command

#

and that works on start up

#

but

#

I got my main builded in command

#

which is called /bta reload

#

which should reload command and once again it load all those so callled aliases

#

from shop files

#

and creates instance of new comamnd

#

but from some reason when player types /BananaSplit or /TokenShop

#

command retrieves old instance before reload

#

and all classes where recreated in my reload() method

#

so I am a bit confused her

smoky anchor
#

I assume you never register the command the second time
So you first have to remove the command from the map and the register it.

eternal oxide
#

did you call updateCommands() on each connected player?

wary harness
smoky anchor
eternal oxide
#

the map is only sent at specific times, so if you change it live the player will not get an update unless they relog or change worlds

wary harness
#

in which class it tht

#

relogging is not working

smoky anchor
#

It's purely server-sided issue

eternal oxide
#

if the server itself is still seeing the old cvommand then you are not creating/replacing it

smoky anchor
#

Yes

thorn isle
#

why are you calling BukkitCommand::unregister in the constructor?

#

immediately after calling commandmap::register?

wary harness
#

It was just a test to see will it unregister

smoky anchor
#

Well it won't

#

that can never work

wary harness
#

why soo

smoky anchor
#

'cause you'd be calling it on the new instance of the command

#

you have to call it on the old one.

chrome beacon
#

Wait why are you using the command map to add aliases

smoky anchor
#

not alias, a whole new command

chrome beacon
#

There's an API method to do so

wary harness
#

this is not aliases

#

it is fresly registered command

smoky anchor
#

Oh wait, I think I get what you may be saying

chrome beacon
#

Command#setAliases

smoky anchor
#

Create one command, add aliasses and then use the label to do your logic ?

thorn isle
#

not ideal but that would work

chrome beacon
#

Probably better than injecting the commandMap

thorn isle
#

myes

smoky anchor
#

Would avoid all reflection, but yes, still horrible

#

I still think having "dynamic commands" like this is stupid

wary harness
smoky anchor
#

Should be a sub-command
Why is it so bad to write like 3 more characters at start

wary harness
#

well people don't want it like that

smoky anchor
#

I have never seen anybody complain about thing like this

wary harness
#

they want to have multiple shops /bananshop /potatoshop etc....

thorn isle
#

they can set that up in commands.yml

smoky anchor
#

/shop potato
just-

thorn isle
#
bananashop:
 - /shop banana
smoky anchor
#

That would require bananashop to be a command specified by the plugin iirc

#

which is not the case here

chrome beacon
#

Not really

thorn isle
#

would it? i don't think that's the case

chrome beacon
#

commands.yml can be used for aliases like this

#

You can make your own commands in there

thorn isle
#

the only issue with this is that it relies on the server admin to know about commands.yml and bother editing it

smoky anchor
#

I know too little about this feature, sorry

chrome beacon
#

You could just put a comment in there explaining what to do

#

or add it to your wiki

misty ingot
#

so yk how we have a command now /tick that changes the tick speed basically

#

how would i go about changing that through a plugin

chrome beacon
misty ingot
#

noic

misty ingot
#

ok so uh im trying to gradually increase the tick speed inside a task, but the task runs every few ticks too so the task itself speeds up as the tick speed goes up which throws off the amount of time that the task waits before incrementing the tick speed again, any workarounds?

river oracle
#

Just make sure to sync to main thread before doing api operations uwu

chrome beacon
#

Or just have the task reschedule itself

#

with adjusted time

misty ingot
#

how would a task reschedule itself

wary harness
chrome beacon
river oracle
#

Calculate offset? Hell naw

chrome beacon
#

At least it will be kept in sync with the server tick speed

#

unlike the executor service which does realtime rather than ingame time

fallow violet
#

Does Block#getDrops(ItemStack) think about fortune?

smoky anchor
#

Based on the documentation, yes

fallow violet
#

thanks

valid burrow
#

nerds

#

help me with a design choice

#

i wanna implement adventure api in UIlabs

#

but

#

since adventure api doesnt exist everywhere

#

i gotta find a way to make it optional

#

now theres a few things i had in mind on how to do that

#

one would be to make my own wrapper class

#

have like a class called TextWrapper

#

and one called AdventureTextWrapper that extends it

#

well i didnt really like that

remote swallow
#

if you want to use components on spigot for a lot of places youll need to nms

valid burrow
#

but im not sure how to implement it without it becoming very weird to use

#

(for the dev)

remote swallow
#

i hope you plan to use MenuType

valid burrow
#

i dont know what im planing on using thats why im here to get yalls opinion

#

?paste

undone axleBOT
valid burrow
#

not real methods but the concept

#

idk i dont like either

#

they both suck

remote swallow
#

id say ur best bet is literally just gonna be having the paper and spigot api accessable

valid burrow
#

well yes

#

but

#

my question is how to implement it

thorn isle
#

option one will explode

remote swallow
#

build something over menu type

valid burrow
thorn isle
#

just because you don't have an import for the adventure component doesn't mean the jvm won't try to find that class when a class referring to it is loaded

remote swallow
#

once its constructed it will do some backend platform logic and if it doesnt support that type throw an erro

thorn isle
#

if adventure isn't on the class path, there'll be a no class def error

valid burrow
#

mhm

eternal night
#

Could do something funny where your root MyGUI<TextType> exists

#

and then a subtype for LegacyMyGUI extends MyGUI<String>, AdventureMyGUI extends MyGUI<Component>

misty ingot
#

adventureapi who

#

i dont quite get whats going on here

#

like is it different stuff for adventure mode? if yes, why? and what?

remote swallow
#

adventure is an api

blazing ocean
#
misty ingot
#

wadahek

#

ohhhhhhhhhhhhhhHHHHHHHH

#

its like a

#

text thingy api

#

ima be real this entire time reading the convo i was like "but why do you need a different gui for adventure mode players"

blazing ocean
#

more than just that

worldly chasm
#

Hello I just wanted to confirm if it's true that spigot plugins will not load on papermc in the near-future?

chrome beacon
#

That's something you should ask Paper about

fallow violet
#

How can i make 2 single chests to a double chest?

smoky anchor
#

Iirc that's just a block state

ornate condor
#

how to create to ticket

smoky anchor
fallow violet
# smoky anchor Set the type to [SINGLE](<https://hub.spigotmc.org/javadocs/spigot/org/bukkit/bl...

I did this but it doesnt work:

Block left = player.getLocation().getBlock();
Block right = left.getRelative(BlockFace.EAST);
left.setType(Material.CHEST);
right.setType(Material.CHEST);
Chest chestDataLeft = (Chest) left.getBlockData();
Chest chestDataRight = (Chest) right.getBlockData();
chestDataLeft.setType(Chest.Type.LEFT);
chestDataRight.setType(Chest.Type.RIGHT);
left.setBlockData(chestDataLeft);
right.setBlockData(chestDataRight);
dense falcon
#

How can I set up a kind of builder? Like when I have a command and need an argument it always gives me the name of the players in recent versions, like I can decide for example to put something else by default like "Hello" in the command /say Hello.

fallow violet
#

You need a TabCompleter

#

Implemente TabCompleter in your Command Class and auto import the method

#

public @Nullable List<String> onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] args)

dense falcon
fallow violet
#

All commands

#

You can also do a custo mclass

cinder abyss
#

Hello, I'm trying to use packed to generate resource pack at runtime just to make a font. But when I try to execute it, it just copy the assets and generate the mcmeta. How can I fix that ?

Here is my code :```kotlin
fun main() {
val pack = resourcePack {
val jarPath = File("C:\Users\paule\Desktop\Spigot\THIT\tmp")

    meta {
        description = "Packed Example"
        format = PackFormat.V1_21_TO_1_21_1
        outputDir = jarPath
    }

    assetResolutionStrategy = ResourceAssetResolutionStrategy(javaClass)
}

// Generates a font to `assets/packed/font/my_awesome_font.json`
pack.addFont {
    key = Key("packed", "my_awesome_font")
    // Adds a bitmap provider to this font
    bitmap {
        key = Key("packed", "sprites/my_awesome_bitmap") // Uses `assets/packed/textures/sprites/my_awesome_bitmap.png`
        height = 8.0
        ascent = 7.0
        chars = listOf("\uE000")
    }
}

pack.save(true)

}```

I also don't get any error. Here's my assets folder

fallow violet
blazing ocean
#

Had somebody else ask me the same thing earlier :') need to fix the docs

cinder abyss
#

thanks 😄 perfectly working now lol

dense falcon
blazing ocean
#

@cinder abyss Got that fixed in the docs

quaint mantle
#

Hey does anybody know how i could teleport a player with his passenger into a new world? I know theres a TeleportFlag but it only works in the same world.
Theres also no Pre Event for WorldSwitching or something like that. Is there a known work around for something like that? I could remove the passenger before the teleport / world switch and set it after the teleport but in the PlayerChangedWorldEvent i dont really know how i could check if the world switch is done. Any help is appreciated 🙂

cinder abyss
blazing ocean
#

You're trying to write it into your jar

cinder abyss
blazing ocean
#

Files#createTempDirectory or something

#

Forgot the name

cinder abyss
#

okay thanks

#

maybe the datafolder will work too ?

blazing ocean
#

Plugin data dir works yea

cinder abyss
#

okay thanks

blazing ocean
#

What you could also do is set the output directory to a temp directory and then save the zip into your data directory

cinder abyss
#

yeah that's true

#

okay thanks for the hints 😄

low field
#

i want to make frogs eat players

#

and not use mixins

young knoll
#

Does that even work with a datapack

low field
#

yes

#

by editing the frog_food entity_types tag

#

if only i could modify final fields

blazing ocean
#

reflection

low field
#

not working

blazing ocean
#

?notworking

low field
#

redefining class neither

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.

low field
#

..

#

jvm doesnt allow it

#

also Field.modifiers is explicitly blocked from reflection

blazing ocean
river oracle
#

Thats not even possible lol

low field
#

bruh

river oracle
#

Dont feed out of date content

river oracle
#

The only way to change it would be Unsafe, which is also deprecated btw

low field
#

i dont think Unsafe works in java 21

river oracle
#

You could do ASM writes

blazing ocean
#

unsafe definitely works in java 21

river oracle
#

But that's about it

blazing ocean
river oracle
low field
#

i cant even redefine a class because its already dynamically loaded

river oracle
#

You always have the worst ideas Rad I stg lol

blazing ocean
#

redefining classes in a plugin also is ridiculous

river oracle
low field
#

man

young knoll
#

You can modify final fields fine

#

As long as they aren't static

low field
#

this one is

young knoll
#

ah

low field
#

public static final

young knoll
#

Well you should't modify that field anyway

#

The game should load that into the registry

pure dagger
#

level >= size || level + 1 > size
are these 2 the same?
level is int

low field
#

i should look for a workaround

blazing ocean
#

I mean if datapacks access it just do what they do

pure dagger
low field
eternal oxide
#

yes they are teh same

pure dagger
#

thanks

blazing ocean
river oracle
#

aahh brain AI fun...

low field
#

yeahhhh

young knoll
#

You can unfreeze the registries and redefine the tags

low field
#

how do i redefine the tags

#

even if i do the ai will still use the original FrogAttackablesSensor

#

right?

blazing ocean
#

show code

remote swallow
#

mojang>>

blazing ocean
#

nah

cinder abyss
remote swallow
#

kek

#

did you add kotlin just to use packed

cinder abyss
#

why ?

#

it says it's not a java library

#

I can use it in java ?

remote swallow
#

id just use kotlin for everything at that point

#

your also running an outdated server

cinder abyss
#

the resource pack generation is a part of my plugin, not the full plugin

cinder abyss
#

But when I'll publish it on spigot (maybe), I'll make it compatible with recent versions

blazing ocean
remote swallow
#

doesnt look like spigot

blazing ocean
#

It seems to be specific to spigot

#

since I don't get this in my example project

remote swallow
#

and you cannot build plain 1.21 on spigot, it got superceeded by 1.21.1 for known bugs

blazing ocean
#

what are you trying to do

broken flume
#

to playerlis

cinder abyss
cinder abyss
blazing ocean
#

what

cinder abyss
#

wdym by source dir ?

cinder abyss
#

@blazing ocean same error on spigot

blazing ocean
cinder abyss
cinder abyss
#

Re-Hello, how can I send a resource pack to player with a zip file located in data folder ?

eternal oxide
#

you can't without hosting it

cinder abyss
blazing ocean
#

no

#

but you can serve it on the minecraft server port

cinder abyss
#

perfect thanks I'll try that

fallow violet
#

is it possible to put a datapack inside a plugin?

scarlet breach
sullen marlin
#

Why do you need legacy API?

grim hound
#

I'm trying to render a skin's pixels each separately

#

using text displays as shown here

grim hound
rough ibex
#

cool

grim hound
#

however, when there is some rotation

rough ibex
#

youve got some maths to do

grim hound
#

and it's cool and all

#

but uh

grim hound
#

the placement

grim hound
grim hound
orchid gazelle
grim hound
#

this is how edgar told me to do the rightRotation transformation

grim hound
#

did you also use text displays?

orchid gazelle
#

well no those were for my own gun engine without projectiles(wasn't limited by the stupid displaying bug that makes your trajectory very very weird with higher speed bullets) and I debugged them with particles

#

well

#

so I used display entities for the visual part, basically following a custom trajectory which is based on a raytracing algorithm I also wrote myself lol

grim hound
#

cuz well

#

it's a performance bottleneck for me

orchid gazelle
grim hound
#

it'll lag the players

grim hound
orchid gazelle
#

ah and, for player rotation

#

lemme see what I used

orchid gazelle
#

holy shit I now remember all the stupidly complex maths shit I wrote back when I was 14 lol

#

Euler Rotations, Matrices and Quaternions are fun when you are not even close to having those topics at school

native nexus
#

Doing it separately is not a bad idea, just have to make algorithms to make sure if it is all in sync when you run animations

hollow warren
#

A question, how long does it take to update the version in the spigot API? Because I have 1.4 but the API shows 1.3 inflatable

young knoll
#

I think it refreshes hourly or somethin

slender elbow
#

keep in mind that the endpoint is behind cloudflare which has a 12h cache

hollow warren
#

I understand, I'm making a bot and it was throwing me a different version, now I understand everything tardigrade

amber fjord
#

the methods that i found suck for making/changing world borders. Does anyone know the proper way? I only could change it using Player#setWorldBorder() which doesnt really work

young knoll
#

That’s player specific

sullen marlin
#

Nah the cache is like 4 hours, check the header for exact

young knoll
#

There should be similar methods in World for modifying the server side border

#

(Or one of its parent interfaces, idk)

amber fjord
#

they just return WorldBorder

young knoll
#

Yes

#

Ah world doesn’t have setters

#

It should be mutable then

amber fjord
#

idk is there a way to run server commands via the plugin

young knoll
#

Yes but like… why

#

Use the api

amber fjord
#

i cant figure iut how to use the api

#

is the problem

young knoll
worldly ingot
#

If you want a world border on the world, World#getWorldBorder() is mutable. If you want per-player world borders, you create one with Bukkit#createWorldBorder(), make the changes you need, and use Player#setWorldBorder()

amber fjord
#

ah

#

i see

young knoll
#

The object returned by getWorldBorder can just be edited with the set methods

worldly ingot
#

The Player#setWorldBorder() methods are just for client-sided world borders is all

amber fjord
#

i tried to ignore the fact that i didnt know what mutable means (amateur hour over here)

worldly ingot
#

Just means you can mutate it

amber fjord
#

oh lmao

worldly ingot
#

I could do world.getWorldBorder().setSize(500); and that would just work

amber fjord
#

alrighty

buoyant viper
torn shuttle
#

damn it

#

this code is still using too much memory

#

I'm going to have to stream this as small bits of data

#

one step forward to steps back

#

mojang trust me bro it would be very funny if blocks were just float values and you just kept incrementing them instead of having all of this cringe data in them

#

think of how funny that would be

#

we were basically there before, we can go there once again

blazing ocean
nimble crescent
#

weird question

#

I got

#

can I make a 1.19 plugin use 1.20 item in menu if the server is 1.20

mortal vortex
nimble crescent
mortal vortex
#

You'd have to like fall back

nimble crescent
pliant topaz
#

Would be better to update the plugin

#

ofc you can try tho

nimble crescent
mortal vortex
nimble crescent
#

great

orchid gazelle
lyric briar
#

For some reason giving players infinite invisibility makes them visible for other players (transparent overlay)
Is there a way to hide players without using invisibility effect and they show again after a condition has been satisfied

smoky anchor
lyric briar
smoky anchor
#

Can you try to use the documentation to look this up yourself ?

lyric briar
mortal vortex
#

bro Dr House House?!?

smoky anchor
#

? ? ?

#

OH lmao

lyric briar
misty ingot
#

im ready, do it

mortal vortex
#

If I set setCancelled(true) on BlockBreakEvent, will it unbreak the block?

misty ingot
#

?tas

undone axleBOT
misty ingot
#

congratulations

tranquil pecan
#

lol

misty ingot
#

whats up with so many people having the same cat drinking milkshake pfp

#

i mean its cute but

#

why so much milkshake

mortal vortex
#

optic_fusion1 wannabe

smoky anchor
misty ingot
mortal vortex
#

let me have my moment

smoky anchor
#

huuh

misty ingot
#

pure shock

#

bro was left flabbergasted

#

bro got flashbanged

mortal vortex
smoky anchor
#

What'd I do, I'm just trying to be-
oh..

#

bru

misty ingot
#

bro getting grilled for helping a ?tas'd person

#

deserved

vestal rapids
#

I'm looking for a developer/manager for my minecraft server it's survival based semi-vanillia and I'm looking for someone to stick with me and the server for the long haul and join the community by chance I will pay if I have to I need a manager/developer for my smp [ DM's Are open come dm me]

#

active player base of 20 to 30 player as of now

wet breach
#

?services

undone axleBOT
smoky anchor
#

I will pay if I have to
Well doesn't that sound promising

rough ibex
#

i will pay if I have to

#

omegalul

smoky anchor
#

lmao

rough ibex
#

Employers love this one trick

eternal oxide
#

What you won't work for the experience?

pseudo hazel
#

thats what we call a hobby

wet breach
pseudo hazel
#

I mean yeah

#

except they still get paid something

#

atleast where in my country xD

wet breach
#

in the US, an internship isn't usually paid

#

however, in order for it to be an internship they also can't have you doing full blown work either

#

otherwise that is considered an employee instead lol

pseudo hazel
#

ah

#

over here, atleast with engineering jobs its just like the interns are working on their own projects usually unrelated to specific customer projects, e.g. to improve tooling within the company or working on r&d stuff that would eventually be developed into something later down the line

#

but yeah idk what you meant by full blown work

wet breach
#

if they are doing the exact same thing as a normal employee that isn't an intern and is an employee and an employer can get in a lot of trouble for this to the point they are banned for a period of time from taking on interns

#

also how many hours they are working are factored in too

pseudo hazel
#

I guess the workload is roughly the same here but the responsibilities are way less

wet breach
#

some employers try to take advantage of interns in order to cut costs on wages

#

and those employers typically get caught and fined a lot of money and ultimately end up having to pay the interns back pay on wages

pseudo hazel
#

yeah I mean thats probably another reason haha

echo basalt
#

Insert intern meme

grim hound
#

how can I move this text display back

#

while also moving this one

#

using the same logic?

grim hound
rose bay
#

anyone know if there is a guide to making custom payloads with protocollib? i could only find really old ones from 2017ish that don't seem to work anymore

slender elbow
#

why not just use the api?

rose bay
#

which api? sorry if that's obvious but i only recently started working with 1.21.4 spigot

thorn isle
#

basically custom payloads were incorporated natively into the protocol as "plugin messages"

rose bay
#

omg never thought of that, i only used those in the past to communicate between bungee servers. tysm

thorn isle
#

which the client will ignore if it doesn't know what to do with them, rather than explode on unexpected packet id

slender elbow
#

you still need to register the channel as outgoing in the messager or w/e

thorn isle
#

that's what it was originally for; you can think of the bungee server as a modded client communicating with the server using "custom payloads"

rose bay
#

makes sense actually, tysm ^^

fallow violet
#

What is the replacement for the deprecated method Enchantment#getByKey when i try to add an custom enchantment from a Datapack to the item?

chrome beacon
#

Read the deprecation note

#

?jd-s

undone axleBOT
fallow violet
#

only for backwards compatibility, use Registry.get(NamespacedKey) instead

How do i work with the Registry? My custom enchantment cant exist in there bcs its not from minecraft itself, no?

chrome beacon
#

If you put it in your datapack then it's added to the registry

#

The point of registries is to be able to add/remove/modify content without hardcoding anything

fallow violet
#

Registry.ENCHANTMENT is deprecated but i cannot find the note for it in the javadocs...?

eternal night
#

paper-api?

fallow violet
#

oh i got caught

eternal night
#

(but like, on paper you could also just properly register a new enchantment typing)

fallow violet
#

nah fr?

eternal night
#

a question to ask in paper's discord, but yea (tho it does come with some hassle and a new plugin system)

fallow violet
#

ima stick to the datapack hahahaha

eternal night
#

if its in a datapack, you are also fine?

#

it'll be in the registry

thorn isle
#

how does that work these days, actually

#

back when i last fiddled with custom enchants, you could get them in the serverside registry either with reflective hacks, nms, or maybe a datapack, but the client wouldn't have localization strings for them, so they'd show up as my_custom_enchant.10 on the item

#

i guess it's a synchronized registry now and the client defaults to some nicer display string for them?

#

or do i also need to send a resourcepack with the localization keys/strings for it

eternal night
#

the description is a component

#

if you plug a translatable component in there, yea, you'd need a resource pack

#

can just as well plug a text component in there

thorn isle
#

i see

misty ingot
#

ah ffs

#

the shock that i felt after the chem paper ended made me completely forget to test UILabs

#

the anxiety before and the shock after

manic delta
#

What does Entity.isPersistent = false means?

#

If the server goes down, the entity will not appear?

quaint mantle
#

Entity won't be written into disk when unloading

chrome beacon
#

when saving*

torn shuttle
#
    private ScriptVector offset = new ScriptVector(new ScriptFloat(0), new ScriptFloat(0), new ScriptFloat(0));

ask me how my day is going

pseudo hazel
#

that looks like great api to use

torn shuttle
#

oh man I really wouldn't want to use this as an api

#

instead it's for a pseudo-scripting language

#

because I really wanted to be able to express ranges like amount: 2~5

#

but then also wanted to do random vectors, so...

echo basalt
#

can't wait for ScriptAdapter.adapt(0f)

torn shuttle
#

nah

#

this is already in its final form

echo basalt
#

no static factory method

blazing ocean
#

cat ear illusion

torn shuttle
#

I don't need a factory, I'm doing the much worse thing of reading all of this from a yml file anyway

blazing ocean
#

did frosty gift em

echo basalt
#

yes

blazing ocean
#

of course he did

torn shuttle
#

at no point do I need to have this run through code

pseudo hazel
#

whats the hurt in just having an overload for a vector that takes 3 floats instead of constructing them one by one

blazing ocean
#

would be too easy

rare ether
#

Hello. I'm doing tab completion for my plugin and I need the tab completion to show online player names. I can just get these names and return them, however I was wondering whether there was some better way.

#

basically, i'm using an interface like so and every subcommand has to return something as the tab completion. Sometimes, there are subcommands nested deeper which should be included in tab completion and sometimes they should return an empty list, because there are no completions, but they should always return something, that's why i'm forcing it```java
public interface Subcommand{

String getName();

String getDescription();

String getSyntax();

String getPermission();

void execute(CommandSender sender, String[] args);

List<String> getTabCompletion(CommandSender sender, String[] args);

}

#

I'm asking this question because I think I saw a way to do that in the past, but I don't remember what it was, so I'm curious what do you guys think about this. 😁

remote swallow
#

if you want to return player names iirc returning null will do that

glossy laurel
#

Not exactly spigot related but does anyone happen to know what the formula for horizontal and vertical speed of an elytra is or where I can find it?

remote swallow
#
Minecraft Wiki

Elytra (singular form elytron) are endgame equipment found only in end ships in the outer islands of the End. While worn as torso armor, they allow gliding by pressing jump while midair. Firework rockets can be used as propulsion while gliding, allowing for true flight.

glossy laurel
remote swallow
#

guess im blind

glossy laurel
#

that's not helpful at all

echo basalt
#

proper approach would be using a tree or sumn

sour mountain
#

Can anyone help me figure out how to turn my plugin into an api/library? I've never made one before and I don't even use them that often so I'm not really sure what to do

sullen marlin
#

all an API/library is is methods that are easy for others to use/understand

sour mountain
sullen marlin
sullen marlin
sour mountain
lost matrix
sour mountain
#

I don't know how to use the methods

#

in the other plugin

#

like I have a different plugin I can't just use another plugin's methods

sullen marlin
#

Or add a static method

sour mountain
lost matrix
lost matrix