#help-development
1 messages · Page 1161 of 1
Right click it yeah than send the packet to play the effect and particles then just apply all the effects
You can find spigot mappings git hash from the spigotmc website
https://paste.md-5.net/uhagacuqiq.cs trying to make a code when a skeleton hit u with an arrow it teleports to your location and you teleport to their location, but nothing seems to work
are you registering the event?
yes
try without the if(s.getCustomName().equals(ChatColor.ITALIC + "" + ChatColor.AQUA + "Switcher") part first to debug it
i did that
by other way
and that seems to be the problem
i will make that every time a player get damage it teleport to the damage location to see if that is
You should identify them with PDC
well dont compare custom entities by name
how could i make that zombies don't have cooldown attacking a player
is there a way to "tag" namespacedkeys?
i want to get some namespaced keys from an item
for example those that contain "keyword", would it be possible doing a toString()?
what does knockback friction actually mean
also with pcd ?
yeah yeah in the pdc but nvm, i saw NamespacedKey#toString()
well you can retrieve the namespacedkey with get getPersistentDataContainer().getKeys() then pass that to a string
ty
is there ways to edit code before its compiled in the minecraft source
or like replace a method entirely or something
within EntityLiving
I'm not looking to fork spigot
How would I derive a cardinal direction from the vector produced by for example player.getLocation.getDirection?
Ignite
but what are you trying to do, perhaps there's a way to go about it that doesn't require rewriting a method
just use Entity#getFacing instead
you would have to make your own system to constantly damage the player when it detects the zombie should attack, as well as setting player invulnerability ticks to 0
there is no way to directly modify mob attack cooldowns
implement custom knockback
...you can do that without rewriting everything?
couldn't you just set the knockback in the EnttiyKnockbackEvent to do your thing
Ehh, you could probably modify the pathfinder goal so it attacks faster
maybe idk
oh, there's also the attack speed attribute isn't there
you can probably just use that
is it?
1.8.8.....
dont say it
just fork spigot bro
im gonna say it
almost a DECADE
that's your only choice
I found this
anyway why cant you just like use velocity or some shit
I would have to modify within EntityDamageByEntityEvent
ok? so do that
and thats called after some of knockback is modified (the part when you sprint hit)
your other best bet is to ask the pandaspigot guys nicely to add the API
pandaspigot?
that's the only 1.8.8 fork that is somewhat active isn't it
wait I'm wrong
your other option would probably be just modifying the velocity packets directly
code goes
on attack
damage entity
if sprinting or using kb modifier, adjust kb
PlayerVelocityEvent
PlayerVelocityEvent existed in 1.8?
why not use that
even if knockback is modified in attack damage, the bottom line is whatever you set in that event
ill give it a shot
sure, you won't be able to affect the knockback of other entities other than players but I assume you don't want that anyway
i mean cancelling the damage event and implementing it yourself is always an option
When it comes to implementing Cloneable, are there any nuances in which would cause the .clone method to throw CloneNotSupportedException?
yeah but theres also knockback changes after the damage event
I think it does just by reading the code
ill try it tbh
oh wait it wont
cus damageEntity will return false
fuck I cant use playervelocityevent cus I'm not able to access the attacker which is where the direction is pulled from and shit
this is what happens when you use a decade old version
oh shit pandaspigot has built in kb config
yeah unfortunately as much as I'd love to, im bound to this version
its really frustrating for sure
Because of old pvp?
yeah
and the culture for the server i’m developing for will not accept an update
is there an event that triggers for ground state changes
Don't believe so
Also, you should not rely on it as it is a client-controlled property.
It can be very easily spoofed.
If you mean the OnGround variable for players
I see
viaversion (viabackwards/viarewind), theres plugins that restore 1.8 combat, and with the changes in 1.21.2/4, you can even re-add sword blocking properly
would it be unnoticeable for the user on the frontend though?
with enough configuration, yea
Hello, there is nowhere else to go so I came here to ask my question. I downloaded auction house 1.20.4, I am on version 1.20.1. I have luckperms, I have vault, and it shows red when I do the /plugins command in game. I have deleted the plug-in and reinstalled it like 20 times, downloading a brand new file each time. I don't know what I'm doing wrong
You should go to #help-server
Ok
Ty
Hello, there is nowhere else to go so I came here to ask my question. I downloaded auction house 1.20.4, I am on version 1.20.1. I have luckperms, I have vault, and it shows red when I do the /plugins command in game. I have deleted the plug-in and reinstalled it like 20 times, downloading a brand new file each time. I don't know what I'm doing wrong
Don't just spam the same question when there are ppl already explaining stuff to you in other channel
I was told to come here dude.... chill out
what is your issue
im just looking for help
an d you are being beyond rude to me
#help-server please
The fact that I can still see the question two messages above it.
And you're in the wrong channel.
Who told you to come here
I also replied to you there, if you want to read it
you obv cant read... olivia posted the # for this channel to me
I read for a living, so maybe you're either not explaining, listening or you do not want to understand.
If you are talking about this message, that is not to you
Not only is it not from Olivo but it is part of different conversation
calling me clown, this guy....
How do you rename a world?
unload, rename folder, load
Bukkit.unloadWorld(World, boolean), new WorldCreator(String).create();
ok i found it thanks
Any good library for GUIs?
a million
it depends on what you want
i made my own because I wanted to
but existing ones are pretty good too
I saw something on a server, the hunger and health bars were hidden in the lobby, they came when I entered the game.
Do they install a different resource pack when you enter the game?
yup
No
You might be able to do some file watcher stuffs
Since it’s just a file
🤓
Don’t you nerd emoji me
nerddd
!!
where does the snake yaml occur? in what class
which method throws exception
??
Exceptions can happen in a lot of methods from both snake yaml and yaml config
which method validates yaml
There's most likely more than one method in snakeyaml that throws something
its a class rather than a method in snakeyaml (spexx.dev)

you can't catch it right?
because loadConfiguration in YamlConfiguration doesnt throw an exception
loadConfiguration is goofy
It catches the exception
And prints it to the bukkit logger
you can use new YamlConfiguration().load(file);
If u so would like to handle it urself
Init
im making a really fancy configmanager
😔
so basically I can do new YamlConfiguration().load(file) and then YamlConfiguration.load() ?
that means i have to load it twice
J stands for efficiency
Jaml
Lol
FileConfiguration config = new YamlConfiguration(); //my glorified hashmap
config.load(file); //load from file to my glorified hashmap
config.get(key); //yayyyy
glorified hashmap
Niiice okay
con is the nerd
Naaa
everytime I see rad, he always drops insane inline higher ordered functions in kotlin
They are beyond your understanding
CON WHY YOU DELETING MY MESSAGSE
NO
it’d make you so much more humble
I'm not a smelly haskell nerd like steel
I'm gonna transform you to a kotlin user
Oh I am one already
oh based
Kotlin is F- tier
Lol
caught in 4k
spexx check its parent
yes
👨👦
🧒
fucking terrifying
XD
😂
Does anyone know how I could get the dimension types of a world? I need it for a respawn packet; it's one of the parameters. I am using protocol lib to write the packet.
Bungeecord
What events I use to listen all player count change
I believe it's LoginEvent
If I use it,
I need ServerShutdownEvent, LoginEvent, DisconnectEvent, etc....
Bungee has many event.
I need server shutdown, player join any server, player quit server.
all of player count of server changing
has anyone checked the source of the new "pause-when-empty-seconds" setting? how does it work?
is it just /tick freeze or what
You can
Hmm
it would make my life much easier without File
but then i have to rewrite some things
and i dont have energy
I've also done some of filewatcher stuff
but its commented out because it doesnt work
Path and Files work good with javas file watcher api as wel
I'll try to change it to Files
btw do you know if there is a constant for "".. Nothing? Like in c# there is String.Empty
the empty string?
ye
Yea
I think it gets pooled more or less
Except if u choose to invoke the string constructor explicitly
what
oh yeah i need to release the patch
will it support the latest version
love the polarized reviews lol
it works fine on the latest version
i mean if you have an error you can, y'know, send it lol
😂
Is there a kind of guide for Spigot?
guide?
guess why they're asking for a guide for spigot lol
Hello, i have problem with intellij i think.
I have multiple projects
Imports not works, here is my gradle:
plugins {
id("java")
id("io.github.patrick.remapper") version "1.4.2"
}
// Library versions
val spigot: String = "1.21-R0.1-SNAPSHOT:remapped-mojang"
// Project version and group
version = property("projectVersion") as String
group = "kz.hxncus.mc"
dependencies {
compileOnly("org.spigotmc:spigot:$spigot")
compileOnly(project(":bukkit"))
}
tasks {
remap.get().version.set("1.21")
compileJava.get().options.encoding = Charsets.UTF_8.name()
javadoc.get().options.encoding = Charsets.UTF_8.name()
compileJava.get().dependsOn(clean)
}
tasks.jar {
finalizedBy(tasks.remap)
}
first and second compileOnly methods not works
I have 1.21 version in my .m2 directory
Also what a font
hahah
tasks {
remap {
version = "1.21"
}
compileJava {
dependsOn(clean) // why?
options.encoding = "UTF-8"
//options.release = 21
}
assemble {
dependsOn(remap)
}
}
// Ideally you'd do also do it this way for JavaCompile tasks, but since you're depending on clean...
tasks.withType<Javadoc>() {
options.encoding = "UTF-8"
}
Could not find spigot-1.21.1-R0.1-SNAPSHOT-remapped-mojang.jar (org.spigotmc:spigot:1.21.1-R0.1-SNAPSHOT:20241014.010741-2).
Searched in the following locations:
https://repo.dmulloy2.net/repository/public/org/spigotmc/spigot/1.21.1-R0.1-SNAPSHOT/spigot-1.21.1-R0.1-20241014.010741-2-remapped-mojang.jar
there's too much garbage in that build.gradle.kts
you're fine lol, I mean it in the way that we can't realistically find the issue from that
huh? 😭
what am I supposed to do
I don'T think I want THAT in my manifest 😭
those are standard manifest keys, the maven manifest plugin adds them automatically if you tell it to
well, for the most part anyway, there's some special ones there
I don't think people need to know who compiled it on what OS
are you sure remapped-mojang is in your maven local?
and if it is, are you sure IntelliJ is pointing to the correct maven user home?
idk, i dont changed it, i have default settings
Does anyone know how to rotate a sleeping serverPlayer NPC properly to a given yaw value? Im using the ClientboundMoveEntityPacket and it is changing the direction with different yaw values, but I feel like its random..
(byte) (player.getLocation().getYaw()),
(byte) (0),
false));```
Goal is that he is sleeping in a straight line where the player is facing.
ik this really isnt development related, but my highlights wont turn on in intellij and i dont know why https://i.e-z.host/uzc19saf.png
you're casting the player's yaw into a byte
in the protocol that byte is from -128-127 (0-255) where each unit is 1/256 of a full turn
Location#getYaw returns an angle in degrees so the range is off
I tried it with (byte) ((player.getLocation().getYaw() % 360) * 256 / 360) which worked, but only when the npc wasn't "sleeping".
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
npc.setPose(Pose.SLEEPING);
this.npcServerEntity = new ServerEntity(npc.serverLevel(), npc, 0, false, packet -> {
}, Set.of());
SynchedEntityData synchedEntityData = npc.getEntityData();
synchedEntityData.set(new EntityDataAccessor<>(17, EntityDataSerializers.BYTE),
(byte) (0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40));
Bukkit.getOnlinePlayers().forEach(all -> {
ServerGamePacketListenerImpl allps = ((CraftPlayer)all).getHandle().connection;
allps.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
allps.send(npc.getAddEntityPacket(npcServerEntity));
allps.send(new ClientboundAddEntityPacket(npc, npcServerEntity));
allps.send(new ClientboundRotateHeadPacket(npc, (byte) ((player.getLocation().getYaw() %
360) * 256 / 360)));
allps.send(new ClientboundMoveEntityPacket.Rot(npc.getBukkitEntity().getEntityId(),
(byte) ((player.getLocation().getYaw() % 360) * 256 / 360),
(byte) (0),
false));
player.sendMessage(npc.getBukkitYaw() + "");
//allps.send(new ClientboundAnimatePacket(npc, (byte) 0));
});
I kept out the nms spawning stuff as the message would be too long, if you think there could be a mistake ill add it.
found this one the protocol wiki
try sending a synchronized player position packet instead
ClientboundPlayerPositionPacket? I don't see how this will affect the npc, doesn't this just apply to the player which the packet is sent to?
yeah it looks like you're right, i don't see any way to specify a specific entity
how is the sleeping npc rotating
How, you mean in relation to the players yaw? I have no idea.. Im spawning it rapidly while turning just a single bit. In some ranges it is changing in relation to my turn but in others it just turns like 80-180° or sometimes even not at all.
https://ibb.co/yXCz55g I tried to turn in 90° angles (idk if im allowed to post links as im not able to post pictures in here, if not tell me, dont click, ill delete it.)
?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
and you can confirm that the rotation works as expected when the npc isn't in the sleeping position?
No, I only looked at the head but as I see now the body rotation isn't always the same
I don't know if you can change the body rotation..
Sometimes it's right and sometimes it isn't.
i believe body rotation is client-sided?
Yeh
it looks like you can either just send a bunch of rotate packets one after another
or you can make the npc perform the arm swing animation
which should set its body rotation to its actual rotation
i tried that but i dont know in which order i have to send the packets
it didnt work sending it last
you mean the hit animation?
no havent
but i just tested with a second account, the angle of the sleeping position is the same for everyone
Just tried it, doesnt work.
ill send code
wait
while in the sleeping position or not?
yes
ok ill try before
Can I just send the dataPacket later or do I have to call .setPose after the hit animation?
ServerGamePacketListenerImpl allps = ((CraftPlayer)all).getHandle().connection;
allps.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
allps.send(npc.getAddEntityPacket(npcServerEntity));
allps.send(new ClientboundAddEntityPacket(npc, npcServerEntity));
allps.send(new ClientboundSetEntityDataPacket(npc.getId(),
synchedEntityData.getNonDefaultValues()));
allps.send(new ClientboundRotateHeadPacket(npc, (byte) ((player.getLocation().getYaw() %
360) * 256 / 360)));
allps.send(new ClientboundMoveEntityPacket.Rot(npc.getBukkitEntity().getEntityId(),
(byte) ((player.getLocation().getYaw() % 360) * 256 / 360),
(byte) (0),
false));
player.sendMessage(npc.getBukkitYaw() + "");
new BukkitRunnable() {
@Override
public void run() {
allps.send(new ClientboundAnimatePacket(npc, (byte) 0));
}
}.runTaskLater(Main.plugin,1);
thats it rn, ill change it up now.
}, Set.of());
SynchedEntityData synchedEntityData = npc.getEntityData();
synchedEntityData.set(new EntityDataAccessor<>(17, EntityDataSerializers.BYTE),
(byte) (0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40));
Bukkit.getOnlinePlayers().forEach(all -> {
ServerGamePacketListenerImpl allps = ((CraftPlayer)all).getHandle().connection;
allps.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
allps.send(npc.getAddEntityPacket(npcServerEntity));
allps.send(new ClientboundAddEntityPacket(npc, npcServerEntity));
allps.send(new ClientboundRotateHeadPacket(npc, (byte) ((player.getLocation().getYaw() %
360) * 256 / 360)));
allps.send(new ClientboundMoveEntityPacket.Rot(npc.getBukkitEntity().getEntityId(),
(byte) ((player.getLocation().getYaw() % 360) * 256 / 360),
(byte) (0),
false));
player.sendMessage(npc.getBukkitYaw() + "");
allps.send(new ClientboundAnimatePacket(npc, (byte) 0));
});
npc.setPose(Pose.SLEEPING);
ps.send(new ClientboundSetEntityDataPacket(npc.getId(),
synchedEntityData.getNonDefaultValues()));```
Still random..
Oh, forgot to remove the delay
still random
I did it now 2 seconds delayed but the body rotation seems to be irrelevant for the sleeping angle.
weird clientside jank then?
2 seconds delayed on the animate packet or the entity data packet
npc.setPose and data packet.
Well it is the same for every player, it's not random for other players on the server.
and before the 2 seconds the body is facing the right direction?
No not exactly. The hit animation doesnt make it turn 100% where my body is rotated to
but it's close?
Well sometimes its very close and sometimes id say still like 15° difference
but after applying the sleeping pos its wrong again.
btw im kinda new to packets, if I have sent the data packet once but change data again, I do have to send it again right?
yes
i believe you should be able to use #packDirty to only send the changed data
depends on how you modify that tho
and all of your debugging just makes me think the client doesn't know how to deal with rotated sleeping players
i do vaguely remember like villagers bugging out and moving while "asleep" but i think that was bedrock
Hmm, im out of ideas. Unlucky.. Thanks for your help tho, do you think its possible to atleast find out in which direction the head is facing? I need the "middle" of the sleeping npc.
But the getBukkitYaw value is also kinda weird only goes from -2 or -4 up to 6.something max.
probably radians?
no
idk then, maybe look at source code
but shuold be, i only compared it to the player yaw radians maybe because of the inaccurate angles it is radians
you can also use a crawling pose instead since that should work much better with angles
why do you need to use getBukkitYaw in the first place?
I want to have text above the body and it looks weird at the feet. Initially I wanted the body to "fall" where the player was facing, with that i would be able to just add half a block where the player is facing which would have been the middle of the body but now i need a different way to get to that.
can't you use the non-bukkit method to get the player's yaw?
there should be one, right?
yes but not for serverPlayers
looks like #getBukkitYaw just returns #getYHeadRot
this is in 1.19.4 tho so might be outdated
yeh, seems like ill end up with a few preset fall directions and switching through them for the text..
i did some more digging and #getYRot (in Entity) looks like it returns an angle in degrees
player.sendMessage(radiansToYaw(npc.getYRot()) + "§c|");
}
public static float radiansToYaw(double radians) {
float degrees = (float) Math.toDegrees(radians);
degrees = degrees % 360;
if (degrees > 180) {
degrees -= 360;
} else if (degrees < -180) {
degrees += 360;
}
return degrees;
}
always returns 0.0.
y rot should already be in degrees but that doesn't explain why its always 0
curse you mc code
might be a bit jank but you can use #getBukkitEntity and get the yaw from there
i do remember some weird stuff about using that method versus just using nms
i think it had to do with visual fires where it would only display the visual fire if i used the method in the bukkit entity rather than the nms entity
well.. even if I dont move at all the values are different everytime i spawn the npc
but the npc is always in the same position
classic mojank
if you only need the angle and it doesn't change you could just store it somewhere when you create the npc
ye but i need the angle for what position he falls to and i havent yet understood any factor that relates to the falling position
oh you mean which direction the body is pointing?
the only way would probably be to just summon it with the same yaw every time and figuring out what angle that is through trail and error then
https://prnt.sc/uDOYXYXjjXH1 this was after turning 5° for 72 times and spawning one with my yaw as input. and I did a full circle. i dont get why that part is missing. For me this looks exactly like 71% which would be the same as 256 / 360 = 71%, going back to your byte to yaw explanation. Maybe you got an idea.. Have a good night and thanks for your help (maybe) cya tomorrow.
yeah that seems to match up with the byte rotation
any idea if the translation is wrong? (byte) ((player.getLocation().getYaw() % 360) * 256 / 360)
java doesn't have unsigned bytes so i believe by making the max value 256 it gets truncated
it should be mapping from 0-360 to -128-127
Just tried using every single byte from -128 to 127 and spawn an npc, same problem.. the same part is missing. Seems like it is in fact IMPOSSIBLE.
what was the issue exactly? Trying to set the yaw of a NPC in sleeping position generating random results?
lets say that i have a task running on my plugin and my plugin gets disabled by the plugin manager after some time. Will that task automatically end too?
clearMembers
I am a beginner spigot developer and I have a problem I am writing code I have a list like this:
ArrayList<String> list = new ArrayList<>();
list.add(EVENTPLAYERITEM("eventplayer", Material.DIAMOND_BLOCK,"name", "lore\nlore"));
list.add(ACTIONPLAYERITEM("actionplayer", Material.COBBLESTONE, "name", "lore\nlore"));
}
But it underlines in red I don't understand why it wants me to create
?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! 🎉
what are you trying to do
what is EVENTPLAYERITEM
Please learn java before programming a plugin
I know Java almost*
that code doesn't look like you know java
Well, I kind of wanted to stuff this into a list and then arguments and then get the value from the list.
what frsvn said ^
😭
well he doesn't even have () after public static GiveItemdeveloperE item
the entire thing doesn't make sense, not just that
oh, the static keyword
Damn, and for this you will oppress me, I only recently started studying plugins...
start studying java then, not plugins
oppress? 😭
i don't think that gradients work like this lmao
you probably using legacy colors
(code's garbage still trying to get gradients working)
just use § instead of translating
Use Adventure + Minimessage 😭
don't like putting dependencies and shading
so no chatcolor.translateblabla?
all ears
Reinventing the wheellllll
translate the string message first
But anyways
i mean, do at the begining message = ChatColor.translateblablablablabla and then the logic
Seeing people use the legacy character still makes me wanna vomit 🤢
yeah ik
mini message is boring to use
Like it’s just a horrible system, Adventure uses a proper system by sending them via the proper format
i don't even like the way it works
ok
for me, easy and working things are better
instead of using unnecessary complicated stuff
too much stuff going on
You can't rotate a sleeping NPC in every direction. As seen in this screen (https://prnt.sc/u0vaYjrr5yHo), even if I spawned one at every possible byte,a small part is missing. And the part that is missing is exactly what is missing due to the limitations of 256. For some reason it does work for ClientboundRotateHeadPacket which also takes in a byte but not for ClientboundMoveEntityPacket.Rot..
Did you do the *256/360 thing
Yes
F
(byte) ((player.getLocation().getYaw() % 360) * 256 / 360)
it does work for the head rot.. but not body rot..
how is having to parse all that decade old section sign bs any better than just using mini message and having a string like "<red>thing"
my assumption is that it comes down to relative vs absolute movement
why not just use ClientboundRotateHeadPacket if that works tho
Only works if the npc aint sleeping. When it is sleeping, it jsut changes the head rotation but not in what angle it is sleeping.
I mean, wiki.vg explicitly states that the x, y, z from the movement packet is ignored when in sleeping pose, maybe the pitch and yaw too in this case
can you even move your head while sleeping?
I don't knot, don't think so but changing the head rotation is no problem. The problem only lies with how the body is rotated when in sleeping pos. If trying to spawn them in a circle for every possible yaw, there is a gap.
can you send me the test code that you used to generate this image? I'm trying out something
did you just send a bunch of rot packets
No i created new ones for every single byte. Send it in dms or here?
Any1 has a good idea on how to get a player object with Bukkit.getPlayer() on offline players?
For some reason, when I use #getPlayer and provide the uuid, it returns null
just send it here, preferably in a paste: https://pastes.dev
Thats the error https://pastes.dev/2LlT66wPmz
owner is null.
But I printed out the uuid, the uuid is not null
course.getOwner() returns an uuid
is the name from getOwner.toString correct?
and does the player have to be online
does Bukkit.getOfflinePlayer still exist?
getOwner returns and uuid
an uuid*
Player owner = Bukkit.getOfflinePlayer(course.getOwner()).getPlayer();
ill try this
course.getOwner is an uuid
ok
compare the uuid with [] around it to the actual one from the player (idk yourself) and check if there is any mistakes, maybe a spacing? ig you get it from a config?
I'm using the same method to print a bunch of items for another gui
and it works there perfectly
change the type from Player to OfflinePlayer
OfflinePlayer owner = Bukkit.getOfflinePlayer(course.getOwner()).getPlayer();
getPlayer will return null if the player is offline
I have many questions about your code, but I can't ask them right now since I'm trying out the lukas stuff lol
if someone doesn't point it out before me, I'll check out later
well this should work
This without #getPlayer() in the end seemed to fix it
Even when offline?
Yea
No wait
I rreplaced
The Player at the beginning
with OfflinePlayer
And then removed getPlayer from the end
Updating Spigot to latest 1.21.1 - I was 43 versions behind - broke my database framework, which I need for everything.
Is there any way to revert back to previous builds inside a version (1.21.1) using BuildTools?
🤔 you sure you updated to 1.21.1 and not .3
I updated to 1.21.3. It broke everything. Then I reverted back to 1.21.1 latest version.
And the database is broken there.
So, I would like to try one of the earlier builds in 1.21.1.
To see if it makes a difference.
The --rev command does allow you to enter version numbers
Because I already deleted the config and I deleted the database and I tried earlier versions of the database and nothing works. So I can only conclude something changed in Spigot.
?paste
Because I haven't written any code in 6 months.
Well, yes. I can type in --rev=1.21.1, but what about the specific builds?
So mv world is giving me this error: https://paste.md-5.net/irekukupeg.cs
this is my code: https://paste.md-5.net/icahucelub.cs
MultiverseWorld mvWorld = multiverseCore.getMVWorldManager().getMVWorld(voidWorld);
mvWorld.setGameMode(GameMode.CREATIVE);
mvWorld.setKeepSpawnInMemory(false);
this seems to fail for some reason
It works at the beginning I think
but when I log in with my alt
and try creating a world
It fails
4329 for example is a build from sep 26
So, do you mean like --rev=4329 ?
You can browse https://hub.spigotmc.org/versions/ for ids and then take a look at the changelog to see what it most likely is
yes
Okay, thank you. I will test it out.
rev 4329 should work just fine
then again, it'd be better if you told us what exactly did Spigot break of your database, since right now you're just pushing the problem into the future
is your db lib using ASM?
That's the problem. I don't know. I would rather push the problem into the future and never update again.
because that's the only change I would see breaking it
(just looking at changelog)
It's not my lib, per say, it's my lib in the sense that I'm using it.
https://github.com/NivixX/NDatabase/issues/11
Is it possible to create a small lib in remapped-mojang and use it with maven in others projects and compile everything together from remapped-mojang to the standard mapping ?
is your plugin CriticalFixes depending on NDatabases in its plugin.yml?
because it is trying to access it before load
either that or you're using the lib in onLoad which I think also may cause issues
Yes. I've been using it for a long time and everything was working fine. Nothing in my code has changed. So I would assume it's either magic or the update broke it.
are there any errors before that one in the issue? Could you send the full log?
No errors.
does NDatabases show up green in /plugins?
What does that mean?
if the plugin NDatabases is green in the list returned by the /plugins command
NDatabase does log startup errors so I feel like there'd be one
odd if there isn't
It is an odd issue.
doesn't look unsolveable tho, just requires some digging
then again, it's your choice whether you want to deal with this now lol
Yes, it shows up green.
oh, they are using guice
I don't like this plugin tbh, there doesn't seem to be much of a compelling reason to not just use a proper ORM instead
it setups a global database if anything, but that's pretty much it
With zero previous experience on Java that's what I chose to use and that's what I integrated everything around.
Are there better options? Probably.
Oh I don't blame you for that one, it is a fine way to go about it, I just don't personally see its benefit over say, Ebean however if you haven't worked with java ORMs before then everything may as well be one and the same
you're trying to use a proper database and not a yaml configuration so you're better off than a majority around here lol
that said, if you do get the chance to refactor in the future, I would recommend straying away from it considering that it looks quite feeble in nature. Anything that implements the Java Persistence API will be a step in the right direction
you'll have to do a little bit more of manual work which that library does for you, but hopefully not enough for it to become an issue, and your code will be more resilliant that way
Well, I tried to revert all the way back to revision 4306. And it didn't work.
So now I'm thinking it must be something in my build environment. I updated to Java 23 and then moved back one step to Java 22.
It's such a weird issue.
make a MRE
start a fresh minecraft server, preferably on latest, and only put criticalfixes and ndatabases on the server
if it doesn't load, then it is definitely something with spigot
well, it could possibly be the java version as you say so try that too, but ruling out that, it just leaves out spigot changes
then again, reverting not making it work does make the whole thing weirded, but it could be that the issues compounded and you just didn't notice (that is, both changes in environment and the spigot version itself)
are there any reasonable ways i could stop fall damage from being taken by a player only once, and not take any at all if they touch the ground before they can? the solution i have in place for this sort of thing right now is a crap one so i wanna know if there are any better ways i could do this because the ones ive seen online havent worked for me :/
Set some sort of flag and then remove it when they next touch the ground
are scoreboard objectives server wide
They're stored on the scoreboard
And you can have multiple scoreboards so, depends
*only one of them is persistent though
I'm having an issue where if I set a scoreboard objective for a player
and then remove all objectives from a completely different player
itll remove objectives from all players
So if you use ScoreboardManager#getMainScoreboard it should be persistent
this is with player.getScoreboard
should I create a new scoreboard for every player and just keep a map in my plugin?
What do yall think is the best file type for a list of things (in my case IPs)? txt, json, yml?
by default all players will have the main scoreboard
in the plugin's config folder
if you want that to not happen you need to setScoreboard to a new one in join event or something
human editable?
yes
yml
also in intellij when generating getters, how would I select multiple options? Its only letting me choose one
ctrl click
thx
Bukkit#getOfflinePlayer(UUID) doesn't do a web request for player information, but if the player has never joined the server before is there a way I can query the player with the UUID instead of the Name?
create a profile with the uuid, update it
alright thank
so theoretically something like this should work.
return@supplyAsync entries.map {
val offlinePlayer = Bukkit.getOfflinePlayer(it)
offlinePlayer.playerProfile.update().get()
}```
in a proper language, probably
kekw
does the server cache this then I presume?
it does use the usercache
but eh
if you wanna use this for large amount of players, your own layer might be advised
I'll throw my own layer at it for good measure
I don't want any exploits here lol
this'll be loaded with a GUI so the more caching the marrier
are you not using coroutines
smh
I prefer CF
why shade a 2mb library when CF is a great API
library it
who shades kotlin stuff
because its designed for kotlin
legit who cares
me & ebic
I don't want syntax sugar when CF is already great
me and rad
fake kotlin user
@blazing ocean
what
what
why are you pinging me
what do you mean
are you stupid
i cant stop coming
https://paste.md-5.net/alojagiqah.java trying to make when a bamboo grows has a chance to spawn a creeper, nothing seems to work
Have you registered the listener?
When spawning a modified entity use the spawn method that accepts a consumer
and modify it there
yes
Add some debug messages
i'll try that
also don't create a new random instance everytime
Just having it in the listener class is fine
I dont know
You could also just use ThreadLocalRandom.current
does anyone know what im supposed to pass into bit set params of PacketPlayOutLightUpdate
https://paste.md-5.net/ijibiwuwic.cs trying to make when a player interact with a certain item it gives attribute + of attack speed during 2 minutes, and when that timer runs up it gives the player the default attribute value, slowness and summon a lightning on the player, everything works except giving the player the normal attribute, slowness and a lightning once the timer run out
Hello there, I'm new at this server. If my message it's out of place please make me know. Also forgive my english.
I'm working on a minigame plugin, in order to simplify furnace usage, the player only has to right click on the furnace with an item in hand to introuduce it into the furnace.
When furnace smelts, I make the furnace drop the result item so the player would pick it up. After that the result slot must be cleared for the next item to be smelted.
However, the result slot is not clearing in the FurnaceSmeltEvent.
@EventHandler public void onFurnaceSmelt(FurnaceSmeltEvent event) {
Furnace furnace = (Furnace)event.getBlock().getState();
ItemStack item = event.getResult();
furnace.getWorld().dropItem(
furnace.getLocation().add(new Vector(0, 1, 0)),
new ItemStack(item.getType())
);
// Furnace is not clearing result slot.
// Let's smelt when the next item is the same
// as the last smelted item, because will be stacked in the
// result slot. But when a new item is different, furnace won't
// cook it due the result slot still has the previous item.
furnace.getInventory().setResult(null);
Messenger.msgToConsole("Furnace smelted and cleaned!");
}
Is there something I'm doing wrong?
In other method I use the same .setResult() and it works fine.
get inventory 100% returns a clone to the actual inventory
i think
not sure
is there a setinventory or some shit
so much for 100%
Okay, I made it work!
This is what I changed:
@EventHandlerpublic void onFurnaceSmelt(FurnaceSmeltEvent event) {
Furnace furnace = (Furnace)event.getBlock().getState();
ItemStack item = event.getResult();
furnace.getWorld().dropItem(
furnace.getLocation().add(new Vector(0, 1, 0)),
new ItemStack(item.getType())
);
// After dropping item, execute a task
// with FurnaceInventory#setItem()
// after 1 tick. C:
// Furnace result slot gets successfully cleared.
Bukkit.getScheduler().runTaskLater(OverCrafted.getInstance(), () -> {
furnace.getInventory().setItem(2, new ItemStack(Material.AIR));
}, 1);
Messenger.msgToConsole("Furnace smelted and cleaned!");
}
Just like @young knoll suggested, I delayed it a tick.
Thanks for the help! C:
Hello,
quick question, does anyone know why I can't find the dependency of minecraft 1.12.2 spigot api. I have not made any changes.
Execution failed for task ':bukkit:bukkit-common:compileJava'.
Could not resolve all files for configuration ':bukkit:bukkit-common:compileClasspath'.
Could not find org.spigotmc1.12.2-R0.1-SNAPSHOT.
Searched in the following locations:
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/spigot-1.12.2-R0.1-SNAPSHOT.pom
Looks like you're depending on the spigot artifact instead of the spigot-api
If you want access to nms and such you need to run BuildTools
?bt
Don't use buildtools, I can't build my plugin because it can't find the dependcy from the spigot api. Since about 2 hours.
You have two options:
- Run BuildTools
- Switch to spigot-api rather than spigot
?bootstrap too :3
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Why did that change earlier?
Hi,
I have read a few articles about buildtools, I understand that you have to run buildtools for the version (1.12.2), then it creates a jar for me, I have to import it into my plugin project and then I have access to nms again. Is that correct? Since I still don't have access to it after importing....
`?nms
!paste
?nms
?paste
https://paste.md-5.net/iluvohihes.php
anyone know why when im sending that
com.comphenix.protocol.wrappers.Vector3F
to a TEXT_DISPLAY it kicks viewers for
java.lang.IllegalStateException: Invalid entity data item type for field 11 on entity class_8123['Text Display'/1000003,
just use a real text display
no
I like the control of the packet version
helpful 100% XD
yea thast why im here asking for help
bc i plan to use the packets
is there a particular reason you want to use the packets?
Does it really matter why i wanna use packets?
not to sound mean but if u dont know how to fix the pakcets i dont really need ur help
Why would you not use the api when you can...?
ah this is why paper is bettter i forgot
XD
you're gonna get told the same things in the paper discord
Paper is better because they have an api... just like spigot?
be mean if you want, doesn't hurt my feelings to read some characters that form coherent words and sentences.
you are so rude
but just so you know, I am the progenitor of holograms
lol
what an useless comment. turn those who are trying to help against you
its fine, they are more then welcome to go to paper 🙂
they are probably using paper anyways
im crying right now because he said that
but what I find ironic, is they are using a heavy lib, to offload a cheap thing to only the client
when they could just use the api which provides what they want at a cheap cost to begin with
He left lol
This is coming from a reliable source too, there’s little reason to use packets for display entities
Its not the first time he's demanded answers without answering ours. I doubt it will be the last.
but muh packets
but it could be
lol true
Idk seems they are quite serious they gave us the middle finger out the door kek
this guy was a "ceo" of a team that I'm apart of... damn
lmfao
Harness the power of AI to craft a Minecraft experience shrouded in gothic mystery. Our tools blend ancient aesthetics with futuristic technology.
That’s certainly a description of all time
he could have literally used this in protocollib
maybe if he looked into the api's he's using he'd get it
I found it so fucking fastr
I too like the control
from the couch, to turn the tv on
(is that a thing people do nowadays?)
^ me right now
no, people just short the wires and have it turn on
who watches tv in 2024 that shit is too damn expensive
um smart tv's come with hulu, netflix and youtube etc
i get that for free
cheaper then cable if that is what you mean
ok, what does that have to do with watching tv?
ok
not meant as an insult, just that it makes sense why you only need a pc
im trying to run BuildTools for 1.21 but it keeps using 1.21.1. How can I change that?
Don't use 1.21
i need it
no you don't
yes i do
1.21 has critical bugs
why do you believe you need it then
that's because you should not be using it
just use 1.21.1
it's just some dupe and bug fixes
say that to the protocollib maintainers then
don't know what you're on about
i think that explains it
is this a question or an acknowledgement
I'm stuck while creating a new custom enchant. Can someone help me pls...
that is not how you do custom enchantments
not that they've ever been supported really, but nowadays you can do custom enchantments via data packs
or nms
but data packs is the only supported way
is there anyway to make a custom enchant without nms ?
where can i find a example of nms plugin ?
?nms
to start with ^
I recommend just doing it with a datapack honestly, will save you a lot of time
you can bundle it with your plugin and install it if necessary, though I'm unsure if the API allows for dynamically loading datapacks, you could just force a minecraft:reload
that is a inconvenient
i mean an example of custom nms enchantment
believe me that dealing with NMS to register an enchantment is a thousand times more incovenient
yeah... that doesn't exist
when dealing with NMS, you have to be aware that it is outside the realm of the API so you'll be solely relying on your knowledge of internals
synchronized registries aren't reloaded, or-- something like that lol; but i know the enchantments registry isn't
tl;dr: good luck, have fun
does the client accept new enchantments if you send the mutated registry with the packet or does it just refuse to acknowledge new enchantments after bootstrap like the server
on a high level, you have to unfreeze the enchantment registry, construct your custom enchantment instance with all the details and definitions and configurations you want, and then add it to the registry
in theory you can kick the player back into config state, but spigot does not play nicely with that at all
danm custom enchantment plugin doesn’t exits in 1.21 anymore
i'm sure EcoEnchants exists
but like, that is overabstracted and overengineered enchantments plugin loll
that plugin doesn't use true custom enchantments, since these didn't exist when it was made
well, I don't know if it does now, but it definitely didn't last time I checked
it just uses the good ol' trick of essentially just replicating enchantments with the lore and shenanigans I can't be bothered to explain
they do seem to add entries to the registry
obviously the enchantment definition is a dummy, but it still has the key for them to identify, and it can be properly added as an enchantment to items i guess
oh, they do registry the enchantments now
We love a little registry abuse
If the registries aren’t meant to be unfrozen then why do I have a blowtorch?
you mean thawed 🤓
Ashcktually, the linguistic register (no pun intended) for the word unfreeze would be more appropriate than thaw, given the technical context 🤓 ||(oops, didn't mean to ping, sorry)||
String falseTeamString = UUID.randomUUID().toString();
Team mobTeam = Bukkit.getScoreboardManager().getMainScoreboard().registerNewTeam("STARTEAM" + falseTeamString);
mobTeam.allowFriendlyFire();
mobTeam.setColor(ChatColor.BLUE);
Entity ent = Bukkit.getPlayer("Aesopian").getWorld().spawnEntity(Bukkit.getPlayer("Aesopian").getLocation(), EntityType.COW);
mobTeam.addEntry(ent.getUniqueId().toString());
ent.setGlowing(true);
Why does a cow spawned with this code and set to be glowing not glow blue? It just glows white...
https://streamable.com/0rcm5t is there a plugin like this?
It varies
why does the true scale not reflect on the client until i relog?
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
ItemDisplay display = player.getWorld().spawn(player.getLocation(), ItemDisplay.class, itemDisplay -> {
itemDisplay.setItemStack(head);
itemDisplay.setInterpolationDelay(5);
itemDisplay.setInterpolationDuration(100);
});
Transformation transformation = display.getTransformation();
transformation.getScale().mul(25);
new BukkitRunnable() {
@Override
public void run() {
display.setTransformation(transformation);
}
}.runTaskLater(this, 1L);```
it'll do as much as it can in the 100 tick duration, but then after that the item just stops transforming. after i relog, it will show the true x25 scale
nvm, seems to be an rendering issue with the client i am using. works completely fine on vanilla...
hi is it possible to somehow cancel a ServerListPingEvent? Like make the server not respond
the class does not implement cancellable and I couldnt see any methods to do this
why would u... not want to respond to pings?
could probably use PacketEvents or ProtocolLib to do it tho idk
VPN blocker
https://imgur.com/a/FzRBEL0 eh, why
it's an optional config option for the plugin im making to not respond to pings made by VPNs (because of server scanners)
personally would not join a server that blocks vpns but i digress, check packetevents or protocollib to see if it has the packet tht u can cancel
help me
it is
everything sent between the client and the server is a packet
https://github.com/retrooper/packetevents/blob/2.0/api/src/main/java/com/github/retrooper/packetevents/protocol/packettype/PacketType.java#L259
https://github.com/retrooper/packetevents/blob/2.0/api/src/main/java/com/github/retrooper/packetevents/protocol/packettype/PacketType.java#L291
these might be of use to u
I got an error:
Could not find artifact org.spigotmc:spigot🫙remapped-mojang:1.21-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
i tried to reload maven, clean,.. but not working
anyone have any idea?
use 1.21.1
i used 1.21.1 and that lead me to an error while doing this:
Component component = Component.literal("Custom Enchantment");
java.lang.NoClassDefFoundError: net/minecraft/network/chat/Component
why nms?
cause i want to make a custom enchantment plugin
Which server jar are you using?
What to do if it doesn’t install?
Just use gson
Gson is the name of the library, it still uses json files
1.21.1
I dont know
anyone...
Using maven?
yes
here is my pom
Use the paste
That looks like the old pom still depending on 1.21 and not 1.21.1
when i use this pom i got this error:
Could not find artifact org.spigotmc:spigot🫙remapped-mojang:1.21-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
when i use this pom: https://paste.md-5.net/viwiwatoma.xml
i got the error:
java.lang.NoClassDefFoundError: net/minecraft/network/chat/Component
and i see no redline while coding, it just apear when i enabling the server
Send the entire error and how you are compiling
i used maven clean and install to compiling
I can't find the attribute type of the player's natural regeneration can you tell me what they are called?
Make sure you're not using artifacts and that you use the non-prefix and non-suffixed jar if there are multiple ones in the output
Regeneration is not an attribute
I don't understand the question?
how to change player regeneration if it is not an attribute
Olivo thanks for your help and i have another question that where can i find java doc or something of net.minecraft ?
they do not exist as that would be illegal
HOWEVER
yarn has javadocs
package index
90% of names will be different to mojmaps tho
that's a bit questionable Ig
wdym
you could probably generate a mojmap javadoc for personal use
you're not allowed to make them public
or even better, a parchment javadoc (parchment is just mojmaps with paramter names and javadoc)
yes, I said "for personal use"
that assumes you do not make them public
in current context
oops I think I accidentally deleted IJ configs and plugins when cleaning up space
happens Ig
wait what how can i do that
through magic
gimme a minute, I'll try doing that
sadly, all my gradle caches have despawned magically, so it'll take a while
feel free ❤️
seems that generating such javadocs is a bit hard (decompiler artifacts bruh) but totally possible
remember that repo
Hmm yes
Do you think it gets rid of decompiler artifacfs?
But I doubt there is a parchment one, so no javadoc
More specifically, this is the issue I encountered https://github.com/Vineflower/vineflower/issues/245
If not it, I could have generated jd
Might try with fernflower a bit later
is there a way to set a block state without updating lighting
Perhaps set the applyPhysics to false on https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/BlockState.html#update(boolean,boolean) ?
declaration: package: org.bukkit.block, interface: BlockState
Not sure tho.
how could i check when a entity it starts EXPLODING
bc, entityprimeevent call when the entity explode
and entityexplode the same
ty
has been fixed a long while ago (https://github.com/Vineflower/vineflower/commit/f610a720357de058c689ef5966d44b598cac38a7)
Looks like I need to update loom
is there a way to allow players to bow through eachother with nms?
I still can't really make entities invisible (not transparent) to spectators, specfically armor stands.
I've tried:
-team seeFriendlyInvisibles (doesn't work, it works for normal gamemodes like creative, surival)
-custom EntityArmorStand implementation - here I cannot really change anything so I assume it is either client-sided or in any parent class
-destroy packets (destroys the whole armor stand)
-giving it invisible effect
Any new ideas?
why did destroy packets didn't work
the entity literally wouldn't be there so there's no way it wouldn't work
yeah but I must keep the custom text of the armor stand
Just use a text display
^
this is needed for backwards compatibility in spigot 1.20 iirc+ I can use it but what for older versions?
you don't even have to do the destroy/spawn packets directly btw, Player#hide/showEntity essentially does that for you
yeah but the solution is a text display
There's not much you can do, just let the armorstand be there
hypixel somehow hides it, that makes me wonder if the entity is even an armor stand
Actually what you can do is use teams
HP doesn't do spectator mode though, does it
but only send the team data when in spectator mode
they just do creative with custom stuff
or does that also remove the nametag?
because spectator mode is too unreliable
if I am on respawning screen you are in spectator and you cannot see it
Does Hypixel even use spectator mode
I don't think it does
Last time I played they didn't
are you sure about that? I am pretty sure it is creative
but that was a couple years ago
ok it is like that:
-when respawning or spectating a specific player you are in spectator
-when actually in spectator you are in survival
🥴
1.12.2-R0.1-SNAPSHOT.
