#help-development
1 messages · Page 1299 of 1
Application first if and when possible, database as fallback
yeah i think
thats the smartest
if they change it on that application
it saves there
I would even say that technically denormalized data doesnt exist. Every data store should be normalized to the context of usage. If its not normalized than means data is useless on its own because it has no context. Thus nosql views for application persistence is normalized to the application logic context, and relation database persistence store would be normalized for generic context acting as a single source of truth for various types of context-specific normalizations
Yeah databases should be used as a final guard and shall be built upon some caching layer that acts as an in-memory store. And for most applications you either don't have concurrent (write) access or you are able to circumvent it because you are within a single application instance. Which is precisely the reason I never took the step to use Databases for Minecraft Plugins. A single file per user does the same job since there won't ever be concurrent access as long as you don't mess up your multithreading (if you even need that) and it's simple to cache the usually relatively small amount of playerdata using a hashmap and a data class
I'm sure you can have plugins with a huge amount of data where a database CAN make sense. E.g. LogBlock. But more often than not a (or multiple) flat-file(s) stored in-memory with periodic saving will do just fine.
Just make sure to have backups. The minecraft server exploding would destroy your data when using flat-files. This won't happen with a DB running on a different server. But you could just have an automatic system that grabs the file(s) every day and stores them on another server as well
omg too long message
caching is only necessary if your DB can't handle the amount of queries you are doing
internet these days is really reliable and redundant. But you can implement caching if internet is a concern I suppose
validation does not necessarily need to happen as soon as possible, only really needs to happen for things that need it
can someone help me delete my thread
report the thread and a mod will delete it
on spigot itself or on discord?
alright thank you
is there a way i can make it soe parteicles render from farther away
no
Anyone helping with BuildTools
i setup BuildTools but i didn't get net/minecraft and bukkit/craftbukkit in my maven
Make sure it's done running and thay you built the right version
And if you're using Mojmaps; that you used the --remapped flag
I didn't use promt, I downloaded via the interface, and I didn't encounter any problems, unless the maven part was skipped, but how do you know that :/
The gui has a toggle for the remapped flag
And you can check the log for what it did
Set the “force” Boolean in the spawnParticle method
I didn't think you could override the client render settings
How i can edit a plugin Or update it
Can you give a little more context?
Probably by... editing it?
If you have the source then just edit the files.
It just “suggests” that the client render the particle from farther away
No guarantee on specific client behaviour
I think the vanilla client just renders it as long as the chunk is visible
yeah thanks i already goolged it and it told me the same thing
Hello, is there a guide/code example for spawning and editing ItemDisplay with packets (ProtocolLib) ?
is there a way to make block displays appear only for specific player (protocollib) and manipulate them?
there sure is
but the question is how haha
Which part
Appearing for specified players means sending some packets to only specified players, and manipulating the displays means manipulating the displays and then sending some more packets lol
but like, can i move the existing blocks (the blocks that have been sent through packet) or do i need to create new ones
I don't think you even need protocollib when we have Player#showEntity & Player#hideEntity
won't there be too much load coming on the server?
Good question, could look at DecentHolograms and how they do it, I believe they use armor stands and packets, but display entities are easier to work with anyway... given shadows api knowledge is correct, you should just do it through the api
for example there will be like 500 players working with 25 blocks each at one time
Of course you can move existing entities
In theory no, as display entities are much more performant than regular armorstands.
^
but existing entities on player side
Entities are server side
i may check it
You just need the entities internal ID to tell the client which entity your packet is for
i know but the question was can i work with already spawned blocks trough packets for player
i think i will try this first,
elaborate on spawned blocks
If you keep track of them yes
Like block displays?
Presumably protocollib already has an api to fetch a free entity id
yea
Do that, there's no reason to use packets when you can do it through the api
alright thanks for help guys, lets try 😄
I remember asking why DH hasn't switched to display entities and they said because packets are more performant
As well as complaining that display entities tick, but they don't iirc?
IIRC, they do internally, but they really shouldnt
Even then, it's still much more performant than armorstands
I mean I get the work of an overhaul but still
People complain we don't get modern tools
We get modern tools
People don't use them
I think another one of their complaints was versioning support, but like you already have the armorstand shit written so...
is there a way to set transparency/opacity of display blocks?
i haven't found a way yet
I think you may need a custom model, iirc block bench has some opacity config when designing models
hello, the idea of making an homes plugins and a team plugins came to my mind but i don't want to make both in the same .jar i want to make them work one alone of the other but i would love to integrate some stuff of one to the other for example the homes one i want to integrate an item in the gui of the homes that it's the team home how can i make the 2 communicate? (Sorry if it's a stupid question but I'm really new to creating API or whatever can make them communicate)
you can use multi modules
multi maven modules
How can I edit the description of a plugin already uploaded to Spigot? Also, how can I upload a new version? I can use @ to reply to you.
@eternal oxide i need 2fa?
yes
ok
can u explain a bit pls?
r u on maven or gradle
maven
it's the best way for make a stuff like how i said or it's one way?
dows it better?
idk
no it doesnt so follow it
do i have to a deep copy when i want to return ItemStack[], and make sure outer methods cant edit it ?
like do i just create another one and place all of the contents in loop ?
public List<ItemStack> getContent() {
List<ItemStack> clonedContent = new ArrayList<>();
for (ItemStack itemStack : content) {
clonedContent.add(itemStack.clone());
}
return clonedContent;
}
Yes, itemstacks are mutable, so a defensive clone of a collection of them must be deep
whaat?
i dont wanna outer methods to edit it
read only
so i return a clone
Thankfully cloning itemstacks is fairly cheap nowadays
??
ok but if i have a record with Itemstack and some other fields
do i ...
what do i do
if u return a constant, then it cant be edited 🧠
yeah ..
Construct a copy of the record with a clone of the itemstack
Ideally not
Shallowly immutable
or idk
But sure if you want to enforce it to be deeply immutable, do that, but also remember to clone the stack in the constructor, and be aware of any performance impact repeatedly cloning it might incur
ooookay
couldnt they make an ImmutableItemStack class?
or smth
or is it stupid
instead of cloning it every time in getter i would just do new ImmutableItemStack(Itemstack) and return that
i could return the same one many times
is that stupid ?
It'd be nice if there was an immutable itemstack type yes
why there is an error downloading XSeries depdencies?
i am tring to download decentholograms that contains XSeries, but it don't find in https://jitpack.io, but i tink it is in maven
i believe it's case sensitive
make sure you have the right caps in groupId and artifactId
ye is correct
is the equal thing (i tried now)
only XSeries doesn't work
what is xseries
but... it is in maven
send relevant info from pom
https://paste.md-5.net/exaqugeces.cs
how can I make the motion smoother, I am using a ItemDisplay
you could try translating the item display with interpolation instead of tp'ing it but not sure if that's recommended
You can set the teleport interpolation too
Make a little bit of a better algo kek
The default is 0, which means it doesn’t have any interpolation when teleporting
Where most (all?) other entities do
oh didn't realize that was a thing
thats neat
what event is called when a player clicks an interaction entity
or are none called
Should be playerInteractEntityEvent iirc
It should be at least one of the playerInteract events
How to make tickrate of hopppers fast like what settings
ticks-per:
hopper-transfer: 100
hopper-check: 100
hopper-amount: 100 what do i do for this to make it go very fast and collect speed
none of them are fired for interact entities for me
ill debug a bit more
It's been a little while since i messed with interaction entities, but something is telling me only right clicks are noticed
yeah its a right-click
It fires a damage event for a left click
And InteractEntity or InteractAtEntity for right click
Don’t remember which
this is not the case
i didnt mean to leave mention on the reply enabled sorry
I tested with both events and both were called for other entities but not interact events
its a problem with nexo, nevermind
is there a way to wait a specific amount of seconds, not ticks?
I'm writing a plugin that does potentially expensive operations asynchronously and I want to make sure that if the operation takes longer than a certain number of seconds it is automatically cancelled
I worry that if I use ticks, the operation could cause tps to drop leading to the operation being given more time than it actually should
you could create a new thread and use Thread.sleep to sleep a certain number of ms and cancel after that time has passed
though it depends on what you're using for those async operations
for example you can use Future::get with a timeout
if it is asynch despite its name the server creates a new thread for that task, therefore since that task is in its own thread it should not affect the main thread
using ticks or seconds is not relevant to a timer
if the operation is using cpu resources wouldn't it lag the server if it's doing too much?
like, this is noticeable with FAWE for instance
even though I think it does almost everything in other threads
the only difference is that if you go based on ticks, if the server lags, your task will also be delayed where as if you use seconds then your task will ask to be executed but since server is lagging still may get delayed in executing
if I use ticks and the tps drops that means the task (that is potentially lagging the server) gets more time than it actually should
that's what I'm worried about
depends on your cpu. Most of the time, your server is only using at most a single core, with threads occupying other cores but not necessarily using them fully
is using normal jvm threading fine on spigot?
real world time it would take longer, but this doesn't mean that it was actually doing anything in the server if the server itself is lagging
sure, what do you think async bukkit tasks are built on top of?
I didn't know if there was any oddities with using it
like it could make sense if it has weird behavior on server shutdown etc.
your only downside is that you wouldn't be able to rely on the bukkit task api if you are handling your own threads
server forcefully exits if everything does not shut down in a timely manner
as for the whole ticks and seconds part, you should in general rely on ticks though. Because this keeps everything at the pace of the server, where as if you use seconds then you may not necessarily be in sync with the server but some tasks do require this
I don't really understand why that matters
when I need to actually get things to the main thread I can just schedule a task
also this is for the purpose of a timeout
because if the server is going slow you want your task to slow down with it
that's not really what I want here
if you go faster then the server can process, all you are doing is contributing to the problem
I guess you are not quite understanding
what I want here is to kill a task when it's taking too long
The way you’d have to tell time is the same way the server does, so your system is only ever going to be as aware as the server in this case
then, you need to run your own timer for this, but this whole taking too long is where you are getting confused when the server slows down
when the server slows down, its not that your task is slowing anything down, or that its spending too much time on your task
rather the server as a whole has slowed down
the server will start skipping ticks and it remembers it has done this
if everything gets too slow for too long
maybe I misunderstand how the scheduler works
if tps is 10, and I schedule a task for 20 ticks later, will it execute after 2 seconds or 1 second (roughly)?
21 ticks technically iirc
you should probably do research on game loops. The tick rate of the server is essentially the game loop and it doesn't necessarily control how fast anything executes per-say especially when it comes to threads, but it does control how fast everything in the game goes
Task scheduling would take a tick + wtv you define as the delay -> ran every x ticks
if we are running at 10tps, which is 10 ticks per second, and you schedule something 20 ticks later, then it will execute at the 30th tick.
the server can still count ticks even if it is running slower
in comparison to real world time. It would take 50% longer. So technically if you are measuring with a clock it would take longer to get to that 30th tick at 10tps, then it would at 20tps
but the same amount of ticks would go by before your task executed
20TPS is 50ms just fyi
so if we run at 10tps then we are at 100ms
which in comparison for executing stuff is relatively fast lmao
by that you mean mspt?
or was it 1 tick is 50ms 🤔
1s = 1000ms
1 tick = 1/20 s = 1000/20 ms = 50ms
right so, 1 tick is 50ms, so if we go to 10TPS then, 1 tick is 100ms
I mean like, still, not killing a task that is lagging the server after the timeout period (because the server thinks less time has passed) seems like a bad idea
I think a better thing you should do if you are that concerned is to have a thread separate from everything that keeps track of TPS
if it hits 10TPS or whatever you decide, you can just pause your tasks
until TPS improves
to pause a task you wouldn't cancel, instead you would add in your code a boolean where if its true it would just skip to the end of the method
that doesn't really work in my case (tasks are player-submitted, they're going to expect them to be done somewhat soon after submitting a command; I want to make sure that if they do a task that's too large it's killed after a certain timeout)
this way your task is still there, just waiting.
This doesn't seem like a very graceful fallback
then you will need to add in the the task a method that records the time when task starts executing, and then you will need a timer to measure from there how much time has elapsed and if that time has elapsed kill it
If a task is "too large" then I guess you could split the workload into multiple threads... or just not allow tasks of that size
at this point it is up to you which time you want it to depend on, that is real world time or in game time
since both are not always in sync
I can't predict in advance what will take longer (well, unless someone solves the halting problem that is)
users submit code that may perform actions on the world
Well what defines a player submitted task? Couldn't you gather enough context from this to decide whether or not it's a heavier load?
but I think if you implemented a method that would just simply pause a task instead as a first measure it might be better then just outright killing it. Maybe reserve that for tasks tthat are taking like 10 minutes?
using a timer is a smarter idea than what I was thinking actually
Yeah completely killing a task especially as these are player submitted sounds like end user frustration 100% of the time
I was thinking to check Thread.interrupted occasionally and have another task run after a timer that interrupts the thread but just checking the timer then instead is definitely better
you should avoid interrupting a thread
because you could indefinitely suspend a thread on accident this way
(tasks really shouldn't take more than like... 5 seconds)
What now
Are you talking about suspending a thread?
No, but I did word what I meant to say wrong though
I meant that they should learn how to interrupt a thread properly otherwise you won't be able to interrupt it at all
and thus unless you implemented some way to kill it, the thread runs indefinitely
ye interrupts can get messy if ur undisciplined
anyone can test mi new plugin
https://www.spigotmc.org/resources/staffx.127407/
Add staff mode it will be better
Why would anyone pick that plugin rather than everything else available
Because I'll be adding a lot of things to it.
I'll add that when you say bad things in the chat, you'll get an alert, and when you have certain alerts, I'll ban you for 1 hour. Give me ideas, otherwise.
staff mode is the most important for a staff plugin
but make sure everything is configurable
i dont think u should add a lot of things
just make the things u do add perfect
add minimessage formatting as well
add a /dn command
what?
what is /dn command?
here we go
sometimes
add mini message formatting
nobody likes a modern plugin without minimessage
ok
man I should've done this a long time ago
we just setup proper gradle scripts
imagine not having 15 different mc plugins
literally 🙏
couldn't be me
same w node modules
it auto downloads and stuff
can be achieved with a gradle task
this is much nicer
imagine maintaining compat against more versions than just latest
damn illusion how'd you grow up to be such a cringelord that doesn't appreciate a proper ui
I guess the universe had to even out after producing a gigachad
😔 if only I read elitemobs' src and discovered half the UIs are hardcoded
this man wants to be able to customize literally the plugin setup page like modifying what it says would make any sense
this guy gets it
make a config generator webpage that links back to the plugin
like
/elitemobs setup
click to open link, set my settings and shit
light/dark mdoe button
press "confirm" and maybe even run a command
ohh but its by magma so now its good
here's a counter argument
how about just no
it adds nothing
there's only three buttons
I forgot you're the guy who refused adventure support because 4 people asked for it
i support magmaman because i dislike mythicmobs much more
if I was going to add a feature every time 4 people asked for it I would have to add and support 50443 new features
ye bc ur a loser
nuh
yuh
your mythic dumpster is a dumpsterfire
mythic has the best plugins no questions asked
ah mythic my beloved
i can feel my blood pressure rising just thinking about it
add a negative space to mythichud and it breaks all kinds of alignment
that's literally all mc gui spacing
not if you do the math proper
then you should do the math numbnuts
even if I counterbalanced the thing it still fucked itself up
it literally adds 1px to every character
isn't this a done issue now
stupid ass plugin
dialog
yeah that
buddy thinks mythichud is a deluxemenus alternative
it's not a cure-all but it's pretty cool
yeah the whatever hud plugin that isn't part of the mythic ecosystem
happyhud used to be separate but then mythic bought it
mythic buys a bunch of shit
private equity firm type shit
took like 4 months to update to 1.21.4
I remember when songoda did the same thing
porque no los dos
thought you were fr*nch not a spaniard
imagine being born 5 minutes ago and not even knowing early 2010s memes
I'll dunk you in gasoline
pls subscibe this is my first video
that was so bad I feel like you owe me something greater than money
BJ at the back of that mcdonalds?
it feels like yu now owe me some kind of spiritual debt
close enough
you need to stop putting everything you find in a fast food joint in your mouth
😔
and miss out on hovers, clicks, keybinds, shadows, fonts...
I haven't looked into it yet
it doesn't fill the same purpose
mythichud is about permanent hud elements
dialogs are an alternative to chest UIs
bit like bedrock forms
oh
k
never even really bothred to much with those ui elements
otherwise I'd probably already have made a plugin for it
eh who knows maybe something to add to fmm in a distant future
do dialogues work on bedrock with the same functionality?
or no, or not yet
bedrock forms are different to dialogues
bedrock forms can take in pictures and shit
they have a different UI style (and language)
fml
lets you do shit like this
dialogs are more about this
feels like raw java ui design
yup
except it has to be sent in the configuration phase and there isn't much you can do
bedrock UIs can be sent at any time and it's just a big json object
bedrock's protocol is a lot more flexible when it comes to things like these
hm
you can just define a new entity and spawn it in
change its hitbox on the fly
and play custom animations
why use interaction entities when you can just scan events instead, it's so much worse!
it's not aabb because aabb is cringe
it's obb
rotates with the entity and can have a different x and z
plus since it's virtual I can customize interaction distances
damn it I have accidentally created a ghost server
I don't even where is htat process
gottem
no, dialogs can be inlined
oh, neat
i figured there'd have to be some way of doing that or else people wouldn't have it running doom already
this is pretty close to whats possible in java except for the theming, which would be amazing to be able to customize
with enough resourcepack magic you could probably pull it off
what i do find strange is that the far more flexible and exploitable (and more 13-year-old-frequented) bedrock dialogs don't have a huge ⚠️ sign always at the top of the dialog, while java's more gimped and less customizable dialogs do
You could probably make a fancy theme with font magic
this isn't google
solution: do not attempt to hide player while disabled
thats because at java they still kinda care about the game
i wish they didn't, in this particular instance
i wonder if we can get rid of it with resourcepack nonsense or if it's hardcoded
the warning sign is not the biggest issue I have with the dialogs on java
that would be the aforementioned fact that its like a 80% fleshed out system with just being shy of the right amount of customization
It's a starting point
Consider it version 0.1
And remember, this is a dialogue. As in a form. For user input.
thats true I guess they could be updating it
yes but still
for example it would be nice if we can change the text on the dialog based on like an option the player selects or a value in an input box
Anything with user input should have a warning saying "Look, this is third party, we can't guarantee what this unknown server is going to do with that data". If they don't include that warning, Mojang can be culpable
Liable*, sorry, is the more appropriate word
It's the same reason they have the checkbox when you first open the multiplayer menu
yeah so they kinda dropped the ball with that for bedrock
Yes, but Bedrock is maintained by Microsoft, so their design decisions are theirs
I think that it too has a third-party server warning though
yeah I guess the general server warning when you enter multiplayer should be enough though?
or is it because the dialog looks like an actual minecraft menu
Could be that, yeah
and the warning is also there to prevent softlocks
There's that as well, yes
with the disconnect ability
what does that even mean
man I need to take a look at this a year from now when over 50% of people are running a server capable of using it
it means you can do something like /dialog show player {} where {} is the actual contents of the dialog, instead of some link to an existing dialog
and ofc throught the API is the same thing
a direct holder rather than a reference holder
you can either register dialogs to the registry with a datapack, which will be sent to the client, and then open them via their resource location, or create them on the spot and send the whole dialog layout every time you want to open them
27.7% of servers have them available, as per bstats
so we are not that far away
I am amazed at the amount of people who got stuck at 1.21.4 though
where should i go/look for a complete beginner
Hasn't that been fixed for a long time now?
I guess you could send a block change one tick after you cancel the event
The home of Spigot a high performance, no lag customized Bukkit Minecraft server API, and BungeeCord, the cloud server proxy.
5 bucks says 1.8
i tried but it isn't not working
so it's working?
love double negatives
I don’t not love double negatives
kek
i dont not love no double negatives
jesus
are registered recipes automatically unlocked in the crafting book when you have the materials?
Good question
I don't know though. Maybe try and see?
I know some part of recipes is weirdly advancement based, but might not be unlocks
is there a way to play a SPECIFIC cave ambient sound in spigot 1.8.9
there has to be a way right 🥹
no bc its already on the client im pretty sure
if u say please ill double check
@fleet pier
and a kiss
⁉️
ye but rate it
@ivory sleet ik u did it
?
u deleted my link 💔
ugh it wasnt me this time
yay

i forgive u then 
give him a warning for pinging
💔
i gave him a kiss and everything
and he still didnt answer my question
yeah no
its not even defined, its in a single file
its in ambient.cave.cave
i think its hardcoded icl
are you trying to play a specific cave sound?
if so use teh play sound method where you can provide an extra value (random or something)
start at 1 and go up one by one untill you get the sound you want
1.8? Nope, send a packet providing a seed to play sound
It’s just a long
It’s used as the seed on the client
Afaik there’s no nice way to figure out which seed will yield which variation
why would a plugin not decomplie im using something to decomplie this plugin but when downloading the result it is justa empty zip if i do this same decomplier with a diff plugin it works perfectly
can i do it somehow on intellij cuz i tried just a jar to zip but then i get the .class files not java those are read only on intellij cuz the JD converts them to .java for viewing
today, this poor soul is going to learn about "Obfuscation"
some obfuscators will jumble up the code and purposefully cause most decompilers to crash while attempting to read a class
but still have the code able to run on the JVM
i believe Paramorphism is a prime example of an obfuscator that has this feature
yes this was a possibility but it wasnt the issue it was actually windows now reading contents switched to non windows computer it worked had to use 7zip not normal to unzip but thx for helping
i dont know why but did i just get the notification for those messages
F
Hey, I'm trying to download Leaderheads, but when I click on the spigot page, it shows me this error
maybe you don't have 2fa enabled or something like that
Actually I have 2fa enabled, still not working
no idea then
any spigot staff will answer me?
they're around usually, but you can also contact the email ig
?support
ty, apreciate it
The plugin is long deleted
Is there any other similar plugin that I can use?
Topper
Does anyone know how to develop a plugin
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Like I have a mod idea, but I have no clue how to actually code it
Start with getting to know Java
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
Can I pay someone to dev it for me, I have all the info and all that
?services or check pins in #general
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/
Mods and plugins are different things BTW
Well I what bedrock access so it has to be set up as a plugin
that fails?
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>Vault</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
</dependencies>
Did you forget to add jitpack as a repo
now?
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Vault API -->
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>Vault</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
</dependencies>
use 1.7.1, and make sure you refresh maven on intellij (little floating maven button)
also it's VaultAPI, not Vault
@slender elbow
did you do the refresh
oh thanks xd
🥄 🍚
you can try the plugin
what you finished it?
When I finish it, this plugin is a plugin that I've been working on for a few weeks.
yes
you finished faster than me
but I've been doing it for a month
👋
When listening to Clientbound packets using NMS, should I do super.write(ctx, rawPacket, promise); for each subpacket in a ClientboundBundlePacket or just do it for the main bundle packet?
just the bundle packet
Hi. Is this the only way to do this or there is a more optimal approach? Thanks
// I want to get the player available slots.
final PlayerInventory playerInventory = oPlayer.getInventory();
int totalEmptySlots = 0;
for (int i = 0; i < playerInventory.getSize(); i++) {
if (i < 0 || i > 35)
continue;
final ItemStack itemInSlot = playerInventory.getItem(i);
if (itemInSlot == null)
totalEmptySlots++;
}
One improvement would be to just use an enhanced for loop on the inventory itself
Inventories are iterable<ItemStack>
I see. Thank you.
👋
[17:20:03 WARN]: java.lang.IllegalStateException: void future
[17:20:03 WARN]: at io.netty.channel.VoidChannelPromise.fail(VoidChannelPromise.java:198)
[17:20:03 WARN]: at io.netty.channel.VoidChannelPromise.addListener(VoidChannelPromise.java:58)
[17:20:03 WARN]: at io.netty.channel.VoidChannelPromise.addListener(VoidChannelPromise.java:26)
[17:20:03 WARN]: at ZelHide-1.1.7.jar//com.zeltuv.hide.nms.NMS_v1_21_7$1.write(NMS_v1_21_7.java:81)
[17:20:03 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:891)
[17:20:03 WARN]: at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875)
[17:20:03 WARN]: at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984)
[17:20:03 WARN]: at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868)
[17:20:03 WARN]: at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:964)
[17:20:03 WARN]: at io.netty.channel.AbstractChannel.write(AbstractChannel.java:300)
[17:20:03 WARN]: at net.minecraft.network.Connection.doSendPacket(Connection.java:496)
[17:20:03 WARN]: at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:476)
[17:20:03 WARN]: at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
[17:20:03 WARN]: at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
[17:20:03 WARN]: at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
[17:20:03 WARN]: at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
[17:20:03 WARN]: at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
[17:20:03 WARN]: at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
[17:20:03 WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)
I'm getting this error when trying to add a listener
// Write raw packet for final outcome
try {
LINE 81 -> promise.addListener(ignored -> Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, () -> {
// Unlist
if (!player.isOnline()) return;
if (!addedPlayer.isOnline()) return;
unlistPlayer("REMOVE", addedPlayer, List.of(player));
}, 10L));
} catch (Exception exception) {
exception.printStackTrace();
}
see here: https://javadoc.io/doc/io.netty/netty-transport/4.1.63.Final/io/netty/channel/VoidChannelPromise.html#isVoid--
you're using a VoidChannelPromise on which adding a listener is an illegal operation
public void write(ChannelHandlerContext ctx, Object rawPacket, ChannelPromise promise) throws Exception this is the write method I'm overriding, I didn't specify it to be VoidChannelPromise tho
Is it possible to add a listener somehow?
a VoidChannelPromise is probably still passed in, since overriding the method doesn't change the parameters passed.
you could try to unvoid it
did java not get the transfer packet??
But would it still be linked to the actual promise (aka, would the listener work as expected)?
that's at least what I would expect, but I'm also just refering to the javadocs. haven't dealt much with netty
why doesnt this use the transfer packet in java??
https://modrinth.com/plugin/server-redirect
i thought it was but it says the client needs to have the mod installed lmao
Guess they didn’t feel like changing new versions to the transfer packet
i cant find a single plugin that does it 
wow how fucking nice https://www.spigotmc.org/resources/transferproxy-transfer-packet-proxy.114653/
they made a proxy using the transferproxy
how very smart
if i wanted a proxy
id just use velocity
who made this shit bro 💀
how does this transfer packet work am i just confused
or does nobody bother to make a proper plugin w it
It just tells the client to transfer to another server
If that server has transfers allowed
The transfer packet means transferring the connection out of the proxy, hence why velocity or bungee wouldn’t use it
“Wow this server looks a lot like Hypixel”
yeah but like why tf did this guy make his own proxy
based on the transfer protocol LMAO
also can i not transfer from one proxy to another?
you can transfer to anywhere, as long as the receiving server has transfers enabled
as for why, it might just be some additional server synchronization logic on top of the transfer packet in order to transfer data along
I imagine they use cookies in order to do that
ye ig but im shocked there isnt a single plugin
there's little use for it
when are you ever needing to transfer a player into a different server completely
only person I see loving this is probably minehut
Proxy updates when you have a multi proxy setup
Or transfer to another network
is it possible to add images to scoreboard in older minecraft versions using resourcepack too?
or let me ask this what version starts making it possible
I can count the amount of servers with a setup like that with my hand
hence why, it has little use
I imagine people do that with font hackery
so whenever custom fonts were added
could you tell me when? 🥹
1.16
ye mini servers dont
what about large servers
any big server is going to use a custom solution rather than something off the shelf
duh ik im saying they have a use
they might, but even in big servers you don't see this kind of thing due to the way things were before that packet existed
proxy down -> transfer to another proxy
proxies have been made and configured to work without it, so there's little use for it now
well ye most large servers dont run anything on their proxy anyways
idk though i think its useful asf
the path to make a plugin able to do this was honestly downright stupid
so much god damned effort and work
I could've just made a standalone game
couldve just downloaded nexo 🙏
what does the plugin do
have u never seen nexo 🙏 😭
they will by the time I'm done with it
a lot of work went into making that api be buttery smooth
it uses callbacks
it's very neat
@slender elbow
Please test my plugin. I've been using it for a week and need feedback.
https://www.spigotmc.org/resources/️randomrain☔️.127459/
not bad
i wouldve roasted u if u put a global radius
but its a radius around each player
looks really good
I'm trying to create a block display entity with protocol lib but I can't figure out how to set the block state (or scale for that matter)
I get that I'm supposed to send an entity metadata packet, but I can't figure out how exactly to do that (I've tried a few things based on the protocol wiki page but none of them seemed to work)
here's my code (kotlin):
// spawn block display entity (this part seems to work)
run {
val packet = PacketContainer(PacketType.Play.Server.SPAWN_ENTITY)
// header
packet.integers.write(0, player.regionEntityId);
packet.uuiDs.write(0, UUID.randomUUID());
packet.entityTypeModifier.write(0, EntityType.BLOCK_DISPLAY);
val box = region.box;
// position
packet.doubles
.write(0, box.start.x.toDouble())
.write(1, box.start.y.toDouble())
.write(2, box.start.z.toDouble());
pm.sendServerPacket(player, packet);
}
// set entity metadata (this is wrong but idk how to fix it)
run {
val packet = PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
packet.integers
.write(0, player.regionEntityId)
val blockData = WrappedBlockData.createData(Material.BLACK_STAINED_GLASS);
// throws Field index 0 is out of bounds
packet.blockData.write(0, blockData);
pm.sendServerPacket(player, packet);
}
Hi, I have a strange issue.
When I add an attribute modifier to a player's max health, their hunger suddenly decreases without any reason.
Here's the code:
String test = "test";
for (Player player : Bukkit.getOnlinePlayers()) {
player.sendMessage("add");
AttributeInstance instance = Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH));
instance.addModifier(new AttributeModifier(test, 4, AttributeModifier.Operation.ADD_NUMBER));
}
new Scheduler(JavaPlugin.getPlugin(CostumePlugin.class)).later(() -> {
for (Player player : Bukkit.getOnlinePlayers()) {
player.sendMessage("remove");
AttributeInstance instance = Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH));
List<AttributeModifier> list = instance.getModifiers().stream()
.filter(v -> test.equals(v.getName()))
.toList();
list.forEach(instance::removeModifier);
}
}, 50);
Current: git-Purpur-1632 (MC: 1.18.2)*
- You are running the latest version
I don't really know why this is happening
thanks
Is it consuming hunger to heal
I'll check it out
Ok
The entity metadata packet uses a list of wrapped data values
Writing to blockData isn't the same as writing a data value of type "block data" at a given index
what property am I supposed to use then?
something like this
you should have a method to get the serializer for block data without having to pass a class
?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 am making a custom implementation of bungeecord
I have a simple setup
192.168.50.64 is the bungeecord server (ferriscord)
192.168.50.2:25565 is the mc server
192.168.50.2 is the minecraft client
I am stuck when the player tries to join in the game at Joining World
I have attached a log file to show what happens
Am I missing some step regarding connecting the user?
I do not in this example do mojang authentication
Minecraft Server (paper 1.21.8)
[02:46:43 INFO]: UUID of player TRiLON is 9600b880-7c04-4dcc-87f2-491971200012
[02:46:13 INFO]: Disconnecting TRiLON (/192.168.50.2:56864): Took too long to log in
[02:46:13 INFO]: TRiLON (/192.168.50.2:56864) lost connection: Internal Exception: io.netty.handler.codec.EncoderException: Pipeline has no outbound protocol configured, can't process packet ClientboundLoginDisconnectPacket[reason=translation{key='multiplayer.disconnect.slow_login', args=[]}]```
Any ideas?
If possible someone explain to me what bungee < -- > paper does during connection
Thanks in advance
Tag me please
if ur on paper u should probably use Velocity
But I'm making my own, I don't want to use velocity
Does the minecraft wiki have the login sequence documented like wiki.vg did
?protocol
considering it's a 7 year difference, i would say yes
NO GIF PERMS IS CRAZY
Gif perms in this server must be purchased, via dming @molten hearth
a lot changed about like. the Whole game
talking api wise
clown
for the scoreboards
"clown"
chill out
no the scoreboard system is STILL dogshit
also 1.19 was a while ago
I was gonna say that scoreboard entries now can have cool display names and score entries, number format etc
but spigot has no API for that
🥸
continuation of this; I managed to get to this code
val packet = PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
packet.integers
.write(0, player.regionEntityId)
packet.dataValueCollectionModifier.writeSafely(0,
listOf(
// type = block data
WrappedDataValue(0, Registry.get(java.lang.Byte::class.java), 14.toByte()),
// index = block state
WrappedDataValue(0, Registry.get(java.lang.Integer::class.java), 23),
// (the block state value)
WrappedDataValue(
0,
Registry.getBlockDataSerializer(false),
WrappedBlockData.createData(Material.BLACK_STAINED_GLASS)
),
// end sentinel
WrappedDataValue(0, Registry.get(java.lang.Byte::class.java), 0xFF.toByte()),
)
);
pm.sendServerPacket(player.player, packet);
but I'm now getting
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_entity_data'
Caused by: java.lang.IllegalArgumentException: Can't find id for 'WrappedBlockData[handle=Block{minecraft:black_stained_glass}]' in map net.minecraft.core.IdMapper@22c8c639
I'm not really sure what that means or how to fix it
nvm, I figured it out:
val packet = PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
packet.integers
.write(0, player.regionEntityId)
packet.dataValueCollectionModifier.writeSafely(0,
listOf(
WrappedDataValue(
23,
Registry.getBlockDataSerializer(false),
BukkitConverters.getWrappedBlockDataConverter().getGeneric(WrappedBlockData.createData(Material.BLACK_STAINED_GLASS))
)
)
);
pm.sendServerPacket(player.player, packet);
what are you trying to do with this
create a block display entity that's only visible for one player
(to denote a selected region)
you could do that with the API no?
I don't believe there's a way to make an entity for solely a single player
I don't want the entity to actually exist in the world
you can make an entity, set visible by default to false and then show it to that player specifically
(also, I'm in too deep now /j)
I see, a lot of people tend to go that route for the same reason actually, we usually just recommend to not do that since it is annoying
What's the issue with the entity existing?
I don't want to have to keep track of what entities are owned by my plugin if I can help it
Unless you're dealing with thousands or more, I get it but otherwise... ?
eh, they're already half-way there, no point in going back now
Just curious
just make sure to spawn the entity every time the player goes out of view distance (unless you're constantly teleporting them nearby)
yeah this is my current attitude lol
like doing it that way would've probably been less painful but I already got this far
There's no probably lol it would have been less pain (.)
Anytime you can use the api, you probably should
I wonder if using packetevents would've been easier, I don't know whether their wrappers for entity data are good
I wish this was more actively maintained: https://github.com/CubBossa/ClientEntities/
if it was I would totally recommend people to use that instead
honestly I don't think I regret doing it this way because I learned a lot about how minecraft packets work
It's good to learn for sure, but again less pain is less pain
hopefully you just don't have to deal with cross-version support, that's where things start to get annoying
though for block displays I don't think their entity data changed at all since their introduction
oh, that is apparently not true, their block state data had the id 22 in 1.20.1, it became 23 on 1.20.2 onwards
Were interaction entities released the same version as the other display entities?
I am planning on supporting multiple versions and also fabric (but fabric will just render it in mc rather than hacking a block entity to do it so that'll be a lot easier)
for versions without block displays I probably just won't have a region preview
Perhaps that's where the numerical change came from 🤷♀️
they were all released in 1.19.4 yeah
if it gets painful enough I'll just switch to the "better" approach
Go have a look at decent holograms, all their stuff is packet based
if it is just a block hologram, you could use an invisble armor stand in older versions
yeah but I don't really feel like doing that
as long as you don't do any fancy transformations, it works
reminds me when people would just use entities of different sizes to do scaling of that kind
display entities were truly a godsend for server-side mods/plugins as well as vanilla
Yeah but interaction entities don't throw events for all types of player interactions D:
Only right clicks smh
I can't say for sure, I remember a couple of people having issues with them and their supposed thrown events
Yk I actually just made an event tracing system for debugging, I could test that rn
I'm speaking from other's experience so again I cannot say for sure
I just know I tried helping a couple times lol
people do get a bit confused when it doesn't trigger the interact event with left click given it is called an "interaction" entity and not a "hitbox"
Funny you say that because that was my fix.. adding a hitbox lol
But this only worked for intersecting entities, ex: shooting an arrow at it
I ended up breaking arrows with that actually
oh, I don't think it fires for interaction with anything other than players
so if that's where people are getting stumbled then it's more understandable
I think the packet fires regardless but I am not completely sure, the events definitely do not
I need to implement this filter better for the event tracer
String simpleName = event.getClass().getSimpleName();
return !simpleName.equals("EntitiesLoadEvent")
&& !simpleName.equals("AsyncPlayerPreLoginEvent")
&& !simpleName.equals("PlayerPreLoginEvent")
&& !simpleName.equals("PlayerLoginEvent")
&& !simpleName.equals("ChunkLoadEvent")
&& !simpleName.equals("EntityAirChangeEvent")
&& !simpleName.equalsIgnoreCase("GenericGameEvent")
&& !simpleName.equalsIgnoreCase("BlockPhysicsEvent")
&& !simpleName.equalsIgnoreCase("ChunkUnloadEvent")
&& !simpleName.equalsIgnoreCase("PlayerMoveEvent");
Best way to filter right here kek
Also oddly enough, when AsyncPlayerPreLoginEvent is traced by this system, the player cannot log in
Doesn't get past encryption and just times out
Yeah duh
Was gonna have two kinds of filters -> filter in/out kinda thing
I still need to implement support for custom events
just use a set
anyone know how to send this packet to the player?
I am now
Bc bukkit doesn't expose a collection of events
but why would you need this
Debugging event driven systems
yeah but like, why not listen to the events
I mean I am... all of them
why, if you are hardcoding the if check for it, why not just listen to the ones you need
bc that was just annoying events being thrown when you load in, also it's fixed now anyway
public class TracedEventConfig {
private final Set<String> enabled = ConcurrentHashMap.newKeySet();
private final Object lock = new Object();
public void enable(String name) {
this.enabled.add(name);
}
public void disable(String name) {
this.enabled.remove(name);
}
public boolean isEnabled(Event event) {
return this.enabled.contains(event.getClass().getSimpleName());
}
public boolean isEnabled(String name) {
return this.enabled.contains(name);
}
public Set<String> getEnabled() {
synchronized (this.lock) {
return new HashSet<>(this.enabled);
}
}
public void toggle(String name) {
synchronized (this.lock) {
if (this.enabled.contains(name)) {
this.enabled.remove(name);
} else {
this.enabled.add(name);
}
}
}
public void loadFromFile(Path path) throws IOException {
synchronized (this.lock) {
this.enabled.clear();
if (!Files.exists(path)) return;
try (Stream<String> lines = Files.lines(path)) {
lines.map(String::trim)
.filter(s -> !s.isEmpty())
.forEach(this.enabled::add);
}
}
}
public void saveToFile(Path path) throws IOException {
synchronized (this.lock) {
Files.createDirectories(path.getParent());
Files.write(path, this.enabled, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
}
}
}```
I'm not very familiar with network programming or how a Minecraft server works, and I want to know if players can hack my server by obtaining an item from their inventory by simply sending a network packet to obtain the item.
Sneaky buggers are hackers, but generally they exploit dupe bugs in plugins to obtain items
you cant cheat in items by just telling the server you have them, that only works in creative xD
But a player on the server gets an item in one way or another, and it doesn't have to be in creative mode. What prevents him from sending a network packet that he receives, for example, when he gets a drop from a mob?
well, the server determines what the mob drops
the client cant really invent items or pull them out of thin air, as they would probably be ignored by the server and other players
atkeast I assume thats what happens in vanilla
If anything when an interaction occurs involving whatever they managed to get would just be removed by the server
The client doesn't handle lifecycles of items and what not so
yeah the server controls what items a player has
And that's assuming they were even able to "spawn" anything in with a packet
Which I don't think is even possible?
If so like steaf said it at least wouldn't be recognized by anything other than the client who sent the packet
Does this mean that the server doesn't accept item acquisition packets from the client at all? Does the server calculate the drop itself and then send a network packet to the client?
yes
the client is just able to display the state of the server essentially
Don't get me wrong the server trusts the client too much but not like that lol
and request changes
if the client could spawn in items with a packet, there would have been big problems already xD
That'd be what we in the biz call "f'ed in the a"
minecrafts networking is pretty server authoritative, it only gets funky when the client is in Creative Mode
Are there any people here with Rostelecom wifi?
Rotschild Wifi? yeahp
Rostelecom is russian provider. It's just that there are people from Russia with this provider. I wanted to ask them why the ports aren't opening if everything is done correctly
yes i use rotschild wifi
rotschild and rostelecom is different providers
creative mode :despair:

bedrock ah exploit
which ports?
public Order getOrder(UUID orderID) {
for (Order order : playerOrders) {
if (order.getOrderID().equals(orderID)) {
return order;
}
}
return null;
}
so i have this method that gives me an Order object from a list
Order myOrder = getOrder(orderID);
if i were to make changes to myOrder through methods i built into that object, would the changes reflect in the list or would i have to put the object with changes back into the list myself
if you get the object from the list and then change that object, then by definition the object you're changing and the object in the list are the same object
Yes
and so any change you make on one object is reflected in the list because there is only one object
Java is pass by reference not by value
Can someone help me, I just want to delete the starter kit that people in my server get from the Essentials Kit when the player drops the items or dies
for some reason my brain knows this but still manages to convince itself that java is pass by reference only when it feels like it is
either way, good to know
Delete it from config?
I'm the same
iirc you can also disable starter kit from the main essentials config
I want people to get it still just don’t want it all over the ground when players die
Probably there is a option for that
I can’t figure out where
Just control + f and type "kit"
Also #help-server for that issue
Here is for plugin dev
Any
Hello, is there a way to remove the first person item bounce animation when changing its nbt? on 1.21.8
yeah there was some way using a resource pack
you can try suppressing the slot change packet if you didn't make any outwardly visible nbt changes
the client will update it when next interacting with it somehow, without the animation iirc
if you want to change like the name or something outwardly visible, dunno
What's was the way?
i can't remember
Aww, thanks for the answers though
aha!
@young burrow https://minecraft.wiki/w/Items_model_definition
hand_animation_on_swap
Oooooh, thank you so much!
and you can use the specific item model on an itemstack with the item_model component
Thx!
So, I'm trying to work around an 11 year old vanilla bug where if you Ctrl+Middle click a block, in this case a populated Chiseled Bookshelf, when you place it back down it temporarily (until modified) loses its blockstate data.
I've verified I can see the items that are "meant" to be in it in the ItemStack in the user's hand using getItemMeta().getAsComponentString(). What would be the right way to read the data? Or will I have to manually parse the string (with the expectation it will probably break every release)?
Is there a way to prevent arrows from getting stuck to an item frame?
ProjectileHitEvent probably. Check if its an arrow and its hitting a frame, then cancel
are you canceling the hit event or removing the arrow?
Bukkit.getItemFactory
How can I create a plugin that costs money? I don't want to do it, but I want to know.
I... don't see how this helps. Isn't this just a way to create ItemMeta?
It has a parse method
I assume you mean createItemStack(str)?
something like that yeah
that just returns an itemstack, which I have
?premium
Ah
Then yeah you can get the data off the meta
print out the itemmeta class and go from there
can someone help me turn .jar file back to the src folders etc
😎
which jar is it
You want me to send it?
Its a polish one you dont know it
no
I haven’t ever made no plugins so I want to see inside of it
how the code looks and folders etc
Could be any plugin really
then learn from open source plugins
i don’t think you should tackle reverse engineering and learning how to code
at the same time
what’s that?
it has a pretty long definition, but for your sake, they openly share the source code
with you
that’s one of the benefits of Open source software (OSS)
so they’re free to use?
usually yes
The home of Spigot a high performance, no lag customized Bukkit Minecraft server API, and BungeeCord, the cloud server proxy.
what fails
Tysm
i suggest you also watch a series
to learn
some plugins can be a bit challenging to understand if you’re a beginner
The problem is dumber than I thought. the block NBT is already correct, it contains the books, but the block state doesn't accurately reflect the block data. Refreshing (via update or via clone and set) either of them doesn't fix it. Am I going to have to spoof an interact event by re-applying one of the books?
Through the power of "I'm dumb and so is the missing event" 😂
Ok but thank you for making packetevents, it's very useful 🙂
i was trolling
but
if you need help and i have time i can attend to yiu
thanks for the support matt, it means a lot
got ur modrinth page on the spigot page of vulcan as well 
have u seen the updated page
Hi everybody
Regarding Dialogs,
I was wondering to what extent the Bukkit API has started implementing this system. I did some research in the Bukkit documentation, but aside from two methods — showDialog and clearDialog — I didn’t find much. In particular, I found no system for registering new dialogs from within a plugin, and to make things more uncertain, both methods are tagged as @experimental.
Should I assume that this feature is still under development and more support will be added soon?
Is it too optimistic to think that we’ll be able to easily create dialogs directly from a Java plugin in the near future?
Or did I possibly miss some methods/features in the documentation and it's already possible to do all this — I just overlooked the relevant information?
In the case that this isn’t currently possible — or might never be, for various reasons — Would it be possible to retrieve user input from a datapack-defined dialog inside our plugin code?
Conversely, could we send variables from the plugin to the dialog to dynamically adjust the content, even though the dialog itself is defined statically in the datapack?
i hear adventure fully supports dialogs already
Spigot shares it's Dialog implementation with Bungeecord. You'll find more information about them in the Bungeecord Javadoc
package index
bungee's implementation doesn't support items, or does it?
Not sure
thanks, so I need to have bungeecore in my plugin dependencies to use these features..
register Dialogs from bungeecore API and open/clear from Bukkit API ?
That will be included when you depend on Spigot
There is no need to depend on it separately
i recall it being brought up here and i think it was an issue with bungee not having the bukkit classes like itemstack on the classpath/as a dependency, so it physically can't declare dialog api methods that do anything with itemstacks
hmm ok thx u, i going to do some tests about that
no clue how that works, never used bungee
The item hover events use raw item data strings
I had attempted to add an interface for BungeeCord to accept and have Bukkit ItemStacks implement it so you could pass them seamlessly, it just never went anywhere
Hi is there any boilerplate project to create a plugin ?
there is an intellij addon that creates a plugin project with all the resource and maven boilerplate
The Minecraft Development Plugin for Intellij comes with one. There are also plenty of maven archetypes (or you can make your own)
[20:08:20 INFO]: [org.mongodb.driver.cluster] Exception in monitor thread while connecting to server 37.27.174.75:15575
java.lang.IllegalStateException: zip file closed
at java.base/java.util.zip.ZipFile.ensureOpen(ZipFile.java:846) ~[?:?]
at java.base/java.util.zip.ZipFile.getEntry(ZipFile.java:338) ~[?:?]
at java.base/java.util.jar.JarFile.getEntry(JarFile.java:517) ~[?:?]
at java.base/java.util.jar.JarFile.getJarEntry(JarFile.java:472) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:209) ~[folia-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:169) ~[folia-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[folia-api-1.21.4-R0.1-SNAPSHOT.jar:?]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
at HypingOrders-1.0-BETA-all-1753898478979.jar/dev.siliqon.hypingorders.lib.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:234) ~[HypingOrders-1.0-BETA-all-1753898478979.jar:?]
at HypingOrders-1.0-BETA-all-1753898478979.jar/dev.siliqon.hypingorders.lib.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:159) ~[HypingOrders-1.0-BETA-all-1753898478979.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
ehm.. what did i do wrong?
mongobongo went bonkers
so its not my fault?
did you reload something?
How tf is it being “bound to PacketEvents” a disadvantage
sometimes mine turns black
and it crashes once in a while
I have this Velocity plugin code that sends a packet to my Fabric mod:
public void onLogin(LoginEvent event) {
WrapperLoginServerPluginRequest request = new WrapperLoginServerPluginRequest(1, CHANNEL, new byte[0]);
logger.info("Sending token request to player " + event.getPlayer().getUsername());
PacketEvents.getAPI().getPlayerManager().sendPacket(event.getPlayer(), request);
}```
The mod receives it:
```ClientLoginNetworking.registerGlobalReceiver(HANDSHAKE_CHANNEL, this::handleHandshake);
private CompletableFuture<PacketByteBuf> handleHandshake(
MinecraftClient client,
ClientLoginNetworkHandler handler,
PacketByteBuf buf,
Consumer<ChannelFutureListener> responseSender) {
try (FileReader reader = new FileReader(TOKEN_FILE)) {
String token = readToken(reader);
PacketByteBuf responseBuf = prepareTokenResponse(token);
return CompletableFuture.completedFuture(responseBuf);
} catch (IOException e) {
LOGGER.error("Error reading token", e);
return CompletableFuture.failedFuture(e);
}
}```
But I don't understand how to receive the response from the client mod in my plugin.
Sounds like a question for the Paper discord
Also why are you using PacketEvents for that? Velocity has api for sending them
(And recieving them)
this not work for login packets
for (Order order : playerOrders) {
plugin.getLogger().info(order.getOrderID().toString());
if (order.getOrderID() == orderID) {
plugin.getLogger().info("1");
return true;
}
the first getlogger line prints the same string as orderID.toString()
true is never returned
what.
(orderID is a UUID)
its equal but i am being told its not
don't use == on strings if that's what you're doing
== isn't equality, it's identity
.equals() is equality
mother-
IDE's should warn you about this
Why? I coded the auth plugin on Fabric with a backend on Velocity. Which event should I use then?
PreLoginEvent I presume?
you might need to make use of the continuation/async event API is velocity to prevent the login process from continuing until your response packet arrives
Did you feck up a core shader?
