#help-development
1 messages · Page 1169 of 1
me when my entire interaction system breaks after updating to 1.21.3
💀
moment
I knew that G was looking kinda funky
oh shi its from another server
?

read this guys like last 5 mins of messages
@austere cove
I think thats why you were pinged
this guy was rude to me first and hten started crying when i matched the energy ^
and i lef thim alone, just typed something in chat and he again replied to me saying no one asked me
and is now crying again
yall can do whatever you want but im not in the wrong lmao
#general message shameless self promo
"But you started first!!"
how old are you genuienly
?paste ur pom
I dont wanna get ?whereami'ed
smh
ik the "syntax" for group id's are something like net.zeradris.blabla if you have that domain but what if i just dont have any domain? what then
whats the correct thing to put
thx
wtf my jar still compiles?
ive seen com.github.user too
clear cache and restart
alr 🫡
~~replace with spigot id and we wouldnt know ~~
Sure super hard to use
MenuType.SMITHING.create
Player.openInventory
And it returns an inventory?
That's just my quick tutorial
Nope an InventoryView
So mist be associated with a player
most inventories should be player based
Welp I've got bad news for you
I also have more really bad news for you
😨
😨 😨 😨
With a side of bad news for you
Bad news 1 Bukkit.createInventory is on its way out
chest inventories
SHIT
DAMN
NO
NOONO
9x1 is a 1 row inventory
Bad news 2 InventoryType is next
ONONONONON
Bad news 3 they'll be replaced by better alternatives
BETTER ALTERNATIVES????
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
Bad news 4 you have to cope some menus only work with players
E.g. smithing anvil etc
Are you saying I can't make the ender dragon open an inventory? 😭
bro everything is yellow 😭
Guys, does spigot actually remove anything it deprecates?
rarely
Yes
Minecraft 1.21.1 is 2 months, 4 weeks old.
?howold 1.21.3
Minecraft 1.21.3 is 2 weeks, 1 day old.
omg outdated!!!
?howold 24w45a
Minecraft Snapshot 24w45a is 1 day old.
?howold 2.0
Yeah
?howold 1.21.4
it's just the calendar week
<year>w<week><id>
Inventory#getTitle is the only one I'm aware of
why?
No use for it
what do they have then
names?
b-but I need to identify my own inventory!11!!!eleven
no
eleven? lmao
ohh
I believe they have IDs
10 year old system that hasn't been replaced
LMFAOOOO
I laughed at that
Bukkit in a nutshell:
minecraft in a nutsheel
^
Meh, they're in the process of just ripping those out and replacing them
slowly
They're also writing somewhat decent code nowadays
i love the ai mechanics
mojank ina nootscheel
4j studios > mojank studios
i loved 4j studios mc
lets face it, glide was the best part of it
frrrrr
cavern record?
dont remember
terra swoop force tho
bro that shit is so useless
10 minutes of gameplay
NOTHING surpasses og glide
change my mind
never played 4j studios
yet you know terra swoop force??
Yeah fuck consoles
you had no childhood
It's noxcrew
this.
I'm German do you expect me to ever have fun
true
do you like know them from elsewhere
always busy raising hands
Yes
sure 🤷♂️
💀
did you drink many beer
not funny
:(
oh fuck that only just hit me
lmao
was it funny for you at least? 🥺
ill take it
im all ears
"its as useful as anne franks drumset"
yeah no clue what that means
but sure
do you know who anne frank was
yes
how would she have used a drumset without being caught
thats such a good response to a racist joke waiittttt
@river oracle how do I get a generic inventory of N rows from an int
it's not really something you make jokes about
sorry.
also, can you convert inventoryview to inventory and/or vice-verca
No
Views are locked to a player
?? 😭
If statement
how do I work with inventoryviews in InventoryClickEvent
The same
getView
A view is just a combination of top and bottom inventory
NO
And it's associated with a player
Well views also have specific data
you mean switch statement
Yeah I mean you could I think
actually, hashmap
Could do that too
is there a way to define a "locked" hashmap? cuz final doesnt do that
immutable is the word I think
Maybe Collections#unmodifiableMap if that exists or create your own wrapper that overrides all modifying funcs
wait, Map.of() is immutable appearantly
didn't know that existed, but yeah.
Most (maybe all, if the std lib is consisten) that use <Some collection>#of is immutable. Just like List.of and Set.of
alr
dont you love it when your code turns yellow
Ya'll a bunch of nerds so help me w/ something batch related.
To echo a blank line on the screen, type:
echo.
This makes sense and so does echo Hello World and echo "Hello World"
but wtf is the point of the dot in echo.Found cURL
Batch 
Parser 😎
This isn't a variable, why the fuck are they using a dot
Average Batch user
Average random github repo
real
good thing I'm having ChatGPT do all the hard work 😎
tf is this about
thats a... very badly cropped screenshot that doesnt really provide any context?
hello; does anyone know if it's possible to change how fast villagers collect crops?
I saw somewhere that EntityChangeBlockEvent covers that so I thought I could just cancel the event if it's a crop & have a chance of it being added to its inventory
to nerf it; that's what I'm trying to achieve
That sounds fine
cool thanks
hey, I have a question: how can I hide players on the server using protocollib version 1.21.1?
Player#hidePlayer(Plugin, Player)
idk where else to post that to not spam, but... I want to ask something. I've always been strictly server-sided, but I want to know how in practice is the server related to the client, like is the same code shared or "taken" out of the main code just for the server. Because I saw DedicatedServer (that are probably localhost/lan?) classes and that got me thinking whether the server (MinecraftServer, other classes) code is actually just taken out of the main (client+server) code. Is there any concept / diagram of that the internal structure? Understanding that is basically a key to modding mc both-sided.
There is MinecraftServer which is just an abstract class, and then DedicatedServer which is an actual server you run. There is IntegratedServer which is a singleplayer world. Both extend MinecraftServer
^^
I believe IntegratedServer is client-only
yes specific classes would be under net.minecraft.client or net.minecraft.server
Yeah it's a client class
I wonder how mojang has it setup internally
like 3 projects, shared server client?
or just different modules?
I'd guess monorepo and some ugly mess of a buildscript
ok so most of the code is basically reused and then it has this categories
net.minecraft.all_common_code
net.miencraft.server
net.minecraft.client?
do you have your bets on gradle or maven 😈
net.minecraft is common, nms is server and nmc is client only
I think they just yeet the entire net.minecraft.client package for the server
Gradle since DFU and Brig have Gradle instructions
oh fair
and then for server just shade 2 out of three modules into a server jar
(probably there is internally more modules? but 3 main)
I don't see what they could be using other than modular projects
do i use special source public or convert to tiny and use tiny
ask @shadow night instead smh
nah
wait he's prob sleeping now
do you think having mc server as a complete separate project would be a bad thing or a good thing (yes we wouldn't have integrated server)?
beacuse I think it would actually be much better and cleaner
what
what
when I do that, players disappear from the tablelist
I actually LOVE that they are hidden from tab, thus I can easily just make multi-instance game in a single server
n-no 😭
That’s what we used to have
there is a reason networks exist
It meant bugs existed on one but not the other
but that happens automatically afaik when sending remove packets probably, so maybe they could fake it being on the tablist idk tho
flag? at least for hidePlayer I don't remember it existing, except if you mean something else
Use tiny
Otherwise you have to use proguard and whatever you need for csrg
my source is special
It’s not in the api
ooooh 😦 I tought I could workaround things this easily
probably just a call to nms tho so it doesn't metter that much anyway
anyone know of a way to get the normal vector off of an entity hit by a raytrace
making custom projectiles and i wanna have it so these things can bounce off of entities
i dont know how to check which face of a bounding box is hit though
making a magic plugin
such entities wont do
need their behaviors to be very specific
Because it is interesting and actually easier for some projectile custom stuff, ofc for a simple stuff modifyng normal is better
Does someone how can I modify/display exeption messages similar to this? I've seen some plugins use them
its brigadier
its on the mojang github org
theres other command frameworks that support it like cloud
you can't modify that exact message where it's showing
that one is entirely client sided
Can they be sent for custom commands?
Is it possible to send those messages without the use of brigadier?
its easier to just use brigadier or a command api that uses it
im back after a couple of months 😛
https://paste.md-5.net/esalequbux.sql
my question is :
why this no worky???
libraries:
- "de.tr7zw:item-nbt-api-plugin:2.14.0"```
yes (im using brigadier)
that only works for maven central
Any way around that? I really don’t feel like shading
add it as a dependency ?
I want my plugin to automatically download all dependency’s so people can easily set up the server
Shading would mean bigger file size, I really don’t want that either
Manual labor < automatic genius
its not manual labor since its shaded in your plugin though
you have only two options
yes
4MB
easy fit
inb4 1.8
I want to make the display name of a item invisible
Duarte clocking in another 9-5 in help development, nice to see good people doing good stuff
So?
I can only really do that with packets or nbt
What are you setting in the nbt?
displayname
To what value
🐬
And or if that doesn’t work I’ll use the hide item tooltip thingy item edit used
If you just want to set it to an empty string you can do that with the api?
When I do that it renames the glass back to default
and I cant do this
if (meta != null) meta.setDisplayName("\u200D");
as it just returns a weird string
Just set it to a space
how does it look like ?
" "
let me get a ss, olivo ill try that again in a minute
Hide tooltip is also an option in the api
gotta remove the nbtapi dependency
So you can just go with that
whats the box size of that compared to doing ChatColor.DARKGRAY+"" ?
ill try this now
that worked 😛
Yeah the name can't be empty
pretty sure that can be achieved with the regular itemmeta api
that is without it
that is with ChatColor.GRAY
omg i did this already
im having memory loss
blackMeta.setDisplayName(String.valueOf(ChatColor.RESET));
god damnet
💀
Hm? Why do you need to PDC tag if every egg has it
Could probably listen to the entity drop item event
Try the LootGenerateEvent
test, who need minecraft server (java & crossplatform) developer ? dm me
no one does
what is the (String.valueOf(ChatColor.RESET) for? you are doing the same thing setDisplayName("") would do
again, setDisplayName("") just defaults to the item name in minecrafts code
ive tested it
then do setDisplayName("§r")
does it really matter
chatcolor.reset is just §r
its arguably less performant. but im just giving more options. § is directly supported
Sometimes its good to be aware of options. doesnt mean you have to use them.
yeah but looking for the section symbol and copy pasting it is annoying
enum is easier
ChatColor.RESET + "" 😁
exactly
Im trying to make a gun that uses rayTraceEntities to get what the player hits but because of lag I think and that the raycast is server side even if my cursor is right on a player that's just moving side to side, I "miss", but if I aim slightly in the future i.e. predict where they will be in a few milliseconds, it hits.
is there a way to make it more accurately reflect a hit in accordance with where players are on the shooting player's client somehow
imho I'd rather fps games follow this sort of tracing logic
Take battlefield for example, this how their gun physics work which is more realistic
I'm not being very helpful because I'm not too sure how to go about that issue but I like the realism in fps
Well, yeah but they do that intentionally by simulating bullet travel/drop and such, in this case, its just a byproduct of client-server lag which is not ideal,
For example, if I had really bad ping the amount of predictive aiming I would have to do would be vastly different than if I had good ping which is a bad experience as it's not standardized for all players yk?
Like I said I'm not sure how to go about this, if it's a latency issue then I'm not even sure that's fixable
Fair enough. I recall popular servers having games that emulate CSGO (mineplex comes to mind a few years ago) and they seemed to solve this problem decently well if I remember correctly, so just curious if anyone here with more experience has some thoughts.
Perhaps, hopefully someone has
so, i'm making a map display plugin, but now i have an issue of sending map packets to new player / after server restart. Now i tried to do that using .dat, and saving each MapDisplay pixel data and mapId to it, and on join just sending all of that to the player. In the console packets are sent, and they are correct, tho maps remain the same - default ones...
I'm using protocol lib for sending packets
(Not sure if that would work!!!!) You can store the current position of the player before raycasting, then raycast into the original stored position and then see if the bullet was fast enough to reach the target (and if it was damage the player). But this is just a concept.
Provide some actual code
I think this is how rust manages it, with more validation I assume but still some shots result as “invalids”
I'm not at home rn, but in short:
- MapDisplay contains mapIs and a byte array of colors ( 128x128 )
- When i save it, i just write the whole array as a value to the .dat file, with key being mapId.
- Stored data, and data plugin loads after restart do match.
- Method that sets map data also works, but map just doesn't update.
bruh i thought i pushed the code to git, but i just commited it
any update on ConsumableComp?
Thats not spigot
does anyone know of an efficient way to get the closest face relative to a point on a bounding box
block or entity ray trace?
entity
not possible with api
i mean surely you can do some math to figure it out right
i just dont know what the best method is
it essentially just boils down to finding out the closest face to a rectangular block
You can make your own raycastr algorithm
i will still need to know how to do this
a custom raytracing algorithm wont fix that
Why do you need to know that?
i want custom projectiles to bounce off hit entities and i'd like this to be done based on their bounding box
but im thinking instead im going to bounce these projectiles from a normal vector from the entity's center isntead
wasnt there a problem when getting the position of the projectile ? the position is mostly not where it rly hits i think
im pretty sure raytraces are pretty accurate in where they hit
if not a custom raytrace algorithm will be necessary yeah
So you want the projectile to bounce off vertically of where it hit or in the opposite direction of the raycast dir.?
has anyone actually ever written a multi server communication with sockets
I'm writing my own but I'm not sure if I'm even going about it in the right way
what is the problem ?
If the Projectiles have a too high velocity it fails sometimes but i think in normal use cases it will work
Hey, how can I disable the farmland to become grass again if there is no water ? 🤔
that might be triggered with a BlockFromToEvent
ah nevermind
BlockFadeEvent might be of use
Okay thank you :D
does anyone know if its possible to move a textdisplay entity by using the EntityRelativeMove packet?
why would you ? but probably yes
wym with why would i? its packet based
what would be the reasons for a world unable to being deleted
after running Bukkit.unloadWorld
the entity is packed based ?
yes
did you try to wait some time and try then to remove ?
did you try the packet ?
never had this issue before with waiting no time
yes
you could try to set the interpolation and then use teleport instead if it is not working currently
wait, the interpolation smooths out the teleport?
yes (maybe?)
im gonna give that a try
and then after an autosave it gives me this
[22:36:41 ERROR]: Couldn't save chunk; already in use by another instance of Minecraft?
net.minecraft.server.v1_8_R3.ExceptionWorldConflict: Failed to check session lock for world located at .\matches\match-1, aborting. Stop the server and delete the session.lock in this world to prevent further issues.
at net.minecraft.server.v1_8_R3.WorldNBTStorage.checkSession(WorldNBTStorage.java:80) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.World.checkSession(World.java:3123) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.ChunkRegionLoader.a(ChunkRegionLoader.java:121) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.ChunkProviderServer.saveChunk(ChunkProviderServer.java:280) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.ChunkProviderServer.unloadChunks(ChunkProviderServer.java:386) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.WorldServer.doTick(WorldServer.java:236) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:944) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:412) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:808) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:641) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
at net.minecraft.server.v1_8_R3.MinecraftServer.lambda$spin$0(MinecraftServer.java:132) ~[patched_1.8.8.jar:git-PandaSpigot-"b0ab6d0"]
even tho I ran Bukkit.unloadWorld
maybe more then one instance is using the world container ?
impossible
public static void give(Player player, ItemStack item) {
if (item == null || item.getAmount() < 1) return;
HashMap<Integer, ItemStack> leftovers = player.getInventory().addItem(item);
if (leftovers.isEmpty()) return;
for (ItemStack leftover : leftovers.values()) {
player.getWorld().dropItemNaturally(player.getLocation(), leftover);
}
}
if item stack amount is > 64 then it just gives the player a stack of items bigger than 64, the maximum is 99, what do i do to fix it so it splits when its more than 64?, should i do it manually, clonning the itemstack and setting the amounts to be <= 64 ?
yup it does, appreciate your help
There’s a separate interpolation for teleporting
im creating them from a async context
public static void give(Player player, ItemStack item) {
give(player, item, item.getAmount());
}
public static void give(Player player, ItemStack item, int amount) {
if (item == null || amount < 1) return;
while (amount > 0) {
ItemStack splittedItem = item.clone();
splittedItem.setAmount(Math.min(amount, 64));
amount -= Math.min(amount, 64);
HashMap<Integer, ItemStack> leftovers = player.getInventory().addItem(splittedItem);
if (leftovers.isEmpty()) continue;
for (ItemStack leftover : leftovers.values()) {
player.getWorld().dropItemNaturally(player.getLocation(), leftover);
}
}
}
okay i made this
i hope thats ok and it works
I'm not sure why you're doing that though. You can do this instead:
ItemStack itemStack = // whatever
itemStack.setAmount(128); // You're allowed to set amounts above the stack limit
World world = player.getWorld();
Location location = player.getLocation();
player.getInventory().addItem(itemStack).values().forEach(remaining -> world.dropItemNaturally(location, remaining));
addItem() always returns the items that couldn't be added, regardless of whether stack size is > max. And if all could be added, it returns an empty map
isnt Staff better ?
Oh! Okay! I mean I don't think so but like if you think so then like I guess that'd be really cool 
BUT LIKE I DON'T HAVE TO
but Emily thinks so, so like I mean I'm not opposed to it
but i meant you can set the amount > 64 but then the player receives this in 1 stack, so player has for example 99 items in 1 slot
I don't think that's the case. I'm like 99% certain is breaks it up into stacks
Did you verify that that was the case?
Weird. I was certain it split them up
What interesting features were added to spigot 1.20.1-1.21?
Like Player.addResourcePack
(Before it was impossible)
i always take a look at https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits for new stuff
1.20.5 added a lot of cool stuff
I can't find versions 😔
What?
oh thanks
I should check everything after 1.21.1? to understand what was added in 1.21.1?
for example yes... but some stuff was added after 1.21.1 but still was already in vanilla MC in 1.21.1 (and not in spigot api)
are you about new attributes and commands?
what ?
Wdym by stuff that was added after 1.21.1 but still was already in vanilla MC in 1.21.1
for example the PlayerInputEvent was added after release 1.21.3 but could have been added in 1.19 for example
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInputEvent.html
you can always take a look at the docs for stuff like this
declaration: package: org.bukkit.event.player, class: PlayerInputEvent
? its just an event which gets called when a player presses WASD oder SPACE ...
Can I somehow make the armor stand in a smithing table wear more than 1 armor piece
i dont think so... its just a visual for the current item
F
I guess it's client-side
why use packets
more optimized than bukkits api
😭
going through packets cuz its more optimized is wild though
??? how?
but its not that different from just using bukkits api, and i use protocol lib, so it is not that hard lol
how can it be null if its final and i instantiate it like that
empty is fine, it just returns an empty set then
this is throwing a NPE
wild
well it shouldt throw npe if you initialized it.
yeah but its actually throwing an npe
rip
maybe it doesn't initialize properly
you tried adding an if with checking != null?
i mean its fine then but if im doing something wrong i'd rather fix that
where do you set animationParts?
first screenshot, at the top of the file
so its just an empty hashmap?
yeah
All that's saying is a key could be null
I just ignore intellij it's got such stupid inferences sometimes
no, animationparts itself is null
and it actually is throwing an NPE
it should not be complaining about looping through a potentially empty map
Show the stacktrace
even then the code wouldnt crash if an element was null
Show me line 20 in SpellTask and 69 specifically
it would only crash if the actual datstructure was as null
How is that even possible unless you're using unsafe
yeah wth
also its a final
the map is instantiated on line 26 xdd
This is why you should use constructors
myea
that was my assumption tbh
it does help to have people walking through possible steps to let me know im an idiot
Constructors>>> Inline field initialization
based
how can I make the /tab nametag toggle work if I disabled it so that the name is no longer visible in the players, the command /tab nametag toggle no longer works?
so the command works, but nothing happens when I give the /tab nametag toggle command, when I disable it, the name is no longer visible in the players above the head, but if I re-enable it, the name is visible and I give the /tab nametag toggle command, it works, the name is disabled, and if I and the command is activated back
that I have a roleplay server and I want to make the /tab nametag toggle work even if I disabled a config so that the name is no longer visible and if you give the command the name will appear only to that person who gave the command
I use tab V5.0.3
this is for spigot help and not for plugin directly help... you should ask the owner of the plugin directly
ok, sorry to bother you
If it's not you it's malware you need to wipe your pc
Hi, I'm using the player.getInventory().addItem() method every time a player breaks a crop, as I want to add the harvested item (e.g., wheat) directly into the player's inventory without dropping it on the ground. However, it seems that this method is quite resource-intensive. I was alone on the server, and after profiling it with Spark, I noticed that Spark reports high resource usage for this function.
does anyone have suggestions for optimizing it?
You can't do much about that blame bukkit for doing deep copies
you could try to teleport the item to the player ... but thats not safe for in lava and i dont know if this is faster because its using NMS
Is creating a queue of all items to add to the inventory and then using a Bukkit.getScheduler().runTaskTimer to process the queue at regular intervals a good approach? My idea is to batch the items from multiple crop breaks and add them to the player’s inventory in bulk every few ticks, rather than adding items immediately on each break event.
I think you're overthinking. I am not at all convinced that this is overloading your server. I think you're misreading your Spark profiler
yeah maybe
If you're looking at the percentage mode, then yeah, it might have a higher percentage than anything else on your server if you're doing nothing on it but the one thing you're actually doing
What matters most is the time taken in milliseconds. If it exceeds 50ms/tick, you're in trouble
You're right I was looking at the percentage mode in Spark
Yeah it can be misleading at best
does saveResource works like this?
You'll often see the server sleep take up like 90% of the server tick, but that's because your server is performing well and doing what it's meant to be doing - sleeping while not processing any logic lol
Ok can i do a spark and send the spark here ?
Sure
what are deep copies
Yes, that would work
You can't do saveResources("languages/") though because it doesn't work recursively
So, I should save every file separately?
typing in one message is hip and cool with the kids
Though now that I think about it, ./languages/langs.yml might not work. languages/langs.yml would though
ok thanks
And yes, you would have to save them all individually
Or make a method to save them recursively
https://spark.lucko.me/l49727s11D
is that good so ?
ok-ok, thanks
oh, yeah
Oh yeah. Your average MSPT is < 1ms lol
Ok so i need to look the ms and not % thx
The thing taking the most amount of time in your plugin is ProtocolLib, but you can't fix that. That's just what ProtocolLib does
Your ms would half if you took it out
yeah it's because i use packet to display fake crops for each player, like every player didn't see the same crops and can change the crops that they see with /betterhoe changecrops wheat for example.
So every time I break a wheat, I cancel the break event and send a fake packet to the player to display AIR like this only the player sees the broken crop, not everyone else. so i can't realy delete it
i mean isnt there a Player#sendBlockChange ?
Yep i discover that after write my code with protocolib
i didn't change it didn't have the time
the only problem is that block updates destroy everything
I cancel all packet that is a block updates
for that you need protocollib always right ? there is no api i think
I'm curious, where can I see this kind of thing?
^^
Oh cool, thank you so much!
Constructions like that have sense? Or I can use just
saveResource("languages/langs.yml", false);
saveResource("languages/players.yml", false);
?
Yes those are fine
Oh, sorry, you're asking which is preferred
yes
saveResource(), when passed false, will not overwrite existing files. So you only really need the top snippet
but it does send a message
It will also make any directories necessary
cant be having messages in my logs
It does send a message in console, which is annoying, but it's fine lol
So this constructions have sense?
Yes. You can just have the saveResource() calls and you're fine
does
playersConfigFile.getParentFile().mkdirs();
have sense?
saveResource() does that for you already
got it, thanks
Just tried now (was not here for the day sorry couldn't try before, the event doesn't seem to stop transforming back in dirt
@EventHandler
public void onBlockFadeEvent(BlockFadeEvent event) {
Block block = event.getBlock();
if (block.getType().toString().contains("FARMLAND")) {
event.setCancelled(true);
Bukkit.getLogger().info("Farmand tried to change");
}
}
and yes my class is registered
it should be BlockFormEvent imo
There are multiple events
Though one of them definitely should be BlockFadeEvent
public static void turnToDirt(@Nullable Entity entity, IBlockData iblockdata, World world, BlockPosition blockposition) {
// CraftBukkit start
if (CraftEventFactory.callBlockFadeEvent(world, blockposition, Blocks.DIRT.defaultBlockState()).isCancelled()) {
return;
}
// CraftBukkit end
IBlockData iblockdata1 = pushEntitiesUp(iblockdata, Blocks.DIRT.defaultBlockState(), world, blockposition);
world.setBlockAndUpdate(blockposition, iblockdata1);
world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(entity, iblockdata1));
}
The block check is weird though. Not sure what's wrong with block.getType() == Material.FARMLAND
yeah, contains its more for multiple blocks with similar names
Even then, use a Set or a Tag if necessary
Is it possible to create really worth parkour tricks plugin?
there is no tag for concrete 😔
Quick question, do I need to use an nbt api if i want to add item components right now because they aren't implemented into api yet
Found :D
It was a stupid mistake from me ^^'
Sorry for the waste of time
nah, you opened an interesting debate
Now i want to hear what the mistake was, im curious :o
well first I tried with FARMLAND instead of SOIL (and also stupidly checked if getType() contained farmland instead of checking if it was equal to Material.FARMLAND (wich should have been SOIL)
fixed code if you want
@EventHandler
public void onBlockFadeEvent(BlockFadeEvent event) {
Block block = event.getBlock();
Material material = event.getNewState().getType();
if (material == Material.DIRT && block.getType() == Material.SOIL) {
event.setCancelled(true);
}
}
In newer version its farmland because im on 1.21 and there is only Material.LEGACY_SOIL which is deprecated, FYI
Oooh, I'm in 1.12.2 ^^'
so i made a map display plugin using protocol lib, and the issue im facing is that new player / players after restart dont see custom maps, so i made this code to save tand load them:
private void loadMapDisplays() {
File file = new File(plugin.getDataFolder(), "map_displays.dat");
if (!file.exists()) return;
try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file))) {
Map<Integer, byte[]> loadedData = (Map<Integer, byte[]>) ois.readObject();
for (Map.Entry<Integer, byte[]> entry : loadedData.entrySet()) {
int mapId = entry.getKey();
byte[] pixels = entry.getValue();
mapDisplays.put(mapId, new MapDisplay(mapId, pixels, player -> {}));
}
} catch (IOException | ClassNotFoundException e) {
plugin.getLogger().severe("Could not load map displays");
e.printStackTrace();
}
plugin.getLogger().info("Loading maps...");
}
public void saveMap(int mapId) {
File file = new File(plugin.getDataFolder(), "map_displays.dat");
Map<Integer, byte[]> existingData = new HashMap<>();
if (file.exists()) {
try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file))) {
existingData = (Map<Integer, byte[]>) ois.readObject();
} catch (IOException | ClassNotFoundException e) {
plugin.getLogger().severe("Could not load map displays for saving");
e.printStackTrace();
}
}
MapDisplay display = mapDisplays.get(mapId);
if (display != null) {
existingData.put(mapId, display.getPixels());
}
try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file))) {
oos.writeObject(existingData);
} catch (IOException e) {
plugin.getLogger().severe("Could not save map displays");
e.printStackTrace();
}
plugin.getLogger().info("Saving map: #" + String.valueOf(mapId) + ".");
}
Problem is, that it still just a default map after loading and sending packets for players
bump
is it possible to make player spin like with trident but without trident
Pose#SPIN_ATTACK?
https://www.spigotmc.org/threads/trident-spinning-animation-riptide.426086/ but be careful with nms because it changes with versions
idk whether there is a spigot approach
Oh, nms.. I dont really want to deal with it, but thanks
yeah
nvm there is not a direct way to set the player's pose without relying on hacky methods
asked this a long time ago but didn't receive a response. I implemented a feature where players get a sign UI to write messages, which I can then use elsewhere. The sign isn't actually placed in the world; it's just a ghost block that is sent to the specific player I want to open the UI for. However, my problem is that the player can see the sign behind them when they are in F5 mode. I attempted to prevent this visibility, but I couldn't figure it out. I noticed that Hypixel, which inspired my work, doesn't allow players to see the sign placed anywhere. How do they achieve that?
By the way, I can't place the sign thousands of blocks away, as it needs to be within 12 blocks of the player in order for the UI to open on the client side.
or inside 😳
Does anyone have any suggestions for this?
I get this error:
at org.solenxia.minecraft.pojo.CrateInfo.fromYaml(CrateInfo.java:42) ~[?:?]```
when the method is literally built in the plugin why does it not exist
are you extending ItemStack? If so, don't do that
instead use a wrapper class
I'm not sure what that means, extending ItemStack.
It has been fixed by renaming the class, another plugin has the same class name and same method name on the same server, which caused this.
It's just 6 blocks below the player. You just can't see it most of the time because you're looking forwards, not down at your feet while flying 10 blocks in the air :p
anvil on top
i actually didn't know it was bound to a position in the world
i thought you just sent an edit sign packet and the client just sends back what's written when you click done
Omg spoilers
Hypixel source code leaked :O
the client will refuse the sign edit packet when there's no block state to update
you can still send the open sign packet I believe, just not get the text inside of it when finished
does the gui close when updating the sign block to be non-existent like a tick later? or would it just not be possible for the text to be retrieved?
it makes sense
how can i access that?
Sorry to ruin the magic for you :(
if I need to spawn in permanent entities such as NPCs and TextDisplays for my server, where should I put the code? Should the code check if the entities exist every time the server starts, and then spawn them in accordingly? Should I make a command to spawn each one in, so I can do it manually and then replace them manually if they get deleted?
well, that was definitely worth the 2 hours of striving through minecraft's source code, apparently, 1.8.9, unlike ~1.20, doesnt have the limit to how far the sign can be, and i joined hypixel to check if i can see it on that version cause i always use it there, so i wasnt seeing the sign, and it messed up my life
i spent days trying to make the sign invisible 🥲
public void updateScoreboard(Player p) {
Scoreboard scoreboard = p.getScoreboard();
for (Team team : scoreboard.getTeams()) {
String suffix = ColorUtils.translateString(applyPlaceholders(p, team.getSuffix()));
team.setSuffix(suffix);
}
}
I'm updating my scoreboards like this, but it doesnt work.
It doesnt get updated.
This function is running in every 10ms
every 10 ticks*
This is not the best way to run a scoreboard
My first time doing it.
Never rly worked with scoreboards.
I just have a bunch of teams which contain strings that have placeholders
so I'm the point of updating is getting all the teams and replacing all the placeholders in them
So what are you thinking?
Have each player hold the team they are in and then just update the team they are in
Players aint in no teams, Teams are actually used so I can have values that I can update, its a weird name ik, tf should a team mean? Its kinda something Minecraft came up with I think, but actually I just use teams so I can have prefixes and suffixes, which I can update whenever I want, so the scoreboard wont flicker.
A pretty shitty explanation I just gave rn tbh, if I had to guess you probably know what Teams are in Scoreboards and their usage etc., you probably just wonder what I'm trying to achieve.
Ah
the scoreboard is a score board, so its originally made to show the score of different teams
Just have 15 teams
In an array
Along with score for each
And then just display text based on the requirements
public void updateScoreboard(Player p) {
Scoreboard scoreboard = p.getScoreboard();
for (Team team : scoreboard.getTeams()) {
String prefix = team.getPrefix();
prefix = ColorUtils.translateString(applyPlaceholders(p, prefix));
ConsoleManager.message(team.getName());
scoreboard.getTeam(team.getName()).setPrefix(prefix);
}
}
I just dont understand why this is not working
it should work
im getting the team
and adding a new prefix
Ive printed out the prefix in console and its exactly what Id like it to be
It just doesnt update
To have it show in the side bar you need to set a score with the same name as you used to register the team
someone help me make a script from scratch?
I wanted to make an NPC that spawns another NPC.
@vital token do you help me?
why are you pinging some random person whose last message was 4 months ago
bc he look and he see role high so he plead
Omg hypixel spoiler
XD
I wonder if that's necessary for older clients
No clue when it changed but I recall at least up to like 1.16 you could just put it at 0,0,0 and it'd work
Damn Mojang ruining everything
Probably a 1.19 thing tbf
Probably, unless hypixel wouldve put it so far away

omg he answered
md can i have purple name
Idk
md can i have purple name too
Are you eligible
🔨
yes ill bob the builder
No you may not have a purple name
may I? 
for making goated content
No
Why is there a @worldly ingot sticker set
is there even a way to combat this? coming from other game engines you can raycast on the client so the hits register in accordance with what the client sees and not the server to avoid this (yes, that introduces a whole bunch of other problems but hear me out)
imma profess my love for kotlin
You could expand the hitbox slightly in the direction the player is moving
or generate a second hitbox so you don't have any wonky cornering
Isn't the gun gonna be basically like an arrow though?
uH
Or is it different because people adjust for arrows but you want guns to be instant
its like a hitscan gun so no projectile simulation
ever heard of hitscan?
That's that thing solider 77 in overwatch is
basically, if u click on them and they're in range they die instantly lmao
Otherwise no
cool approach to guns (computationally expensive): when clicked it shoots a projectile from the barrel which travels at a certain speed and has projectile falloff at certain distance ranges, with a damage falloff formula
lame approach (very fast): when click raycast and damage the target entity and maybe shoot a particle
But now that you mention it I dont think ive ever observed that happen with arrows, like it always seems like if the arrow on my screen "hits" a player they take damage. Does the arrow mechanics also expand the hitbox to account for lag or something
Ahh ok
I guess you just need to make your hitbox bigger
make your ray size bigger yeah
Yeah raySize argument I assume
Hi, were you able to do this in a previous version & with proof?
I was talking in the Mojira discord about this, and apparently this was never possible?
They are taking away .setLastDamageCause() and i can't find a replacement or other way to set the damage cause. Any ideas? Something im missing?
?xy
My xy is i want to set a damage cause when i manually give damage damagable.damage() to a player (by command is one way) and i don't want the wrong reason for damage or death given.
.damage(amount, source)
But source doesn't include damagecause, it only has damagetype.
and type is a subset of cause
what reason are you passing in
You mean the cause? Sometimes suicide, or custom, or fire, or fall, etc.
type should get translated to the right cause
suicide doesn't look like its used at all by the server anymore, it should be removed.
fire, fall, etc will come from using the respective source
So finial answer is find an equivalent type for cause?
yes, and the further answer is stop using cause at all
Why you hating on cause 🙂
cause is only an API thing, it won't change anything in the server
ok
whereas source is a server thing and will make everything work properly - death messages, advancements, etc
yes, I think that's how it works in vanilla
Thx
I don't see how to assign the damage type to the DamageSource object. Docs say builder(DamageType) but im not seeing how to use it. new DamageSource(DamageType) didn't work and DamageSource.builder() isn't valid.
you said damagetype extends damagesource right
End goal is using the damageable.damage(amount, damagesource). So im trying to create the damagesource to pass to it.
Im confused. How is that not what i tried above?
you are using a constructor for damage source that does not exist, builder takes in a paraamter
it then returns a builder where you can add more info then call build on to get the DamageSource back
i tried to use custom damage source once and fucked it up so bad minecraft didnt even have a translation for it
new experimental api for it is sick
based
how do i repeat a task every X amount of ticks?
new BukkitRunnable() {
@Override
public void run() {
// Code to run every second
}
}.runTaskTimer(plugin, 0L, 5L); // 0L delay, 20L ticks interval
this doesnt work for some reason
Bukkit.getScheduler.runScheduler....
Bukkit.getScheduler() isnt a function
it says at least
i can do it in my main file but
Bukkit.getScheduler().runTaskTimer(plugin, ()->{
}, 10, 1);
i use this for a 10tick delay at start and run each tick
i dont wanna do it there i have a seperate file for this specific task
and the code works in the main file but not in there
do you call the seperate class ?
i mean i will but i havent implemented it yet i literally cant import Bukkit.getScheduler()
like it says that function isnt a thing
if you create another class where your scheduler code is you need to run the Method or whatever in the onEnable for example
what happens if you do new Bukkit()?
yeah ik
i fixed it now nvm
it was cause i wasnt doing it in a object
cause java is oop
?scheduling
constructor is private
alr fixed it thanks
Yeah js ssaw that
but lets say i modify the code, what will happen?
nothing
Nothing
everything is static
alr
Does the BuildTools experimental profile generate the latest 1.21.3 jar? And is there a way to view what its going to generate (so i dont have to keep asking :p)
No,dev is latest. Experimental is the experimental branch (can view on stash)
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
Can I have a purple name md_daddy_5?


He loves that name I promise.
30% in processing usage on a server with 35 people and 45% if I count velocity and lobby. Do you think processing usage will limit how many people I can host?
use item meta i dont think there is api for the components
I dont really understand how. For example I want to add food component to the gold ingot
ItemStack a = new ItemStack(Material.GOLD_INGOT);
a.setItemMeta(a.getItemMeta().setFood(<FoodComponent>))
but how to create this food component?
getFood, modify, setFood
oh
Jealous?
ty
Is it possible to change item in general? Like all items of this material?
Only by changing all loot sources of getting this item?
And how to change drop of block by BlockBreakEvent?
BlockDropItemEvent
Or just ItemSpawnEvent
EntitySpawnEvent? Idk something like that
Thanks
Ok, it's understandable, but what's about FoodEffects? If I want to add FoodEffect then I need one of them, but in most of the items size of foodeffects is 0
addEffect
yes, but how to get FoodEffect?
You mean that most of the plugins wont work in 1.21?
With regards to the food component, yes
why there is no food effect in 1.21.3?
what happening mojang
its not funny funny
You mean adding potion effect when you eat food?
They changed it to a separate component
ohh
And I don’t think spigot has added api for it yet
Spigot doesnt
I did it manually listening to the PlayerItemConsumeEvent
ok, I will do this by ItemConsume event to not make troubles
The only thing this doesn’t cover is eating placed Cake, I believe I listened to PlayerInteractEvent for that one
Doc has a PR open for the comsumable component
Is it worth creating a cache for this? https://paste.md-5.net/icilonuquj.cs
How do i send redstone particles in 1.21? the names are changed and i need to use BlockData? I dont understand
Of course
Caching your messages is a good thing
I see you're already doing it with the hashmap
Just move it in a field and register the messages in there
declaration: package: org.bukkit, enum: Particle
i dont get it from this ngl
thats why asked here
Instead of registering them based on the need, just register them once
What part are you having troubles with
But this way it is always allocated in memory
The cache won't help in this case for example, replacing the player placeholder for the first will give you a wrong placeholder for the next players
nvm that could you help me with this
public void createHelix(Player player) {
Location loc = player.getLocation();
double radius = 2;
for(double y = 0; y <= 30; y+=0.05) {
double x = radius * Math.cos(y);
double z = radius * Math.sin(y);
// PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.BARRIER,true, (float) (loc.getX() + x), (float) (loc.getY() + y), (float) (loc.getZ() + z), 0, 0, 0, 0, 1);
// for(Player online : Bukkit.getOnlinePlayers()) {
// ((CraftPlayer)online).getHandle().playerConnection.sendPacket(packet);
// }
float locx=(float) (loc.getX() + x);
float locy=(float) (loc.getY() + y);
float locz=(float) (loc.getZ() + z);
player.spawnParticle(Particle.FLAME,new Location(loc.getWorld(), locx,locy,locz),1,0,0,0,0);
}}
This is a function I made (stole the math) for a helix that goes up from a player, but i want it to go in the direction a players looking, Im making like a shooting thing and its gonna be 2 helix's combined with different colors and once they reach a player or a block the particles no longer appear
no
im bad with vectors and that stuff and i dont wanna just yoink code (couldnt even find any to steal ngl)
the logic is right
Ah, I read it as the player from the loop
can i change the rotation of an item display without teleporting it
apply a transformation
alright, what does the left rotation and right rotation mean in the Transformation constructor
Should I in any case use stringbuilder.append for performance? I have a method that is called every 5 ticks and I am doing several concatenations
Internal error
com.intellij.ide.plugins.EssentialPluginMissingException: Missing essential plugins: com.intellij.java, com.intellij.java.ide
at com.intellij.ide.plugins.PluginManagerCore.checkEssentialPluginsAreAvailable(PluginManagerCore.kt:614)
at com.intellij.ide.plugins.PluginManagerCore.initializePlugins(PluginManagerCore.kt:682)
at com.intellij.ide.plugins.PluginManagerCore$initializeAndSetPlugins$2.invokeSuspend(PluginManagerCore.kt:899)
at com.intellij.ide.plugins.PluginManagerCore$initializeAndSetPlugins$2.invoke(PluginManagerCore.kt)
at com.intellij.ide.plugins.PluginManagerCore$initializeAndSetPlugins$2.invoke(PluginManagerCore.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.sta
why do i get the jar outdated info waiting for 20s after building and using the newest ?
Are you sure you're on newest? If so it's a bug pretty sure that's a manual date time thing
yes ... thats why i am wondering ... didnt changed anything .... always worked before with: java -Xms512M -Xmx2024M -jar BuildTools.jar --dev --remapped
ide startup
-dev is not release so out of date would be correct
I don't think 1.21.3 is the default yet is it? Sounds like an issue with last 1.21.1 build tbh
its the default
I didn't even know BT had a --dev build not sure what that is
(i am using 1.21.3 all the time)
always the newest of the newest ^^
--dev isn't a build, it's a flag
--dev
Disables BuildTools version checking, Java version check, and MC version lookup.
Just builds the actual build environment.
someone know what can i do
Seems like an intellij problem
You should ask them
where
Idk can't hurt to use Google lol
I know the search engine is intimidating but I believe in yoh
their support should take weeks
try to reinstall
unfortunately arch linux prevents me from doing this
If you can't figure out how install and reinstall something you probably shouldn't be on arch
the partition has no space and I can't modify it in arch linux
If your partition is full you have bigger problems than intellij
Maybe you should pick an OS that is easier for you
I just have this space problem, this shit OS doesn't have a way to modify the partition sizes when formatting
You honestly just have a skill issue and probably shouldn't be using arch linux switch to an easier distro if you're going to stick with linux trust me it saves a lot of time
I've been using Arch Linux for a few months now
First off, it does. You just have to know how to do it.
Secondly, if you're modifying the same drive that your OS is currently running on and you don't have the space to spare to make a new partition, then you can't do it anyways.
Well, that's why I wanted to do it when I formatted it, but when I formatted it, I couldn't change the partition sizes.
I went to restart the PC and it doesn't turn on anymore. Can anyone help me?
if power button does nothing, reset cmos
💀
you said it didn't turn on anymore
linux does not boot
pressing Enter does nothing?
No 😦
You should at least have a tty
private void setupScoreboard(Player admin) {
ScoreboardManager manager = Bukkit.getScoreboardManager();
scoreboard = manager.getNewScoreboard();
Objective objective = scoreboard.registerNewObjective("EventSidebar", "dummy", ChatColor.RED + "Zabij Admina!");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
objective.getScore(ChatColor.GREEN + "Admin: " + admin.getName()).setScore(3);
new BukkitRunnable() {
@Override
public void run() {
if (!eventActive || targetAdmin == null || !targetAdmin.isOnline()) {
this.cancel();
return;
}
Location loc = admin.getLocation();
// Usuń stare wartości przed ich aktualizacją, aby zapobiec duplikacji
scoreboard.resetScores(ChatColor.YELLOW + "X: " + (loc.getBlockX() - 1));
scoreboard.resetScores(ChatColor.YELLOW + "Y: " + (loc.getBlockY() - 1));
scoreboard.resetScores(ChatColor.YELLOW + "Z: " + (loc.getBlockZ() - 1));
objective.getScore(ChatColor.YELLOW + "X: " + loc.getBlockX()).setScore(2);
objective.getScore(ChatColor.YELLOW + "Y: " + loc.getBlockY()).setScore(1);
objective.getScore(ChatColor.YELLOW + "Z: " + loc.getBlockZ()).setScore(0);
for (Player player : Bukkit.getOnlinePlayers()) {
player.setScoreboard(scoreboard);
}
}
}.runTaskTimer(plugin, 0, 20L);
}
hey, I have a problem, every time the player moves, there are duplicate lines in the slidebar instead of updating, how can I fix it?
So its hanging
Looks like you're going to need a recovery drive
If the startup continues, it returns to the same screen
broken boot
If i do it i lose archives?
you need a recovery drive
No, you just boot from the recovery drive and move the data to another one.
How can i solve it?
Or try and fix the boot issue with the recovery disk

