#help-development
1 messages · Page 1255 of 1
you would think such ai would only be in place if doors were even nearby
you gotta look for em
it's a tragic case of generalization and abstraction, it uses the RemoveBlockGoal to search for doors in some arbitrary range
I wonder if it does pallette lookups
it does chunk lookups so for sure palettes must be involved as well
i think checking the current/next node in the pathfinder path for being a door would be enough
not sure why it searches a range
Yeah but a pallette contains is a lot faster than range checks
see if the chunk has it and skip it if it doesn't type shit
there might be some low level optimization
or whatever they called it
lemme see before assuming give sec
for (int i2 = this.verticalSearchStart; i2 <= i1; i2 = i2 > 0 ? -i2 : 1 - i2) {
for (int i3 = 0; i3 < i; i3++) {
for (int i4 = 0; i4 <= i3; i4 = i4 > 0 ? -i4 : 1 - i4) {
for (int i5 = i4 < i3 && i4 > -i3 ? i3 : 0; i5 <= i3; i5 = i5 > 0 ? -i5 : 1 - i5) {
mutableBlockPos.setWithOffset(blockPos, i4, i2 - 1, i5);
if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
this.blockPos = mutableBlockPos;
this.mob.movingTarget = mutableBlockPos == BlockPos.ZERO ? null : mutableBlockPos.immutable(); // Paper
return true;
}
}
}
}
}
nuh
it's too abstract to make use of palettes
since whether it's valid or not is just some arbitrary condition that might not even have anything to do with the block type
it just checks the target nodes and stuff.. hm
or actually i think i misread this
this is almost certainly the turtle egg attack goal, not doors
i'm not sure where i got doors from
it's most likely the turtle egg
door destruction uses pathfinding and just extends DoorInteractGoal
yeah that makes sense, that's how i assumed that'd work
makes sense for it to search for a range then but i wish it'd cache them as poi's or something instead of searching the entire area every however many ticks
or like override canUse and check the block palettes of the nearby few chunk sections to see if there are any eggs in them at all
it defaults to a search range of 24 blocks 🤡 jesus christ
Yeah this could use some micro optimizations
in all directions?
x and z, y is set to 3
I suppose y being constrained to 3 is better then 24 lol
that doesn't sound right
1.7k
yeah, math checks out on the 1.7k
well, it's a range
so x/z is 24+1+24
and y is 3+1+3
or i'm not sure about that +1, it could just be 48*6*48, but that's still 14k
pretty sure the range is centered on the entity already o.O
regardless, it is still per zombie
so whether its 1.7k or 14k its a lot of blocks
honestly, the most taxing operation there is gonna be the chunk lookup
eh
okay yeah i think you may be right, i can't quite parse whatever the fuck goes on in those 4 nested loops but guessing from for (int i3 = 0; i3 < i; i3++) { "range" is probably actually diameter
we could skip half the ops if we looked up the blocks and kept an internal ref of the pallette?
wat
like ran a contains on the chunk pallette and had a Map<ChunkKey, Chunk> or whatever
do you mean doing a chunk lookup only once for each chunk section intersecting the search area?
I worded it terribly
clearly the fix is turning the eggs into an entity so the lookup is quicker 😎
oh yea, you could 100% do a pretty solid "skip" of a lot of this if you were to #contains on the pallette
but yea, as said, isValidTarget does not yield you a nice way to do this
tho potentially easy to add, given you can default to isPotentiallyValidSection() to true
build a list of targets, sort by nearest and filter?
yeah, we'll have to override canUse to check the sections first and short circuit to false if none of their palettes contain eggs; otherwise delegate to super
is that code actually that hot 
I'd honestly semi expect the getChunkAtImmediately calls to be the most taxing part
over indexing into a palette and comparing a block state
afaik the most time consuming stuff at a large scale is zombies and spawners
zombies are the most cpu intensive mob of all the basic monsters and this is one part of why
somehow zombies manage to consume more resources than villagers
that outer loop is truely disgusting tho 
the order that search is happening in is gonna make it really annoying to skip sections
I mean you could probably just remove the egg and door goals
Who actually remembers those mechanics exist
this might have the most merit, since this goal is used by a lot of other things apart from just zombies finding eggs
🗣️
well, given the loop structure, I am semi sure you won't get an actual benefit here
we reorder the loop
you can't
the search order is a gameplay mechanic
if you change it, you break vanilla compat
yeah well whoever relies on that can go eat shit

There’s probably some wacky farm that relies on it
we reorder it to go by chunk, then section, and finally blocks
sort the final end results by whatever magic order it's currently in if we have to stick to it 🤡
i'm using protocollib's nbtlists, yet whenever i create one it comes out as {"name":"whateverthenameis","value":["a","b"]}, and i don't think that works in 1.21 as it isn't working for me? is there a way to just format the nbt as {"messages":["a","b"]}
Hi, how can I glow entity but only for cerain player. 1.21.3 version.
player.sendPotionEffectChange(horse, horseConfig.whistleEffect);
public PotionEffect whistleEffect = new PotionEffect(
PotionEffectType.GLOWING,
20 * 15,
1
);
it doesn't work
What are you using it for
?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.
entity is not getting glowing effect
this, i'm trying to do packet.getNbtModifier().write(0,nbtvar), except i can't get the nbtvar right because of this
It supposed to glow Horses for certain player
Any errors?
What packet are you working with
What are you trying to do with protocollib
i'm trying to send a blockentitydata packet after a blockchange packet so that i can edit the lines of text on a clientside sign
Isn't there an API method for that
There is
Someone mentioned it earlier
What about sendBlockUpdate or whatever
have you tried waiting in between sending the change and the sign open packets
sendBlockChange
declaration: package: org.bukkit.entity, interface: Player
oh wait, lemme try this thanks lol
yeah
is there any benefit of this vs sendSignChange
I'd have expected sendSignChange to just delegate to sendBlockUpdate but turns out that isn't the case implementation-wise
well, aside from the fact sendSignChange only lets you change the front of the text and not the back
hi, how do i make the itemstack add armor when it's on my head, i use it but it adds armor when it's in my hand
meta.addAttributeModifier(Attribute.ARMOR, new AttributeModifier("armor", 2, AttributeModifier.Operation.ADD_NUMBER));
have you tried making an attribute modifier with the HEAD EquipmentSlotGroup?
Yeah use the non-deprecated method
declaration: package: org.bukkit.attribute, class: AttributeModifier
also, the AttributeModifier constructor that uses String as key is deprecated
dang, beat me to it
i can only get the output slot item name from a anvil just using nms right?
because printing inventory contents only returns the input item
this works, thank you so much lol. is there anyway to hide the sign prior to the person clicking done, or would i just have to move the sign away.
meta.addAttributeModifier(Attribute.ARMOR, new AttributeModifier(new NamespacedKey(plugin, "armor"), 2, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlotGroup.HEAD)); its good?
It's much older. Possibly could now. And yes back is why there's the new method
Should be in there, but maybe not in contents array. Also there is a get input text method
Someone why some players getting kicked with Network Protocol Error after a player joins?
there is no error in the console
what everyone does is just put the sign somewhere the player won't see it
that's usually underground or above their heads
I think you can place it as far as 15 blocks or something like that
you may want to make the key a constant somewhere rather than creating one each time you add or retrieve it, but other than that yes
What will I need a key for in the future?
well, I am sure you aren't creating that item stack only once, so creating the key each time is kind of wasteful
you'd also want to use the key if you want to get the attribute from the item stack, be it to modify it or just get its value
in AnvilInventory?
yes, but also in the AnvilView
oh, apparently the AnvilInventory methods are deprecated and you're meant to use the AnvilView only now
how can i call to anvilview
(inventory.holder as AnvilView)?
you get the anvil view when you open the inventory
or if you didn't open it, in the InventoryOpenEvent, or Player#getOpenInventory
maybe i can undo the github push
famous last words kek
you just got to do git rebase --hard HEAD~1 then git push -f
i guess i can copy it from here too
i'll do this for now, thanks, it sucks that there's no way to actually hide it
i guess i can call it on InventoryClickEvent
yeah, the client just refuses to open the sign if you hide it in any way, as it means the sign isn't there anymore
like this
it isn't noticeable at all tho, unless you're in the void and the player enters perspective mode
what is AnvilInput
isn't that a paper thing
?whereami
I know, but the problem doesn't have to do specifically with paper.
to be completely fair, if you support both platforms, it gets kind of funny
in the paper discord you'd probably be told to just stop supporting legacy platforms
and in here people might just help you if they feel like it
there's no winning lol
(you'd be told the same thing here too)
Yes, I think we should all help each other no matter what software we use, versions, we should just help and that's it.
rarely have I seen people completely refuse support just because they're using paper, even when people ask about Paper specifc APIs
In the end we are programmers and we want to learn
spigot people don't know what paper changes in the internals so for all we know it could be paper
Yes, but some cases are not specifically related to Paper. If I asked for help here about MobGoals, of course I would have to go to Paper, not here.
I mean to this point, there are discords specifically for most of the mainstream server softwares, either way you’ll be told to ask about issues with x software in x discord
it could still be paper changing the logic, we don't know /shrug
that'd be fine if it were a support-centered discord, but in reality these discords are platform-centered, so it does defeat the point to ask a different platform here, or legacy versions for that matter. People might have more leeway in regards to that here, but that isn't necessarily a good thing to take advantage of
yea thats a point
I am not faulting you for it, but you'll have to bear the whereami whenever you ask a question since that's just the culture lol
ye iknow
Does anyone have experience with LogBlock?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
thats the question
you're looking for topic experts, which isn't necessary to answer a question even if it might be related to something specific
Im trying to make a plugin that alerts the admins when someone breaks a block, placed by a player
now that's more of a question
so technically a GriefAlert
so you're looking to use logblock's API I imagine?
but since im using LogBlock, and this plugin stores every broken block into a db
yes
what block specifically are you trying to warn about?
does LogBlock even have API I wonder
Chests, Doors, Wooden Blocks, Torches, Signs
basically every block that was placed by a player
do you not want players to place any of them?
it kind of does have an API https://github.com/LogBlock/LogBlock/blob/master/src/main/java/de/diddiz/LogBlock/LogBlock.java#L315
no i want that the players can place them, LogBlock logs the placement, but if any other player (rather than the original player) that breaks that block, every admin gets an alert saying "Player broke (block) of (player)"
but only for player placed blocks?
yes
do you only care about blocks being manually broken by a player, or any kind of grief
in that case as Javier posted you need to query LogBlock about the specific block
make sure to not run that method in the main thread though
Broken by a player in every manner (by hand, pickaxe, axe), tnt and creepers are disabled
I mean, that's all manually, I was talking about other ways like fire spread or the kind
I don't know what kind of grief methods players use nowadays but whatever possible way
if that's the case then you only have to care about manually broken, so yeah you can just listen to the BlockBreakEvent and check with that method above if the block was placed by someone else
is it possible to retexture an item as a head without a resource pack?
there are more tabs than code on my screen
how would i implement the API tho?
what do you mean
all you have to do is get a LogBlock instance with LogBlock#getInstance then call getBlockChanges on it
Bukkit.getPlugin("LogBlock")
I would need to implement the API so that the plugin knows which blocks are placed by a player and which not
omg this is so difficult
tell me, using logblock commands, how would you identify who placed a block at a given location
you can't change the item's texture but you can change the model with the item model component
./lb tool
can I change its model to use a custom head
and then i receive a wooden pickaxe and with that i knw who placed a block
i had prefix formatting plugin and after i deleted it my prefix is still there, i've restarted my server several times but it won't go away
they might have used scoreboard teams to give prefix
did you check if there are scoreboard teams? Also, this is a question for #help-server
mb, how do i reset it?
https://pastes.dev/ZhR40YJ5XB I vibe-coded this for you
that said, LogBlock looks horrible, I wouldn't touch it with a 10ft pole
Yea i know its old asf, and it didnt get updated in the last 7 years
it is more of an issue with the code rather than it being old lol
no API whatsoever, most classes I've looked at got no encapsulation (all public fields) and the QueryParams parsing gives me nightmares
I would need to edit it a bit, since i think u didnt understand very well what the plugin should do but im thankful!
Idk if u already tried it out, but ill do it
I haven't tried it, I made deepseek generate it by feeding it the whole of the QueryParams then checked if everything it did was fine
it looks sensible enough to me, what it is supposed to do is to stop a player from breaking the block if they haven't placed it themselves
I don't think that works
Yeah you need to be blocking the event
blocking on every block break doesn't sound like a good idea to me, but I don't know if you'd have any other option lol
What type of paste bin is this btw javier that u use
pastes.dev is lucko's paste service (LuckPerms creator)
Well, the plugin should just let the player break the block and, alert the admins of that breakage
oh well in that case it should work just fine, remove just removing all the cancelling logic will do
I was just saying that you need to be blocking if you want to cancel it
Otherwise the event will complete and the cancel will do nothing
yeah, I am aware, I was just commenting on the fact that it'd be a bad idea even if you do it the "proper" way
luckily they just want to send an alert and not cancel the event, so timing doesn't matter
you might not even need to go back to main thread to send the message tbh
I used deepseek since it was the only free one that allowed me to give it the whole class, even gemini didn't allow me to and it supposedly has a 1m context window (ig it is only for pro users)
I wasn't gonna bother trying to comprehend whatever they were doing in that class by myself lol
I guess i would need to put LogBlock into the dependencies right?
yes
if this is a new-ish server, what I would do instead is take logblock's database, and import all the data you need to a sqlite database, then track block placing yourself instead
yea it is kinda new
almost a month
the problem is, idk. how i would accomplish that
Is BungeeGuard built into bungeecords later versions or am I just being stupid
No
is there an alternative to a respawn packet to refresh a player's skin (after sending playerinfo packets)
nope
why is the respawn packet an issue tho
just can't get it work via protocollib (unsure of what exactly to put in it) or packetevents (just straight up not working)
nowadays you're better off using PacketEvents as that's the better maintained one
that said, what have you tried
do note that even if you use ProtocolLib/PacketEvents, you might have to use NMS to call some methods on the CraftPlayer instance to sync with the server properly
using packetevents, i get this error when trying to output, which i don't get because i believe those are the correct arguments for the wrapper?
No matching static constructor: WrapperPlayServerRespawn.<init> called with (com.github.retrooper.packetevents.protocol.world.Dimension@62fe237f (Dimension), world (String), easy (Difficulty), 8101906099017792395 (Long), CREATIVE (GameMode), null (Null), false (Boolean), false (Boolean), false (Boolean), null (Null), null (Null))
can you show the code?
ah, I see the issue
you're passing the dimension instead of the DimensionType/DimensionTypeRef
there's two constructors though, is there not? one for dimension and one for dimensiontype
also, i fixed smt in my code and that error is gone, now it just says the packet is null
just show the code ig
SpigotConversionUtil.fromBukkitWorld(p.getWorld()),
p.getWorld().getName().toString(),
Difficulty.getByValue(p.getWorld().getDifficulty().ordinal()),
p.getWorld().getSeed(),
SpigotConversionUtil.fromBukkitGameMode(p.getGameMode()),
null,
false,
false,
false,
null,
null)```
that's some ugly ass code
lmao
pls shift+f6 rename p to player
it isn't so much the issue with the naming but just that being a long ass constructor lol
you're missing one argument
which?
portalCooldown
why is portalCooldown an Integer and not an int
retrooper what you doing smh
though that constructor is deprecated so may as well not use a deprecated one
ohh, i see, the ones with dimension are deprecated
unsure why it's still not working, i must be missing something completely. how would you do it with protocollib?
how could i make that pufferfish follows the nearest player?
modifying his ai
is it possible to use armour stands as memory cells in minecraft and store data in it as armour stand can have millions of tunic armour and trim armours
millions sounds a bit excessive
but is this actually a plugin development question? Because I see little point in using armor stand as some kind of storage when you can just have a database in a plugin?
i wanted to create some custom player data which players can achieve by collecting materials of that armour stand and then punching it will give that data to them
if it is for the sake of proving a concept then go off, I guess. You can use literally anything as storage with enough effort, it having more states does give you some liberty on the format you can use with it
sounds like an interesting concept if anything, but what kind of data would a player want to personally input and/or retrieve by punching? Sounds like it'd be limited by design
like armor stands will contain randomized data , that invovles effects, items , and attributions ,players will make the armor stand and punch it and it gives the effect to corelates to that amor stand data , since armor stand can have millions of state i cou dl theotically store more complex data in it
well, I am really not seeing the picture here, but it sounds doable and the concept is interesting enough. I'd go through with it and see how it goes
thanks for your input!
kiory Audiences...
Wondering what audiences might be and what it takes care of
My interest:
particles
sound
actionbar
bossbar
(i need booleans works for it or not)
(i suck at reading but i think it involves all of above?)
audiences are just recipients for a given message
message is a bad word to describe it as they can receive any type of minecraft media, and message leads one to think about text-based communication, while it can be sounds or even resource packs
for some reason particles are out of scope but alas
oh i see
particles out of scope
kinda weird
(thats actualy bad since i cant send particle to specific audience and it will lag my server)
unless ill find other way ofcourse (im new to dev)
particles can be sent per player
I hate that vibe coding became so prevalent
Like just learn to code. It's not that difficult if you enjoy it
Yeah too many people are relying on AI
Yep
What on earth is vibe coding
Using AI for everything
How is that related to vibes
I can’t believe they took the name “Vibe Coding” from us to use with AI
Hi, I am working on a plugin for 1.21.1 and I am struggling on filling in the ancient city blocks on right click. I have tried some ways which either are bugged or just do not work. Pretty much like filling in a portal with blocks.
What did you try and what happens
I tried this.
The issue I have come across is that I have to place 2 blocks of reinforced deepslate or else it does not work at all. This can be seen more clearly in the image.
However it will still not work to expectations as it will offset the frame filling by one block as seen in the other image.
?paste
Those streams look horrible and probably worse way than doing it manually
6 iterations over just one
By manually do you mean by just going to the next block untill I conplete the loop
looping over the block set, using Math.min/max
And this somehow horryfies me frameBlocks.iterator().next()
Never seen this, does this even work properly ?
😭 I am relatively new so I am not suprised my code can be this scuffed and messy
Not sure how you even ended up doing that
That seems like a real odd piece of code
And if I'm not mistaken, you do no not show where you call fillFrameWithIce
oh yeah sorry
can somebody throw it in a paste my phone won't download it, I wanna see this
private void fillFrameWithIce(Set<Block> frameBlocks) {
int minX = frameBlocks.stream().mapToInt(Block::getX).min().orElse(0);
int maxX = frameBlocks.stream().mapToInt(Block::getX).max().orElse(0);
int minY = frameBlocks.stream().mapToInt(Block::getY).min().orElse(0);
int maxY = frameBlocks.stream().mapToInt(Block::getY).max().orElse(0);
int minZ = frameBlocks.stream().mapToInt(Block::getZ).min().orElse(0);
int maxZ = frameBlocks.stream().mapToInt(Block::getZ).max().orElse(0);
for (int x = minX + 1; x < maxX; x++) {
for (int y = minY + 1; y < maxY; y++) {
for (int z = minZ + 1; z < maxZ; z++) {
Block block = frameBlocks.iterator().next().getWorld().getBlockAt(x, y, z);
if (!frameBlocks.contains(block)) {
block.setType(Material.STONE);
}
}
}
}
}
?paste
That's not all the code
Where do you call fillFrameWithIce from
@EventHandler
public void onRightClick(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Block clickedBlock = event.getClickedBlock();
if (clickedBlock != null && clickedBlock.getType() == Material.REINFORCED_DEEPSLATE) {
Set<Block> frameBlocks = new HashSet<>();
findFrame(clickedBlock, frameBlocks);
fillFrameWithIce(frameBlocks);
}
}
}
😭
No one enjoys overusing it
they seem to-
Personally not a fan of that recursion there
Surely you can do floodfill in a better way
But begginer, so I guess it's fine
I am still trying to figure out how to solve this. I want to just restart
ill have a look at some floodfill spigot forums and try again
floodfill is not spigot specific thing lol
obviously. I mean its more in context so its a little easier
But again, it's fine as you have it
it doesnt work at all
So, what you're trying to do is to create the same thing nether portals do, filling a portal frame with blocks.
well for starters, it seems that your portal check is completely wrong
What you have now would fill more of a box if you had some blocks "to the side"
Which I assume is what you're seeing
This still confuses me tho lol
Oh right it works 'cause of this
really sorry but I gtg for like 10mins. I will read anything you write and reply to you when I am back.
I think you have to redesign this completely
Something like:
From starting block, decide one starting direction (let's say NORTH) and start going in a line there until you find a block going up
Then just go up until you find a block going to south, then down, then back north again until you reach starting block
If a block is missing switch to going in the other cardinal direction (in my example it would be EAST)
If both fail, you do not have valid portal
Also,
findFrame(clickedBlock, frameBlocks);
fillFrameWithIce(frameBlocks);```
This is just bad
_at least_ have findFrame return Set<Block> instead
This is just for future
And I assume you'd want some check to make sure the inside of the portal frame is empty
And have some max size too
If you're looking for an exact structure you can brute force it instead
can i take a function as a param but with an unspecified amount of parameters? just like Function<Object> but it can be 2, 3, 4...
Probably can do <Object[]>
do i need to pass an array then, or does it interpret it as multiple params?
Object...?
There's a reason for this :D
i think we need java 2
then make your own functional interface
that wont help
public interface SomeFunction {
void doSomething(Object... args);
}
yeah, im doing that but i wanted to allow lambda too
That's the same as Consumer<Object[]> tho
true yeah
ok
(it can also be annotated with @FunctionalInterface but not required)
It should be. Any interface you expect to be used as a lambda target should be annotated with it. It's a compiler hint to prevent you from being a big dumb stupid idiot head and adding a second method to the interface
I mean tbf mojang uses that in DFU, purely so they can optimize different data transformations etc
is the only way to fix chat validation error after changing someone's skin using a plugin to remove chat validation in its entirety
hello, I'm writing a plugin for Minecraft 1.21 and for some reason I can't import anything from net.minecraft or bukkit.craftbukkit (Working with spigot)
which build system are you using
maven
let's see your pom.xml
i cant send a file here, can i?
?paste
Perfect
thanks
Ur using the api
And not the bundled jar
Build spigot using buildtools and remove -api from the artifact
try it and ask if you run into a problem and we will see whether anyone can or will help, i won't write any blank checks
sure thing
why do i get some errors if i add this depo
<groupId>de.diddiz</groupId>
<artifactId>logblock</artifactId>
<version>VERSION</version>
<scope>provided</scope>
</dependency>```
Invalid it doesnt exist
VERSION
you probably need to set VERSION to a valid version…
what type of version
the... version of the library?
Where do i find it?
probably the same as the plugin version if I had to guess
nop still doesnt work
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.diddiz</groupId>
<artifactId>logblock</artifactId>
<version>1.19.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>```
my whole dependencies block
Hi guys does anybody know about ClueScrolls plugin?
if yes, please tell me like there is a random quest scroll which i want to be stacked, like i have 2 type of scrolls
Obsidian quest scroll and Golden quest scroll
Both have their own random like so
Random Obsidian Quest Scroll
and for golden
Random Golden Quest Scroll
i just want to stack random ones only but not when we right click them and we get the actual quest. I just want to stack random ones how can i do please tell.
pls dm me or ping me for the solution thanks!
@sly topaz how did u put the dependency
did you also add the repository
i bought a plugin a few days ago of spigot and i checked today and it says i have to buy it again
was wondering if yall can help me with this dependancy error:
java.lang.ClassCastException: class io.github.***.menuSystem.MenuSystem cannot be cast to class io.github.***.menuSystem.MenuSystem (io.github.***.menuSystem.MenuSystem is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @38afc57a; io.github.***.menuSystem.MenuSystem is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @bbca529)
at io.github.***.expertiseStylePlugin.ExpertiseStylePlugin.onEnable(ExpertiseStylePlugin.java:27) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:267) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:492) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugin(CraftServer.java:576) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugins(CraftServer.java:490) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:641) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:426) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:269) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1017) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]```
Looks like you loaded the same class twice
from two different plugins or classloaders
If you're shading you should relocate the dependency
why are you redacting your github name
just dont really wanna have my name out there
it was easy to find Somebodys home 😉
btw your issue is your menu system is a Plugin and you also have it in your other plugin as a dependency but with no scope
Do you have the plugin twice in the plugins folder
Or accidentally shading it
he just has his menu system as a dependency with no scope so it gets shaded
when its a plugin
Is it expensive to combine 2 hashsets?
Depends on the size of them and how you do it
Is there a better way than checkinh which one is smaller and then iterating?
Im guessing this scales with the amount of items?
Ok
since LogBlock doesn't have an API, it also doesn't provide a maven repository for you to take their code from, you have to install it into your local maven repository (just cloning and compiling it with mvn install should do), or use jitpack
See I thought that would be a problem but I figured since my other plugin also depended on it without a scope then it would be fine
But if that really is the problem then what scope do u recommend me using?
if for some reason you cant' compile it yourself, you can also use the maven install-file goal from the maven install plugin to inject the jar directly into your local maven repository with a specified group and artifact id, but ideally you should be able to compile it. That way you can make sure you are using the same version both on your server and development
provided
Ok 👍
Can anyone help me I want a map where the world is only one biome that has no water and only small hills/mountains like in mcprac.net for: Desert, Badlands, Snow, Plains, Mushroom PLSSS
Hello anyone know how can i disable mongodb logger for my spigot plugins ? I try:
Logger.getLogger("org.mongodb.driver.client").setLevel(Level.OFF);
Logger.getLogger("org.mongodb.driver.cluster").setLevel(Level.OFF);
Logger.getLogger("org.mongodb.driver.connection").setLevel(Level.OFF);
``` but nothing working
https://stackoverflow.com/questions/30137564/how-to-disable-mongodb-java-driver-logging did you try this
Use World Painter for a simple map like this
got a link 😄
And this is probably not a good place for this
? pls ?
got google ?
no
womp womp
did the guy just leave ?
skill issue
logback 😦
if() {
player.getInventory().remove(i);
}
}```
what would I have to change here to include the offhand slot aswell?
that seems like a rather silly way of clearing the contents
consider iterating over slot numbers or something instead
hmm
there's also log4j stuff in there
which is what mongo uses iirc
or if you want to iterate over the content array itself, call setAmount(0) on the itemstacks to clear them
because what you are doing now is going one by one over the items in the inventory, and then searching for similar items in the inventory and clearing the first one
since you're calling Inventory::remove(ItemStack)
to clear the offhand slot specifically you can Inventory::setItem(EquipmentSlot, ItemStack) and pass OFF_HAND for the equipmentslot, and null for the itemstack
you most likely have to set it inside the log4j2.xml, or do it via reflection
Im trying with log4j2.xml but don't work idk
where would i go to see what information i need to set on a protocollib respawn packet (i.e. packet.getBlah().write(0,blah))to get it to work as i'm not really sure what to put in it
can i set biomes with spigot api
using biomeprovider?
it says biomes now set with biomeprovider but when i open it i cant find explaination on website as turns out i end up in confusion
im asuming api is incomplete?
I have no idea what you're saying here
what says what ?
On what website
But no, BiomeProvider can not set biomes, you can only get them, hence the name provider
lol
uhhh xD so i was confused and now more confused
World#setBiome(int, int, int, Biome)
Mind you that you can not set biome per block, only per 4 blocks and the biomes have some noise
And you have to relog to see the changes right away I believe
Or make some "hack"
Really not sure if that API send biome updates
Does somebody know how I can get the ItemStack of a player head with a base64 texture in 1.21.4?
does anyone know?
you can either check the minecraft wki for the protocol documentation or the Minecraft code itself
but the respawn packet isn't where I would expect people to stumble when it comes to spawning npcs
yeah lmao idk, the packetevents version just doesn't work and the ClientboundRespawnPacket sends the player to the loading terrain screen for 30s.
wait, were you spawning npcs or changing player skins? I forgot
oh changing players skins, sending a remove info then update info packet
is there a reason you aren't just using NMS for it
well, for respawning I don't think you even need to send the packet? You can just call the method on the player
Pretty sure that requires them to be dead
what do you mean
you mean for respawning?
I mean for everything
mostly because you'll have to call some craft methods regardless of whether you use protocollib or not
which methods?
setOpLevel, onUpdateAbilities, among others I don't remember off the top of my head
I think SkinRestorer has a Bukkit API only way of doing that, I don't exactly remember what was possible just with API and what wasn't anymore
i am using nms, just not for the respawn packet
if you are using NMS, it is easier to send the respawn packet using it lol
i know, but i get stuck on the loading terrain screen for 30s
connection.send(new ClientboundRespawnPacket(serverPlayer.createCommonSpawnInfo(serverPlayer.serverLevel()), ClientboundRespawnPacket.KEEP_ALL_DATA))
ohh, yeah i see lmao, lemme try that
i thought the last part was the issue but im still on the loading terrain screen for 30s
let me give it a try myself I guess, but have you tried doing everything else you have to do after sending the respawn packet and see if anything fixes it
i believe so?
import net.minecraft.network.protocol.game.ClientboundRespawnPacket;
import net.minecraft.network.protocol.game.ClientboundSetExperiencePacket;
import net.minecraft.network.protocol.game.ClientboundUpdateMobEffectPacket;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.players.PlayerList;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.PositionMoveRotation;
import org.bukkit.entity.Player;
import org.bukkit.craftbukkit.v1_21_R3.entity.CraftPlayer;
import java.util.Collections;
public class PlayerRefreshUtil {
public static void refreshPlayer(Player player) {
if (!(player instanceof CraftPlayer craftPlayer))
return;
var serverPlayer = craftPlayer.getHandle();
var connection = serverPlayer.connection;
var level = serverPlayer.serverLevel();
connection.send(new ClientboundRespawnPacket(serverPlayer.createCommonSpawnInfo(level), ClientboundRespawnPacket.KEEP_ALL_DATA));
serverPlayer.onUpdateAbilities();
connection.internalTeleport(PositionMoveRotation.of(serverPlayer), Collections.emptySet());
var playerList = serverPlayer.server.getPlayerList();
playerList.sendPlayerPermissionLevel(serverPlayer, false);
playerList.sendLevelInfo(serverPlayer, level);
playerList.sendAllPlayerInfo(serverPlayer);
connection.send(new ClientboundSetExperiencePacket(serverPlayer.experienceProgress, serverPlayer.totalExperience, serverPlayer.experienceLevel));
for (var effect : serverPlayer.getActiveEffects())
connection.send(new ClientboundUpdateMobEffectPacket(serverPlayer.getId(), effect, false));
}
}
if that doesn't work as it should then nothing will
(completely not code from certain fork)
wonder how much of that could be done with the API instead of just using the raw methods for it
eureka, works, thank you so much!
hey so i tried this and still got the same error, heres my yml in case i did something wrong
why even have the shade plugin if you aren't shading anything (besides the jetbrains annotations, which if anything you shouldn't)
you are also declaring the maven compiler plugin and the resources block for no particular reason
no actually yeah youre right i didnt need to do that
actually can you explain what you ment by this?
do you still have the same issue with your plugin?
yeah
the exact same error?
yep
try removing all plugins except this one, just to make sure it is an issue with shading
alr sure
Performance I've seen set is better than list. I am not to worried about order I just have 2-3 seconds before my ui opens because its retrieving data from my database.
I am not sure if you meant to follow up that statement with a question lol
yep, it still is
i do have another plugin's yml that also depends on the menusystem plugin if u wanna see it
I haven't heard of anything bad about Guava's eventbus, and from what I can remember of it, it's a pretty simple event system so I don't see why not
the exact same error again? Can you send it?
also, what does your pom.xml look like now
wondering because maybe i should just copy luckperm's one lol
I don't know what LuckPerms does, but given they use their own thing, I'd stay away from it as it might not fit whatever you're looking for in comparison to a more general solution like Guava would normally provide
then again, do you need a separate event system, is there a reason you can't just use Bukkit's
I think personally I don't really like the HandlerList, and I would want just my users to just subscribe to an eventbus but idk
java.lang.ClassCastException: class io.github..menuSystem.MenuSystem cannot be cast to class io.github..menuSystem.MenuSystem (io.github..menuSystem.MenuSystem is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @741848c4; io.github..menuSystem.MenuSystem is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @1c51670f)
at io.github.***.expertiseStylePlugin.ExpertiseStylePlugin.onEnable(ExpertiseStylePlugin.java:27) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:267) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:492) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugin(CraftServer.java:576) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugins(CraftServer.java:490) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:641) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:426) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:269) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1017) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.lambda
s
p
i
n
spin0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]```
so it is still just complaining about the fact that you're using MenuSystem class from plugin x, even though you removed all plugins? That's impossible
it should be throwing a ClassNoDefFoundError if you removed all plugins
yeah it did
org.bukkit.plugin.UnknownDependencyException: Unknown dependency MenuSystem. Please download and install MenuSystem to run this plugin.
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:280) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.loadPlugins(CraftServer.java:465) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:236) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1017) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]```
you're looking for fancy, which is fine if you feel like experimenting, but any users of your plugin's API would much appreciate you using the normal event API rather than having to learn a different one. It is overhead that isn't well received unless your plugin has become big enough to need something custom, like LuckPerms does to maintain a common interface across platforms, among other things
so MenuSystem is a plugin library of yours, which is properly listed in your depend list of your plugin.yml
or is it supposed to be a library you shade in to use
yeah a shade in library, cuz i didnt need it to be its own plugin
also side note, i cant find it anymore after moving it out of my plugin folder so thats fun
if it is a shade in library, why did you put it in your depend list, can you show me your plugin.yml
why is it throwing an unknown dependency exception when it isn't listed there, what the hell
https://pastes.dev/S0iMiVyV3Y this is what your pom should look like for that case
are you sure you replaced the plugin in your test server with the one you recently compiled? Because based on that plugin.yml, there couldn't be an UnknownDependencyException as there isn't even a depend or softdepend list, unless it is below the command definition
your api version is also wrong, since you are running 1.21.1 and not 1.21, minimal thing but I'd change it
wait, are you using getPlugin to get an instance of MenuSystem class? But it isn't a JavaPlugin
yeah so funnily enough i updated my artifact that compiled my plugin and the server just loaded so i guess that was a problem
also yeah i forgot about that
you cannot use getPlugin to get instances of anything, it just gets instances of the currently loaded plugins
if it is a shade-in library, you have to instantiate everything yourself, including registering any listeners which I suppose you have since it is supposed to be a menu library
oh yeah i alr had all of that sorted
if that is the case then it is all working now? Lol
yeah everything seems fine
well, glad you got there lol, at last
but in all honesty, I wouldn't bother with a custom menu library and instead use a well-known one like stefvanschie's IF or DevNatan's inventory framework
maybe, but i did put some stupid shit into mine that are important + im bad at interperting other peoples code
like ive tried to import and understand 3 plugins by now and everytime i dont understand sheit so i might as well do it myself
being able to understand other people's code is a big part of being a developer, so I'd recommend training that skill as much as you can
that said, there's nothing wrong with making custom stuff, just that it is often brittle in comparison to something geared towards the general public
even more so in a constantly changing ecosystem like the plugin's one is
Yeah cuz u probably right about that
Has anyone figured out how to get the Cow Variant in 1.21.5 yet?
there is a getVariant method on the Cow entity
hey guys, I have a problem with hoverable chat messages, I'm showing an item on hover but for some reason it doesnt have its attributes like enchantmens etc.
private HoverEvent getHoverable(ItemStack item) {
ItemTag tag = ItemTag.ofNbt(item.getItemMeta() == null ? null : item.getItemMeta().getAsString());
System.out.println(tag);
return new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(
item.getType().getKey().toString(), item.getAmount(), tag
));
}```
What version are you on?
1.21
.0?
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
Could have just said .1
But nowadays breaking changes happen in these versions too so you gotta specify it fully
oh okay, do you know how to help?
I believe you need to use getAsComponentString now
Yeah as far as I can tell the serializer is just broken and gives the wrong tag
Not sure about 1.21.1 though was testing on 1.21.4 and .5
where?
instead of new Item(...) or what?
like that?
private HoverEvent getHoverable(ItemStack item) {
ItemTag tag = ItemTag.ofNbt(item.getItemMeta() == null ? null : item.getItemMeta().getAsComponentString());
System.out.println(tag);
return new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(
item.getType().getKey().toString(), item.getAmount(), tag
));
}```
it doesnt seem to be working..
it seems like the Item object is created correctly, same with HoverEvent, it has correct nbt tags, but the item on hover isnt displayed correctly
Assuming I'm reading the BungeeCord source correctly and that that thing is actually used in Spigot
It's wrong, the serialization is just incorrect and md has to update it
It will not generate the correct json
-# And speaking of generating json, text components now use nbt instead so I assume this has to be translated to nbt which is just adding pointless slow down
The correct format should be: {"hover_event":{"action":"show_item","id":"minecraft:golden_chestplate","count":1,"components":{"minecraft:unbreakable":{}}},"text":"TEXT"}
I too am going by latest btw
Actually idk why I bothered lol, there's an open issue from last year
https://github.com/SpigotMC/BungeeCord/issues/3688
Yeah that's what I also noticed while digging through the code
You could reflection into VersionedComponentSerializer and replace the gson field with basically the same, but fixed ItemSerializer
(I believe reflection allows you to replace private final field? I know there have been changes around that)
But this is extremely hacky and probably a bad idea :D
Would be better if you just used NMS or some different chat api
oh, so what should i do
Could probably just tell Spigot to run the tellraw command
getAsString and getAsComponentString seem to give the correct nbt depending on version
so you'd just pass that in to a full tellraw string and run that
can't you deserialize the json string from that into a component and send that?
what, do we not have a facility to deserialize json into components in spigot?
Which is what's broken
im so confused rn
As far as I can see, this returns the format for /give which will not work inside tellraw
didn't you say serialization, not deserialization, is broken
both are
🤡
even if you tweak the string to get deserialized properly it needs to be serialized when sent
so it's broken eitherway
So as far as I can tell this would probably be a good option if you want to avoid nms
at least for now until someone decides to fix it
Yep, agree
Using adventure is also an option
Should work just fine
private Component getMessage(Player player, ItemStack item, String slot) {
Component message = Component.text(
this.plugin.getMessage("Messages.show-%s".formatted(slots.contains(slot) ? slot : "other"))
.replace("{player}", player.getDisplayName())
);
Component itemText = Component.text(
this.plugin.getMessage("Messages.item-format")
.replace("{amount}", String.valueOf(item.getAmount()))
.replace("{item}", this.getItemName(item))
).hoverEvent(getHoverable(item));
System.out.println(itemText.hoverEvent());
message = message.replaceText(TextReplacementConfig.builder()
.matchLiteral("{item}")
.replacement(itemText)
.build()
);
return message;
}
private HoverEvent<HoverEvent.ShowItem> getHoverable(ItemStack item) {
return HoverEvent.showItem(
HoverEvent.ShowItem.showItem(
Key.key(item.getType().getKey().toString()),
item.getAmount(),
item.getItemMeta() == null ? BinaryTagHolder.binaryTagHolder("") : BinaryTagHolder.binaryTagHolder(item.getItemMeta().getAsString())
)
);
}```
hover didnt work at all
Are you on Paper?
The API you're compiling against
im using spigot
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.14.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>4.3.2</version>
</dependency>```
4.3.4 is the latest of adventure-platform-bukkit, and you shouldn't need to specify adventure-api explicitly
and what server version are you running?
i doubt the BinaryTagHolder version of ShowItem works post-data components
What kind of matryoshka doll shit is this
admittedly, I have no idea
idk that seems redundant lol
i mean, it doesn't work either way, does it?
ShowItem.showItem requires BinaryTagHolder
i mean without this matryoshka shit it throws an error xD
omg that's so baad
who made it
who can I curse at
my IDE shows only this...
i mean BinaryTagHolder
what is the latest version of adventure
4.20.0 but idk if adventure-platform is updated to it
it is community maintained after all
it'll get as far as people want it
ah ye, but shouldn't the hover message appear anyway?
even if the tags are not handled correctly
right?
not necessarily
hover events have changed a lot in recent versions
if old adventure doesn't know how to deal with new minecraft version, it will skip it
so first of all, I should update adventure?
Latest for bukkit platform seems to be 4.13.1
So what Emily sent would not work anyways
Use tellraw, construct the command yourself
-# There is a PR for support for 1.21.5 tho :D
for spigot 1.21.5?
but will plugin written for spigot 1.21.5 work on 1.21?
Unlikely
so i gotta fuck around with the tellraw?
In this case, most likely not
'cause the format was changed between those versions too I believe
I would say that is the easiest thing you can do right now
Or NMS
but its pain, right?
Only if you plan on updating the plugin
oh, if it's gonna stay on 1.21 I'll be alright?
Depends on you I guess
Personally I have no problem working with NMS
Apart from the updating
But I have not touched spigot in over a year so I have not suffered since :)
isn't it really obfuscated?
Compare different mappings with this website: https://mappings.dev/
wait no
?nms
not doing friend requests or support in DMs, feel free to tag me here tho
alr thanks, have a good day
@smoky anchor so from what I understand I should just send a packet with the message to player?
hellno
you do not need to send a packet by yourself
Construct the message and then use a method to send it to player, most likely in the player object
You can get that if you cast the bukkit Player object to CraftPlayer or something and getHandle()
sendSystemMessage I believe it should be or maybe a bit different, I'm looking at decomp of 1.21.5
Assuming the craftbukkit object is CraftPlayer, yes
I don't exactly have code at hand, I'm going by docs and memory
and then srnd the Component message using
craftPlayer.sendMessage()```
Hmmm not from CraftPlayer I don't think ?
That would not take NMS text
3PM
alr good, same as me
Ye not this, this takes only string so it ain't gonna work
craftPlayer.getHandle().someSendMessageMethod
alr thanks
hello, does anyone here know a cool gui library that will allow me to make a simple animation? Inventory 2 rows, items in row 1 "appear" from the left and stop, and in row 2 from the right. If no one knows such a library, my idea is to make such "frames" of animation, i.e. some List where there are <slot, item> maps and set the gui content with a delay
That's not too hard to do yourself
yea I know, but how can I do it good with and not to waste resources (efficiently)
is my idea okay?
Not sure I understood what you meant
but you'd just use the scheduler or smth to set the next slot
question, how do you get the value of an attribute?
There can be multiple attribute motifiers
their values are added together to make the final result
Also why is there a reduntant loop there
where?
You're looping over a list you made with only one entry
- There's no need to loop over every entry in the multimap to find elements with you key
use the get method
olivo i love you
oh sick i didnt know that method existed
my idea would be something like this, is it a good idea?
That's slightly better but it still ignores a bunch of attribute modifiers and their operations
also no need to get the item twice and the item meta twice
use the variables
you will probably end up with an admirer

@smoky anchor it works, thank you so so much man
how do i load a pre configured config.yml file from my resources folder
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
dankeschön
I'm going to make one for fun, and I'm using ByteBuddy to generate implementation classes from interfaces since I will be having a ton of events
Why is intellij not installing the dependency? i installed buildtools and run it for 1.21.5: ``` <repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/repository/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://repository.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
--> <dependencies>
--> <dependency>
--> <groupId>org.spigot</groupId>
--> <artifactId>spigot</artifactId>
--> <version>1.21.5-R0.1-SNAPSHOT</version>
--> <classifier>remapped-mojang</classifier>
--> <scope>provided</scope>
--> </dependency>
--> </dependencies>``` --> is marked red
And what does the red say
Oh sorry, its says the dependency is not found somehow
?bt
🗣️
already did that
i got this error: ```
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [sh, /home/raven51229/Desktop/BuildTools/apache-maven-3.9.6/bin/mvn, -Dbt.name=4479, -P, remapped, clean, install]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
at org.spigotmc.builder.Builder.runMaven0(Builder.java:936)
at org.spigotmc.builder.Builder.runMavenServer(Builder.java:905)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:683)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
then please pastebin the entire BuildTools.log.txt file when seeking support
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Looks like your not using a jdk from a quick glance
java -version was working
OpenJDK Runtime Environment (build 21.0.6+7-Ubuntu-124.04.1)
OpenJDK 64-Bit Server VM (build 21.0.6+7-Ubuntu-124.04.1, mixed mode, sharing)
Now run javac -version
well okay that wasnt working
well its installed but still the same error i guess: ```raven51229@DRAUGER-YVK977H2:~/Desktop/BuildTools$ javac -version
javac 21.0.6
Send the new log
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Hey, I try to implement specific Unicode to display custom GUI with the resource pack but I have this error:
[Render thread/WARN]: Couldn't find glyph for character (\uf7b3)
My <namespace>/font/default.json include that:
{
"providers": [
{
"type": "bitmap",
"file": "<namespace>:font/test.png",
"ascent": 60,
"height": 256,
"chars": [
"\uF7B3"
]
},
]
}
In my textures folder I have a test.png: <namespace>/textures/font/test.png
Someone have an idea? Im in 1.21.4 =)
Rerun BuildTools in an empty folder
can you send me a ZIP of your pack
or just the font part
the font json?
and the png
yep
I want to test it with my WIP library, see if it loads it OK
👍
unsure if this belongs here or in #help-server but how do you prevent player/entity nudging?
Are you writing a plugin?
yes but i was unsure if it's just a simple setting in the server properties file considering so many servers have that turned off
declaration: package: org.bukkit.entity, interface: LivingEntity
I send a dm with the pack
ok
I believe a Paper has a setting for that
now it built but still not working in IntelliJ Could not find artifact org.spigotmc:spigot:pom:1.21.5-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/repository/snapshots/)
Make sure you built 1.21.5 with the remapped flag
i run this command: java -jar BuildTools.jar --rev 1.21.5 --remapped
Did you reload maven after BuildTools finished running?
yes i did
okay now its this: https://paste.md-5.net/imarefosej.xml and its saying: Unresolved dependency: 'org.spigotmc:spigot:jar:1.21.5-R0.1-SNAPSHOT'
Did you run BuildTools as root?
because it seems to be installing the dependency in to it's .m2
at least in one of the earlier logs*
i used sudo was that wrong?
yeah
yes
Don't do that
every time I read this blogpost it reminds me I have to make a site that you can automatically copy this configuration but with updated versions
right now that one is outdated both in the minecraft version and the maven plugin version (though just by 2 minor versions)
i was gonna say that i'd rather i give someone the text to copy paste than them resourcing to ai, but, nahhhh
it's just annoying since they didn't use a property or anything, you have to do search and replace like 5 times for the spigot version
it isn't a big deal if you only have to do it once, but if you create new projects constantly, it gets annoying lol
doesn't intellij say "hey there's a new version of xyz dependency available" with maven?
But how do we know you aren’t AI
it doesn't do that, but it lists the new versions in auto-complete if you're replacing them
mkay that's good enough lol
I usually do it this way so that I don't have to replace it everywhere, at the very least: https://pastes.dev/u14bVNl8KW
that way I can also use ${spigot.version} as api-version in the plugin.yml
I also didn't understand for the longest time why there were two executions to that goal until I actually took the time to look at what it was doing
since it just calls specialsource, it is going, mojmap -> obfuscated -> spigot using obfuscated "mappings" as intermediary
how to send TextComponent so that it keeps the legendchat channel, tags and nickname like this example: https://prnt.sc/pf6m10LVQh8S
Kyori component or bungee?
Also show your code for what youve tried far. We dont have a lot of context
package br.com.pixelmonplugin.Listeners;
import br.com.devpaulo.legendchat.api.events.ChatMessageEvent;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.battles.attacks.specialAttacks.basic.HiddenPower;
import com.pixelmonmod.pixelmon.entities.pixelmon.abilities.AbilityBase;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.Gender;
import com.pixelmonmod.pixelmon.enums.EnumType;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import java.util.Optional;
public class PokeShow implements Listener {
@EventHandler
private void onChat(ChatMessageEvent event) {
try {
Player player = event.getSender();
String message = event.getMessage().trim();
if (!message.contains("@poke")) {
return;
}
event.setCancelled(true);
String[] parts = message.split(" ");
TextComponent finalMessage = new TextComponent("");
for (String part : parts) {
if (part.startsWith("@poke")) {
String slotStr = part.substring(5).trim();
try {
int slot = Integer.parseInt(slotStr);
if (slot < 1 || slot > 6) {
player.sendMessage(ChatColor.RED + "Slot inválido: " + slot + ". Use um número entre 1 e 6.");
continue;
}
PlayerPartyStorage pstore = Pixelmon.storageManager.getParty(player.getUniqueId());
Pokemon pokemon = pstore.get(slot - 1);
if (pokemon == null) {
player.sendMessage(ChatColor.RED + "Não há Pokémon no slot " + slot + ".");
continue;
}
String hoverText = createPokeHoverText(pokemon);
String displayName = ChatColor.GOLD + "[" + ChatColor.BLUE + ChatColor.BOLD + pokemon.getDisplayName() + ChatColor.GOLD + "]";
TextComponent pokeComponent = new TextComponent(displayName + " ");
pokeComponent.setHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
new ComponentBuilder(hoverText).create()
));
finalMessage.addExtra(pokeComponent);
} catch (NumberFormatException e) {
player.sendMessage(ChatColor.RED + "Formato inválido. Use @poke<slot> (ex: @poke1).");
}
} else {
finalMessage.addExtra(new TextComponent(part + " "));
}
}
} catch (Exception e) {
Player player = event.getSender();
player.sendMessage(ChatColor.RED + "Erro ao processar o comando. Contate um administrador.");
Bukkit.getLogger().severe("Erro no PokeShow: " + e.getMessage());
e.printStackTrace();
}
}```
player.spigot().sendMessage(component)
yes but it does not keep the channel, tags and player name of the legendchat plugin for example
so you want to send a message on behalf of a player?
With a text component it's gonna be a lot harder. With a regular string you have Player#chat(String).
But if you're using a text component you might have to manually invoke the AsyncPlayerChatEvent and use that formatting
The chat plugin likely has an API you can pass text to for it to format
no have
and how would it be to send?
no have support for text component
Invoke the event, then listen for it again on monitor priority and replace the message with your component
It's a bit hacky but I can't really think of another way to get formatting
anyone know why intellij is yelling at me? it wasnt like this a couple hours ago
in my project
Are they imported?
nope
Time to do so
no like they are but
what build tool are you using
idk what the actual name is called, but is this and / or maven clean package
both, depends on how im feeling that day
Don't use artifacts
Use maven
why?
Makes builds work outside Intellij. No relying on jars and good practice to keep the project easily portable (most of the time when deps are in a non-local repo)
whats wrong with maven?
You do also get other features such as shading and relocation and remapping with nms
dont get me wrong, I use gradle, but im curious to know ur opinion on why "dont use maven"
I think it is more programmable and has easier tools to configure.
I use Maven. I'd never use Gradle to build against Spigot
why
because it doesn;t need anything "more programmable or configurable" as Spigot is designed to work easiest with Maven
Now the question is do you need that extra complexity, also I wouldn't say it's much easier than Maven
yes i need
For what?
Not to build for Spigot you don;t
you can do stuff like that https://github.com/system32developer/SystemCore/blob/master/build.gradle.kts
wym
First off, thats for paper
it doesnt matter if it is for paper
is the same
No its not
yes but a lot of the industry already uses xml, so easier is extremely subjective - a lot of stuff that run java will bind its dependency through spring or dagger xml files, it will bind its logging and log configs through xml files, so in that way, pom.xml with maven is very natural to experienced devs in the industry
it is more programmable- but at the cost of being more scripty, and the fact that u have to rely on the gradle api, now dont get me wrong: thats all great once u get it to work, I also see tons of gradle scripts that dont follow conventions and use bad practices, which doesnt happen in maven cuz like- its just xml
it does lmao
for simple stuff where u dont need to pivot snippets of code around ur build pipeline, maven works excellently
I would keep that versioning logic out of the build file
and converting to gradle when it does get more complicated works reasonably well also
xml is ugly for me
Doesn't really belong there
gradle build system looks better
"better"
build system?
That's subjective
I see simpler as better
this is not facts tho, maybe in ur own world, but terrible counter argument
plugins {
id 'java'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
}
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ejemplo</groupId>
<artifactId>mi-proyecto</artifactId>
<version>1.0.0</version>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
</project>
which look better
and more easy
realistically, thats not how ur gradle file is gonna look
its a shit example
yea it does if u just generated a blank project
No publishing task
but most if not all major projects that use gradle imports tons of gradle plugins
wtf you mean
javadocing, versioning, shading, modularity etc
for spigot dev you only need two
only this
plugins {
kotlin("jvm") version "2.1.20"
id("com.gradleup.shadow") version "8.3.2"
id("xyz.jpenilla.run-paper") version "2.3.1"
}
literally two
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.kotlin.dsl.named
import xyz.jpenilla.runpaper.task.RunServer
plugins {
kotlin("jvm") version "2.1.20"
id("com.gradleup.shadow") version "8.3.2"
id("xyz.jpenilla.run-paper") version "2.3.1"
}
group = "com.system32"
version = "1.0"
repositories {
mavenCentral()
mavenLocal()
maven("https://repo.papermc.io/repository/maven-public/") {
name = "papermc-repo"
}
maven("https://oss.sonatype.org/content/groups/public/") {
name = "sonatype"
}
maven { url = uri("https://jitpack.io") }
maven ("https://repo.codemc.io/repository/maven-snapshots/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.github.system32developer:SystemCore:1.6.3")
implementation("net.wesjd:anvilgui:1.10.4-SNAPSHOT")
}
val targetJavaVersion = 21
kotlin {
jvmToolchain(targetJavaVersion)
}
tasks.build {
dependsOn("shadowJar")
}
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
}
tasks.register("acceptEula") {
doLast {
val runDir = file("$rootDir/run")
val eulaFile = file("$runDir/EULA.txt")
if (!runDir.exists()) runDir.mkdirs()
if (!eulaFile.exists()) {
eulaFile.writeText("eula=true")
}
}
}
val path = "com.system32.schooldaysPets.shade"
tasks.named<ShadowJar>("shadowJar") {
relocate("net.wesjd.anvilgui", "$path.anvilgui")
manifest {
attributes["paperweight-mappings-namespace"] = "spigot"
}
}
tasks.named("runServer").configure {
dependsOn(tasks.named("acceptEula"))
}
tasks.named<RunServer>("runServer") {
minecraftVersion("1.21.1")
}
this is a fully file
for spigot dev
yea now thats realistic example
i dont think so really
maybe "cleaner" in ur eyes
let me search one from maven
but objectively, its more complicated, because u use the grammar from kotlin script, and u use api calls from gradle api, and u use types etc
you can use java
if your project is for java
groovy u mean?
yea
its not java buddy
give me a second
its groovy
yea
as I said, this still stands
if u deny this, u're delusional - im sorry
that being said, yes gradle has a lot of benefits
dont get me wrong
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.system32.ultimatewhitelist</groupId>
<artifactId>UltimateWhitelist</artifactId>
<version>1.9.8</version>
<packaging>jar</packaging>
<name>UltimateWhitelist</name>
<properties>
<java.version>16</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>de.tr7zw.changeme.nbtapi</pattern>
<shadedPattern>com.system32.ultimatewhitelist.UltimateWhitelist</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
<layout>default</layout>
</repository>
<repository>
<id>opencollab-snapshot</id>
<url>https://repo.opencollab.dev/main/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>api</artifactId>
<version>2.2.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.14.1</version>
</dependency>
</dependencies>
</project>
maven one
plugins {
id 'java'
id("xyz.jpenilla.run-paper") version "2.3.1"
}
group = 'com.system32'
version = '1.0'
repositories {
mavenCentral()
maven {
name = "spigotmc-repo"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
maven { url "https://maven.enginehub.org/repo/" }
maven { url "https://jitpack.io" }
maven { url "https://www.matteodev.it/spigot/public/maven" }
}
dependencies {
compileOnly("org.spigotmc:spigot-api:1.21.1-R0.1-SNAPSHOT")
compileOnly("com.github.LoneDev6:api-itemsadder:3.6.1")
compileOnly("dev.lone:LoneLibs:1.0.58")
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.12'
}
def targetJavaVersion = 21
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release.set(targetJavaVersion)
}
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
tasks {
runServer {
minecraftVersion("1.21.1")
}
}
groovy
yes, its simpler, because its just xml under a set of tags, yes its more verbose but verbosity doesnt equate how complicated or simple something has to be
no one uses groovy as said - the intellij support for the groovy dsl sucks
i think gradle is 0 complicated
lol
I do 
visible disappointment
jus use kt
I prefer it over Kotlin
wy
really, I had so many syntax highlighting issues with it
yea lol
and ide auto suggestion issues
i remember it not recognizing shadowJar types, tho that might be because shadowJar gradle plugin was coded poorly initially
@jagged thicketwhich one you think is better
but also just the fact that its... groovy makes it somewhat daunting to even touch
i use kts gradle
why
what?
oh because ^
@chrome beacon why u up
oh
mine sometimes
💀
Not really
i want to buy a raspberry pi
i have rasp 3
is it good?
no
More like burned out
💀
oh I see
raspberry pi sucs for anything useful