#help-development
1 messages · Page 1180 of 1
you're not setting the ItemMeta back
it just shows a space
maybe its the purple
no
its not the color
im not sure whats wrong
something is happeing to the item cuz normal swords dont have that space
but text wont show
/data get @s SelectedItem
would be 10x faster to learn the spigot API but he's deciding to rawdog it
that commaned does not work
but
running it on my self
shows it kind of
customenchatattempt2:venom
oh there /data works
the lore isn't being set
code says otherwise
getLore() returns the set lore
It may be returning an empty list?
hard to say when you only post screenshots of 10 lines
instead of your actual source code
because that code sets the lore
okay so post the rest of it
it may be ran at all
you're asking me to work with very limited context
see that extra space
its not there if i dont modify anything
so i know the lore is being modified
just not to what i want
is it a client issue?
but my code says otherwise 😭
thats irrelevent
indeed
okay i got it
yes?
thats alot of work
spaces help me organize
no one will care unless they decompile
this person does not care, they never read anything I say fail to follow well outlined guides and refuse to improve their java knowledge before continuing
but names r okay
my java is enougj
you're not going to write good code in the future if the code you write now continues to be awful
your java is not enough
Player player = (Player) commandSender;``` this sticks out like a sore thumb
the problem i asked u for help with was not caused by my lack of knowledge
in java
I don't know what your problem was caused by because you never told us
one with enough java knowledge would know the naming conventions
like not naming your class 'venomcmd'
does this need to be public and open?
the fact you're naming it '2' signals you don't have a version control system
cmarco behavior
(it's not)
(you're in denial because doing the process itself takes longer than just achieving what you want right now)
(even if it takes 1.5x longer to do anything)
declaration: package: org.bukkit.event.inventory, class: PrepareAnvilEvent
getView
getItem
what about the result?
u right
javadocs
you mean you were trying out
having enough java knowledge also means being able to read javadocs
I know how to read it
so for my project structures i have the mainfile then i have a folder called enchants where each enchant i want is a file like venom.class
now I can only have one event handel
so im thinking of giving
every single enchant file
the event
to processes it
(like in the file it will check if the enchant book that the player wants to use matches it)
idk whats the better way to do this
but anyways after I pass off e to venom
i cant access certain parts of it
why is an AnvilView named e, the event for preparing anvil is called envil, and your class name for venom is all lowercase???
youre passing in an Event and then casting it to a player???
oh yah ignore that
i think its time for me to get sleep
my brain will work better in the morning (it wont)
im not even religious but lord have mercy on anyone reading your code
dont just name things random bullshit like e because no one knows what a single letter means, unless its like catching an exception or something
it also doesnt even save time because autocomplete exists
this doesn't logically make sense
passing events to a file (I know as some in-memory abstraction)
ideally you would have your config files read into their own discrete objects
and a flexible config system
He used sleepiness to cover up his lack of knowledge of Java
you might say he needs a cup of java to learn java
Lol
why would i lie
if i wanted to cover it up
it would just deny it
like every
other single time
🤫
Lol
I do some spigot dev during school break too
That’s why my hours are a lot sometimes
based
per day?
then yeah its p good
if its per week, you can do better.
I get like 6-7+hrs a day
it's per week
I know I can do better but at the same time I've kinda ran out of things to do
Nowadays if I'm coding I'd like to get paid for it
Personal projects don't bring me much. Sure exposure and portfolio is fine but I'm already good
dude I wish
- i am not good enough to do paid projects
I am, womp womp
I mean just look at my code.
There comes a point where you can do a lot in very little time
Yea
So pushing yourself for 30+ hours a week takes a toll on your mental because you're thinking a lot more and throwing shit at the wall a lot less
You mean like getting a redbull and a kebab and eating it in about 2 min
I mean, with skyblock I get to do testing and stuff so its a lil fun
~70% of my code works first-try
I got so used to my redbull breakfast that I could just chug a can in under 10 seconds
Kekw
you appreciate it a lot less and it just kicks in all at once
Illusion do you ever eat something that's not takeout
ur mum
no u
I'll prob go to the store today and get some frozen pizzas n shit
also 90% of my meals are delivered, not takeout
you really think I go outside?
yeah
learned last week that lidl has pizza pockets
right I meant that
I'm doing an active effort to have less food delivered and just eat more frozen stuff
mostly because I'm 19 and I'm spending at least a minimum wage in food every month
and that's too much
I can instead spend half of that in food and the other half in other stuff 😏
like christmas gifts
and alcohol
More monitors
sure
okay but do you eat it frozen or do you fry it again
microwave / bake
I have an air fryer too
I don't really use oil when I "cook"
if I do I just dip a napkin and use it to coat a frying pan
then fry my egg or whatever
I would hope you don't, keyboards and computers aren't compatible with oil
genz humor type shit
go back to doomscrolling
but yeah back to working for money
I wouldn't really say I'm having fun when coding anymore so there's zero excuse for me to work for free
Those who know 💀
make fried rice
shit is so good and so easy to make
shit
Same for me, doing personal projects feels useless.
Hello I'm trying to create a BlockData with only the tag open for a barrel.
So I typed : BlockData toAdd = Bukkit.createBlockData("minecraft:barrel[open=true]");
But then when I parse the 'toAdd' blockdata I have a new tag in addition : facing=north.
Someone know why (maybe its a bug) and how I can create a clean BlockData with only the tag I specified ?
BlockData always has all tags, but explicitly set ones can be manipulated through eg https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/BlockData.html#merge(org.bukkit.block.data.BlockData)
declaration: package: org.bukkit.block.data, interface: BlockData
Or https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/BlockData.html#getAsString(boolean) with true
declaration: package: org.bukkit.block.data, interface: BlockData
Okay so I think I can't create a Barrel item that has only the tag open
Yes you can, it just needs to be manipulated appropriately
but with merge I cant delete the tag facing ?
Well you'd merge it onto the existing block which has the facing yeah you want
I dont want any facing
A barrel will always be facing somewhere
not when it is an item
it can be undefined
/give @s barrel[block_state={open:"true"}]
It places an open barrel and the facing it determinated when the player place it
I've pushed a fix
Damm that was fast, thank you !
The method Bukkit.createBlockData("minecraft:barrel[open=true]") still generate the unpecified tag
toString shows all tags
Okay it's fine thank you md_5
getBlockData(Material material) applies also the defaultData that is why I was confused, in my testing code at first I get the data from one item and then parse it into another.
I opened a suggestion ticket for that https://hub.spigotmc.org/jira/browse/SPIGOT-7963.
Since I work on the barrel : /give @s barrel[container=[{slot:0,item:{id:apple}}]]
by any chance, is there a way to read the container tag?
Otherwise I will try to do a PR
Ty I tried, but I see nothing maybe something in my side, I will double check
Cast the state to container
for my network wide party system should I be caching parties for each spigot server and then write communication between servers to update their cache when a party changes for example a player leaves
or should I just database lookup every time I need to get a party
first one i’m guessing tbh
You probably want something like redis
yeah I wrote that framework already
so it’s chill
just dreading actually rewriting the party system
I want to have a party manager class but not make it fucking massive
cus of all the if checks to check if player is in a party or checking for owner or checking party size etc
any tips to avoid this
just look at how other plugins do it
true
https://github.com/simonsator/BungeecordPartyAndFriends this is the first one I found, don't know how good it is
I just did this recently, can confirm all the owner/party member checks are dreadful lol, best of luck 🫡
https://github.com/Dominik48N/party-system finding a velocity one that was updated took me longer lol
I can keep it all inside command code I think
tbh
and just have party manager only accessing like the database and the list
It works thank you
props to that guy the code looks really well written
is there much performance negligence by looping through a map of parties every time I need to get the party of a player?
or should I keep a player uuid to party id map somewhere
I mean, if you don't expect to ever have a ton of parties, it shouldn't be an issue, but the fact that you have to loop over anything when you got a key-value map definitely strikes as a code smell
Is there a way to obtain a list of all permission groups with spigot api, instead of using a permissions plugin api like luckperms?
only with Spigot, you'd have to get their effective permissions and check for group.<something> type of permisisons
if you extend yourself a little with Vault, you could do Permission#getPlayerGroups
but generally, you'd want to use luckperms API anyway, nobody sane is using anything else
Thank you, appreciate it 🙌 Will look into it
true, I was thinking of keeping maps tied to a uuid and then maybe saving player party to database
use something like a BiMap if you don't want to keep two maps around
interesting
package de.thenobrainguy.serverplugin.lobby;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
public class LobbyPlayer extends JavaPlugin implements Listener {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
@Override
public void onDisable() {
}
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
Inventory inventory = player.getInventory();
ItemStack itemInSlot5 = inventory.getItem(4);
//
if (itemInSlot5 != null && itemInSlot5.getType() == Material.ENDER_PEARL) {
if (event.getClickedBlock() != null) {
player.sendMessage("block");
} else {
player.sendMessage("air");
}
}
}
}
why is Material do not work
?paste next time and update intellij
Anyone familiar with attributes for a Minecraft version which is about a decade old?
@pseudo hazel It got approved.
attributes haven't really changed since their introduction
How exactly do you add an attribute for an item?
I see
https://github.com/aadnk/AttributeStorage/tree/nms/AttributeStorage should be pretty much the same for 1.8
which event to use to change the biome into a snow biome AFTER generating a chunk and its buildings so that it snows instead of rains.
just set the biome of the chunk?
RegionAccessor#setBiome, World is a RegionAccessor
This may prove to be much faster (4-5x)
They definitely pulled that number out of their ass
I bet it's around x1.2 times faster after caching
eh, it could be that they weren't caching the Method instance
Aha explains a lot
Or 1.12
nowadays with cached method handles, you get same speed as direct access
You do? Damn
yeah, method handles avoid having to check for access on each invocation by having a trusted lookup instance, so it is pretty much the same as directly calling a method yourself
how to make a command execute every day at the same time
Assuming real time; you can use the ScheduledExecutorService
compile properly first
thats a very good place to start

can i not add lore to a book?
Idk, but may I suggest not overriding the lore, but instead adding to the existent one?
there is no lore tho
existing
Oh you are applying it to the book, not the item. Sorry
The error tells you about the enchantment not the lore. Customenchattempt2, Line 40
Idk what you doing in addGlow but he dont like it
Oh right
Could someone throw a spoof implementation of ServerGamePacketListenerImpl for 1.21.3 at me?
For NPCs
Wdym
I've used an implementation with a dummy connection so that i can add it to a ServerPlayer
this.nmsPlayer = new ServerPlayer(MinecraftServer.getServer(), world, gameProfile, ClientInformation.createDefault());
this.nmsPlayer.connection = new PlayerConnectionSpoof(this.nmsPlayer);
you can just give the connection of the player if it's packet only
but this is pretty interesting
public class DummyConnection extends ServerGamePacketListenerImpl {
private static final Connection DUMMY_CONNECTION = new Connection(PacketFlow.SERVERBOUND) {};
public DummyConnection(ServerPlayer player, Profile profile) {
super(MinecraftServer.getServer(), DUMMY_CONNECTION, player, CommonListenerCookie.createInitial(profile, false));
}
}
Thx
this works too
you shouldn't really
well for me it wasn't fine
it's one of these packets who need the connection anyway
and i looked it up and it doesn't need it for much
ye
this is why i think
it was really safe for me to just pass the player connection
does some1 know how wynncraft made their character selection, so that the player cant move its head? (with no lag, you cannot move at all)
something boat related maybe?
can you not move the head in a boat?
i think so? not sure actually
spectating an armor stand possibly
couldnt i then leave with shift?
you can cancel it
thank you guys, im gonna try it with armor stands
good luck 😄
You can spawn a boat entity, make the player ride it and then set the player's camera to another arbitrary entity
e.g. you can spawn the boat at y=10000 but have the camera be at y=20
https://pastes.dev/TeRzLOgXAM this is what I do for my stuff
(yarn mappings)
(this is said stuff)
That's pretty slay
thank you
you don't deserve it
@blazing ocean thx
Does anyone know more about the new custom model data conditions
pretty sure they're just model conditions
Specifically, I know there’s a condition for when the player is hovering over the item and holding shift
not CMD conditions
Is it possible to somehow change the lore with that condition or only the model
Sadge
[21:01:34 ERROR]: [global] TIMING_STACK_CORRUPTION - Look above this for any errors and report this to Spigot unless it has a plugin in the stack trace (TimingIdentifier{id=Minecraft:plot_46 - doChunkMap} did not stopTiming)
?whereami
do you have the ability to read
no
i heard it's a great prerequisite for asking for help
what should i do?
(TimingIdentifier{id=Minecraft:plot_46 - doChunkMap} did not stopTiming)
Start from the top
mf
what’s with the rudeness
I propose every time a stacktrace that tells you to report the bug to whatever fork shows up, that we halt the server and force the user to acknowledge they have read the error message by forcing them to type in the full message. (Which would include the name of the fork)
100%
???
Look above this for any errors and report this to Paper unless it has a plugin in the stack trace
and
bruh
"and"?
lmao
dude
what do you want from me
Are you incapable of doing what that message said?
you've got to be trolling
nah md_5 made paper 👍
ah yes just 1000+ patches
Did you
Oh wait, you right. My bad chief
LMAO
Hmm, could an IDE be wrong? feel like my code is right, done this method plenty in other projects
Doesnt matter what combo, seems to get it wrong
How to run world creating task asynchrounosly?
No idea
what is problem to create world asynchrounosly?
idk man maybe you know the answer
and just say me it
i need to rewrite whole bukkit/spigot ?
who has hypixel server jar
that is not something that is supported by the API in spigot
@worldly ingot!
hypixel does
this guy is not real
cause i am AI?
i think ai is smarter tbh 😭
You sure fucking act like it
Not GPT-1
@worldly ingot can give you the hypixel server jar
i need it for a school project
I need it for educational purposes only
My grandma is sick and needs it to get better
the world will explode if you don't send the hypixel server jar to HYPIXELSERVERJARURGENT@radsteve.net
🫵
has someone found a way to change player tags (tablist & above head) with ProtocolLib in 1.20+?
just send a player info update packet
i know this is paper but im banned from paper discord,
is there a way to use Placeholder.parsed() on something that is ALREADY a component
idk i cant rmember
Some people just can't avoid breaking rules
i dont even think i did
idk man could u help w my problem tho
try asking paper 👍
good job
Placeholder#component is the answer for the record
that is also not Paper-specific API, but adventure's so it should be fine to ask anywhere really
yk how ppl be in here
i just thought it was funny that you were "banned"
nah thats not what i mean
like i cant call mm#deserialize cuz that takes a string and placeholder
but i have a component and placeholder
You can convert it from component to mini string
how
Check the adventure docs
there should be a better way to do this, give me a second
probably
thanks g
Practice reading the docs in the meantime
wait, how does the component contain the placeholder? Is it just a string there?
it's very annoyingly abstracted and implemented in a weird way, I hate using it
yeah i know
what im trying to do is fix legacy code
and yes it used the wierd text replacement system
but surely theres a btr way now
the best way for that is really the text replacement system
aight thx for the help guys
ideally as Coll said, you keep it as a string until all the mm placeholders are parsed
aye
if you do want to convert it into a mm string and back like Olivo suggested, i.e. for chat messages which you have no control over
you just have to MiniMessage#serialize then deserialize
is it okay to ask paper questions here?
?whereami
Yeah I understand that, but is it that big a difference
have you considered asking in the paper discord?
They scare me
weirdge
That’s not less spooky
paper-specific API is a bit of a reach, but there's people who are willing to help either way
rather than asking if it is allowed, just ask the question and hope for the best
you'll either get mocked for not asking on the proper discord or just get help
Or both
Hey, I have something of a bit dumb question I don't know if anyone here can help me:
So, I've created this custom entity that performs several actions, and I want it to keep doing its thing even when no players are nearby or when they're offline.
Initially, I thought about tracking the ChunkUnloadEvent and canceling it if the entity is within that chunk. However, I discovered that since Minecraft 1.14, ChunkUnloadEvent can't be canceled anymore.
As a workaround, I set setForceLoaded(true) on the chunk and then scheduled a runnable to set setForceLoaded(false) after a couple of seconds to prevent the chunk from being force-loaded indefinitely, as I believe this method works in vanilla Minecraft. But then I realized that ChunkUnloadEvent.getChunk().getEntities() often returns an empty array because entities are unloaded separately...
So, I tried the same approach with EntitiesUnloadEvent (which also can't be canceled). But I'm encountering two issues:
- As far as I know, there's a limit on how many chunks can be set as force-loaded.
- These workarounds seem somewhat sketchy to me.
So far, I haven't found a better solution. I'd be interested to hear if anyone else has faced a similar issue and how they managed to tackle it in a more elegant way...
What actions are being preformed? Could you not just keep track if how long the server has been running and then calculate what should have happened in that time. Rather than actually trying to do that thing with an entity constantly?
It's a custom NMS entity with an extensive codebase and AI.
It acts essentially like a player.
For something simpler like a "Farming entity," that approach might have been ideal, but due to the amount and complexity of the actions I don't find feasible to pre-calculate all possible interactions.
Thats hard. I dont know if you will find a way that is not 'sketch'. First thing that comes to mind is to do some trickery to make the server think there is a real player at the entity, thereby it would automatically keep everything loadded around it by design
Lol I found an open sourse pluhin that does just that: https://www.spigotmc.org/resources/fakeplayer-redstone-technical-1-20-x-1-21.118375/
Is there any API for detecting when a player's warden warning level changes (not anger level, but the warning level which leads to a warden spawning)? Or perhaps once a warden spawns a way to tell which player caused it to spawn?
Seems like no but wanna validate in case I'm missing something
Hmm it seems that they are emulating player packets and sending it to the server itself.
I would love to avoid that xD
Seems like trickery might be needed for now :D
Why does this shit happen? i've invalidated caches, thrice
Is your dependency set up correctly
Yeah man it builds fine.
even @NotNull which is an annotation?
wtf
This project was maven, i did my best to piece by piece convert it to gradle. but clearly something is off
Wait, if it wasnt, would it still build
it builds fine
does player.isInWater() return true only if a player is standing in water block or does it also return true if they are standing in the rain
removeWhenFarAway
my plugin.yml looks like this ```name: Skonic
version: '${project.version}'
main: ca.nagasonic.skonic.Skonic
api-version: '1.19'
depend:
- [Skript, ProtocolLib]
softdepend: - [Citizens]
but it can't find the dependencies, even though i have them in my server[15:43:30 ERROR]: [ModernPluginLoadingStrategy] Could not load 'plugins\Skonic-1.0.5.jar' in 'plugins'
org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [[ProtocolLib]]. Please download and install these plugins to run 'Skonic'.
at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:82) ~[paper-1.19.4.jar:git-Paper-550]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[paper-1.19.4.jar:git-Paper-550]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.19.4.jar:git-Paper-550]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.loadPlugins(CraftServer.java:431) ~[paper-1.19.4.jar:git-Paper-550]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:273) ~[paper-1.19.4.jar:git-Paper-550]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1104) ~[paper-1.19.4.jar:git-Paper-550]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.19.4.jar:git-Paper-550]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]```
?whereami
i came back to this after a while again 😂. Ok if business logic would strain the database that could be shifted to an application, then why do we really use foreign keys or primary keys? After all, these are data constraints which check if id is unique both to a row and to table, which is kind of a business logic?
doesnt this imply that some logic like data integrity checking with constraints should be preferred to do on database to not ruin the database outside external custom sql client
sql glazer fr
im pretty sure primary key constraints are really not needed, but you should prefer them. and if you're missing an performance from primary key constraint, you can always create INDEX for that column manually, because all PRIMARY KEY does is it adds PRIMARY KEY constraint to check if the key uniquely identifies the column within a table and a dedicated INDEX to speed up lookup times for it
Is there in any way to modify block break speed for specific tool?
attributes api
declaration: package: org.bukkit.attribute, interface: Attribute
you just need to apply that attribute to specific itemstack
Ah thanks, is it possible to only apply the speed on specific block only?
Maybe I need to dynamically add/remove attribute based on block that player interacts?
im pretty sure its possible because i've saw some conditional attributes done with command blocks back in 1.8 days 😄
i havent touched api for a while so im not really sure
Well thank you, it's a start for me.
i did, and it still didnt work
you're combining a scalar and a flow sequence in that yaml
either do:
depend:
- Skript
- ProtocolLib
or:
depend: [Skript, ProtocolLib]
not both
why is the code saying the item has the lore even tho it my client does not see it
try it in survival
oh
Ive been playing around with item displays and trying to use them instead of armor stands but the movment doesnt feel very fluid when im rotating. Is this something I can fix or am i better off still using armor stands at this point
works thanks
whats the best way to get rid of it?
do i set the cursor item to null?
i mean
get rid of the ehcnated book
the reason this happens is because creative inventory is mostly client-sided, so click events don't quite works as one expect. There's InventoryCreativeEvent though so you may try handling it with that if you care about creative interaction
after the sword has been enchanted
the event happens before the action happens, so yes, just set the cursor to air
just make sure to test it doesn't get bugged or anything
how are you rotating the item display
Bukkit.getScheduler().runTaskTimer(MinevolutionCore.getCore(), new Runnable() {
private float angle = 0.0f; // The current angle of the rotation
private long lastTime = System.currentTimeMillis(); // Last time we updated the angle
private Quaternionf targetRotation = new Quaternionf(); // Target rotation (for interpolation)
private final float rotationSpeed = 1f; // Degrees per second
private final float slerpAlpha = 1f; // Interpolation alpha for smoothness
@Override
public void run() {
// Delta time in seconds (time between ticks)
long currentTime = System.currentTimeMillis();
float deltaTime = (currentTime - lastTime) / 1000.0f; // Convert to seconds
lastTime = currentTime;
// Calculate the angle change based on the speed and delta time
angle += rotationSpeed * deltaTime;
if (angle >= 360.0f) {
angle -= 360.0f; // Wrap the angle around when it exceeds 360 degrees
}
// Update the target rotation with the new angle
targetRotation = new Quaternionf().rotateY(angle);
// Get the current transformation
Transformation transformation = itemDisplay.getTransformation();
// Perform smooth rotation using slerp
transformation.getLeftRotation().slerp(targetRotation, slerpAlpha);
// Apply the updated transformation
itemDisplay.setTransformation(transformation);
}
}, 0L, 1L).getTaskId();
This is the smoothest I could get it to work
the reason people use it display entities is to take advantage of client-side interpolation
Doesnt look horrible but could look better with armor stands
right now you're not taking advantage of interpolation by doing it server-side
So do you mean there isnt a way to do it through a plugin or the way im doing it is wrong
the latter
private final long durationInTicks = 20L;
Bukkit.getScheduler().runTaskTimer(MinevolutionCore.getCore(), new Runnable() {
private float angle = 0.0f; // The current angle of the rotation
private final float rotationSpeed = 1f; // Degrees per second
@Override
public void run() {
// Calculate the new angle
angle += rotationSpeed * (durationInTicks * 50 / 1000.0f);
if (angle >= 360.0f) {
angle -= 360.0f; // Wrap the angle around when it exceeds 360 degrees
}
// Compute the target transformation
Transformation transformation = new Transformation();
transformation.setLeftRotation(new Quaternionf().rotateY((float) Math.toRadians(angle)));
// Apply the transformation with interpolation
itemDisplay.setInterpolationDuration(durationInTicks); // Total duration for interpolation
itemDisplay.setInterpolationDelay(-1); // No delay
itemDisplay.setTransformation(transformation);
}
}, 0L, durationInTicks).getTaskId();
try something like this
Ill give it a try
ah I forgot to divide the duration for the interpolation duration, should be in ticks
So if I understand correctly this will give it a new position to rotate to and sets the duration of the rotation to start until the next fire of this run?
it's actually kinda borked since I just edited your code halfassedly lol
the intent is for it to do a full rotation every 1 second
I mean I understand the concept so I dont mind playing around a bit I didnt even know about the interpolation I just saw a slerp and figured that was the way to go lol
Ok I got it working thanks looks way smoother
dawg no one cares
Could you show me videos of that to see how smooth it is please?
any idea what packet should i send to change display name of an armorstand?
entity metadata
iirc index 3 is a boolean determining "custom name visible" and number 4 is an optional of a text component
might have the indexes switched up
nvm I'm entirely wrong
is is as smooth as it gets
I spent way more time fidling with that timer method than I reasonably should have lol
@graceful oak not sure if you ended up doing it in various cycles, but that above snippet does it in 1 cycle and it is pretty smooth
why are you showing off after you were helped with each step of the process
Look at what I copied papa!!
why the need to be an ass
they were glad they got it working and wanted people to see, that's all
if you don't care then just go about your day, no need to make the shitty comment
Its good to be proud, it pushes you to do more.
How can i add an hologram to an block
TextDisplay, ItemDisplay, BlockDisplay
textdisplay
TextDisplay
thanks
someone able to help me with a plugin thing im trying to do
?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!
ah
my bad
Right now im trying to do a /staffmode plugin which i managed to make it go into spectator mode but when i run the command it doesnt take me out of it and im having trouple setting that up im wondering if someone knows what to do for it to take me out of it
Set the gamemode to something other than spectator?
i sent you the code i was doing maybe you can see what i did wrong
?paste
you else code will never run
how come
That if statement will always be true when a player runs the command
what can i do to fix it
?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! 🎉
forgot this one is long af sorry
Have an if statement that checks the gamemode instead
i tried putting if statement but i couldnt find what i feel like i was meant to be looking for
p.setGameMode(p.getGameMode() == GameMode.SPECTATOR ? BameMode.CREATIVE : GameMode.SPECTATOR);
that will toggle between the two modes
so get rid of the things under else as that isnt needed
that worked thanks very much any suggestion on what to do so the p.sendMessage says something else for when it basically disables the staff mode
p.sendMessage(p.getGameMode() == SPECTATOR ? "You are a Spectator" : "You are in Creative");
thank you very much
would i be allowed to ask you a question in dms by chance
I don't do DMs
understandable ig ill ask here from your experience since im new would me trying to make a /turn command plugin help more also learn more since i wanna make that but dk if its something that would be hard
Creating any plugin is good experience.
there is any way that I can pay someone to upgrade a plugin?
?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/
would a /turn Player plugin be hard to make you think atleast for me given these questioned i asked above
I've no idea what a turn plugin is
/turn IGN would turn a player 180 degrees
it would a good experience as you'd have to learn about teleportingf a player and calculating directions/vectors
is there any videos on this kinda thing or should it be easy me learning from full scratch
so basically what /rotate now does?
asssuming it turns a player 180 degrees then yh
i mean not just 180 degrees but any rotation
its a new command
so maybe you dont even really need to make a turn command
if you wanna send me the link to it ill look but also thinking of my own custom 1 cause it also teaches me yk what i mean
@eternal oxide sorry if im a little annoying at all
Isn't it better to do this?
Player p = (Player) commandSender;```
no, depends on your java version
Now you get an ugly error when it’s not a player
Was that for me? or?
if(!(commandSender) instanceof Player)) {
//Do the magik here
}
You might as well do the casting inside the instanceof
Provider you aren’t on an ancient version
?howold 1.8.8
Minecraft 1.8.8 is 9 years, 3 months old.
Quite young
We’re approaching a decade
Minecraft 1.8 is 10 years, 2 months old.
?howold 1.7
Minecraft Snapshot 1.7 is 11 years, 1 month old.
Fun
?howold 1.5
Minecraft Snapshot 1.5 is 11 years, 8 months old.
?howold 0
Version 0 was never public 😔
i swear to god
that oracle apex
is so shitty product
how is missing comma doesnt emit validation error here
i've spent an hour trying to see why my query doesnt work
debug doesnt show anything
no console logs nothing, no STDERR, no STDOUT
f.... terrible
So let's say I am making a DB table for players' cosmetics, where each cosmetic has its unique ID.
If I design it denormalized, it would look like this:
--------+----------------
UUID_1 | (null)
UUID_2 | [1,5,23]
UUID_3 | [5,12,45,50]
In this case, I'm storing all the player's cosmetics in a single column. To store the equipped cosmetics, I put it at the beginning of the array, so:
UUID_1has no cosmetics.UUID_2has 3 cosmetics (1, 5, 23), with1being equipped.UUID_3has 4 cosmetics (5, 12, 45, 50), with5being equipped.
I *understand *the "Benefits of Normalization," but let's assume the average amount of cosmetics for each player is 5. This means I would store n(5) cosmetics for each player. If I have, for example, 300K offline players, I will need to store around 1.5 million UUIDs.
Wouldn't this negatively affect scalability? Or is it still better to use a normalized design like this:
UUID + Cos + Eq
-------+----+---
UUID_1 | 1 | 0
UUID_1 | 24 | 0
UUID_2 | 6 | 1
UUID_2 | 31 | 0
UUID_3
Which design do you think would scale be better for large datasets like 500K offline players?
well its a tradeoff between querying and insertion performance
with normalized dataset you can do more advanced SQL queries by selecting values by specific condition.
with non-normalized form you will be able to efficiently store the cosmetics, but you lose the ability or querying that easily
if you're looking for a way to serialize data from the game and then deserialize at load and there's no further operations with it, i would prefer the first one, as it is more efficient approach for large volumes of data, since you wouldnt use custom SELECT's, JOIN's or UPDATE's
although it could be cumbersome if you lets say would want to purge some type of cosmetics from specific players
i would say maybe try to benchmark this
see if those UUID's really cause some performance issues
after all, primary keys are being indexed
so it shouldnt be really a problem for insertions or select operations
but it probably needs some testing
osmetics aren't something players will change constantly, like kills or deaths. So, when a player joins, I'll perform some initial queries to load their cosmetics. Whenever a player buys or changes a cosmetic, I'll update the data accordingly
i am storing uuids as bytes tho
so it takes 16 instead of >=32
will you include some admin functionality which would allow you to remove add cosmetics from the players?
no, players can buy / change their own cosmetics thats it
then i will cache all the data when player joins
well then first option should scale better
so when the game starts i will get the cosmetic from the cache not the db
since you would only use the database for persistent storage
and not for querying implicit data from it
what you can do is kind of hybrid approach, is to maybe retrieve the data from db, deserialize it, cache it and then transform it into normalized form
depends on how you will cache it tho
alright so now :
1
UUID -+- Cosmetics
--------+----------------
UUID_1 | [1,5,23]
UUID_2 | [5,12,45,50]
In this case, I'm storing all the player's cosmetics in a single column. To store the equipped cosmetics, I put it at the beginning of the array, so:
or 2
UUID + Cosmetics + Eq
------+-----------+----
UUID_1 | [1,5,23] | 5
UUID_2 | [4,7,29] | 4
in this latter case i think it doesnt really matter which you choose as it wouldnt save much anyways, equipped in the second version will use integer tho in this case so it will probably use 4-8 bytes at most
I'd really suggest benchmarking this
Multivalued attributes are in generally considered bad right in terms of normalization practices
kinda makes it nosql
yes, but sometimes they're bad for performance
that too
Like, this seems like such a common usecase, I would not be surprised if the sql implements correctly optize this
he's asking whether normalization would impact performance at 300k UUID datasets, with many to many relationships, around ~ 1.5 million UUID's
should i be using p.getlocation etc or player#getLocation#getYaw for a command plugin that turns a player 180 degrees when the command is typed in chat
i would probably develop a benchmark with puts dummy data inside a db
Player#getLocation() then nodify the yaw and teleport the player
and then i would run a plugin
to see if that impact it in any way significantly
in a normalized form first
i dont know much about this yaw situation could you possibly help
and then if there's something wrong i would denormalize it
But like it so depends on what kind of queries and sub queries we run
Unless we just care about physical storage where there is a definite answer
yeah, he said that he mostly will be using database for persisted storage, a.k.a for serialization/deserialization, so he wouldnt use any complex SQL queries like joins or conditional searches
sure for now, but if u’re talking about horizontally scaling it to support 500k users chances r u gonna be interested in more complex queries and data analysis in the future
so in this case imo non-normalized form would make more sense, but if his database engine can handle that much UUID's in normalized form without a hitch then does it really matter at this point to develop complex application level deserialization
i agree, i would probably just try to build database in 3rd normalized for at first
try to push 300 K UUID data
test it with a plugin
if it does lag i would do some optimizations like denormalize some parts which impact the most
i highly doubt that it would really do much difference, but idk, it all depends on database engine and the hardware the plugin runs on
Yup
worst thing in software development ☝️
but also might be worth routing nosql if u don’t care about data relations
yeah but also most common thing, if it didnt depend we wouldnt be needed
you can see yaw values in F3 menu
if it all depends, why do we build generic products then
which turn out mostly shit
IT DEPENDS™️
™️
How do I write a tab completer that allows me to complete a pattern just like typing //set <pattern>
unless im blind i saw nothing
im not sure which one is pitch and which one is yaw
tho
i cant remember
but you can figure it out by rotating the camera up and down and in the sides
you just set those yaw and pitch values for the player via bukkit api you get from this debug screen and that's it
you've rotated player model
Not quite
to rotate/move the player you have to alter teh Location object and then teleport the player
tryna figure out what to type and where to type it cause i want it like a staff command so when a staff does /turn <player_name> it roates the player 180 degrees
i guess yeah
you should really just learn java first and then watch some videos on spigot api
making commands is piss easy but if you're not doing the bare minimum of learning java basics you're gonna struggle with everything
i mean commands are part of bukkit api, so he might be not used to bukkit api
no hes literally just new
true
i would mostly skip spigot tutorial and learn how to read javadoc and seek for info here: https://hub.spigotmc.org/javadocs/spigot/
package index
if your only goal is to make a quick turnaround command you might as well ask chatgpt
i got suggest this video series for spigot development which ive been watching
bad advice tbh
last time i did that i was told the coding wasnt even java or anything
chatgpt probably mentioned you Minecraft's bedrock's scripting api which is based off javascript iirc
you might not have asked the right question
using chatgpt without knowing why its suggesting things is a terrible habit
i said in javascript which might have messed it up
yeah, javascript scripting is only supported for bedrock version of minecraft
if you want to develop for Minecraft: Java Edition, you would need to use Java, not JavaScript
im stupid i need all the help i can get lol
they are completely separate
Real
it causes too much confusion among users
they should just call it webscript or whatever
NodeScript fr fr
makes sense
as we have WebAssembly
why not just call ECMAScript WebScript
sure JS is being used outside the web
but all knows that JS's prioritized on the web
i've heard from some influencer that he doesnt call JavaScript ECMAScript mostly because it sounds like a name for skin condition 😄
"Java is as similar to Javascript as Car is to Carpet"
- Silk, 2021
might as well be Alladin at this point
ecmascript sounds like a ligma joke
try asking it "I need a minecraft java spigot plugin with a single feature: a command with 1 optional parameter taking in a player name. i need the command, when executed, to turn the command executor(or player, if given) around by 180 degrees. the command should send an error message back to the command executor if the given player (if any) is invalid. or, if the optional player parameter is omitted, send an error message to the command executor if the command executor is not a player. can you do that for me?"
should be good
Kk hold on
thats literally programming but wihtout the syntax
Lol
yes thats the point
my experience taught me that the longer the sentence, the more hallucinations the AI starts to have
i just tried being as specific as possible
if they can figure out how to write that kind of text, they can learn to write java code
just let the guy ask the question whats the worst thing that can happen
yeah
yeah you're a real nerdy nerd bro
Asked it umm anyone got the pastebin link
?paste
guh
Cheers
lets see what chatgpt cooked up
wait I just got a genius idea
what if you askled chatgpt to make a paste link for it xD
I wonder if its able
probably not
not too bad but it kinda forgot to make this an actual plugin
alrght now you gotta try and put the code in a plugin
and some method names are wrong
i assume you already have an IDE to program in so you can probably fix these small mistakes yourself
after that you can check if it actually works
it wont, because its turning you around by 360 degrees, lol
I do have IDE
wdym its rotating 360
in turnPlayer its adding or subtracting 360 to your yaw
yeah after it added 180
the comment says its adding 360 to normalize the yaw
seems fine
yeah its probably not necessary
So it only needs some editing before testing
yeah prob
i mean this is just the class command
if you still have chatgpt open you can ask "this is a good start, but you've not fully understood my question. i need this to be a plugin as well, so could you modify the given code such that the TurnCommandExecutor also extends JavaPlugin, and register the command in onEnable()?"
in case you dont know how to do that yourself
chat gpt cant access the web
although copilot seems it can
but its limited
right but can it make pastes
it doesnt even have codeblock support, i doubt that it would support pastes
seems good, you just need to register the command "turn" in your plugin.yml now
yeah true
you can do that yourself
Yh
Actually reading the wiki and learning java: ❌
ChatGPT: ✅✅
Hey, if I create a file during run time (Or load that file) should that be async? Also when retrieving data from a .yml during run time, should that be async?
If file is small then don't do async
Can I fully dress up the dude in the smithing table?
So i'm creating a file per player to avoid file being really big
So not necessary for it to be async?
Yep
However, file could be big, (maybe 100-300 lines if the player plays actively)
Does that matter or not?
Well it's few hundred ms for load and configurations are usually cached.
retreiving from a yaml config is quite cheap, as long as it is already loaded, bukkit loads the values to a hash map
I see
loading and saving is more expensive and should be done async
yeah
I wrote the code and asked help for it
in block break event how do you get the item used to break the block
since it could be offhand or mainhand
how would the player break a block with their offhand?
i realised that
also is there a way to modify the itemStack isSimilar method to ignore durability
I'm a beginner, but I would recommend either making your own version of that method, or Mixins(I wouldn't recommend this)
alr
or, before comparing, make them both at full durability. that way it doesn't matter what durability it is, it will always be full when checking
i'll just make my own comparison its easy enough
I wish I wasn't banned from PaperMC
I said smth about taxes and got banned, couldnt find any way to appeal
appeal link in community guidelines
where would that be?
i probably shouldnt be clicking on links as quickly as I just did
bro is desperate
i do get 2 errors
only got the bottom error now
player.teleport(player.getLocation().setYaw(newYaw));
Line 57
setYaw returns void, but you need a location
Location rotated = player.getLocation().clone();
rotated.setYaw(newYaw)
player.teleport(rotated);
line 57?
i didnt use that paste since its within a plugin its like on another class
im using this 1 https://paste.md-5.net/raw/abemugodoq
// Set the player's new yaw (turn them around)
player.teleport(player.getLocation().setYaw(newYaw));
Line 57
setYaw returns void, but you need a location
Location rotated = player.getLocation().clone();
rotated.setYaw(newYaw)
player.teleport(rotated);
As i said
am i replacing this with
setYaw returns void, but you need a location
Location rotated = player.getLocation().clone();
rotated.setYaw(newYaw)
player.teleport(rotated);
yeah when you got a guy that clearly has no interest of learning java or spigot and they only care to make a small specific plugin then yeah chatgpt is a fine option
Can I fully dress up the dude ||(armor stand)|| in the smithing table?
doesn't look like it
maybe with nms
but probably not
ic
i find it intresting i just believe with issues i cant learn right i wanna try but still believe even after some videos there will be things i still dont understand
because you're not learning java first
learning spigot is not gonna help if you dont know how java works
learning java first will be kinda boring but its required
any suggestions where to learn it from
?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! 🎉
yeah that
hey
no
how i can make a "Elytra Glide without Elytra" with the spigot api?
does somebody know it?
ItemMeta#setGlider(true)
which itemMeta?
any
and then to false again after stop gliding?
any item's item meta can be modified to make it a glider
or instantly to false?
final ServerPlayer serverPlayer = ((CraftPlayer) player).getHandle();
final Level level = serverPlayer.level();
final BlockPos fakePos = serverPlayer.blockPosition().above();
final BlockState signState = Blocks.OAK_SIGN.defaultBlockState();
level.setBlockAndUpdate(fakePos, signState);
final SignBlockEntity fakeSign = (SignBlockEntity) level.getBlockEntity(fakePos);
final SignText signText = fakeSign.getFrontText();
int i = 0;
for (final String line : withLines) {
signText.setMessage(i, Component.literal(line));
i++;
}
fakeSign.setText(signText, true);
fakeSign.setChanged();
serverPlayer.connection.send(new ClientboundBlockUpdatePacket(fakePos, signState));
serverPlayer.connection.send(new ClientboundOpenSignEditorPacket(fakePos, true));
}```
Is there something i'm missing? it always open the sign empty, with no lines, only happens in new 1.21
well if you wanna make the item stop behaving like a glider then yea you set it to false
but you dont have to turn it off after the player is done gliding
depends on what you want ig
i want that you can press "F" on the spawn, and then you will be boosted to y + 50, and then the glider should be activated
well there's LivingEntity#setGliding
then you can make an entity glide without them wearing an elytra or gliding item
it doesnt work
event.setCancelled(true);
user.getPlayer().setVelocity(new Vector(0, 20, 0));
user.getPlayer().setGliding(true);
i just get boosted on top
this should be paired with an EntityToggleGlideEvent listener where you cancel the un-gliding of the entity since the server immediately removes the effect
ohh
public FileManager(NormalDiscGolf normalDiscGolf) {
this.obstacleFolder = Paths.get(normalDiscGolf.getDataFolder().getPath(), "obstacles");
try {
if (Files.notExists(this.obstacleFolder)) {
Files.createDirectories(this.obstacleFolder);
}
} catch (IOException exception) {
exception.printStackTrace();
}
}```
If the obstacleFolder does not exist because the data folder of the plugin doesn't either, would the creation call as a consequence create the data folder as well?
yes
createDirectories creates all subdirectories up to and including the obstacleFolder starting from your work dir
yep
@hushed spindle do you believe asking chatgpt to make a command log kinda system and have it upload in pastebin or is that too big of a plugin for it to do
?tas
no clue i dont work with chatgpt
generally speaking the more you do with chatgpt the worse it gets
im using the basic thing you told me to look at to try and learn that stuff but seeing what chatgpt is also able to do but the pastebin stuff has managed to lose me
Pastebin does have a decent api to work with
Though I don't see why you would use it to log commands
its not a good idea no
for your experience level i see no reason to want a logging system
also, you wont learn much using chatgpt
When you use gpt for info you loose out on learning a very important skill
Which is how to find good information and solve problems
i was just using it to see what it can make if that makes sense but i am trying the https://www.codecademy.com/courses/learn-java/lessons/hello-world-java/exercises/commenting-code thing so far so good
I was wondering if it is possible to change a weapon's attack damage on 1.8.9?
if attributes dont exist then no
Attributes do exist in 1.8
No idea if it's part of the API or not
Doesn't look like it
You will need NMS
Hey, I was just wondering I'm currently trying to develop some sort of one time elytra plugin. the problem im facing is that a few years ago I believe i was using the PlayerToggleFlightEvent, but now it doesnt trigger when no elytra is equipped. Is there any equivalent event?
answer @frigid falcon , bro's really down bad rn
You want it to trigger on equip or when they start to fly?
im guessing there is no actual elytra?
^
otherwise idk why teh fact that you need an elytra now is an issue
I want the event to trigger when trying the players try to start flying but doesn't have an elytra
bro wants an event to trigger a gliding state without having an elytra equipped
Yesss
Client won't like that

Why? I've never faced a problem with the gliding state without elytra
we were having the discussion if that ever was a thing and I told him no
if anything, you'd probably need a custom event for double-jumps and then somehow force a gliding state
its probably a side effect of some optimization or something
or it was assumed that its a bug that has now been fixed
i.e. there is 0 reason for the toggleflight event to be called when you dont wear an elytra
Hmm do you know any other way to achieve what I wanted
not sure
idk the exact conditions of your plugin
maybe you can detect a jump and see if they are already in the air?
idk what version you have
Hmm could be a way
latest should have the input events
1.21.3
declaration: package: org.bukkit.event.player, class: PlayerInputEvent
does client send a JumpPacket if you are already in air?
but like idk when these events exactly get called
yeah thats something you have to try
The toggle flight event only gets triggered when the player can fly
I do not remember a version where that hasn't been the case
Plugins doing double jumps for example would enable player flight and then listen for the event
Ahhh I think thats what I'm missing
Ahh I can remember my old code
Thank you very much
im sending the PacketPlayOutOpenSignEditor packet to a player, but the sign UI immediately closes once opened, anyone know why?
try {
Constructor<?> blockPosConst = PacketUtil.getClassNMS("BlockPosition").getConstructor(double.class, double.class, double.class);
Object blockPos = blockPosConst.newInstance(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ());
Constructor<?> packetConst = PacketUtil.getClassNMS("PacketPlayOutOpenSignEditor").getConstructor(Objects.requireNonNull(PacketUtil.getClassNMS("BlockPosition")));
Object packet = packetConst.newInstance(blockPos);
PacketUtil.sendPacket(player, packet);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) {
e.printStackTrace();
}```


