#help-development
1 messages Β· Page 1037 of 1
Did that disruptive change make me so famous? π
No you just always touch damage code π
You got it
Because the damage system is full of bugs
indeed xD
π
this is a tragedy
In fact, vanilla code has problems
i have to backport new features to an old mod bc of via version
what do you mean, mojang code is bug free 
I have to say if they do fix the shield rebound issue it will be even more outrageous
Imagine PVPers will be easily repelled by the shields
Maybe Dream can fly by clicking spam at the hunters' shield

Im still not sure where to add the new class
Because orignal nms codes dont contain this new class
no they go into org.bukkit.craftbukkit.whatever
oh thanks
literally how holograms came about
it was created from a bug and then became a legitimate feature XD
WHAT
You mean invisible should hide armor stands' name tags?
I always thought that was on purpose
But they added text display instead
holograms came from a bug with the horses age
if you set its age negative, the horse turned invisible except its name tag
one of the bugs that mojang was going to fix in 1.8 that they randomly decided to announce was this bug and it made a lot of people upset, so they created the armorstand that had this functionality
now we have progressed to having proper entities for such things
Thats cool
so yeah, some of the bugs in the game could be technically features if you used right π
Is there a better/cleaner way to do this?
Or do I really have to extract and set the ItemMeta every time?
Got any recommendations?
Last time I looked for a library on google I ended up with some hot garbage that drains my RAM.
Idk I just made my own
oh wait the Gui library has one
I am very intelligent and always look at things before I ask. (trust)
im gonna make the random assumption that the new spigot 1.21 doesn't have support for custom enchantment datapacks (not complaining, just wondering if anyone else has experienced this in the latest build)
whenever i log custom enchants, i am getting these instead
Depends on how they were implemented
And how you are getting them
Enchantments should be registry backed so you can idewntify them by namespaced key
ah, i am identifying them from what ItemStack#getEnchantments gives
I'll give that a shot
i think Spigot support read enchantments added by datapacks just not exists an API for register enchantments via plugins.
yea, I'm adding these through datapacks until paper is updated
i believe they have a custom enchantment api in the works, probably smarter to wait, but eh
the Registry register thing (not recommend if you use reload/plugman xd) i think.
currently the only way is with datapacks
yea i was using that hack for a little bit but just stopped and started using pdc because it wasn't really needed
So does printing their namespaced key not work?
i mean if you wanna later move to better use the hack way becuase leter only need get the enchantment with the correct namespace
haven't tried yet, I'll check soon just been busy with some stuff
should getEnchantments also work tho?
that is half the reason we have Enchantment as an abstract class
In theory
how do I fix this?
yea works fine on paper
and I don't think we have a patch there?
Weird
If you can reproduce in the latest spigot build please make a ticket
@spice burrow
I mean, the enchantment has to be in a registry, you can't use an anonymous enchantment
if that is what they are doing
but that should error out
very odd indeed
i will make a ticket
minecraft:lucky 

So they key is fine but the name is wrong?
Hi there. Do you think I shouldn't obfuscate a premium plug-in? If so, why?
yea π key works fine
Even the vanilla enchantment name is wrong

dying at the impl of CraftEnchantment#getName
@young knoll opinion?
but yea, getName is iirc legacy enum crap
don't use it
I see
Yea
Do enchantments not have a name internally?
they have a description component
Just a translation key?
They're translatable components
Even custom ones?
Yes
Well, they're components
common spigot moment
They don't have to be translatable
of just "trust me bro imma cast to translatable"

I already have a method in the component API to return the name as a component
So do we just tell getName to getFuxked?
I mean, the display thing could be exposed as a flattened legacy string
e.g. render out translation to english
and gg wp
but yea, choco PR time

Does the server have the english translation?
Yea
See PlainComponentSer- 
but like, why add legacy string methods when you could just merge chocos pr
Because I'm not md ;c

Nope, not true. Modifying the registries is a 1time thing, so reloading doesnβt matter
Shouldn't be hard
If you do commands, no.
yea
If you squint your eyes hard enough, you could just remove the freeze boolean π
But just the registry modification api, it still lets you iirc
Yeah⦠no. Because you have to re-sync the registries.
Yea only commands blocks reloading
And that means configuration stage
Here's my code as well
Why freeze when you could not freeze
Just kick every player into configuration stage 
me when im canadian 
that works so well on spigot
Yea but you get maple syrup so, take it or leave it
Nobody knows or they just dont wanna help?
I remember modifying biome registry while players were connected
Made them very laggy
pretty sure its not the worst gif from tf2 xd
If u didn't send it as txt, probably more people would have looked into it
That is not a high bar 
what do you want me to send it as
?paste
I did try that but...
Feel free to reply ping me tho
HakiPlugin.java: https://pastes.dev/RchbfGt0l9
Error: https://pastes.dev/1I0EbWweNg
SQL.java: https://pastes.dev/IoUU2jbCBe
DatabaseFile.java: https://pastes.dev/sxrQALDABL
I sent every file that might be associated with the error so its easier for you guys to look into it
databasefile is wrong
#getString won't throw an NPE
it'll just return null
which you then also return
so uh, i have a block display model (that is related to a boss attack) and i dont know how to spawn it during the boss fight
the minecraft command is 3.7k lines
i have an idea in mind to spawn it somewhere in the map and have the code clone the entity from that location but idk how to clone entities
How can i get this ip and port from [/ip:port] logged in with entity id in BungeeCord Plugin.
using ProxyPlayer.getSocketAddress() doesn't give the correct address
ip are the same , but port are different
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Entity.html#copy(org.bukkit.Location) (note that this is experimental)
is there something that isnt experimental
the server always display a larger port than BungeeCord displays.
Is there any way to get it from BungeeCord
why do you want the port
to find the connection exactly.
What if you pass the entire signature
i want to make ice not slippery
does this clone the passengers as well
it says "all its data", so probably? not sure though, you'll have to try it yourself
@young knoll does it clone the passengers as well
Uhh
did the plugin startup with no errors?
It didnt even startup
It can;t find your sql server Caused by: java.net.UnknownHostException: null: Name or service not known
I believe it does copy passengers
I'd need to see the startup log. There shoudl be an exception
kek
What should I do now
null check the value instead of try-catch
Spam more try catch π€ͺ
its throwing me a warning since im doing a mixin
like this?
public String databaseHost() {
String host = plugin.getConfig().getString("database.host");
if (host != null) {
return host;
} else {
Logger.getLogger(DatabaseFile.class.getName()).log(Level.SEVERE, "Host configuration is missing");
return "localhost";
}
}
more actions -> suppress?
Is there a way to change player's skin (For everyone) using protocol lib?
Yea
https://pastes.dev/MHg25ujb3K should work now?
try and see
st language to java btw
looks better tho yea
i meant in comment type
comment type?
Got a error in HakiPlugin.java
paste.dev the exception 
Cannot resolve method 'FileManager' in 'DatabaseFile'
Ik I need to create a public void in DatabaseFile
but where
yea i cant find the proper inspection id for the //noinspection comment
//noinspection SimplifiableConditions
doesnt work
Suppress all 
ConstantConditions
list:
- [Hello world!]
- [Hi there!, Hello there!]
list in this example should be able to be cast to List<List<String>>, right?
Theoretically possible, but not certainly
I'm sure it'll be fine :)
whatever
just pray
if the config changes, you have isisues
Yeah
yea
But that's the users issues already
How to send packet remove player in nms 1.20.1?
same error
I found only ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER,(((CraftPlayer) player).getHandle()))
Add player

chatgpt saved the day:
//noinspection ConstantConditions
there's no such option in this case for some reason
nvm
im dumb
i found it lol
but kinda hidden
damn thats what i said
wdym hidden that option has always been there lol
but, ig if you don't know, you don't know
sometimes it is in main options
Hi guys! im making plugin but plugin doesnt work can you help me?
main - https://pastebin.com/VbGfJdMf
https://pastebin.com/14L7Mc6i
https://pastebin.com/4uz39zQY
another one "it doesnt work" π
with some suppressions it is, i've saw it i swear
maybe it could help if you said what doesnt work
dude gone
xd
I'm trying to display a YouTube video on a frame using paper. But when I insert the paper into the frame nothing happens
is there a good scoreboard-api, thats open source, that i can look into?
Is there any nms guru?
?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!
How to hide player using nms? Something like the opposite of Action.ADD_PLAYER
I want to change player's skin, so I have to hide player before adding the fake one with other skin
I have to use nms
well, see what the server does in hideEntity and replicate that :^)
well, no, to another player
I still want to make it using nms
Cause I add player using nms
And I'm not sure that it will work normally
yeah, so, see what the server does in Player#hideEntity and replicate that logic but in your nms code
Kinda nonsense ngl
sure
How to see it? I'm not sure that it's possible to see native code of spigot
yes it is? aren't you using nms?
yes, so you have access to the spigot impl code
CraftPlayer implements Player, and you will find the code for hideEntity there
oh really
thanks
Well.. I did what I wanted, but it didn't work... My minecraft just crashed
I'm working on an animation system, let's say I have a line, updating it is fairly easy, but what if I only want parts of it updated? How can a system like this be properly designed?
example: Time - 5:31
^ static ^ updated
whats updated? the 31?
the time?
just set "Time - $time"?
bad example then, im talking about animations in general
that dont have a int or something
rather color changing
?paste
Just forgot the command and site for me
browser doesnt store that url?
So... For some reason, it doesn't work. It's like the first time I used nms, so maybe someone may help?
https://paste.md-5.net/iwoyaxosem.coffeescript
Minecraft just crashed with this
[19:55:35] [Render thread/ERROR]:
Signature is missing from Property textures
Why exactly aren't you using the api for this
Which one?
PlayerProfile api
i can confirm
It can't? I was under the assumption that was partially why it existed
I didn't know that it's even possible
That's a bug then

no that is a feature request lmao
it can be used for skulls
player skin modification using this becomes very funny very quickly
Well, then it's still problem, If playerprofile api doesn't work like that
if u can help me make specific blocks with lore unplaceable dm me
?pdc use a pdc instead
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
i'm guessing they meant placing the item?
I thought he meant that he wants blocks with lore which doesn't disappear after placing
what
Like lore, that doesn't disappear after placing and breaking the block
once you place a block its itemmeta is gone so idk what you mean
and you shouldn't be able to place it down in the first place :P
I know, but I thought that he wanted blocks with lore, that after placing and breaking (it's drop) still has lore
In that case I would use blockpdc
can u teach me??
yes
i want that
it's literally in the links
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Oh wait
You don't want them to be placeable? Then add tag to item's pdc and cancel the block place event if the player use item with this tag
dms
direct messages
oh
I guess you should just learn the base of spigot..
for cd
?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! π
πͺ
Just use youtube
no i wanna learn
so i use youtube for every problem that bad
all i know are basics of java
nothing else
use chatgpt
If I use fileConfig.set("path.to.this", true) and path or to don't exist, will it create those sections?
yes
to do what exactly?
Youtube has a lot of tutorials of java, spigot etc. in your language (whatever it is)
ah please dont watch those yt vids about plugins, most people will stick to that awfully written code then
^
No its impossible to have inventory immediately, try yourslef how to do. Leave event is called after asyncpreloginevent but before asyncprelogin event the player is again on the server 1 si he van interact with the server (un the same time we should save his inventory in db but the player can change it after)
Its my opinion not sure
how do i get the middle location between the 2 legs of the player
Player#getLocation gets the edge of the feet
You can't. You have to do a check after they join
If you are maintaining their inventory in the db you could wipe their inven on login/join, then update it a few ticks after join
?>
Yes so I need to put it in limbo few sticks but maybe. Because the action take probably few ms. I can put the player in limbo in server 1 and cancel all his events, then save his inv and moove it)
What's the recommended version of shade?
The plugin won't compile anymore after updating triumph-gui to 3.1.8 because of the 1.20.5 item changes.
mine is on like 3.5.0
oh lord mine is outdated then
which compiled everything from 1.19.3 to 1.21
much better
Hello. I have been trying to create a nms item entity and when trying to set the item i get this error. Cannot invoke "net.minecraft.network.syncher.DataWatcher$Item.b()" because "datawatcher_item" is null
why did intellij generate a POM file with such an outdated version lol
damn thats some cursed kotlin
anyone?
wdym?
Anyone know why this is not applying to the player
PotionEffect potionType = new PotionEffect(PotionEffectType.SPEED, speedTimer, speedLvl, false, false, true);
p.addPotionEffect(potionType);```
p.send message under that code and it sends the message fine so I know the code is running but for some reason its not applying the Effect
when a player gets hit by a mob
is one of your conditions not passing
??
What's the difference between a normal jar and the shaded version?
Will my server explode if I used the shaded one?
Normal jar is replaced by the shaded jar, so they are in then end identical
Everything I found online seemed outdated or not full explanation.
How am I able to change players Nametag color, in world and in tab?
how do i get the middle location between the 2 legs of the player
Player#getLocation gets the edge of the feet
add them to a team
and then I think you can set the teams color
if you want the absolute center Player#getBoundingBox() then getCenterX() and getCenterZ()
fanks
Hi does anyone know why unsafe dig_speed enchantments dont show any effect above level 5?
hey does File constructor take fileName, fileFolder or opposite
because I don't understand what "parent" is
anyone knows why this doesnt run on first join
usually file path from main class I think?
if you are using the two String constructor
then it has a couple of uses
first File is just a pointer to a location
it could be a Directory or a file
if you pass (getDataFolder(), "test")
and no file called test exists in teh data folder it points to it
the location
you could then do file.mkdirs() and it would create a test folder inside the data folder
same with a file
(getDataFolder(), "test.txt") would just be a pointer too
if you called file.mkdirs() on that it would make a directory called test.txt in the data folder
Does anyone know how to hide the damage and speed part of the tooltip with triumph-gui? .flags() doesn't seem to do anything.
idk if that's removalbe
smh, mixing components and legacy
how do I include a library into the jar with maven ?
yeah no don't do that
you would shade it
looks good
why it should be a problem
They're fine
It makes so much more code
You can just use MiniMessage
its not really that much more, especially if you make use if the tree structure and static imports
no you don't, you just aren't making the best use of the adventure api
how are u supposed to append text with dif colors?
text().append(text("Stuf", GRAY), text(" is Gold", GOLD, BOLD))
fair enough ig
the docs don't show that
the javadocs very much do
the other docs aren't supposed to spell out what every method does, that's the javadocs
They provide examples
sadly these doesn't change anything :l
:|
and probably having it the most verbose is good there so its more clear whats going on
still not include what I need
when are they removing translated color code support
wot da fook
it include every other libs though
Heya, the docs dont seem to clear, what happens when i do Plugin.getResource(resource), if the resource doesnt exist
Where is that on the docs
I mean it does tell you pretty clearly?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/Plugin.html#getResource(java.lang.String)
declaration: package: org.bukkit.plugin, interface: Plugin
I only see this, are the docs im looking at outdated?
That's in the method list
Ohh I see
Click on it and it will scroll down to more detailed info
Ah so sorry thanks for the help
any help :L
So why are you shading all dependencies
also relocate the dependencies you want to shade
tell me how to correct these
hmm
well they are not all plugins
Set scope to provided
on the dependencies you don't want to shade
oh
these are all set in the main file :l
so how to make it compile?
?
it its removable actually
you are probably using a paper server right?
don't tell me paper fucks this up
you need to apply a custom attribute, only then will it be hidden
like apply random luck or something
and then hide it
I don't get this part
or like a multiplier by 1
well you can add custom attributes to tools
like +2 damage
uh huh
but I think there is also luck
which doesnt do much afaik
but you can also try to add a multiplier that just results in the same value, i.e. multiply damage by 1
but the point being
that now it has a custom modifier
and the flag will hide all the attributes when set
did they add a way to do that in the ItemBuilder or do I manually need to modify the ItemStack?
I have no idea
I did it with item meta since I was already changing the meta
idk about any api
but thats the item flag behavior that paper has
paper fixes it
whatever spigot did to make hiding attributes still work actually breaks items
cosmic user?
you can't hide attributes without setting something to the modifiers either an empty list or some modifiers (can't be an empty list for armor, thats a vanilla issue tho)
it breaks the functionality of I see attribute, I try to hide it with flag
hello is there anyplace i can report a bug like on the websiute some whereA?
but no, you cant hide all attributes because you didnt add a custom one
Like a Spigot bug?
yea
?jira
?jira
?jira
sniped
?jira
Thank you! lmao
ty!
._.
you can set an empty map of modifiers, but that actually does remove modifiers
any custom modifiers set completely override any modifiers that are default to the item type
including an empty map
if the item is just for a gui, then yeah, doesn't matter
popos is nice
btw when I discoverd this paper "feature" was when I found out there is a scale attribute which can literally change your size xD
how old is is that attribute
is this the correct way to launch an entity? because it only seems to work when its falling or doesn't have a block directly under it.
// Set the new velocity (keep horizontal velocity as it is)
entityToLaunch.setVelocity(entityToLaunch.getVelocity().setY(launchVelocity));
1.20.5
oh that expains it haha
I feel like you keep talking about it as if the behavior on paper is wrong. its as close to correct as it can get
its very funny though
vanilla needs to support not setting any modifiers but hiding them
there's an open mojira for it cause it doesn't support that behavior
its better than breaking itemstacks by randomly actually removing modifiers when someone just wanted them hidden
I mean sure papre might have fixed the actual breaking logic, but like
take a regular sword, set hide attributes on spigot, and the sword no longer has its default modifiers
its just feels like why couldnt they have just done the extra step and kept the same functionality in the end with like hiding the attributes
because you cant hide attributes without setting some or an empty map of attributes
yeah, but that sounds like awful behavior. someone calls setItemFlag(Flag.hideattributes) and suddenly it adds a random modifier?
that's not good API, just adding modifiers behind the scenes when someone sets a flag
i have not missed this from the old app
but neither is having a flag called hide item attrbutes that doesnt hide attributes by default
idk
its an issue with the ItemFlag API itself
maybe there is just no other way
its not just attributes that have this problem, its just the most commonly used item flag for this
Is their a diffrent function you need to call for when a player is standing on a block?
Because atm I have a plugin where when they get hit they get launched 5 blocks in the air
but they only get launched when they are already in the air and when they are standing on
a block they dont get launched
Here is the event code: https://pastebin.com/sd84HpDg
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
amd drivers on there arent
different compared to what
I've got a system76 laptop so no complaints π
Sorry forgot to put code
Or better yet is their a reason why velocity dont work when a player is standing on a blcok but does work when they are hit already in the air ?
?whereami
any way to get the title of a currently opened menu?
why the whereami?
get the open view from the player and get the title
inb4
?gui don't use titles to see which GUI you have open
InventoryView has a title
sure but you really shouldn't use getTitle
depends on what use
there is almost 0 use for that method
I mean I genuinely can't think of a good one
99.99% of the time someone asks about a title they're just doing a naive GUI implementation
read the thread above
yeah I'm trying my best to avoid that
you're exposing whatever plugin this is to possible exploits
yeah the only time you touch the title is when you set it yourself
and really setTitle should be called sendTitleChange you're just throwing a packet out
I wrote that API
dumb developer
I was told to change it to setTitle
setting the title for the view on the server side though does work
it does more than just throw out a packet
it sends an container open packet than edits the title field in InventoryView
oof
IK paper doesn't like that method, but I find it quite useful, even though it is a client quirk that allows it
this could have really been such a nice "send packet method"
like, that we would have pulled
the fact that it fucks around with the state is so ass
cant we just have a send packet method for all packets :/

I mean the original title state is preserved though, even though I agree, now my thoughts have somewhat changed from what they originally were.
ducktape is amazing πͺ just better hope it doesn't rain
Can't you just make another pr that does it the way you want then?
sure but they offer 1:1 spigot compat rn
or very close to it
Hi, how could I confirm if a tree is 'natural', so if i wnat to make a quest to mine a 100 wood, how could i confirm its not wood they have placed down
Probably through meticulous seed generation comparison code.
naive approach imho
just count the wood in their inventory
you could get away with your own metadata or PDC here
PDC >>>
literally just apply a byte to a block you can do this super easily with blockpdc
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
if you only apply 1 byte you don't really have to worry about storage
Do placed blocks actually store data now?
Ahhh
@eternal night I actually had a question for you. I've been playing around with the new InventoryView API to ensure it works smoothly, however, with my current implementation I found a strange issue.
If I set anvil repair cost in PrepareAnvilEvent it updates under the conditions
- Shift Click Occurs into the Anvil
- Item Text is changed
It doesn't change if a regular placement occurs though.
I narrowed it down to a packet update spigot does, but I'm confused why specifically it causes an issue with regular click.
sendAllDataToRemote(); // CraftBukkit - SPIGOT-6686: Always send completed inventory to stay in sync with client
This is the exact reason it updates for Shift Click's and Item Text changes, but it won't for regular placements unless I send it again a tick later
anvil.setRepairCost(10);
// Bukkit.getScheduler().runTask(this, () -> ((Player) event.getView().getPlayer()).updateInventory());
my main wonder is why does a regular click not send the correct data to the remote even though I've confirmed that its set correctly in the data slots
Lemme finish paper and read π
I mean... it also breaks the client
it breaks drags and other various things depending on if the click event is cancelled or not
Whats the best way to replace text in a chat message without sending the message again? or is it just not possible?
i feel like if i took their message then cancelled and changed it and broadcast it again thats inefficient.
why not just change the message in the chat event? π€¨
lynx ip leaked totally real
yeah he has all the IPs
now how is this any different in functionality
private static int indexOrThrow(char value) {
byte idx = -1; // dummy value to make the compiler stop complaining
Assert.isTrue(
value < MAX_RANGE_CHAR && (idx = indexLookup[value]) != INVALID_IDX,
"character %s is not allowed in a symbol name", value
);
return idx;
}
then
private static int indexOrThrow(char value) {
Assert.isTrue(value <= MAX_RANGE_CHAR, "character %s is not allowed in a symbol name", value);
byte idx = indexLookup[value];
Assert.isTrue(idx != INVALID_IDX, "character %s is not allowed in a symbol name", value);
return idx;
}
(
static void isTrue(boolean condition, String fmt, Object... placeholders) {
if (!condition) {
throw new SyntaxException(fmt.formatted(placeholders));
}
}
)
somehow first one somehow decides to throw
Sorry for ping but it shows me again like Material is deprecated.. I must always check for updates or smthng is wrong with my InteliiJ?
Not sure
Hi does anyone know why unsafe dig_speed enchantments dont show any effect above level 5?
What do you mean effect?
Hi , when iam using redis (jedis) server freezes
Does the server guarantee the order of execution of event handlers to match the order in which the events were created in?
Don't use it on the main thread
where i should run it then?
it should be onEnable
subscribing is blocking the main thread ..
No. If you want to guarantee order, you use priorities
What if the other plugin is already on highest :(
loadbefore
Bukkit.getPluginManager.disablePlugin(...) >:)
What if they use monitor! Clearly we need monitor+
what if they use monitor+
Can an annotation even use those
thats just so overkill lmfao
most certainly not
just take a string you pass to the ctor
Perfect
devs gonna fight until the server runs out of memory
Look my listener is simply the most important
my brewing stand broke guys
If only brewing was that fast
new inventory PR coming soon π«’
you can make it that way π
@river oracle You left at the worst time. I just got it to work.
π₯³
wondering, I was working on a cutscene system and realised setting the pitch & yaw of a location doesn't actually set the players yaw & pitch to those values upon teleportation, is there a different approach to this? Setting it directly via player.getLocation().setYaw/pitch doesn't set it either.
I swear that method didn't exist 2 minutes ago
.. thx I'll try
yeah that method does exist, but you're not actually allowed to set the rotation of a player "and you should consider teleporting instead", unfortunately teleporting doesn't set it either π
xd
yeah the debug is just funny. Printing x y z yaw pitch of the location I teleport to gives me the values I want. printing the player values right after teleporting gives me the x y z, and then just yaw and pitch r completely thrown out the window
not sure thats even a my-code problem anymore tbh?
For the record, this doesn't exist on Spigot
Smh emily
Uhh blame choco
eh, not really blaming anyone
just not sure why setyaw n setpitch do absolutely nothing
And it's getting slightly irritating after like 3h lol
because getLocation returns a new Location each time, so you'd have to teleport the player, but you said that didn't work so idk /shrug
Vanilla. Bukkit. Spigot. Paper. My grandmother used to tell me stories about the old days, a time of peace when Aikar kept balance between the Bukkit Tribes, Spigot Kingdom, Paper Nation, and Vanilla Nomads. But that all changed when Wolvereness' DMCA attacked.
My great grandfather faught in the DMCA wars it was a time of tremendous struggle and pain.
Only he could stop the ruthless paperbenders. But when the world needed him most, he vanished.
Anyone know if CoinsEngine has a public repo? Their .readme isn't very helpful lol
that is the repo.. it does have other files besides the readme lol
:PepePoint:
Oh then I'm just dumb
I need to hook into it D:
Infection be gone
You know what. I should probably add some sort of check to BT to see if those have been set and inform people if they have been set to what it once was so they can change it back.
Is there any way I can get the hook on the head?
https://imgur.com/a/TrmgGmn
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
Oh you have the right one
thanks
https://prnt.sc/_D1gzh6I0qTC
Usage: !verify <forums username>
A private message has been sent to your SpigotMC.org account for verification!
!verify nonymous13
A private message has been sent to your SpigotMC.org account for verification!
so I'm trying to get the entity hook that the player has on his head, is there any method to do this?
Turns out it exists on Spigot, I just don't know how to use a search bar
Just been exploring Bungee Plugin Messaging and I'm kinda stuck, so in the spigot server I want a placeholder to get the balance that the player has, but the problem is the data is in bungeecord server, how can I get the data from bungeecord to spigot server and display it in PlaceholderAPI placeholders?
If I have a Bungee server that is running my Party system plugin on the proxy and I want to be able to access cached information from the individual servers running on the network, what is the best way to go about this?
You on J21?
Some weird shit can happen If you're under j21 developing latest
Otherwise could just be eclipse being weird
If it compiles that's all that matters
π java 5 wtf
idk
What version are you developing for like mc version
i use 1.8 for all of my projects
1.21
im on J18
JSE1.8 is java 8
This is my attempt of getting data from BungeeCord to Spigot server, it looks so bad lmao. I'm trying to do it with one method like double getBalance(org.bukkit.entity.Player), what is the best approach here? Here is the code https://paste.md-5.net/oxodefuves.js
builds on a literal 20 year old JDK
Oooh, nice
This is very good
What about packets? Can you even add custom handlers to them?
Ping when answering please
There are 3rd party libraries for that
Use PacketEvents or ProtocolLib
packetevents my beloved
^
^
hey guys, is there any way to get blocks in a chunk?
I tried this :
public static int[] getMaterialAmount(final Chunk chunk) {
final int[] amount = new int[Material.values().length];
final int minX = chunk.getX() << 4;
final int minZ = chunk.getZ() << 4;
final int maxX = minX | 15;
final int maxY = chunk.getWorld().getMaxHeight();
final int maxZ = minZ | 15;
for (int x = minX; x <= maxX; ++x) {
for (int y = 0; y <= maxY; ++y) {
for (int z = minZ; z <= maxZ; ++z) {
++amount[chunk.getBlock(x, y, z).getType().ordinal()];
}
}
}
return amount;
}
@Override
public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) {
long time = System.nanoTime();
final int[] amount = getMaterialAmount(((Player) sender).getLocation().getChunk());
time = System.nanoTime() - time;
sender.sendMessage(ChatColor.GREEN + "TNT: " + Integer.toString(amount[Material.TNT.ordinal()]) + "! (" + DECIMAL_FORMAT.format(time / 1000000.0D) + "ms)");
return true;
}
But It's not work at all
how can I get blocks in a chunk
?paste
'to me?
Yes.
And please explain if you have errors, or whatever
.
.
I've tried this : https://paste.md-5.net/kebiruhoye.java
but the error said :
0439)
[16:23:51 ERROR]: Could not pass event BlockPlaceEvent to ShibaHopper v0.1
java.lang.IllegalArgumentException: x out of range (expected 0-15, got -736)
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:193) ~[guava-31.1-jre.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftChunk.validateChunkCoordinates(CraftChunk.java:398) ~[purpur-1.20.1.jar:git-Purpur-2001]
at org.bukkit.craftbukkit.v1_20_R1.CraftChunk.getBlock(CraftChunk.java:107) ~[purpur-1.20.1.jar:git-Purpur-2001]
at kr.shibapark.hopperlimit.listener.HopperListener.getMaterialAmount(HopperListener.java:35) ~[ShibaHopper.jar:?]
at kr.shibapark.hopperlimit.listener.HopperListener.onPlace(HopperListener.java:17) ~[ShibaHopper.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor122.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:git-Purpur-2001]
The question wasn't answered
Is network order preserved for handlers?
It takes relative coordinates not absolute
It's a serious question π
You never asked about the order?
I asked about normal events and then about packets
Anyways I believe it's the same as regular listeners with ProtocolLib, set the priority. Not sure about packet events
Hmm
I'm interested in how the server works under the hood. Does it handle the packets in the correct order internally, at least?
When does it even handle the packets? Is it in some part of a tick? Or does it have a separate update cycle?
So the order of execution for event handlers is unspecified between event types? Assuming they have the same priority
Also, how do things like ProtocolLib allow you to add packet handlers? Do they intercept traffic, or is it something in the server exposed that they catch?
They inject a packet handler it to netty
Which is the network library used internally
Oh, okay
hello
guys i hope anyone help me
i have build tools, minecraft nms 1.20.4_R1
i try to make npc but i dont know, i hope any one help
java.lang.IncompatibleClassChangeError: Found class org.bukkit.inventory.InventoryView, but interface was expected
Thoughts on how one would support this and previous versions of spigot?
I can update my spigot builds and change it to an interface, but then it will break any versions before this commit
People changing stuff just to make me do more work π’
hi , question how i can get a data from config file that use bungeecord api?
this does not work ..
it send empty data
but the file is there , and it have the correct data structure
Multimodule for older versions
If you're just trying to support older 1.21 builds don't bother
I recommend just using Citizens
++
any idea?
You're getting kits.kits.key
I doubt that's how the file is structured
You get used to it π
tbh, I already got a bunch of version specific code....
spigot just likes changing stuff to watch us suffer
i don't recommend support older versions its really painful π¦
atm I support 1.13+
i did it , many times .. really painful and waste of time and effort just try to support 1.19+
soo?
So fix the path in the code
you mean the section?
You already have the kits section there's no need to get it again
Remove the path variable and just use key
Yeah ItemStack class isn't going to work on Bungee
You really should setup your project properly so that import isn't available
Use multiple modules
Runtime ASM of course
If you're extending InventoryView that's on you
I am not
We don't support API Extension
I believe thats the code its failing on player.getOpenInventory().getTopInventory()
Then that's a bug it should runtime asm everything
Please make a jira report
Not sure how that breaks it I ran many plugins on that build
The problem is compiling against new version not working on old servers
Ahhh then cope kekw
That ASM thing is for old plugins to run on new
Oh in that case you can even use MethodHandles
Not available in J8
@radiant aspen nvm don't report that I wasn't aware you were going new to old
Yeah nothing we can do about that
supporting old versions goes brr
I think they are actually
who know nms?
I currently compile against org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT

?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!
they are
yes
MethodHandles should be a J8 thing, might even have been introduced in J7
No one does
We're not going to spoonfeed you how to make NPCs
If you don't want the error compile against an older version
if anyone claims to know about NMS, they know so little about it they dont understand how much they dont understand
Use Citizens
Sure, but then I wont support new versions
Which is dumb
It's always recommended to go
old _> new vs vise versa
that's a solved problem already
You can modularize easily
But then I wont be able to support anything below 1.21 no?
Compile against your lowest wanted version than have a module for each version
Yeah, which is super dumb
Not really it's the reccomend way to do legacy support
It's the easiest way to avoid random issues like this
Doesnt make it less dumb
What's dumb is support 10+ year old legacy api for people who won't update
That's what's dumb
I wouldnt really call 1.20 "10+ year old legacy"
1.20 still contains code that is ridiculously horrible We're moving forward in some areas that is long overdue
I mean Im not really sure how much benifit moving from an abstract class to an interface provides tbh, seems fairly minimal
You have 0 clue it's extremely beneficial
Ig wait and see
The fact I actually convinced md to make a breaking change says enough
I do have 0 clue, you are correct. I dont know too much about the inner workings of Spigot
but It means I have to do work, which is annoying
because instead of doing work, I would rather not do work
because not doing work > doing work
Just switch to doing multi version support in a sensible way
I currently have this which is where all the horrible scary code I dont want too have to deal with goes
I mean its not too bad tbh, its just I dont like dealing with it cuz every time I do, It reminds me of how much I need to clean it up
I also gotta update my tests now cuz they are failing aswell
it shouldnt take to long to be fair
I just like complaining π
Yep just a warning this is simply the first domino so jump ship while you can duck tape won't fix this
May I ask, where is this heading ?
Pretty much every abstract class is going goodbye
What else is planned
what other classes are abstract?
I am convinced they just like watching us suffer....
Almost all enums and abstract classes are being converted to interfaces to be backed by NMS registries and hopefully eventually an API for registering data driven components using this registries.
As far as InventoryView I'm modernizing the Inventory api pretty much all of the internals are being rewritten. And most of the curren creation and InventoryType will be deprecated and replaced with a more modern and capable api. The backend of the old api will be replaced by these new internals to ensure compatibility
Sounds like its gonna break basically everything :/ when will this be finished?
We're asm most things it'll only break compile time
ABI is maintained
ABI?
Binary interface
Im most concerned about version support, it feels like its going to be extremly difficult to support anything 1.20 and below no?
whats that statement even supposed to mean?
I mean given you use this weird reverse system you do very likely will be yeah
Well what would you reccomend instead?
and dont say drop 1.20 < support
Application binary interface. It means that at a binary level we will rewrite everything
thought you meant the api contract would be unchanged
Switch to the lowest version API and work your way up instead
Vs working down
The only huge change is deprecating Material tbh
Most people won't notice other stuff
ASM will do heavy lifting
asm will do what?
Rewrite invoke calls
but that wont work either no? if I implement org.spigotmc:spigot-api:1.20.0-R1.1-SNAPSHOT (which is before these changes) which makes InventoryView an abstract class, then it will support 1.20< but then It wont support 1.21 no?
At the binary level
you're saying a lot of magical words without any meaning :)
Idk how to simplify it. Yk how jars have class files with bytecode right?
yes
Dude, its not that hard. Hes saying hes re written the binary matrix transformatin implementation which will result in the switch trip translation being obfuscated into a new language model.
clearly
Spigot has a class called commodore and it loops through method calls to search for out of date methods and classes used and reroutes or rewrites to the updated or expected byte code
:/
Hopefully that simplifies it idk how else to simplify java asm
Basically its magic stuff which turns old methods into new methods automagically
lol
So if I implement the old API here, it should magically support both the old and the new version? and use either the abstract class or the interface class depending on what version its on?
Spigot uses the api version your plugin is iirc for the rewrites
Tbh idk completely the checks they use derfrzocker wrote most of Commodore
if (e.getView().getTopInventory() instanceof BrewerInventory) {...}
what's happening here? what changed with 1.21 that this now throws this error?
Welcome to the club
what on earth is donkey kong? new king kong classic?
Welcome to the conversation that's been happening fie the past 30 minutes
man
lol
so this is ongoing and no solution is found yet xd
Itβs a painting
Well it's solved you jjst should not start at new version then go to support old version
Not sure what to say we can rerelease finalized versions with an update thats quite silly
So whats the plan for the Material changes aswell, that sounds like its going to be a huge thing aswell?
Is this changing every enum aswell or just Material (im assuming every, so EntityTypes Biomes ect)
wait im not understanding this, so you cant make a plugin compatible with versions 1.21+ and below?
The other enums will be yeeted and replaced with abstract classes
From what I understand, if you compile it with version 1.20, Spigot will do magic stuff and it should support 1.20 and 1.21
interfaces no?
Or was that changed
So what will be the new way to do this?
ItemType / BlockType
π€
its nice that blocks and item types will be data driven now tho