#help-development
1 messages · Page 1265 of 1
?mappings
Compare different mappings with this website: https://mappings.dev/
Can I ask whats the best way to see if a potion is water bottle
I am designing a menu system that will be compatible between versions(1.17-1.21+). However, I am confused about how to achieve this in my project architecture.
1- Should I create a menu system for each version through abstraction and make it acceptable as a menu system in the core?
2- Should I pull the necessary dependencies for my menu system from the appropriate nms version according to the user spigot server version and use those classes for my menu system in the core?
Why are you using NMS for a menu system?
i think i dont need nms or obc for that
yeah but it will be one of my api feature
what?
i will use my api for creating menus in my other plugins
Okay?
Still doesn;t answer why you think you need nms for a menu system
I'll assume your menu is just going to be an inventory?
yes
then there is zero need for nms
The ONLY thing you have to handle is the ItemMeta difference when using components
no
no
why would you need internals for that...
im learning
I don't think you should be creating multi-version projects at this point in time...
im noobie in spigot
exactly
a simple menu system is ok for your first project as a method of learning
but start simple
create a working simple menu first
then expand it
i used ?gui
i dont have any problem with java features or paradigm rules that we use. im just unfamiliar with API
i mean i just learned OBC / NMS stuff im not practical atm for their use cases.
what is OBC ?
org.bukkit.craftbukkit
bridge for minecraft internals
an implementation
for bukkit api
I don't think that's where you should have started
everything you are wanting to do is accessible via the API
thank you
i will test my menu system now
i will type if it wont work via versions
i only used org.bukkit
Guys does anyone have a regular expression to check if a minecraft nickname is valid
a quick search results in /^\w{3,16}$/i
This does not include character checking :(
true, its only length
playerName.length() <= 16 && playerName.chars().filter(i -> i <= 32 || i >= 127).findAny().isEmpty()
glhf
There surely is an NMS Method for that. Maybe even in the Profile class
Well I'm writing in Python
its going to be [a-zA-Z0-9] or something like
Okay ChatGPT helped me
It's ^[a-zA-Z0-9_]{3,16}$
I missed _

It's not a plugin
didn;t you know REAL Spigot devs use Python!?
Jeah my bad
?gui
You shouldnt need any NMS or ceaftbukkit for this
thank you
i loved your guide
you no longer love it?
It loses its shine once you have read it once
still
it loses its shine once you've started using interfaces
yo how can i make some1 full invisible like so you cant see armor arrows and main/offhand
Trying to make a vanish plugin?
guys do you think that a plugin sort of like the broken skript mod could be a good plugin idea?
like an horror plugin
could be a thing?
declaration: package: org.bukkit.entity, interface: Player
in PacketEvents I'm trying to spawn a Player with WrapperPlayServerSpawnEntity but EntityTypes.PLAYER doesn't seem to spawn anything while any type if other EntityType, such as an Armor Stand, spawns... I'm working with version 1.21, what do you suggest? the code isn't throwing any errors btw
I think it is missing parameters such as the name and the skin? how could i fix that
Need to send the PlayerInfoUpdate and Metadata packets as well
info -> spawn -> metadata
in that order
I don't really know how to do that, you sure? my class looks like this:
public class CreateFakePlayer { public static void spawnFakePlayer(User user, Location location, UUID fakeUUID, int entityId) { WrapperPlayServerSpawnEntity packet = new WrapperPlayServerSpawnEntity( entityId, fakeUUID, EntityTypes.PLAYER, location, location.getYaw(), 0, null ); user.sendPacket(packet); } }
it works for every EntityType besides player
how could I do that?
.
I'm new to these things, do you got any doc that shows how to do that
like a starting point idk
I recommend you use Citizens
but it costs doesn't it?
ok thanks
if i have an entity as a variable, can i kill it if its not loaded? what to do ?
if you have an entity variable that isn't loaded I'm fairly confident you have a memory leak
if it's not loaded , that's a memory leak like what ImIllusion said
you should remove it when needed in the code
iirc Entity#remove should do the trick
so if i spawn an entity in code, and everyone will get far away can i do all the things like killing it ?
i thought that entities like disappear when you get far
you know
how does that work
Maybe you need to LivingEntity#setRemoveWhenFarAway(true)
that's true by default
so do i spawn it and just do "setremove"
what is your issue, I just hoped into the convo lol
Only for some living entities
What type of entity are you spawning?
i dont understand how mobs work, if i spawn an entity, and everyone gets far away can i kill the entity or do somethin with it ? i thought its not loaded
wither skeleton
they disappear in your view not erased from the memory (by default , really depends on the type of the living entity)
try removing it using the method Spinotto mentioned if its a living entity
And isn't despawning naturally?
no, i dont want it to despawn
Try this
just have acces to it, and be able to change its hp etc
i checked '.isValid()' and it returns false
Because it's unloaded
yeah
so
they said this
now you say that its unloaded
;-;
what?
You have a memory leak because you are keeping a variable of an unloaded entity
So you have a variable of an entity that doesn't "exist" anymore
what if it has a nametag?
It goes back to existence when the chunk is loaded again
it wont disappear but will it 'exist'?
so its another variable ?
different
It persists when the chunk is unloaded and then reloaded
i is just a counter, which is wronly using an AtomicInteger for
I think
so many errors w that class
fun fact: you can use variables in anon classes to bypass the final issue
umm okay thanks
If you want the entity to vanish when unloaded setRemoveWhenFarAway(true) (if doesn't work try also setPersisent(false))
ill try that thin you said
no i dont
i want to keep it and have acces
AtomicInteger isn't just a counter, it provides atomicity guarantees which are only necessary fo cross-thread operations
Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
int index = 0;
@Override
public void run() {
index++;
}
}, 20L, 20L);
Ah
if you want a counter, use a variable inside the anonymous class like Illusion demonstrated above or just an array with a single elem also does the job
So you need to check when the entity is unloaded and reloaded with event handlers
and do wha t?
Or do you want to make the entity always loaded?
int[] counter = {0};
Bukkit.getScheduler().runTaskTimer(plugin, task -> {
// do the thing
counter[0]++;
}, 20L, 20L);
also works
ew
i dont know what you mena, ill say, lets say i want to spawn a mob, have always acces to its health, and kill it after 1 hour
@real lagoon
it looks uglier but it's convenient if you access the counter outside of the task
you just need a wrapper around the variable so that the scope of the local variable gets expanded
Does it move away from the chunk is spawned in?
Or does it remain stationary?
Listen to EntitiesLoadEvent and EntitiesUnloadEvent to change the value of your variable to the new object when the entity is reloaded (save the UUID of the entity to distinguish it from others)
Also save the position of the entity and when you want to remove it and it's unloaded get the chunk, addPluginChunkTicket to load it, kill the entity and remove the ticket
I was still writing
sorry
No problem
You only need to save the Chunk, not the Location
Anyway, now I'm going to despawn myself, tag me if you encounter some issue
you're dividing the step when you should be multiplying it
thanks, i hope that will work, but im gonna do it tomorrow probably
I am still unsure of what your issue was
you seemed to have been saving entities references, which you shouldn't as most entities become invalid when the chunk gets unloaded
and holding a reference to them is what causes a memory leak, since there's nobody else but your code referencing it and it can't be freed
it happens lol
my issue was that i need to kill an entity after an hour and its unloaded
you could just check Entity#isValid and if it is true, kill it, otherwise just remove it from the map/list or whatever you're using to track them as it's already dead
if its unloaded it always means its dead??
isValid checks whether:
- the entity is alive
- the nmsEntity.valid field is true
- the chunk where the entity is at is loaded
- if the entity is still in the world
if any of those is false, isValid returns false, the nms Entity.valid field gets set to false whenever the entity is despawned, and that happens when the entity stops being tracked
Just a thing, effectively you don't need to have an EventHandler for EntitiesUnloadEvent, but only for EntitiesLoadEvent to update your variable value, and since the UUID is already stored in the entity you don't need to save it (same for the Chunk), but you only need to check if Entity#isValid and if not get Entity#getLocation()#getChunk() and then Chunk#addPluginChunkTicket to load it, do whatever you want with the entity (since the chunk will be loaded, EntitiesLoadEvent will be called and the variable will updated) and last remove the ticket from the chunk to unload it
In the EntitiesLoadEvent check if an entity has the same UUID as your Entity#getUniqueId() and update your variable
So you only need to use one variable for the entity
(I think getLocation will work even if the entity is invalid)
I was actually wrong above, an entity can be invalid and alive apparently, but you can just call remove on it regardless and it should be fine
I don't believe it is necessary for one to listen to the entities load event or load the chunk just to remove the entity
And if you remove it even if its invalidi it will actually remove it from the world?
How, invalid means its not in the world
Right?
invalid means what I said above, generally means the entity has been unloaded since the chunk is unloaded
I believe so, but if it doesn't then you can just remove them in entities load as Spinotto suggested
Okay thanls
I don't think you can do anything to an unloaded entity. It would not save.
no i just want to make the player full invis whilst also beeing able to attack and keep armor
but i dont know hjow to do that
You're saying two different things here
"invisible like so you cant see armor arrows and main/offhand"
yes so i want the player and their armor and arrows stuck iun therm to be invisble to other players whilst still be able to attack /keep armor
So you don't want other ppl to see their armor ok.
You can either use packets to remove the items from the player for other players
Or some stupid solution like hiding the player and using a dummy entity instead of the player just for the hitbox and then transfer the hit :D (dont)
ok thx
hwo do i do packets
i am new to coding sry
I'm encountering a visual bug where players launching a custom projectile see it go a little bit to the right or to the left of where they are aiming. This only occurs when the angle is close to being straight (North, South, East, West) but a little bit offset.
However, the actual projectile goes in the correct direction. It just LOOKS like it goes in the wrong direction, but it successfully makes contact with where they are aiming with their crosshair. Here is a video: https://youtu.be/vuQEm_PbzO0
Here is the code that spawns the projectile: https://paste.md-5.net/iyeyarafal.cpp
Believe this is a protocol issue that's been around for a while
EDIT: Protocol not client
What velocity are you using on that projectile
it's clamping the velocity in the packet, so if you're using a high velocity it will desync
the length of the vector is 4.5
if I need it to go that fast, theres no fix?
bruh
my github commit was rejected
and intellij now claims there are no more files to commit
can't even retry
like bruh
i think u can click on the branch tab and there should be ur commit that was rejected
who hallucinated this
3.9 is the cap
yeah it's there but
it's the same repository!
why was it the commit link removed?
it was literally linked today and it somehow corrupted (I had a power outage, maybe that's why)
anyhow, wtf
i hate flat ui design
remember when we used to put text on buttons?
MM YES, the circle with a line going through it, I can totally intuit what this button does
how big do you want to make this side bar? yes
5 meters
im sorry but that is a mess
i agree
in your main class you can register commands with "this" as a parameter for registerEvents
in your plugin.yml you also dont need to specify usage
usage text .. is what you should handle manually
i will refactor these
i just want to know why this returns usage
there are no error
it returns usage if you return false from your onCommand
if (strings.length() == 2) {
if (strings[0].equals("open") && strings[1].equals("piano")) {
this.menuManager.openMenu(new PianoMenu(), player);
}
}```
open and piano are arguments
what is your main command?
/<main command> open piano
/menu open piano
/menu is my main command
i guess problem is different because this was work before
I've been comissioned to make a plugin for 1.7.10, but I have no clue where to begin with a version so old. Can someone point me in the right direction?
1.7.10 is relatively easy to work with
just grab the api jar for it and you should be good lol
where do i find that is the question
right, you will have to search for it because buildtools isn't going to provide it unfortunately
why don't you ask the ones who commissioned you for the server jar?
the server jar contains the api and you can just build against that
I mean "comission" as in a friend who is running a Mohist server and wants me to write a plugin for him
and they have 1.7.10 server right?
i believe so
then they can give you the server jar
why i get this
Fatal error trying to convert MenuPlugin v1.0:me/erano/com/menu/PianoMenu.class
org.bukkit.plugin.AuthorNagException: No legacy enum constant for WHITE_STAINED_GLASS_PANE. Did you forget to define a modern (1.13+) api-version in your plugin.yml?
at org.bukkit.craftbukkit.v1_21_R4.util.Commodore$1$1.visitFieldInsn(Commodore.java:338) ~[spigot-1.21.5-R0.1-SNAPSHOT.jar:4491-Spigot-3dafb73-07a3b65]
at org.objectweb.asm.MethodVisitor.visitFieldInsn(MethodVisitor.java:404) ~[asm-9.7.1.jar:9.7.1]
at org.objectweb.asm.commons.MethodRemapper.visitFieldInsn(MethodRemapper.java:145) ~[asm-commons-9.7.1.jar:9.7.1]
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:2443) ~[asm-9.7.1.jar:9.7.1]
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1512) ~[asm-9.7.1.jar:9.7.1]
at org.objectweb.asm.ClassReader.accept(ClassReader.java:745) ~[asm-9.7.1.jar:9.7.1]
at org.objectweb.asm.ClassReader.accept(ClassReader.java:425) ~[asm-9.7.1.jar:9.7.1]
at org.bukkit.craftbukkit.v1_21_R4.util.Commodore.convert(Commodore.java:218) ~[spigot-1.21.5-R0.1-
this is my other project
this works
@glossy wren check your DM's 😉
thats not the plugin.yml that is in your jar
wdym ?
this is my demo project
and it is works
but when i move to my multi-module project
its done
you did not specify an api-version in the current jar you are testing
open teh jar and look in its plugin.yml
so i have to specify api-version in my multi module project right
your multi module build script is fumbling the resource packaging and including the wrong plugin.yml
did you run a clean package
You just don’t have an api-version in there
scroll up canada man
im showing 2 different project btw sorry for that
i have to show that my code works
and i type command correctly ingame
on the project you just added api-version to
did you clean package
clean, install
check the project you are adding to right now, and do another clean package/install
the price we pay for legacy remapping nonsense still like a decade later
better to do package over instal else you fill up your local repo
however, you still need an api-version in the plugin.yml or it will try to use legacy mapping
even if you put 1.13
prior it will ignore teh version and still work
the eraliest version you are building for
then 1.17
i also have this
thats usualy META files you can ignore
fk
this dependency was added 5 times
how i did that i dont know
i deleted
1.25 s
im idiot
hey does anyone know how is this packet called? it's in SYSTEM_CHAT, but is there like a list of packet types or something?

That toast is displayed if the server advertises itself as not enforcing secure chat
The journey of chat signing haters 
🗣️
i have still same issue
message previewing got around that didnt they
command returns usage, in my multi-module project
and other one is still works with the same code
The server sends the original and the modified. So the client has a little warning if the server changed it and will notify that in the report screen

help with what
"/menu open piano" command returns usage, in my multi-module project
and other one (EranoMenu project) is still works with the same code.
im using exact same code
i changed api-version as elgarl said
your getCommand uses Menu while you're using menu to execute
ever since 1.19 or so, command labels are case-sensitive
i changed after that
and still wont work
and there are no error code
it just returns usage
refresh the page
what did you change, the plugin.yml entry or the getCommand parameter? Because both have to be the same
can you push the jar you have in your test server right now to your github repository, that way I can check if there's anything wrong with the jar
/Erano01/MinecraftRepository-Maven/tree/main/MinecraftPlugins/EranoAPI/Dist/target/EranoAPI.jar
i just pushed
to the github
i tilted to myself
now showtps is also dont work
You return false in it
if this shows up then your plugin is probably disabled and that's why the command just shows usage
you have to fix your shading first
look at the photo its still in use
if any exception reaches up to JavaPluginLoader::enablePlugin without being caught, it will be disabled
it's just the plugin being disabled
but your structure is in fact messed up if your shading isn't working, because you do have a 1_17_R1 module
well, I don't know why it isn't being disabled properly, but it should be and that's probably what's happening anyway
fix that error first and then try the command again
idk i didnt change anything related to tps
in core
i use latest spigot-api
other nms sub modules uses spigot - mojang remapping
for accessing obc & nms
and in core i setted api-version: 1.17 in plugin.yml
thats what i changed
mfnalex dont use api-version in plugin.yml in his tutorial
Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show ...
Its a tutorial not a copy/paste. He only shows what is important
i didnt
i even use design patetrns
abstract factory method
are you testing on a 1.17 server?
it was working except menu feature
yes
now im testing it on 1.17
at the first i was testing in 1.21.5
then your shading is broken
from a quick look it seems an issue with yoru dist module/shading
did you fix the path in the createNMSHandler ?
If you did, open your jar and check you have teh class at
I'm going to guess missing or a typo
check the full path, case sensitive
Is there a supported way of handling packets during the configuration phase or registering configuration tasks?
I found this message by @sly topaz which seems to imply there isn’t
So I was wondering if plugin channels also receive and respond to configuration-phase packets, or if I’m going to have to use reflection to replace the configuration task queue during PlayerLinksSendEvent?
i love you bro
now there are no error message
everything works
Thank you to everyone who tried to help
how i didnt see that typo idk
i looked same place like x1000
before
how should i refactor what do you prefer for best practices, i normally create 2 private method for registering events and commands
How should I tag an item? Like an item that has a right click abilitiy, how should I tag it in the plugin to know it's the unique one
NBT tags
?pdc
Is it possible to use the scale attribute client sided? So a player sees someone else a different scale but only they see it?
You could send the viewing player a packet that says to update the scaled players attributes
That is what I was planning to, will the attribute work client sided? It is just for cosmetic purposes
i wonder how that's gonna work with the hitbox
but sure it'll work until the entity or its attributes are resent
I mean it'll use the server-defined hitbox
At least for any hitbox logic that's server authoritative
There is no hitbox
It is for cosmetic purposes it's okay
Thanks that works for my needs :)
Changing the scale attribute for the observer will also change how big the observer sees the target’s hitbox
Yes, the server will check the target’s distance from the attacker
Again I don't need a hitbox for the client
But if you want people to be able to fight while seeing them scaled up you’re probably going to have some issues
If this is just for an NPC or something though that doesn’t matter
I don't care about the hitbox bro 😭
What’s your use case for this?
When it comes to combat:
- If you scale up the target only a little bit, then the observer will have an easier time hitting them than if they were normal size
- If you scale up the target too much, it’ll become harder for the observer to attack them at all (they’ll be pushed away by the scaled up hitbox - not the normal hitbox - and they’ll only be able to attack them if they’re within attack range of their normal hitbox)
- If you scale the target down, the observer has a much harder time hitting them (because the target’s hitbox is smaller for them, and an attack is only attempted if it hits the client hitbox)
a sign to stop building legacy versions
are u running buildtools through cmd, powershell, or Git Bash?
(im assuming windows)
do u have Git installed perchance?
try running from the Git Bash application instead maybe
last I checked BT will not build 1.8 without building a later version first
its missing a dependency, if I remember
nah it can build 1.8 on its own
at least i do think it can
only if the dependency is already in your local maven
Hi guys, when it comes to making a bunch of inventory GUIs in my plugin, I need about 5 Inventories and around 20 or so buttons.
is there an easier way to make a gui with item buttons that each have a unique "action" when pressed?
I have not come across an api that does this in the way I want (really customizable)
is there no other way but to write my own lib for it?
?gui
very interesting
so far I actually kind of came up with the same structure but with some slight differences
ill read through it when im home ❤️
how do you spawn an entity like an arrow, and then shoot it at a specific direction, from location a to b
that sounds like pain in the ass to do. I'm trying to spawn an arrow and shoot in in between the stair
Do you mean hex colors ?
yes
20w17a 1.16 yes
Pog
(wiki is great for this btw ;) )
yeah i was in the process of reading changelog
figured id find it either there or thru spigot
https://minecraft.wiki/w/Text_component_format and Ctrl+F for hex and go to history
picking minimum api vers i wanted to use
didnt want to deal with component coloring issues, figured id go with whatever version added hex support
ah well thats awkward
time to figure out multi versioning
Gotta do that ugly protection I + hide enchantments for lower versions than like 1.21 or whatever added that :D
You're in for a treat if you're supporting so many versions haha
i feel like supporting only latest and like latest-adjacent just wouldnt be fair for the simplicity of the plugins i have
this is for my common API stuff
1.20.5
can a record class not be package-private?
yes, but it would be restricted to that package
what ? you can do public record
what am I missing
ah, i had my access levels mixed up
i meant protected i think maybe
oh its still not allowed
default IS package-private 😉
oh I misread ok
ah i just didnt actually realize classes only have 2 access mod states (public, or pkg-priv) lol
not that it makes sense for a record to be protected 🥴
I've used it a couple times
I tend to use protected less than package private lol
normally i dont care abt visibility but working on something i need to put a bit of actual effort into
so i wanted to restrict an internal api record
thought about modules yet
like java9 modules?
no, maven/gradle modules
oh
seperate out api into its own module
separate api from impl?
yuh
ehh
I was gonna do some modding so I need to figure out how to do that properly
but for spigot plugins I haven't had a need
i dont think this is something that would benefit for modularity for me
theres not particularly meant to be /another/ way to implement said api
not a module in sense of people make their own impl, an api to interact with your stuff
oh like i just provide them skeleton classes and have the implementation internal?
like spigor?
basically yeah
meh
Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show ...
no stabbing them
the more ive been thinking about this now the more i want to start the whole thing over 😭
okay so, make it do what you want, rewrite it better, rewrite it better, and then rewrite it better, wait 3 months and rewrite it again
and each time think to yourself "wtf was I thinking, this is horrible"
spigor
can put them on imgur
its laggy
believe google drive and one drive works too
oh
but uh
how
do I embed them?
navigate to your gif on google drive and click on it, should give you a direct link
not sure how one drive works as I don't use it
still
how
on the spigotmc page
can't embed as media
Get a Shareable Link:
Right-click: on the GIF file and select "Get link".
Choose the sharing option: Ensure "Anyone with the link" is selected and "Viewer" access is granted.
Copy the link: Click "Copy link"
by putting it in the image tag
?
[img url= " "]Some text if you want in case it doesn't load[/img]
make sure you are copying the url of the actual image and not some webpage that just shows the image on it
you can't embed webpages
at least not with bbcode
technically true but it depends on the site. I used to have a script where you could technically embed sites on a forum 😛
or it showed like a preview of links to websites
but isn't that what frostalf suggested?
this
also, did you mean that literally?
idk how google drive works, but typically unless the url ends in a .png or other image file extension, it probably points at a webpage rather than an image
yeah what I put is valid bbcode for embeddng images
how about you paste that link here and somebody looks at it and sees if its an image or a webpage
im 99.99% certain google drive wont let that be used as a direct url to an image
using the bbcode editor just pastes the literall code as if it was text
it may embed [on discord] but thats about all
it will
there was a hack to get a direct url for gdrive files but idr what it is
its quite possible that spigot has restrictions in that the url must have a valid image extension in the url
which, if that is true then google drive would be more difficult to use
<iframe src="https://drive.google.com/file/d/1H7cUug-Sm9Z83ik6fr7pdMKETAALsrpc/preview" width="640" height="480" allow="autoplay"></iframe>
This is what gdrive suggested for direct embed
I’m pretty sure spigot does require file extensions.
Imgur links need to have the .png extension for them to load correctly
but uhhh
Wouldn’t be surprised if the same applied to other links.
try this link
https://drive.usercontent.google.com/download?id=1H7cUug-Sm9Z83ik6fr7pdMKETAALsrpc&export=view&authuser=0
hmm it tried to load for a sec but
bam
its not playable even normally from this link
have you considered using not google drive?
It plays for me
this
what else then?
hmm
wouldn't really recommend it. Considering how much traffic spigot gets
does not show up for me
forgot
proxying through cloudflare still won't help with the traffic
break the image down into minecraft skin sized patches and hotlink them from mojang
free image hosting
LOL
oh yeah that works
its just not playable
what browser are you even using?
brave
it also does not work on chrome fwiw
that is why, I am using firefox
kind of ironic
link?
seems both imgur and google are doing the same thing
imgur you sucker
turning your gif into an mp4
https://i.imgur.com/SPUNqCu.mp4
still
the link you gave takes me to the normal imgur site to view it
the link I provided is the direct link
does the preview not display gifs?
no
ending it with .gif does not change anything
the https://i.imgur.com/SPUNqCu.gif will either send you the .gif binary or redirect you to the imgur website based on user agent
there are 14 competing standards
Spigot does allow small gifs
how are you all doing it then?
mine is 182
Mb?
Too large
post it, check out your page, edit, post again, edit again etc etc
noticed
at some point embedding a youtube video is the most viable option
what are you hosting on?
lol
I noticed that isn't very efficient in attracting attention
I used to host on photobucket but recently they nixed my free account
@vagrant stratus isn’t it like 5mb of smth or what was it. Think it was super low
isn't that for direct uploading?
the thing with gifs is that they turn huge very quickly
Gif size limits on resource pages
No idea
what other format does spigot support?
just embed a youtube video
it still won't play automatically
which is good
I usually just try to keep it as still images
why does it need to play automatically?
auto-playing videos make me exit a page immediately
my browser doesn't play stuff automatically
since I have it set to block anything that does
I find it fine for some things, buttt not this
Me everytime I listen to music and some random news article starts autoplaying a video to the article and stops my music: nope
Still a 5mb limit
theres a limit on external url file size? tf lol
yeah I thought it was for direct uploading
I am pretty sure external linking didn't have a limit or was significantly higher
Oh maybe
I got yelled at it for my signature being too big once
Prolly different
Hopefully
maybe too big as in it took up too much screen space?
not that its file size was too large XD
i guess maybe its bc spigot proxys multimedia
spigot has the bandwidth, just direct uploading consumes hard drive space
proxying might involve caching which could also take up drive space
not on the spigot site
webservers when they proxy something, don't actually save anything unless you actually setup caching for such things, otherwise its all bandwidth
bandwidth is easier to manage then an ever increasing storage XD
hence the words "might" and "could"
yeah but spigot isn't caching that stuff from other places
well, all the plugins currently on spigot easily fits on a 1tb hard drive
think last it was calculated from a couple of years ago, all the plugins take up like 300 or so gb of space
knowing that, there is probably 2 boxes for the site
and what does that have to do with the proxying configuration?
go ask him if you really want to know
point is, the spigot site isn't caching stuff from other places because that would literally be dumb to do. Maybe cloudflare might do it on their end but that isn't spigot doing it
Discord does it too for external media
People could track the activity on their page if it wasnt cached
not sure what you are talking about
If you send a link that is a video/image file, the data youre seeing as an embed does not come from that link, rather from discords servers
Well im just saying that it apparently does make sense, otherwise discord wouldnt be doing it that way
discord does it that way otherwise loading times would take forever and some things would be broken when going back in history
also discord likes to save everything
Ye so you said it would make no sense to do, now youre bringing arguments why it does make sense. So spigot might be doing it too, no?
it makes no sense for spigot to do it
I wasn't talking about everyone else
you are the one that brought up discord, when the topic was about spigot website o.O
spigot has no interest in saving anything/caching. Like why would spigot care that your resource page broke because of some media links? The reason it doesn't make sense for spigot to cache anything that is external is because all it would take to bring spigot down would be to have enough visitors to hit the site to fill the entire hdd with caching, or at minimum break the proxying as it can no longer cache. I have no idea what the daily visitor count is for spigot but it is quite high. I wouldn't be surprised if the entire spigot site is hosted on a 500GB SSD with maybe a second 500GB ssd or 1TB HDD
but muh fingerprinting
why would more visitors result in more cache usage?
and maybe it would make sense after 18 years to move away from the hard drive in your basement and embrace newer technology like object storage
it would probably even be cheaper than the ssd
Uh no. Object storage is insanely expensive
Because that would result in more things that get frequently accessed
spigot isn't my website, however even if it was I would not spend a whole lot on it either in terms of hardware when it isn't necessary
if it ain't broke don't touch it
exactly
paper hangar learned that the hard way
then swap "your" for "someones" idc
how? if theres in total 1 mil external media links in all resource pages that wouldnt turn into 2 mil cache entries because every page is visited twice
websites were serving millions of visitors long before this new tech just fyi
therefore that tech is super cheap to rent and sufficient
why spend more?
the guys were literally melting over the website shitting bricks due to some threading deadlock issue
I doubt that everything is cached permanently at all times
there is a limit in how much can be cached
the word for this is cache churn
there we go
as if that couldnt happen with a php 3.6 website
I have never had a php website deadlock on me, maybe a experimental branch sure but you would need to also be using fpm
without fpm its impossible
How is that even supposed to work, all requests get handled on a single thread with php
unless you are using fpm
ye and its about as impossible to deadlock a jetty server
ye, if you dont factor in any costs except the power usage of the ssd
hmm not so sure about the impossibility to deadlock a jetty server
did you read the thread? xd
Even then object storage is more expensive
how?
yes, they are complaining about their jetty getting deadlocked
which you said was impossible or nearly impossible to do
if you do Thread.wait() and never wake it up in php then you deadlock it too
it isn't jetty that is deadlocked
if you lock on a monitor without ever releasing it, that's your shit lol
not jetty's
Guess where the stuff on a block storage is stored on
an ssd
Php will kill it on its own after some time
yeah php will kill stuff, and same with apache and nginx
cool
until you need it to take that long
That's rarely ever the case
anyways seems redrhino is so desperate to prove new stuff is always better I guess and that spigot caches when its not necessary or needed
old stuff works plain and simple
I don't use new stuff because it is rarely needed
it's WEB SCALE and on the CLOUD and scales HORIZONTALLY
we should go diagonally
because no one does that
they need to invent a new dimension so they can write a new database engine that scales along that dimension
lol
what even is the third dimension called?
i call it blurple
im hype to be able to chain entities with leads
depth?
I find it interesting you can float them all away with a ghast
generally yes
did they fix the infinite accumulation of falling damage when you suspend something with a lead
i think they did that a while ago
neat
I forgot that was a thing
would be a shame for me to float away my livestock with a ghast only for them to implode when they land on the ground again
could you imagine how many people would be so upset at this?
after seeing the cool images
to only try it out and just like have everything die in front of them
Float away my friends, grab this leash we are going to go to safety
theres the ground lets go
You Died
you could turn this concept into a minigame
where you have to keep the ghast floating otherwise everyone dies
have to do certain things to ensure that
make a bedrock world with 1 block high lava
did they fix the fall damage with leads issue
really I have no idea
but I would imagine so since I haven't heard anyone complaining
amazing
can players hang from leads like this i wonder?
would be quite cool but i kind of doubt it
we could have benji jumping and grappling hooks and other cool things
it'd be a bit difficult to do on the server side, but if it's done on the client it should probably be as simple as copying some of the leash logic from entity tick
i have a feeling mojang didn't bother however and leads just go one-way
maybe not, i haven't started up .5 yet to take a look
well, I am quite popular
I told you I'll make the best Floor is Lava minigame out there
so no surprise if someone remembers me
I remember you now
but I aint stopping here
I'll make it crazy. with guis and abilities and classes and chaos events in game
interesting
make it have floating ghasts that players have to hang from with leads
and the floor is lava
is that possible?
want to depend my other plugins to my multi-module (maven) api plugin, which module i should depend to my plugin?
core? dist ? or root?
I thought players are the ones who grab entites where they want, not the other way
i guess core
i mean ideally u may have an api module that u can depend on during compile time
that's how you will want to do it, as if you depend on the root module, you will also easily be including all the transitive dependencies from all the child modules
and in your case that will be like 100 different versions of nms, making the dependent project practically un-buildable
@ivory sleet
would anyone happen to know how i would get the Statistic Playtime of a player? the old way dont work anymore
int ticks = player.getStatistic(Statistic.PLAY_ONE_MINUTE);
Is how i use todo it
That hasn't changed
?notworking
"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.
the "Statistic" shows up red
what does the red say when you hover over it
cant resolve symbol ''Statistic''
If you're using Intellij make sure it's up to date
ill see if it needs an update, been awhile since ive done minecraft stuff
this and make sure you've actually imported it at the top of the class file
So when i use to open intellij it would let me know if there was an update, it no longer does that so i assume its the correct version?
Go to Help and About, see what that says
sorry for all the noob questions, it really has been a HOT minute since ive touched minecraft stuff
update was there and it is now updating
Might have to run it a couple of times
I appreciate you guys for helping, its all working now. spent like an hour trying different ways to get Statistics for nothing LOL
https://github.com/winnpixie/commons-spigot/tree/main/src%2Fmain%2Fjava%2Fio%2Fgithub%2Fwinnpixie%2Fcommons%2Fspigot%2Fconfigurations i ended up abstracting it a little bit but i still provide my own implementation @remote swallow
i was gonna have it be just an interface but i just hate boilerplate of adding fields that would be present in all implementations (ie. the ConfigurationAdapter)
i might abstract it further and/or split it from my spigot commons lib but idk, and nor have i fully ruled out using maven modules to separate API from implementation..
Whats a good way to check if the inventory that someone clicked in is the inventory that you need?
Compare the inventory instance
How do i do that? is there a feature for that?
if(event.getInventory() == myInventory)
If I have a coin that is in the same place for everyone and it dissapears for the person that picks it up, aka the others can still pick it up, should I add the coin with packets and remove it with packets, or should I add it to the server and remove it with packets
Yeah, just make it non pickupable as an item and hide it when a player “picks it up”
i'd spawn a separate item for each player, and then make it only visible and pickable by that player
since just hiding the entity won't display the item pickup animation, which can look a bit unintuitive for the player who picks it up
alternatively do what tan juck said but send an item pickup packet before hiding the item
I forgot something very simple, help, how can I prevent the lava from spreading when I put lava with a bucket?
This is my current openscoreboardcommand code but it doesnt show the player an scoreboard.
package de.constt.idleeClicker.commands;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.*;
public class OpenScoreboardCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if(commandSender instanceof Player) {
ScoreboardManager manager = Bukkit.getScoreboardManager();
assert manager != null;
Scoreboard scoreboard = manager.getNewScoreboard();
Objective objective = scoreboard.registerNewObjective("test", "dummy", "Scoreboard Title");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
Score score = objective.getScore("test");
score.setScore(3);
}
return true;
}
}
Where are you setting the scoreboard for the player
Oh I forgot that...
Now It works! Is there an way to set the scoreboard of an player automaticly when they join
they are in 2 different classes
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I forgot something very simple, help, how can I prevent the lava from spreading when I put lava with a bucket?
declaration: package: org.bukkit.event.block, class: BlockFromToEvent
is it possible to set a display name of an ItemMeta using adventure components?
Im not sure how to format a component so that it works with ItemMeta display title
on join event or u can delay it so it runs a bit after joining to prevent nulls
nah
Spigot is strictly Strings only still
cough cough nudge nudge @worldly ingot
wait so you're telling me I can do it if I switch to paper?
wym
(full Componentization PR pls)
yes
yeah paper embraces Components
or use the bungeee serializer that may or may not work still
Spigot is getting there (cough cough nudge nudge @/Choco)
in Spigot you'll need nms or unsafe
okay so how hard is it to switch to paper on a large project <.<
That will get you a component
however there's no method to use it with
ah true forgot that part
try and see, do note you will need to go to paper for support if you do
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.List;
public class ItemUtils {
private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();
private static final LegacyComponentSerializer LEGACY_SERIALIZER =
LegacyComponentSerializer.legacySection();
public static ItemStack setDisplayName(ItemStack item, String miniMessageInput) {
if (item == null || miniMessageInput == null) return item;
ItemMeta meta = item.getItemMeta();
if (meta == null) return item;
Component component = MINI_MESSAGE.deserialize(miniMessageInput);
String legacy = LEGACY_SERIALIZER.serialize(component);
meta.setDisplayName(legacy);
item.setItemMeta(meta);
return item;
}
public static ItemStack setLore(ItemStack item, List<String> miniMessageLines) {
if (item == null || miniMessageLines == null || miniMessageLines.isEmpty()) return item;
ItemMeta meta = item.getItemMeta();
if (meta == null) return item;
List<String> legacyLore = new ArrayList<>();
for (String line : miniMessageLines) {
Component component = MINI_MESSAGE.deserialize(line);
legacyLore.add(LEGACY_SERIALIZER.serialize(component));
}
meta.setLore(legacyLore);
item.setItemMeta(meta);
return item;
}
}
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.14.0</version>
</dependency>
code util and pom
if u have gradle u can convert it easily im lazy
That will strip important information that cannot be represented as a string
like not at all lol
just change the Spigot repo url and ur spigot dependency to paper
😭
the API will still be the same (for like 99.99% of stuff) since Paper was built on Spigot
what
why do you always say some confussion shit
olivos solution was more than enough 🙏
does that pay the pickup animation? i don't think it does
its a custom model
with modelengine
the player doesnt acutally pick it up
its a virtual coin
an animation plays if u pick it up
then yeah hiding it is the best option
then how should i store the players who pickedit up on the server
should i check if its hidden if they try to pick it up
or store in a map who picked up which coin
as in what olivo suggested
how you want to persist it depends on how you want it to work, really
its a minigame
so coins are one time per game
they are stored in a database later but that doesnt matter
you could have a database; you could store the set of picked up coin id's in the player pdc; you could store the set of players who picked up a coin on the coin's pdc
no
coins are stored in a datbase but i wont store the session coins in a database
thast probs the most unefficient solution
ight look, i got a map, it has 5 coins, each player can pick up the coin and it disseapears for them
how should i check on the server if the player picked up that coin already
if it's a minigame and you don't need the data to persist across sessions, a player id -> set of picked up coin id's map in memory is the most straight-forward
then query that map and set to see whether the player has picked up the coin
so map yeah?
yeah oki dw
could also be a Set<UUID> if you want to refer to coins by entity uuid or something
also scale thing works perfect
Holy shit shes small
i think some nametag plugins have trouble with scale since the scale attribute doesn't change the riding entity height
?softban @cyan kelp Spam bot
Done. Enough chaos.
Smol
@EventHandler
public void onBlockExplode(BlockExplodeEvent event) {
// Block explodedBlock = event.getBlock();
// Mistake here was assuming the block explode was for each individual block omg - 4/19/2025
Iterator<Block> iterator = event.blockList().iterator();
while (iterator.hasNext()) {
Block block = iterator.next();
if (block.getType() == Material.DRAGON_EGG) {
System.out.println("Explosion detected dragon egg");
EggData eggData = getKingdomEgg(block);
if (eggData != null) {
System.out.println("Explosion detected kingdom egg");
iterator.remove();
}
}
}
// if (!(explodedBlock.getType() == Material.DRAGON_EGG)) {
// return;
// }
}
does anyone know why my explosion listener isnt even picking up a dragon egg in the list of detonated blocks
ive confirmed there is indeed a dragon egg, but the first print statement will not fire
Can dragon eggs even blow up
im going to print the entire blocklist to see
Huh yeah it can
It’s fairly blast resistant but it can
Are you causing a block explosion?
Hi, I would like to know how to create an NPC, because according to what I found online, I need to use certain classes that are not present in my version of the Spigot API (1.21.R4).
For example: ServerGamePacketListenerImpl cannot be found.
i'm summoning a tnt on top of it to test
Those aren’t part of the api
?nms
TNT is an EntityExplodeEvent
Since it’s an entity
ah shoot you're right
the question must be asked then, what is blockexplodeevent for
can't think of any blocks that exploed without being converted to entity
you're so right
BuildTools was already installed and I can use NMS but some files has missing
yup that fixed it, thanks
the endstone thing as well
tombstone
no 😭
lodestone?
respawn anchor
What files?
Are you using the right dependency?
example: ServerGamePacketListenerImpl
I think

