#help-development
1 messages · Page 1204 of 1
alright
that should fix it
Pretty sure .setLevel no longer works. It broke long ago when Bukkit changed the backing logger
oh
damn
did not know that
yeah its a bitch
I can set something like.. if the int value of the level is greater than or equal to that of info, send the message to discord
Here's some kind of warning
[17:14:06 WARN]: Nag author(s): '[]' of 'DTMBridge v1.0' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
oh ye thats just cause we were using sout to debug
ah right
tried that... didnt work
ye no i assumed it was due to diff levels but since i saw this idk
ill look at it some more but its 6am and im tired af so ima sleep and hopefully while i sleep someone else can help or knows the answer
always works when i reload the server instead of restart
like /reload
yep
weird
maybe i could set some sort of delay after the bot is initialized..
Sorry, can you tell me what ConsoleDiscordHandler is supposed to do ?
Its a Handler for the Logger which is supposed to log to a Discord channel
So, anything that would be shown in the server logs, should be sent to discord
yes
caught this while using /reload:
[net.dv8tion.jda.api.requests.RestRateLimiter] Waiting for 1 requests to finish.
Can you, as a test, create a Filter and add it to the Logger ?
Just sout the LogRecord or something.
Well, I'm kinda tired now. I'll see if I get some time later. Thanks for all your help
When I wake up ima clone your hit and mess around myself
I just looked earlier
Like 10 mins ago
He uses log4J basically
Seems it uses Filter as well, but from log4j
I'm gonna have to deeply study logging if I want this to work correctly. Thanks though.
The main class is really, really big. Wow.
I need help to replace a deprecated method in order to provide support for 1.21.4
Why has Biome.values() been deprecated and made unavailable?
bruh
You can then use the stream method and whatnot
Thanks... not a fan of Regitries
so have a few dumb questions, made a second module in my project for api so third party plugins can hook. My question is, how do I compile the api in the core module? atm the api is <package>pom</package> do I need to shade it into the core or what's the process?
shade it in the core or shade them both in the parent
Nice, ill try shading it in the core 🙂 ty
Is there a way to transform a JAR file into a IntelliJ Project?
I'm restoring an old private project which original code has been lost, except its .jar
you can decompile it but you wont get the exact code
it will be decompiled code which can be very broken sometimes
Question is there an event for when a player loads a chunk into render?
I am using nms and packets to spawn npc's and I need it so that when a new player loads a chunk with an npc in them they get sent the packet so the npc shows up for them
There isn't
You'd need to use nms for that part as well
or you know not reinvent the wheel and just use Citizens
PlayerChunkLoadEvent
I'm not reinventing the wheel, I'm doing very specific things with npc's that citizens and their api doesn't allow for and I really don't want to use 50+ api's in a plugin.
How do I decompile it Sir.?
The example text even says it can be used for excactly that case
Awesome I seen ChunkloadEvent but not PlayerChunkLoadEvent on the javadocs. Thanks
use something like vineflower or fernflower
Damn I really don't wanna use paper's api for just that.
My other option was to listen to the player move event, and check when they enter a new chunk if it contains my object. But that feels kinda bad for performance
theres a method to get all the olayers seeing the chunk
^^
You'd need to check that every couple of ticks
for every chunk
Which uhh is not great for performance
Yea that still kinda feels bad imo
?paste
Yea I'll go ask on the paper discord about that specific PlayerLoadChunkEvent and see what they say
shh
Oh I'll look into that thanks
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.4.1:jar (default-jar) on project liam: Error assembling JAR: Problem creating output file for zip C:\Users\Admin\Desktop\LIFESTEAL\plugins, C:\Users\Admin\Desktop\LIFESTEAL\plugins\liam-1.0-SNAPSHOT.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
how do I fix this?
iirc spigot handles visible entities not by chunk but by radius entity distance (spigot.yml)
entity-tracking-range
Default: (display: 128, players: 48, animals: 48, monsters: 48, misc: 32, other: 64)
Type: Integer
Description: Controls the range in blocks that entities will become "visible" or otherwise known as "tracked" to the client. Entities outside of this range will be invisible as they are not being rendered to preserve CPU usage and bandwidth. This is particularly useful for PVP servers, as turning down the player range will 'nerf' wallhacks and radar to some extent. Miscellaneous controls the range for item frames, paintings, dropped items, and experience orbs. Other is a general maximum limit for all entities on your server.
Does not impact server performance much to change these values. These will mainly help client-side lag when lowering these.
you should read this config value and calculate the distance between you and the npc
it shouldnt be handled on chunk basis
Blasix1x sent 1251 packets in a tick. Terminated the connection!
this is on the proxy
anyone know how to fix?
dont send 1251 packets in a tick, what exactly are you doing?
Sending 1251 packets Ina. Ticket obviously
😔
I'm sure he HAS to send 1251 packets a tick or his movements will be jerky 🙂
Any ideas how to deepcopy a ConfigurationSerializable and change a value that is final during that?
I tried it by serializing and then deserializing but that is just a shallow copy.
My next attempt was to use gson but it turned some of my nested ints into doubles, breaking the config
My last attempt (see below) was to create a temporary yaml configuration, write the object, save and read the object again, this however won't let me change values before reading it again as the commented line causes the whole Object except the freshly written field to be removed.
public Integer duplicateActivity(int id) {
ConfiguredActivity activityToCopy = getById(id);
YamlConfiguration tempConfig = new YamlConfiguration();
tempConfig.set("copy", activityToCopy);
//tempConfig.set("copy." + ActivityBaseField.ID.configKey, currentHighestId++);
tempConfig.saveToString();
ConfiguredActivity newActivity = (ConfiguredActivity) tempConfig.get("copy");
addActivityInternal(newActivity);
return newActivity.getId();
}
Just wondering if anyone could help me with this small plugin I am making, I've hit a bit of a dead end and not sure what to do
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
why are you doing this? also why not just have an object that u populate with the config & clone that
Rough Idea:
So I want to make it so that when you join the server, the plugin will check if you have one of the following permissions 'ascension.team' or 'abyss.team'
If you have neither, a command will run to give you a luckperms group (either ascention or abyss) and the way it does it is by balancing the players in each group. If 10 people join, there will be 5 people on Ascention team and 5 people on Abyss team.
The plugin should check Luckperms to ensure the teams don't change size when players log off the server or should adjust the size of teams if players switch teams using another plugin.
Issue:
When a player logs on or off, the team size of what ever team they are on keeps on increasing.
I have never coded in my life before so and am using ChatGPT to code so I have most likely done something wrong. It would be greatly appreciated if someone could help me out!
no one can help you without the actual code
I will provide it if someone wants to help
yea just send it here someone will probably answer
How do I do that
😭
Because there are 5 different files and some are over discord limit
?paste
Ping or DM me if you can help. Thank you (will be gone for about 1-2 hours)
I have an Object that extends ConfigurationSerializable and gets configured through some GUIs. I literally just wanna copy it so you don't have to start from 0 to configure it (if you press a specific button that is). What do you mean by populating it with the config?
But of course it needs a new ID so it's more than just a copy
I guess I'll just do a copy constructor that also allows the new ID
lol just make an all args constructor then yeah
I mean I have that but since the Class contains maps it's not as simple as to just reach the map from the other object in because that would just hand in a pointer
new HashMap<>(oldMap)
So I have to specifically deepcopy those, but I can do it in a seperate constructor
yeah
so whats the problem
Constructor(Map<Object, Object> map) {
this.map = new HashMap<>(map);
}```
Nothing, I was just hoping for something less bloaty since there's quite a few fields and I have to nullcheck a bunch of fields
And I thought "Oh I can already serialize it, so maybe I can just serialize and deserialize somehow"
Because that doesn't go well with null. But I can do it. It's just very bloaty
why would it not go well with null wdym
if you call that with null it will give you a nullpointer
Map<Integer, Integer> failureActions = null;
if (failureActionIdsWithDelay != null) {
failureActions = new HashMap<>(failureActionIdsWithDelay);
}
So I basically have to do this all the time before calling the constructor
this.failureActions = failureActionIdsWithDelay == null ? null : new HashMap<>(failureActionIdsWithDelay) is a cleaner one liner i guess
no worries
you can just have two constructors one with the map and one with noting, then people can decide if they have a map or not
While this is true for just one field, it would require me to do that for all possible combinations and have a bunch of constructors that have call constructors. I decided to go with a non constructor based approach which is just
objectToCopy.copyWithNewId(newId);
And then calls the constructor internally with the one line null checks
Hey there, I am trying to create the effect of a player dying and dropping his inventory without actually killing the player.
I want to do this because I prevent the player from dying and instead instantly make him a spectator.
Does anyone have an idea how I can do this with the lowest possible performance impact?
I already considered to loop through the players inventory and spawning the items piece by piece as entites but that seems like too much brute force from my point of view.
listen for when the player dies, let him die respawn him as spectator
at the same location
you can call dropItem on the player
isn't that just for the item in the players hand?
Yes, it is
thers lots of them
if you really want to simulate teh player dying then world#dropItemNaturally
I would personally go with respawning the player and setting the respawn location to their position as this causes the least amount of noise for other plugins
But if compatibility is not an issue then it's just looping the items. It's not even 50 iterations, that shouldn't cause any performance issues
How do I drop items from a specific slot?
just getcontents/armor and drop each item
Don't you wanna drop all items?
Yes I do, but I can't find the function to drop an item from the inventory besides the Player#dropItem method
Oh. No you can't. You'll have to loop and do World#dropItemNaturally. Either that or you'll have to loop and set the item in the players hand to then drop it.
The latter would cause the PlayerDropItemEvent to fire for each item, which is probably not wanted.
And don't forget to clear the players inventory afterwards
Thanks for your help, I'll try the first version 😄
you can also just cancel the event & send the packet to nearby players
cancelling the event & dropping the items afaik will not have the death animation
Just curious, what would someone use runtasklaterasynchronously for?
for something that doesnt need to be on the main thread
examples are chat, tablist, scoreboards
or anything else
Oh okay
And whats the difference between something being on and off the main thread?
it can run in parallel and you make use of the cores of ur pc, altough im not sure what runtaskasync does internally
Ok
It offloads it to a thread pool
As for how those threads are managed, that’s up to the OS and the JVM
when you're building a texture atlas, does it usually needs to be inside a grid (just like minecraft did prior to resource packs, they sill iirc build texture atlases dynamically) or can you make it gridless and hardcode the positions of the texture itself onto the object?
what's the best way
The death animation is not necessary, so the option above will probably be the best 😄
Manually hardcoding everything probably makes it twice as hard
ok so i can use tool component to set the mining speed right?
also yk how if you try and put sharpness on a pickaxe and it doesnt work or if you use command and it says unsupported enchant for that item, how do i add enchants to that list? so for example make it so my itemstack cant be enchanted with fortune
You need a datapack for this
https://minecraft.wiki/w/Enchantment_definition
However for your specific case (sharpness on pickaxe), I believe you can just add your item material to the tag (idk which one)
But as said before, this only allows it for the material, so not only your custom item would be enchantable, but all items of that type.
how can i use tool component to change the mining speed of a pickaxe?
iirc you can simply change the attribute
is that with setAttributeModifiers?
Idk about the tool component, not sure how far the API is with it.
The wiki can always help tho https://minecraft.wiki/w/Data_component_format#tool
yeah ive been looking at the docs but i think i seem to make a new tool component instead of editing the oringnal one because after i change it i cant mine blocks
Probably add would be better.
Bear in mind that adding an attribute will override the items default attributes, sou you'd have to re-add those.
some code please ?
Why do ToolComponent.ToolRule methods return Float and Boolean ?!
edit: should have read the full description
public ItemBuilder setMiningSpeed(double speed){
ToolComponent tool = meta.getTool();
tool.setDefaultMiningSpeed((float) speed);
return this;
}
read docs of getTool
Gets the tool set on this item, or creates an empty tool instance. The returned component is a snapshot of its current state and does not reflect a live view of what is on an item. After changing any value on this component, it must be set with setTool(ToolComponent) to apply the changes.
so at the very least you'd have to do meta.setTool(tool);
sorry yes i am doing that in another part of the code
No you're not
If you can, please paste the whole ItemBuilder class
But I doubt you are if the setMiningSpeed is complete
when using markers for spawnlocations of specific minigame events like player spawn points or item generators, should i use customname or metadata?
Neither, use PDC for the Marker entity
?pdc
so i think what ive found out is that there is no tool components on itemstacks unless you specifically set one which means there is no default to go off
Are you attempting this on item with default tool component ?
Like a pickaxe ?
yeah attempting to set the mining speed of a default pickaxe
And to reiterate, you have to do setTool in this method.
You can't do it "somewhere else"
If you send the fill ItemBuilder I can help more possibly.
If you were to do it somewhere else, you would have no access to that modified ToolComponent, each getTool returns a new copy. As stated in docs.
public class ItemBuilder {
private final ItemStack item;
private final ItemMeta meta;
private final ToolComponent tool;
public ItemBuilder(Material m, int amount){
item = new ItemStack(m, amount);
meta = item.getItemMeta();
tool = meta.getTool();
getLogger().severe(String.valueOf(tool.getDefaultMiningSpeed()));
}
public ItemBuilder setItemName(String name){
meta.setItemName(name);
return this;
}
public ItemBuilder setMaxDurability(int durability){
Damageable damageable = (Damageable) meta;
damageable.setMaxDamage(durability);
return this;
}
public ItemBuilder setMiningSpeed(double speed){
tool.setDefaultMiningSpeed((float) speed);
return this;
}
public ItemStack build(){
getLogger().severe(String.valueOf(tool.getDefaultMiningSpeed()));
meta.setTool(tool);
item.setItemMeta(meta);
return item;
}
}
If your code is correct, then I guess Spigot just does not return the default component. This may be a bug as docs don't state anything about this.
when i get the pickaxes tool component there is nothing set such as the blocks it can break
ok, your ItemBuilder looks correct.
You can still try using the attribute, I do believe there is a way of getting default attributes, so overriding them should not be much problem.
yeah its looking like the attribute way is the easier way
Guys, I want to have an object (of a class that doesnt implement AutoCloseable) saved in an array, but when I access that object via a method I want it to return a class that has the same methods as the first class but it also implements AutoCloseable. Is that possible?
xy? Why do you want to do it that way?
Im just curious whether that's possible
cuz the only way I can imagine that is breaking inheritence logic lol
So long as you use a getter you can cast it
but that's the point, I would be casting a parent to its child, no?
like, that's not possible right?
You specified no limitations in parent/child design
well thats how I imagine it should be done
for (AttributeModifier am : meta.getAttributeModifiers(Attribute.MINING_EFFICIENCY))
getLogger().severe(am.getName());
Cannot invoke "java.util.Collection.iterator()" because the return value of "org.bukkit.inventory.meta.ItemMeta.getAttributeModifiers(org.bukkit.attribute.Attribute)" is null
Why do you want one auto... and the other not?
I suppose MINING_EFFICIENCY only applies to certain tools
im checking a pickaxe though
incorrect, it is an attribute, it applies to any item
my bad
Well, you're sorta correct, I jumped the gun
You need to get the default attributes of the item
- Get object X from array
- Tell object X which array and which position it came from
- Do stuff with object X
- Make AutoCloseable run update on array which is saved on X
I see no reason for it
fr
Why not just have it auto... it makes no difference if it implements and is not used
you are doing all this to avoid an IDE warnign of unused methods?
no
how safe is .clone()
can I use it out of the box
depends on your Object
which parts of it specifically?
what field types are bad
Can't remember. Its been many years since I used cloneable
alr thx
btw i was looking at this but opposite so i got a pickaxe itemstack and i dont want it to be able to have fortune on it
lol?
clone is fine, at least it does a shallow copy so will not clone other object references
I've done both in the past and it really depends on your object and requirements
effective java have a good chapter about it
Yeah~ I dunno about removing from the tag, you can only either append or replace.
And if it is your custom itemstack, then you'd need to use some spigot events, datapack would not help here.
Given all the problems associated with Cloneable, new interfaces should not
extend it, and new extendable classes should not implement it. While it’s less
harmful for final classes to implement Cloneable, this should be viewed as a performance optimization, reserved for the rare cases where it is justified (Item 67).
As a rule, copy functionality is best provided by constructors or factories. A notable exception to this rule is arrays, which are best copied with the clone method.
Is there any attitude among the plugin development community towards <nullException vs null check> ? which is better?
check over Exception. Exceptions shoudl not be used to control teh flow of code
at least that was teh idea a few years ago, unless its changed
“Nullexception” is less productive than ‘if’ but if I make an api it gives the convenience of understanding the error for api users
idk what to do
especially for intermediate objects
I think it's better to yeet an error when user does something wrong than to just silently fail and leave the user to wonder what went wrong. In the API case.
so many factors
if you are making an api that its method mustn't take null arguments then do note in the javadoc that it throws NPE if the params are null and just slap a Objects.requireNonNull(foo, "foo is null"); at the beginning
if null is a valid argument value then annotate the parameter with some @Nullable annotation and handle that as a value
When a programming language like Kotlin, syntactically adapted to Java, becomes available...
translator be like:
what specifically do you want ?
The nullability thing is part of valhalla and will come some day
The more I live, the more I want to make a java analog, but not like Kotlin.
but i gess this very hard
null restricted types?
Yup
is there something in the spigot api to query the current world of offline players without touching every single player file?
no
and what is the best way to search through each individual file?
are you trying to figure out which offline players stayed in a specific world?
you'd probably have to create your own personal database for that for tracking that
Exactly, I would like to know the world from all offline players who have ever been on the server
https://paste.md-5.net/ohavabivel.java - what the argument ResourceKey<Level> resourcekey need for get server level
The resource key of the world to get
why it's not tied to the player himself.
but I don't just want this for new data, but also for all those who have been online in recent years
You're not looking in the player
You're getting it from the server
all players are stored in their own file without proper indexing and anything, and iterating through all of them is insanely slow. you should use a proper sql database for that, if you need that info regularly. and possibly just loop through all offline players once to store it in your database
one time would be enough for me
there is this method
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#getOfflinePlayers()
you should probably access it async (which should be possible when dealing with offline players) as i am afraid it otherwise freeze your server
declaration: package: org.bukkit, class: Bukkit
but that only returns the player name
What data do you want?
the world on which all offline players are located
Use getLocation
You can get that info from the OfflinePlayer object.
Oh hey, I added that method. lol
So I don't have to read out every single player file with NBT? As I said, it's about old data
Unless you need more data that the world they are in, no.
You can just iterate over #getOfflinePlayers() and use #getLocation().getWorld().getName();
okay thanks, I'll give that a try
Does anyone know how to create large explosion particles now? I only see explosion in modern versions and explosion emitter which was huge, but what happened with large?
I tried explosion and that’s too small and not how large explosion used to be. It would suck if I only have those two, but I’ll compare them later
this does not work for me, it says "not found" for every player. am i doing something wrong? https://pastebin.com/nQBpWs1t
Because they are not online?
Why are you checking getPlayer
getPlayer only works for online players
Call getLocation directly on the offline player
iirc SMALL_EXPLOSION became POOF, and LARGE_EXPLOSION became EXPLOSION
They should be the same size between versions I don’t think they modified that
Yea, like others have said, don't use #getPlayer() from the OfflinePlayer object. They are obviously not online.
Use the #getLocation() method directly from OfflinePlayer. OfflinePlayer#getLocation()
thank you very much! it seems to work now https://pastebin.com/BfwjeNzz. or is there anything I can improve?
I don't think hasPlayedBefore() will ever be false because getOfflinePlayers() is going to get a list of players that have played on your server
Otherwise looks fine
What if I delete the player data files without deleting the player cache!!!!
I just saw it yeah thanks
right 🙈 , and does it make sense to make it asynchro? someone had suggested that earlier
tbh I'd do it async anyways. It does lots of file IO
Just say no and it legally can't do IO
I didn't understand that correctly. So I mainly need it to know who is on it if I want to renew a world. Or recently when I changed a multiinv plugin that I could inform players to go into a world to not lose the inventory. I hope that makes some kind of sense 🙈
How can i check if a player is damaged by intentional game design?
intentional game design is not on .DamageCause
What is intentional game design???
bed explosion
Bed in nether or respawn anchor in overworld
getDamageSource -> getDamageType -> getDeathMessageType == DeathMessageType.INTENTIONAL_GAME_DESIGN
thanks
Was that a long time ago?
Almost been a year. :p
i keep forgetting it isn't 2024 anymore
then thank you for that 👍
looking for a free "skript" developer if anyone can help me out dm me
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
can I also change the location with it? and preferably also with dependencies of other plugins? sorry if the question is stupid
It's a read only operation, so no, you cannot change the location of the offline player.
Not sure what you mean by that second question.
Setting the player location could be added in another PR, but I feel like there are more challenges/things to consider with an addition like that.
there is also no other method to change the location of an offline player? with the second question I meant dependencies such as a multi inv plugin. That this is also taken into account when changing the location.
best way is to just move the player when they log in imo
^ in the PlayerSpawnLocationEvent
mh okay thanks
I cannot find where this event is in the source. wtf
There is a javadoc page for it, but it's not in the location it should be?
https://hub.spigotmc.org/javadocs/bukkit/org/spigotmc/event/player/PlayerSpawnLocationEvent.html
Hi everyone,
I’m currently trying to understand how the underlying Minecraft and Bukkit code works by going through a stack trace to see what’s being called in the background. While doing this, I noticed something strange: the line numbers in the stack trace don’t match the lines in the decompiled code.
yeah the decompiler has some artifacts, especially the header comment
(that's for VF at least)
got it so the line numbers are only a estimate where the underlying methodes located
pretty sure they're in the bytecode somewhere
Then why should the decompier be wrong if they are in the bytecode contained
just click on the class in IJ
it should navigate to the right line number
and why not just clone the spigot repo and apply patches?
could you show me this?
The bytecode contains line numbers
but decompilers won't try to match the code exactly
well match the line numbers*
but why is the decompiled code at the wrong linenumbers
Because it's decompiled
It tries to generate java code that matches the behavior of the bytecode
It does not have access to the source code so can't it know what types of syntax sugar you used when compiling
or if you decided to combine multiple lines of code
so it don´t accually contain the line numbers
The bytecode does contain line numbers
Just run the BuildTools and load spigot project in IJ
but not of the source code right?
It contains the line numbers of the source
yes
That's how java knows what to put in the StackTraces
https://paste.md-5.net/tasuzezufo.cs Trying to make that explosions of end crystals, tnt carts, beds and respawn anchors doesn't work, i tried with cancel the explosion but doesn't work, nothing show up in console, and it still explode
Did you register the listener
Yes
Note that due to the nature of explosions, BlockEvent.getBlock() will always be an air block. getExplodedBlockState() should be used to get information about the block state that exploded.
From Javadoc
also why are you checking blockList for beds
You want to check what exploded not what's being broken by the explosion
so should i change every .getBlock() to .getExplodedBlockState ?
https://paste.md-5.net/ogoxutegoc.java trying to make when a player die it gets resistance, and when attacks a player it removes the resistance, the problem is, when i respawn i get the resistance removed
Give the effect after the player has respawned
Hey, so I have a little problem that the world is null but the world really does exist. Could anybody help me?
Based on the context from my codebase, it seems that I am having an issue with the teleportToLastCheckPoint method in the CheckPointSystem class. The issue is that the teleportToLastCheckPoint method is trying to teleport a player to a location that has a null world.
Main Class: https://hastebin.com/share/tejosoqaya.java
CheckPointSystem: https://hastebin.com/share/gazifimoyo.java
MoveListener: https://hastebin.com/share/rubupivamo.csharp
Make sure your plugin loads after the worlds
That's default behavior no?
how would I do that?
name: Takeshi
version: '${project.version}'
main: de.silvan.takeshi.Takeshi
api-version: '1.20'
commands:
warp:
w:
welt:
world:
lobby:
l:
hub:
watch:
startflappybird:
start:
joingame:
the plugin/server is actually in the 1.21 but that didn't seem to have caused any problems up to this point
Here it is 🙂
Not sure, code looks ok to me
Are you sure your plugin jar is up to date and that's what the log says is the issue
I see no loading of the world TAKESHI_1. Is it the default world of the server?
If its a world loaded by some other plugin you need a depends in your plugin.yml
Hello I was hoping to get some help with this error https://pastebin.com/93PWJMKz Im getting when building for 1.21.4. Same pom sub versions will work just fine with 1.21.1 . Pom is as follows https://pastebin.com/WtZFsHHq. Never seen an error like that before any help understanding the issue is appreciated
?paste the full pom
Could you please provide the parent pom?
Do you know what maven version you are using?
Are you the same qball?
assuming IJ and winbash use the same 3.8.1
idk what you mean by that
Then you have two possible fixes.
The original qball from the past
Or you someone new
then yes and no. Same person but older and more mature than I was as a 17 yr old kid here
Nice, welcome back then
hmm?
Maven now blocks insecure http repos by default in 3.8.1.
You can either change it to an https repo (if it's available)
Or you can add an exception to your .m2 settings.xml
At least you can be happy to know at least one person hasnt forgotten you 
ahh I see. well thank you for the help
<repository>
<id>mikeprim-repo</id>
<url>http://repo.mikeprimm.com/</url>
</repository>
This repo right here is what's causing the error. :p
And I guess the vault-repo
which umm if I have the vault repo here Im not sure why
if this is being used for nms, afaik codemc has a more updated one
I cant think of anything staffplus would need from vault
Perms
uses bukkits built in permission methods \
missing a colon
Vault allows centralized permissions access
try and add the colon in here and see if it works
might be the issue that ss is throwing for
Oh, that would also cause some issues. :p
i just read the error and thought, why is that all one word and saw it
gotta kidding me right? Did I screw up when I copied and then pasted and changed ver numbers from 1.21.1
Lol
its always the simple issues that cause the most trouble
it's always a stupid mistake that causes you the most trouble now to twiddle my thumbs for a minuet while it builds and hope for no red
aye build success thanks y'all
we never expect simple issues anymore, np
here I was deleting my 1.21.4 build folder in m2 home and rebuilding thinking maybe I forgot a command argument
i was gonna say did you run bt with --remapped and then read the error and saw it and thought that might cause a few issues
I think I saw someone use maven variables for that section so they wouldn't have to change the version numbers every time.
Might try to set that up in my multi-module projects. :3
I would forget it if I didnt make a build script where I just type the version number and it goes
versionBumper.sh is what I have for staffplus a little script I made with the help of google lets me type what version I want staffplus to be and it goes through and does it so I dont have to go thru 15 modules and do it by hand
afaik you could do something like ```xml
<properties>
<minecraft.version>1.21.4</minecraft.version>
</properties>
<srgIn>org.spigotmc:minecraft-server:${minecraft.version}-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
then just use ${minecraft.version} everywhere instead of changing 50 variables
for that yes but I need each module to have the same project number as far as I know
so script it
Would need one for revision number too if that ever changed
the R0.1 bit never changes
It used to
i dont think thats ever not be R0.1 since like devbukkit days
I think it did for like 1.7 and 1.9
they dont get any fancy nms so it should be fine to use that or something along those lines
There is a plugin you can use for maven
I will show you
``` is how I do it now the script just goes thru all subfolders \
So the way i have it setup it currently changes version number in plugin.yml to be same as pom version
well that certainly seems easier
It is flexible in its configuration too
You change multiple files in multiple directories and accepts regex
Imma have to go look into that plugin
Token in my example is what it looks for. In this case anywhere it sees maven-version-number it will auto replace
You can see my plugin.yml has that specific string lol
Just fyi google no longer maintains it. But it still works
I have this code using org.json ```String decoded = new String(Base64.getDecoder().decode(base64));
JSONObject jsonObject = null;
String url = null;
try {
jsonObject = new JSONObject(decoded);
// Extract the "textures" JSONObject
JSONObject textures = jsonObject.getJSONObject("textures");
// Extract the "SKIN" JSONObject and then the "url"
url = textures.getJSONObject("SKIN").getString("url");
} catch (JSONException e) {
throw new RuntimeException(e);
}
return new URL(url);``` how can i change it to do the same with Gson?
wait nvm i think i got it
who tagged me
Lol
It’s part of addEntity now
They just merged the two packets
hm
alr ty
well
i just inputed a serverplayer
into the packets field for an entity
uhm sorry to bother once again but what is a serverentity in nms?
version: 1.21.4, hash: 2587de835f
?mappings is the main site
Compare different mappings with this website: https://mappings.dev/
im guessing CraftPlayer#getHandle should return the entity you need
thank you very much
just as a thing, id recommend using a lamda for those loops and doing all of those in 1 loop rather then 3 differnet loops
ok thank you i will do that
is there a way to negate the italicization in setDisplayName() for ItemStacks?
it didnt, any other suggestions?
You need to give it some other colour to override it. ChatColor.WHITE + "Your text" should remove the italics
o mb
i'll try both methods out tysm everyone
ChatColor +? hooligan, we need global components NOW!
adventure...?
Missing support for Spigot api methods
Like you can't set the item display name with that
Unless you're using Paper ofc
yet another reason to use paper i guess
hey guys, I am currently trying to set a lot of blocks within an area (millions), and I got to the point of using nms chunk sections to do the trick. It is INCREDIBLY fast, however, there is a lighting issue that follows when trying to use it. I tried to mitigate the issue using player.sendBlockChange, but that is just a temporary fix. I found some forum threads and they suggested to update the chunk itself, but all of the methods were outdated. Has anyone else gone through this? Thanks for the help!
your loss
quite frankly i think i lose nothing
adventure isn't proper on spigot anyways, the only reason its "cursed" is precisely because there is no native integration
the entire concept of audiences is a pain in the ass
What performance numbers are you achieving? 👀
I kinda need to deal with this at work and it's a lot slower than expected so I might be missing something
Running on a 6-core 10 year old xeon
For some reason multi-threading block pasting makes it like 50% slower than just running workdistro
Im not at my computer rn, but ill send you my profiler when I am
its pretty insane
just the lighting problem
I'm only achieving like 300k ish blocks a second which is fairly small for what I'm doing 👀
hoping for at least 10 million
this was the guide I refered to
the third one
nms chunk sections
the last one is EVEN faster
but its got a lot of cons
- I dont need it that fast lol
I know a way to do super high millions. Just depends on use case
yeah I can prolly use it
I'm assuming it has to do with writing directly to either the data palette or nbt files
problem is that this cpu's multicore is doodoo and the guys don't want to invest more in the testing network for now
If you want fastest speed possible you do it with server off and just modify the region files directly
because we're like 4 months late
We only need these to be in-memory and I'm pretty sure manipulating ram is quicker than packing ram and unpacking it again
You can easily modify thousands of region files with direct approach
Yeah but is it any faster than modifying millions of blocks in another thread
because IO is a thing
as long as we keep a thread for each chunk section there's no need to lock stuff
On average a region file is like 1mb if empty 10mb if filled with somethings
Cpu should easily handle it
Its not like your using some pentium
we're using a really old xeon
with a whopping 6 cores
clocked at like 2.3ghz
I bet if we switch to a proper ryzen / threadripper it'll do good
but that's not my decision
BTW this is for pasting +-12.5 million blocks across a ~1100 x 1100 area
That is plent good to manipulate thousand of files in one go
At the moment pasting a 47x47x47 structure takes +- 200ms
You will hit your ram limit before you bogged the cpu down with region files
don't forget we still need to pack data
Switching from just queuing stuff to the main thread -> yeeting it to an executorservice increased the pasting time by 100ms
which is crazy
context switching is not a homie
Manipulating files is not slow
packing a bunch of bytes, compressing etc is a lil
slower than just writing data to a data palette
Not with direct manipulation
I disagree but cba arguing with you at 5am on a saturday
One of these days i will write a test to show you can do millions in matter of seconds
optimization TO THE MAX
You need to leverage what the OS can do for you. If you write it properly your limitation is going to be open file handles
I wouldnt even use java for the direct approach except to initiate the process
But java is sufficient still
But your not going to get light speeds out of a computer that isnt using light to process anything
But we can get it going fast
Anyways, got some tires to do lol
@echo basalt here ya go
it might not replicate your situation
but here are the profiler stuff
tested on 3m blocks
1 million per second
reset
ignore the LearningPlugin
thats diff
focus on BuilderDelight
specs?
crazy powerful for a 4 core ampere
I have yet to test it on my mac
It'll prob be better
this is actually insane
tested on m2 macbook
8gb still assigned to server
24m blocks
1m per second
0.71 ms
ill bump up the speed and check it out again
@echo basalt btw, do you have any idea on how to fix the lighting issue?
there's a way to tell it to do lighting updates
something with the light engine
serverLevel.getLightEngine().checkBlock(BlockPos)
sumn like that
update on this
server keeps crashing now
I changed the speed to 10m blocks per second
just wont work
ampere is crazy fast in the time i used it fr
as long as it beats this 6 core xeon im good
Yeah has to do a lot of checks
Better off having a plugin fix lighting when a chunk loads otherwise you are going to have to load every single chunk and then check all params for light conditions lol
Are you saying just dedicate one plugin to fix lighting? Or am I understanding it wrong
Its dedicated to it, but for when chunks load during gameplay
Hmmm, so the sole goal of the plugin is to fix light issues, by listening to when the chunk loads. Is putting it through an async task feasible?
Depends on server implementation being used and how exactly you go about it.
With spigot if you use the api, most things that interact with the world like that typically have issues with doing certain things async
However in modern versions of mc, light updates are separate from the chunks now and have their own file they get stored in
So i cant really say in regards to doing the actual light update fixes lol
Why are there light issues anyway? Isn't there a --recreate option built into the server anyway as well
I use spigot 1.21.1
World modifications on a large scale would cause lighting issues i would think and depends how you change the world as well in that regards. As for the command i couldnt say as i never checked for that since i normally dont care for lighting lol
So relatively modern. I think light data in that version is stored separately from the chunks
Is there any way for me to check?
Uh, should be able to look in the world directory and see a directory i think for lighting similar how entity data is stored separately
Oh alright, ill check it once I get home, thanks for the help btw
Might be worth investigating that command and how it works internally
Might be able to use it somehow for your use case lol
Can thank md for that 
how do i check if a dog armor item is dyed?
Can someone help me with this?
I'm trying to use HikariCP on my Spigot Plugin
java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariConfig
at org.craftex.service.MariaDB.init(MariaDB.java:14) ~[?:?]
at org.craftex.service.MariaDB.getConnection(MariaDB.java:37) ~[?:?]
at org.craftex.service.CourseDAO.getAllCourses(CourseDAO.java:35) ~[?:?]
at org.craftex.gamemodeElytra.handler.GameHandler.chooseCourse(GameHandler.java:60) ~[?:?]
at org.craftex.gamemodeElytra.handler.GameHandler.<init>(GameHandler.java:26) ~[?:?]
at org.craftex.gamemodeElytra.GamemodeElytra$1.<init>(GamemodeElytra.java:32) ~[?:?]
at org.craftex.gamemodeElytra.GamemodeElytra.onEnable(GamemodeElytra.java:31) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:267) ~[spigot-api-1.21.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.21.3-R0.1-SNAPSHOT.jar:?]
I'm trying to fix it since yesterday, but nothing works. I tried shading it, I asked ChatGPT, ... Here's my pom.xml:
<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>org.craftex</groupId>
<artifactId>elytra_race</artifactId>
<version>0.1-BETA</version>
<packaging>jar</packaging>
<properties>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>3.5.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.zaxxer.hikari</pattern>
<shadedPattern>org.craftex.shaded.hikari</shadedPattern>
</relocation>
<relocation>
<pattern>org.mariadb</pattern>
<shadedPattern>org.craftex.shaded.mariadb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Which command may I ask?
Just Guessing: Maybe try checking the Item Meta?
@echo basalt I found something interesting during my playtest, if set the blocks speed enough, it affects the other player's ping more
e.g. I set the blocks reset per second to 1m
and their ping went to 1k
very odd
Alright, thanks for that
there's getColor() but i cant compare it to the default leather armor color from itemfactory since its different
They are identical, both getColor from leatherArmorMeta and getDefaultLeatherColor in ItemFactory
However, default is the DEFAULT, it may not be the color you applied
Any1 knows what's the fastest lib for zlib decompression?
on java?
Just use the built in class
It runs the native c library, which is fast
So I'm asking if there are any faster alternatives, especially for writing directly into a ByteBuffer
probably not. You cant get much faster in java than a native c library
Java nio uses epoll, but that doesn't mean that it's faster than netty's epoll implementation, even with the JNI overhead
Same with zlib
Just because java uses a native c lib doesn't mean that there doesn't exist a faster alternative
Why? Are you having a performance issue using compression?
in minecraft exists custom bars?
i was see smth liike this when found plugin for weather
Is it possible to set a default permission for something like plugin.use.*, where * applies to any checked sub-permissions?
it depends
Wildcards are not supported by Bukkit natively
So you need a Permission plugin that can handle wildcards
If you are talkiung about Just your own plugin, then no, you can not create a native wildcard for all variants
You could process wildcards within your own plugin though
check if the Player has plugin.use.* directly so cover any sub permission
if sub permissions are unknown you have to do it yourself
or just add a permission for plugin.use.all or something
same as using *.
yeah but you arent fooling yourself
you would still have to check for it
LuckPerms handles Wildcards but I don't like recommending it as it hacks Bukkit to do so. GroupManager handles wildcards if you query the plugin directly or check via vault.
But if you are writing a plugin that needs to handle wildcards you must do it yourself for compatability
I think that as an admin there is a lot of value in a plug and play solution for weighted permission inheritance, context resolution and wildcard resolving without having to scour plugins specifically having to handle those features which might not there be alternatives doing that in the market
Yes, my only reason against LP is that it changes the native behavior of permissions.
I want to send a PluginMessage from Bungeecard to the Paper server, but my Paper server cannot receive it. What's wrong with my writing?
https://github.com/TWME-TW/WorldEditSync/compare/main...bungeecord
?whereami
The one I have issues with is Bungeecord. My Velocity to paper works fine
Is there a dedicated channel for Bungeecord?
yes, this is for both spigot and bungee
Many will ignore question which reference paper as its behavior is not always the same as spigots
If the issue is repeatable with a spigot server you are likely to get more answers
Build against the lowest API you want to support
You can use Modules to support higher API versions if you want
but the base shoudl be the lowest API version
always latest, but depending on what you are doing back as far as 1.18
very few servers/players are on lower versions
3.7% of servers run 1.8
depends what plugin you want to write
then you can write it for 1.8 easily
1.8 will run on all versions
you only need the API so just a normal maven setup
?maven
api-version was introduced in 1.13
yep, it will be ignored in prior versions, but its required to prevent a nag warning in newer versions
why not 1.13
Assign the items with unique ids and check if they are similar
Client can skip on sending the inventory close packet
and then they open the backpack again
Triggering the close event but that's too late the new inventory has already been opened
If you're in some recent version, there is a component to hide tooltips. Not sure how/if it's done in the API
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
thanks for the help guys
`package me.kelz.glitched;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;
public final class Glitched extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
getServer().getPluginManager().registerEvents(new JoinLeaveListener(), this);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
return super.onCommand(sender, command, label, args);
return true;
}
}
`
Not annotated parameter overrides @NotNull parameter
Doesn anyone know what this means @NotNull parameter is highlited for sender, command, label and args
its telling you that the method params dont have @NotNull but the method its overriding does
im new i have no idea what that means
I already told you what to do like a week ago?
are there any resources for CustomModelDataComponent() outside of the javadocs? i'm really unsure how to set it up
What about it are you unsure about?
so with CustomModelData() you'd put an integer and it was simple but since 1.21.4 you can modify so many things; I'm confused on just how to create a custommodeldatacomponent that includes a string
getCustomModelDataComponent -> getStrings() -> add (to new list) -> setStrings -> setCustomModelDataComponent
or just set strings directly if you don't care about keeping anything that's already there
Yeah you can make some cool stuff
so something like this?
ItemMeta meta = itemStack.getItemMeta();
List<String> strings = new ArrayList<String>();
strings.add("bat");
meta.getCustomModelDataComponent().setStrings(strings);
itemStack.setItemMeta(meta);```
You forgot to set the model data
Smth like
var modelData = meta.getCustomModelDataComponent();
modelData.setStrings(List.of("bat"));
meta.setCustomModelDataComponent(modelData);
itemStack.setItemMeta(meta);
something went wrong hmm
the vanilla command "/give @p mace[minecraft:custom_model_data={strings:['bat']}]" gave me the proper item but not spigot
checking the data from the spigot generated one says it has 0 strings attached to it
What is that even supposed to do lmao, what is bat, is that like a custom texture?
bat is just the identifying string in the resource pack files to render it as a different texture if the item in-game has it
ItemMeta meta = itemStack.getItemMeta();
List<String> strings = new ArrayList<String>();
strings.add("bat");
var modelData = meta.getCustomModelDataComponent();
modelData.setStrings(List.of("bat"));
meta.setCustomModelDataComponent(modelData);
itemStack.setItemMeta(meta);
event.getPlayer().getInventory().addItem(itemStack);```
Looks correct
that's so weird because the game says the item generated has no string apart of its custom model data
"Felinkaa has the following entity data: {"minecraft:custom_model_data":{}}"
I wonder why getCustomModelDataComponent() is non-null however you can pass null to setCustomModelDataComponent
because ItemMeta is a highly flexible system
hopefully i can find a way for it to work this is so frustrating
If I pass null it would just return to its original form?
no, it'll create a new, empty one
null would just remove it
that's why you also check for hasFooBar
Oh remove it okay
if this is correct does anyone know why it isn't working?
Whats the import to import GENERIC_MAX_HEALTH
org.bukkit.attribute.Attribute
Helpchat has old Javadocs for you https://helpch.at/docs
Attribute#MAX_HEALTH
^ if you're not on an old version
thanks
im on 1.21.3
ive imported it but it cant resolve
.
for both
Invalidate cache maybe
im using org.bukkit.attribute.Attribute
IntelliJ has issues with that, kinda annoying
Update Intellij if it's outdated
yep doing now
(No idea why it's so common to run 1 year+ old versions)
2024.3.1.1 is the latest
ah
and there's a way to do that:
For example, I have two worlds
one ordinary world
the second one: donate_world
and it is possible to make it so that in donate_world and world, there were separate homes for example in world to work the command /home
and in donate_world the command /dhome
and each command would have its own functionality?
Still got the prob
which one?
i was on bout my GENERIC_MAX_HEALTH not working
i was told 2 update and it still not working
It's just MAX_HEALTH now
ohhhhh
?
Yes just check what world the player is in when running the command?
You can keep your homes in a map
like, I need the hams to be separate in each world.
like, I'm gonna have donate_world with no wipes.
and the donate_world will be wiped.
I need to make sure that after a vyp, all the hams in the world are deleted.
but in donate_world they don't get deleted.
can this be done with one plugin essentials?
If you're not making a plugin this is the wrong channel
You should ask in #help-server
Is there a way to make the players screen have a purple tint overlay?
Oh, I apologize, I'm in the wrong place.
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
?howold 1.14.4
Minecraft 1.14.4 is 5 years, 5 months old.
is it possible to create the new PlayerTextures with existing texture/signature saved as string ? i only see the methods with URL's...
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/profile/PlayerTextures.html
declaration: package: org.bukkit.profile, interface: PlayerTextures
import org.bukkit.boss.BossBar.Color;
import org.bukkit.boss.BossBar.Style;
whats the correct imports for these?
Are you using GPT or smth 💀
Don't write your imports by hand
so a .colour might work
Let your IDE handle it
ok
That string is base64 encoded json containing the url
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
https://paste.md-5.net/imojeyimaw.cs
what is the serverentity required for addentity packet?
https://paste.md-5.net/keseqenevu.cs
hi again
when running my plugin, it declares that the serverplayer class does not exist (MC 1.21.4)
ItemMeta meta = itemStack.getItemMeta();
List<String> strings = new ArrayList<String>();
strings.add("bat");
var modelData = meta.getCustomModelDataComponent();
modelData.setStrings(List.of("bat"));
meta.setCustomModelDataComponent(modelData);
itemStack.setItemMeta(meta);
event.getPlayer().getInventory().addItem(itemStack);```
whenever i run this, i get an item with custom model data of "{}" and not "{strings:['bat']}"
does anyone know why?
What version of Spigot are you on?
1.21
1.21.4-R0.1-SNAPSHOT
thanks for teaching me about this
Send the full output
"This server is running CraftBukkit version 4416-Spigot-33ece3-c905a71 (MC: 1.21.4) (Implementing API version 1.21.4-R0.1-SNAPSHOT) You are 2 version(s) behind"
Hi, I'm having a player spectate a blockdisplay that is teleporting with the .setTeleportDuration() method.
During the blockdisplay movement, if it's too quick, the player triggers 'moved too quickly' in the console, is there any way to disable this for the duration the player is spectating the blockdisplay?
Through nms or something?
EDIT: I am using buildtools 1.21.4 mojang mappings
hi is there something wrong with my pom.xml?
https://paste.md-5.net/mobocaluxe.xml
it declares that ServerPlayer does not exist as a class
Did you run BuildTools with the remapped flag
yes
it allows me to use it in development
but loading it into my server
causes it to not load the plugin at all
Are you sure you're using maven to compile
i am
Do not use Artifacts
ok
So you weren't using maven
why is ItemMeta#getItemName() deprecated and how should i get an item's name instead?
displayName
look at the docs
You aren’t using the spigot api
Paper user spotted
Can someone tell me how people make their menu gui's using a chest?
?gui
thanks
can anyone help me use nms and nbt with my plugin? I've been through almost every tutorial I can and intellij is still not cooperating with the imports. I think I'm missing a step somewhere but I genuinely have no idea what it is. DM me if someone can help so I can give more specific details
if it helps, what I'm trying to do is create custom skull texture meta but I can't import nms or nbt anything to create it.
If you're on a modern version you don't need nms
how would i get about creating custom skull texture meta?
its on 1.21.1
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
how can i keep a chunk to fully tick? adding a ticket is not making crops to tick
I'm currently experimenting with text displays to make custom nametags.
Everything works fine, but when using the see through property it makes the nametag very visible through walls. When disabling see through you can't see it through walls at all.
Is there a way to make it so the text displays work just like player nametags, where it becomes transparent when viewed from behind a wall?
what event handels throwing of lingering potions?
i want to disable throwing them
there use at all
PlayerInteractEvent
Is there a way to dynamically create command suggestions like this?
https://imgur.com/a/7nqnz91
add a tab completor method
Hello. I've seen a claims plugin in the past, that uses particles on the ground to outline an area. It creates like a square perimiter of the area using particles.
Any idea how this is done, other than just recursively creating particles?
it doesnt need to be recursive
just loop over the perimeter
you can make a lot of optimizations but only doing particles within the players radius and not doing it so fast
would anyone know any good way to make custom enchants with just the 1.21.1 API?
Persistent data containers lore and events
Can read about pdc here
?pdc
is that the only option? its the main thing im trying to avoid tbh :/
Why?
its just alot more to handle than just adding an enchant, removing lore mainly some items with lore will be added
This maybe could help https://www.spigotmc.org/threads/custom-enchantments-1-13.346538/
That won't work anymore
yeah i seen it before but i also seen how old it was :/
That method is broken and relied on bad api behavior anyways
It's either a datapack, the lore pdc method or registries pick your poison
Ah yeah
Can I get some help please? I need to scale an ender dragon down but it's not working. I could do it on my datapack so is there a way on a plugin? I have:
entity.getAttribute(Attribute.SCALE).setBaseValue(SCALE); but nothing happens. tried a few values for SCALE like 0.7 with no luck
I saw a bug report over a year old so I would think it was fixed by now
is the bug report RESOLVED or FIXED
My code can't seem to access the org.bukkit.#.# things, any way to fix this?
It's also spamming cannot find symbol
Maven
wdym? I've been fuddeling around a bit with the plugin, just seeing if I can make one based on a tutorial, but it seems it doesn't work
Now it's saying package org.bukkit.entity does not exist, this is what there is: import org.bukkit.entity.EntityType;
If it helps, im using IntelliJ IDEA
try invalidating caches and/or restarting the IDE
also update IJ to at least 2024.x
Seemed to be an issue in the POM.xml file, after adding the Paper respository and dependency, it seemed to have worked, probably it was relying on Foundation which failed somehow
its now done with components, custom model data got ditched by custom model or something
i found a reddit post 🥲
there seem to ve a few good tutorials on youtube
ah okay, so there 2 different things
up to 1.21.3 its pretty simple, sinxe 1.21.4 it changed a lot
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "minecraft:item/item_id"
},
"overrides": [
{ "predicate": { "custom_model_data": 1 }, "model": "namespace:item/model_name" }
]
}
PreLogin will be the first contact
nothing exists in 1.8
you can use the scheduler though
in your plugins onEnable schedule a task to run 1 tick later.
it will run in the next tick that the server is fully started
yes
@EventHandler
public void onPrepareAnvil(PrepareAnvilEvent e) {
AnvilInventory inventory = e.getInventory();
ItemStack item = inventory.getItem(0);
String data = item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING);
if ("Hammer".equals(data)) {
getLogger().severe("Trying to enchant Hammer using an anvil");
}
}
im getting a bunch of errors saying item is null?
@EventHandler
public void onEnchantItem(PrepareItemEnchantEvent e) {
EnchantingInventory inventory = (EnchantingInventory) e.getInventory();
ItemStack item = inventory.getItem(0);
String data = item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING);
if ("Hammer".equals(data)) {
getLogger().severe("Trying to enchant Hammer using a enchantment table");
}
}
also this prepareitemenchantevent gets fired 3 times when you put a item in?
getItemMeta returns a copy
and I believe getPersistentDataContainer does so too
so make sure you've set them correctly
👍 Good to know
Once for each offer I assume
but from just one event you can get all the offers that are offered so would it still fire 3 times?
¯_(ツ)_/¯
btw the enchant event doesnt say item is null only the anvil event
so basically i just need to make sure the item isnt null then it should be fine
Im always getting this error: java: error: release version 21 not supported
Module NightVision SDK 17 is not compatible with the source version 21.
Upgrade Module SDK in project settings to 21 or higher. Open project settings. All things have been set to Java 17, what's this?
my end goal for the enchant event is to change the enchant offered if there is forture
Well theres your problem, its for Java 21, so 17 wont work
since i think 1.20 or something mc uses java 21
OOH, im stupid haha, idk how I missed that xD, tysm!
I don't know if I am blind or something but I cannot find anywhere the unit of org.bukkit.Statistic _TIME -based enums, such as SNEAK_TIME and TOTAL_WORLD_TIME. The documentation at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Statistic.html#TOTAL_WORLD_TIME has no info either. Are they measured in server ticks or something?
might have to compare it to game values, client reports sneak time for my test server is 0.59h so it could be in h
In hours? Interesting. But thank you!
It's tracked in ticks
This makes more sense. Thank you!!
A good source of information is the Minecraft wiki
what is shield stunning and what have you tried so far
Can someone help me? Out of nowhere... no changes were made in code or etc
so is this a configuration thing? or are you trying to develop a plugin; if it's the former go to help server
Did you reload maven
well, have you added it to your project
what is FakeOnline-spigot
(I have no idea how maven works)
and why did u add dependencies of 2 versions
artifact id from 21 module
what?
this multi module system
some modules from other version use nms
but 1.21 will use protocolLib so
21 version will use only spigot api
but constructor not can find this module
but this module exists...
have you added the module to the project
in your parent pom
yes
have you reloaded maven
yes
but parent think this not spigot module
constructor not can find him
this module exists just like package
this version disappeared from the module gui wtf
install that module