#help-development
1 messages · Page 1229 of 1
turn the server to offline mode?
yes but i dont have two nicknames
just make up one, any will do
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
An alternative can be an account switcher mod, some allow offline mode
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?
Yea thats what chatgpt said also, but then i need to teleport it everytime no?
On the long run it's easier to just buy another account or to ask a friend/sibling
Remember that uuids change if you switch to offline mode and that can be paain
I believe so, but nobody is gonna tell you how.
We gave you two alternatives if you don't have two accounts.
just use a launcher lmao
Can you create custom patterntypes for banners??
Well yes but actually no.
You need to use a datapack for this.
Cant i just do it using nms somehow?
How
I'm sure there would be a way, but don't
datapacks have to hook in somewhere
Why
Im trying to recreate flags in minecraft
and youd want a rp for the client to actually have an effect for the pattern presumably
Oh ye that is also a part.
I think doing it nms would be too complicated and painful.
I'll do switzerland with a red background and a white cross
A resourcepack is where you draw the line ?!
Its wierd but thats all i can
I dont want too many resources just to display some flags
And its just a experiment
how else do you expect to display the flags
you need to have all flags somewhere at the end of the day lol
just make banners out of existing patterns and use those whole
I'll do that
Do i add switzerland or denmark
Cause i have to use red background and a cross for both
you don't want to do this, the server will refuse to teleport the player if there is anything riding on it
enderpearls and teleport commands will fail silently
teleporting is definitely not better
what I do is just patch the server to not do that
it's fine as long as you also copy the velocity of the player and hide it from the player themselves
it is; a third party can't tell the difference
incredibly stuttery
no
I've tried it myself and you 1000% can tell a difference
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
did all that
false
not false
if it looks like that for others then you are messing something up somewhere
let's see code
that's a clip from 7 months ago
we're just adding it as a passenger nowadays and don't have any problems
i'm using passengers for entities and teleporting for players
i would send a video but it doesn't seem like i'm permitted to send attachments
whatever
?img
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
HIDE_POTION_EFFECTS item flag
for some reason
now it's called HIDE_ADDITIONAL_TOOLTIP
HIDE_POTION_EFFECTS does not exist anymore
Thanks
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
?paste
https://paste.md-5.net/ofiqapofam.cs
can someone help canceling any item move events of the opened gui(this.inventory)
@Override
public void onDrag(InventoryDragEvent event) {
if (event.getInventory() == this.inventory)
event.setCancelled(true);
}
cuz shit like this doesnt work
you shoul use equals
when i use player.openInventory its still the same reference isnt it?
lemme try
let's see your entire inventory listener instead of just 1 event handler
you'll need to listen to both inventoryclick and inventorydrag
isnt it here?
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
it doesnt cancel item move events
there's no listener here
its handled by guiRegistry
you're implementing some gui interface from some gui library/framework i'm guessing
?paste
its js a listener calling the registered guis
have you debugged it to confirm that this logic even gets called?
for example the notifyGuis method might fail to find the guis to notify
so everything besides InventoryClickEvents works
and it workedbefore
ig it fails cuz of 1. line with the inventory check
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
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
is it an inventory created with Bukkit.createInventory
yea
line 33
uh actually less, cuz imports arent included
why dont you use inventory holder
its not needed
iirc you're not "supposed" to do that
for me it works
nvm, i cant use that as i use both the players inventry and the opened inventory
try just getInventory instead of getClickedInventory
already did
try e.getview().gettopinventory()
oooh
since the clicked inventory could be the player inventory
even if they're looking at your gui
yeah thats why you should use getInventory
which should always be the top inventory
or player inventory
if there is no top
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...
in the case of holder make sur you did set the holder when creating the inv
IT WORKS
?gui
https://paste.md-5.net/asilinaneq.java - help pls why list is emty?? When i use command from echants plugin is not
" EcoEnchant ecoEnchant = EcoEnchants.INSTANCE.getByName(id);"
i did roughly follow this guide, but i still need to compare inventory references as i use both the opened and the players own inv
you can use the clicked slot to determine which inventory it is if you wanna be extra sure
Wild guess, but are you sure you can get the entry using getRawDisplayName ?
its sooo weird. like my onMove(INventoryMoveEvent) debug msg doesnt work but the whole gui does
I'm trying to check source code of EcoEnchants, but I can't read kotlin..
it's not that wildly different lol
if you just try a tiny bit you'll understand it
I know, I think I could if I gave it a bit, but I'm too tired
did you register the listener
type shit
yea type shit
cuz all the other events work
wtv. everything works now so ill js stop thinking before i go insane
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());
Either use early return or a simple && will do
Also, I would suggest following javas naming conventions
leaf_litter_random does not follow that, should be leafLitterRandom
oh thank you, forgot that can use that for it, also will fix your mentions
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
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
go to #help-server
ok
not nice :(
is there a way to edit the vanilla tags with a plugin and without a datapack
no
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?
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
oooh ty!!
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);
what
How would the server wide scheduler magically know what plugin is calling it
just give each plugin its own PluginManager smh
didn't mean to ping
no regrets
lynxplay[no-ping]
just walk the stack and check what plugin the caller class belongs to
speed police wants to know your location
i will avoid it by loading classes into a custom cl
what if you just don't load classes
could indeed be implemented via a copy task
so true
no
You only ever need one class
Well now I need 0
anonymous classes be like
Initialisation order likely
how the hell did I make my classes init so badly
that the very first thing to init is SOMEHOW NULL
oh I guess if I request itself from as a result in the constructor
like if I did Messages.file in MessagesFile's constructor
We love inner classes
why the hell does this
because you can init a variable?
just throw RuntimeException instead of throwing existing
allows you to give a nicer message too
I know of that
You’ve already logged an error message
checked exceptions have pros and cons
Pros: they force developers to deal with them
Cons: they force developers to deal with them
who did this
use kotlin where it basically doesnt care
also you never responded to the cat i sent you
Cat
ebic show me the car
e may not be able to be thrown?
he long
nuhuh
show me the car!
your 2 screenshots are of different issues
Ok fine then review my code
why
does a throw statement
need to be surrounded
nuhuh
because it might fail
in a try catch
What the fuck is e
THROWING?
You never told what e is
D:
nuclear look at ur pings
when can throwing an exception fail?
and wtf is Unsafe throwException?
who?
tf is he verifying
brotha you got an exception
call back
brother what are you doing
I just remembered this code
Your rethrow is fine
and I still don't know what this does, specifically
not the point
who the fuq is the verifier, and why is there an option to skip em
and why does netty use it
what is everything
java uses it once
the verifier is probably the caller & jvm checking exceptions
But youre working with dark magic so I cant know for sure
that fuqer also prevented me from doing some hot class bytecode reloading
good
nonono
fucking wizardry
like I sort of get the method instruction visit
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
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
Block#setType?
Or do you want to actually copy any states the two materials have in common
kinda
yes
and just discard the ones are are invalid to the new type
i dont want that exception
omg ty
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.```
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
There is the correct one
have you tried https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/Inventory.html#addItem(org.bukkit.inventory.ItemStack...) without using the random math?
declaration: package: org.bukkit.inventory, interface: Inventory
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>();
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
I just converted the inventory to a normal inventory and it works, thanks. I don't know why I think its the same
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?
Updated code: https://paste.md-5.net/uyodisotup.java
Ignore that, I seen what it was
What was it, now im interested because i watched the entire video
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?
When what errors?
I mean yeah you can wrap everything in a catch block and disable
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
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?
https://imgur.com/a/9JNtnIa something like this.
is there a way to edit the 'enchantability' of an item?
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
Yes, what I sent you is the correct thing
I know what enchantability means
wait wha
The component that has this functionality is called "enchantable"
And its value controls the enchantability
The wiki link has more detail about the component
Smh why isn’t it called setEnchantability
What version
1.21
exactly
.0?
yes...
now even dot releases have big features
so youre telling me
this got added in 1.21.smth
what happened to the thing after the dot being for maintainance updates
1.21.2
Gone, reduced to atoms.
Anyways, update ::)
well i mightaswell just update it to 1.21.4
the biggest updates now happen on maintenance released
while minor versions are just for new blocks and mobs seemingly
fuck you whoever changes the enum names every goddamn version
just remove GENERIC_
yeye but still, annoying
This really is not that big of a change
a nn o ying
I love how 1.21.3 fixes like 3 bugs
And 1.21.4 added the Pale Garden
Really cool versioning there Mojank
its not minecrafts fault for bad names in the spigot api
Well in this case, the enum is named after vanilla attribute name
And vanilla changed it and so did Spigot apparently
Is it possible to create your own enchantments or do i have to manipulate the lore and fake one?
Yes, datapacks
wait fr?
mhmm
but not via plugins?
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
ah okay
thank you man thats nice
ofc you can
it just requires a bit of hacking into
oohhh but how .... hahaha
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
it's just that if something is possible with datapacks it's possible with just plugins
You can attempt this, requires NMS ofc
Would suggest you set your plugin to load as soon as possible tho
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
ur build doesnt depend on shadow jar
run the shadowJar task or make build depend on it
yep, first time using gradle
tasks.assemble {
dependsOn tasks.shadowJar
}
so thats why assemble didnt work either
How can i implement NMS with Gradle for 1.21.1? Do i have to use Buildtools for that? I forgot...
?nms
iirc that has a gradle part on it
thank you
bad idea
Good idea 👍
nah
ant 💪
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
I mean there isn't any other way
of that command
but from some reason comamnd is puling old instance of the classd
like command is not replaced
don't reload
well point of whole thing is to be able to reload
no luck with it
and have you considered printing a stack trace lol
I even tried with reflections
stacktrace is not throwing any errors
because you are not printing a stacktrace if an exception occurs
quick question, how are you planning on reloading just one class
while this logic somehow remains?
hotswap 🧌
pls dont use reflection to access the cmd map on every command
I am not sure what you mean
But to be clear I got my main command of plugin which call /bt reload
which calls method reload()
which is setting all new isntances of all class ShopManager etc...
then at end of my reload method I call registerCommands method
which creates code for all shops by new instance of this BCommand
here I just tired to unregister
to see what happens
but command still remains
again, what does that method do
is bt reload closing and re-opening a classloader?
What you mean by that
it is simply calling my methods which create new instances of all classes
here
why would just creating a new instance of your class "reload" it
copy task
my brain just cooking now and I am confused
I think because I just created new insaces and fresly loaded all from config again
and registered command again
what should I do then ?
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
you want hotswap basically
ok but it worked before and I am registering comamnd again with new instances which I am passing in constructor
it certainly did not work before
well I got one comamnd which work other not
that is dam strange
can you hope in vc
I will just share screen
there is 0 way just calling new Command again will somehow reload it from disk
nah, sorry, no time
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.
so for each shop file you got aliases/command
so player can justr call /tokenshop
or what ever server owner sets in shop file
Imo this is stupid, should never be its own command.
Always a command argument
nope
mb then
loading a .class file
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
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.
did you call updateCommands() on each connected player?
what is that method?
Reflection in https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/command/SimpleCommandMap.html#knownCommands and remove it manually
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
Don't think this is the issue
It's purely server-sided issue
if the server itself is still seeing the old cvommand then you are not creating/replacing it
Yes
why are you calling BukkitCommand::unregister in the constructor?
immediately after calling commandmap::register?
wrong class look at latest screen shoot
It was just a test to see will it unregister
why soo
'cause you'd be calling it on the new instance of the command
you have to call it on the old one.
Wait why are you using the command map to add aliases
not alias, a whole new command
There's an API method to do so
What is the api for that ?
this is not aliases
it is fresly registered command
Oh wait, I think I get what you may be saying
Command#setAliases
Create one command, add aliasses and then use the label to do your logic ?
not ideal but that would work
Probably better than injecting the commandMap
myes
Would avoid all reflection, but yes, still horrible
I still think having "dynamic commands" like this is stupid
but thing is that is just quick command to open shop it is not main command for plugin
Should be a sub-command
Why is it so bad to write like 3 more characters at start
well people don't want it like that
I have never seen anybody complain about thing like this
they want to have multiple shops /bananshop /potatoshop etc....
they can set that up in commands.yml
/shop potato
just-
bananashop:
- /shop banana
That would require bananashop to be a command specified by the plugin iirc
which is not the case here
Not really
would it? i don't think that's the case
commands.yml can be used for aliases like this
You can make your own commands in there
the only issue with this is that it relies on the server admin to know about commands.yml and bother editing it
I know too little about this feature, sorry
that is why I do that
You could just put a comment in there explaining what to do
or add it to your wiki
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
declaration: package: org.bukkit, interface: ServerTickManager
noic
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?
Yeah, use an executor service
Just make sure to sync to main thread before doing api operations 
how would a task reschedule itself
Just had short circit in my brain after 2 days of trying I managed to unregister dam command and now thing is working
Example:
class TaskA implements Runnable
runTaskLater(TaskA)
inside TaskA run:
runTaskLater(this)
I got that math ick
Calculate offset? Hell naw
At least it will be kept in sync with the server tick speed
unlike the executor service which does realtime rather than ingame time
Does Block#getDrops(ItemStack) think about fortune?
Based on the documentation, yes
thanks
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
if you want to use components on spigot for a lot of places youll need to nms
thats why i wanted to make them optional. you either use adventure api or strings
but im not sure how to implement it without it becoming very weird to use
(for the dev)
i hope you plan to use MenuType
id say ur best bet is literally just gonna be having the paper and spigot api accessable
option one will explode
build something over menu type
y?
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
once its constructed it will do some backend platform logic and if it doesnt support that type throw an erro
if adventure isn't on the class path, there'll be a no class def error
mhm
Could do something funny where your root MyGUI<TextType> exists
and then a subtype for LegacyMyGUI extends MyGUI<String>, AdventureMyGUI extends MyGUI<Component>
adventureapi who
i dont quite get whats going on here
like is it different stuff for adventure mode? if yes, why? and what?
adventure is an api
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"
more than just that
Hello I just wanted to confirm if it's true that spigot plugins will not load on papermc in the near-future?
That's something you should ask Paper about
How can i make 2 single chests to a double chest?
Iirc that's just a block state
how to create to ticket
Set the type to SINGLE
Oops you want it the other way, just set them to LEFT or RIGHT
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);
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.
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)
I add this in a custom class or in all commands?
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
i have a base command that i extend to all of my commands that looks like this: https://pastebin.com/d9rk9Wvt
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Add a .png at the end of the sprite key
Had somebody else ask me the same thing earlier :') need to fix the docs
yeah x)
thanks 😄 perfectly working now lol
Alright thanks.
@cinder abyss Got that fixed in the docs
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 🙂
perfect thanks, also do you know how I can create the resource pack at runtime in a tmp dir ? When I'm trying to do that, I get this error : https://paste.md-5.net/wubogiguse.kt
That's not a temp directory
You're trying to write it into your jar
that's why it fails ?
Plugin data dir works yea
okay thanks
What you could also do is set the output directory to a temp directory and then save the zip into your data directory
what is it
i want to make frogs eat players
and not use mixins
Does that even work with a datapack
reflection
not working
?notworking
redefining class neither
"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.
Thats not even possible lol
bruh
Dont feed out of date content
The only way to change it would be Unsafe, which is also deprecated btw
i dont think Unsafe works in java 21
You could do ASM writes
unsafe definitely works in java 21
But that's about it
pretty much mixins
Unsafe in plugins is ridiculous
i cant even redefine a class because its already dynamically loaded
You always have the worst ideas Rad I stg lol
redefining classes in a plugin also is ridiculous
Take lynx previous answer at face value the answer is "No"
man
this one is
ah
public static final
Well you should't modify that field anyway
The game should load that into the registry
level >= size || level + 1 > size
are these 2 the same?
level is int
i should look for a workaround
I mean if datapacks access it just do what they do
sorry my brain doesnt brain
am i allowed to post decompiled mojang code here
yes they are teh same
thanks
aahh brain AI fun...
yeahhhh
You can unfreeze the registries and redefine the tags
how do i redefine the tags
even if i do the ai will still use the original FrogAttackablesSensor
right?
show code
yarn smh
mojang>>
nah
@blazing ocean idk why I still get errors, even in the datafolder
https://paste.md-5.net/fapewaxido.kt
yeah
why ?
it says it's not a java library
I can use it in java ?
id just use kotlin for everything at that point
your also running an outdated server
I know just basis of kotlin and I prefer java syntax
the resource pack generation is a part of my plugin, not the full plugin
yeah that's because it's for my own server for now so I'm using spigot 1.21
But when I'll publish it on spigot (maybe), I'll make it compatible with recent versions
Seems like an issue with the resource asset resolution strategy, probably just wanna use a source directory or a git repo one for now
doesnt look like spigot
and you cannot build plain 1.21 on spigot, it got superceeded by 1.21.1 for known bugs
what are you trying to do
I'm exposed
so I precompile and then embed the zip in the jar and use it at runtime ?
what
wdym by source dir ?
I'll compile spigot 1.21.1 directly and use it, they are the same for what I do I think
@blazing ocean same error on spigot
A minecraft resource pack compiler library for Kotlin
hey, reading the doc is a good idea thanks
Re-Hello, how can I send a resource pack to player with a zip file located in data folder ?
you can't without hosting it
even with packets ?
no
but you can serve it on the minecraft server port
perfect thanks I'll try that
is it possible to put a datapack inside a plugin?
Is there a documentation existing for the https://api.spigotmc.org/legacy/ ?
Why do you need legacy API?
https://api.spigotmc.org/legacy/update.php?resource=$RESOURCE_ID
That's all there is to it, but again it's legacy. You shouldn't be using it for new plugins
I'm trying to render a skin's pixels each separately
using text displays as shown here
and existing models that I just map this onto
cool
youve got some maths to do
edgarL gave me the rotation math
and it's cool and all
but uh
this is done by manually fixing the translation
but why would this occur?
I did similar things, tracking player animation and movement and hitboxing for all pixels
this is how edgar told me to do the rightRotation transformation
yoo
did you also use text displays?
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
did you also display each pixel separately?
cuz well
it's a performance bottleneck for me
display no, track yes
it'll lag the players
that's much easier, aight
for the main part, I actually rendered all different body parts
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
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
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 
I think it refreshes hourly or somethin
keep in mind that the endpoint is behind cloudflare which has a 12h cache
I understand, I'm making a bot and it was throwing me a different version, now I understand everything 
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
That’s player specific
Nah the cache is like 4 hours, check the header for exact
There should be similar methods in World for modifying the server side border
(Or one of its parent interfaces, idk)
i can create a world border using Bukkit#createWorldBorder() or Server but neither actually applies it
they just return WorldBorder
idk is there a way to run server commands via the plugin
.
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()
The object returned by getWorldBorder can just be edited with the set methods

The Player#setWorldBorder() methods are just for client-sided world borders is all
i tried to ignore the fact that i didnt know what mutable means (amateur hour over here)
Just means you can mutate it
oh lmao
I could do world.getWorldBorder().setSize(500); and that would just work
alrighty
from/to @alpine urchin ?
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
You used a modern version?????!??!!!???!!11???
weird question
I got
can I make a 1.19 plugin use 1.20 item in menu if the server is 1.20
To do that, wouldn't you be using the Material enum? which if you're on 1.19, wont have the entries for 1.20?
yeah, but I think you can use Material.matchmaterial
Yeah you can, but that won't give you the 1.20 item in 1.19.
You'd have to like fall back
yeah but if the server is 1.20 It will give I think
someone asked for support for that version
Ohh yeah I misread ur question, yeah u can write the plugin to support 1.19 by doing that, fo sure
great
Ye I ported it when it came out
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
Global pallette be like
transparent overlay
You mean this ?
If you have the players in the same team, theres an option to disable this
Yes just like that
Can you tell me this option
(I do not think that I put players on the same team. I did make their names colored randomly)
Sure. Thank you for your help
bro Dr House House?!?
With the shape of a house
im ready, do it
If I set setCancelled(true) on BlockBreakEvent, will it unbreak the block?
?tas
congratulations
lol
whats up with so many people having the same cat drinking milkshake pfp
i mean its cute but
why so much milkshake
optic_fusion1 wannabe
More of "it will not break the block. And it will send block break refuse action to client"
yeah it reminds me of optic i get confused every gah damn time
shut it kid
let me have my moment
huuh
it wasnt a serious question. i was just trying to get ?tas'd #general message
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
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
I will pay if I have to
Well doesn't that sound promising
lmao
Employers love this one trick
What you won't work for the experience?
thats what we call a hobby
it would be more accurate to say that is what an internship is
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
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
they are doing the same work, workload as an employee would
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
I guess the workload is roughly the same here but the responsibilities are way less
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
yeah I mean thats probably another reason haha
Insert intern meme
how can I move this text display back
while also moving this one
using the same logic?
(make the red touch the aqua)
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
why not just use the api?
which api? sorry if that's obvious but i only recently started working with 1.21.4 spigot
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/messaging/PluginMessageRecipient.html#sendPluginMessage(org.bukkit.plugin.Plugin,java.lang.String,byte[]) this is minecraft's custom payload packet
basically custom payloads were incorporated natively into the protocol as "plugin messages"
omg never thought of that, i only used those in the past to communicate between bungee servers. tysm
which the client will ignore if it doesn't know what to do with them, rather than explode on unexpected packet id
you still need to register the channel as outgoing in the messager or w/e
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"
makes sense actually, tysm ^^
What is the replacement for the deprecated method Enchantment#getByKey when i try to add an custom enchantment from a Datapack to the item?
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?
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
Registry.ENCHANTMENT is deprecated but i cannot find the note for it in the javadocs...?
paper-api?
oh i got caught
nah fr?
a question to ask in paper's discord, but yea (tho it does come with some hassle and a new plugin system)
ima stick to the datapack hahahaha
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
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
i see
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
What does Entity.isPersistent = false means?
If the server goes down, the entity will not appear?
Entity won't be written into disk when unloading
when saving*
private ScriptVector offset = new ScriptVector(new ScriptFloat(0), new ScriptFloat(0), new ScriptFloat(0));
ask me how my day is going
that looks like great api to use
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...
can't wait for ScriptAdapter.adapt(0f)
no static factory method
cat ear illusion
I don't need a factory, I'm doing the much worse thing of reading all of this from a yml file anyway
did frosty gift em
yes
of course he did
at no point do I need to have this run through code
whats the hurt in just having an overload for a vector that takes 3 floats instead of constructing them one by one
would be too easy
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. 😁
if you want to return player names iirc returning null will do that
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?
that says nothing tho
guess im blind
the only thing it says is how to calculate the player's flown distance with a certain angle
that's not helpful at all
this is the simplest and most "fucked" way of doing it
proper approach would be using a tree or sumn
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
all an API/library is is methods that are easy for others to use/understand
Is there a new api?
I know what one is, I just don't know how to turn my existing plugin into something that can be used in a different plugin
well you dont need to do anything, a different plugin can use all the public methods if it wants
hi can u help me?
but how do I get my plugin into a different one?
Please dont cross post
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
You can use PluginManager.getPlugin and cast to your main class instance
Or add a static method
how would the plugin know what the other plugin can do?
You can simply write your api/lib like any other plugin.
When your plugin is loaded, every other plugin has access to your classes.
You simply write documentation for it


)