#development
1 messages · Page 46 of 1
no i meant all the data on the item to be a Map<String, String>
like if u were to get all the item's data it'd be in a Map<String, String>
ex with lore:
key1: value1
key2: value2
oh
wait wdym
registered twice?
why dont u track which enchants were registered?
even if i do, then a single key cant have different data for different items
once an enchantment is registered, it's name is stuck (so it's data value can never be altered)
and even if it was able to be changed, it'd be changed for every item (or just break lmao)
oh
If you’re using a Map then you won’t be able to route two values to a key. That’s literally what the map is specifically built to NOT let you do.
If you want two items to have the same “key” and “value” pair use something like a List<Map.Entry> or make your own custom class and use a List<CustomClass>.
From there just search for what you need using .stream().filter() or sm
my server is.. crashing for some reason can anyone help?
idk, why is it crashing
and not #development
Multimap / a map with collection value can do this with much better performance than a list
That’s what it is right now (or at least what I want, each item having its own map), except without the actual map, as it’s using enchantments
Each item basically has its own map (in a form of enchantments)
This is just an analogy
Just using nbt api now, don’t think enchantments would work in the long run
tbh i avoided using the normal enchant registering and used nms to create nbt data manually
not pike the enchants would be visible anyways since the tooltip doesnt show any enchants that arent registered on the client side
like
Yeah I wouldn’t use the vanilla system
Lol
R u shading or no
Ye I’m shading it
But in the future I might look into it’s source code and just remake it myself (probably not lmao)
Hmm
And rely on the user to relocate it?
No I relocate it
O
Like I do with bstats
So if they already have nbt api shaded
They just have to deal with 2 nbt apis?
Or
Well ig they wouldn't
Or maybe not and they’ll just have 2 with different packages (I think this cause the relocation is done upon compilation)
I'm trying to spawn a custom nms entity into the world, but nothing spawns if there is no player nearby, even though the server has the chunk loaded
Anyone know why this might be?
show code
EntityManager.registerEntity("PitBlaze", 61, CustomPitBlaze.class);
World nmsWorld = ((CraftWorld) spawnLocation.getWorld()).getHandle();
CustomPitBlaze blaze = new CustomPitBlaze(nmsWorld);
blaze.setLocation(spawnLocation.getX(), spawnLocation.getY() + 5, spawnLocation.getZ(), 0, 0);
System.out.println(nmsWorld.addEntity(blaze));```
They spawn on plugin start. If I reload in the general area, they spawn
If I reload in the spawn area and tp to the chunks
Theres nothing there
Everything works fine for the vanilla mobs
hi, could anyone help me out with Bungeecord?
What’s up?
so I just started using it and I have no idea what im doing.
Using it as in developing with its api, or just using it on a network?
um.. what?
Ok I’m just going to assume you’re using it normally then
yeah, probably.
So run me through what you’re trying to do
I'm trying to get on the server, but when i connect it just kicks me for "Kicked whilst connecting to lobby: You are already connected to this proxy"
Hmm, either the proxy is frozen or your internet is really bad
I assume that you aren’t already on the server on your client?
I am not
Total players online: 0
And it’s still giving you that message?
yes
Does it show you attempting to join in console?
yes
I don’t see how that could happen, try restarting it
well it says
19.05 21:25:40 [Server] [INFO] [Jeetic] disconnected with: Kicked whilst connecting to lobby: You are already connected to this proxy!
19.05 21:25:40 [Server] [INFO] [Jeetic] -> UpstreamBridge has disconnected
ive been restarting way too much at this point
my lobby console?
Yeah, tell me if it shows you attempting to join
i dont have a lobby console
this is the only console I have
maybe thats the problem.. :/
What server are you trying to send the people to?
the Bungeecord server
:|
It doesn’t actually create any joinable world
It’s only used to seamlessly move players inbetween servers
oh.
bungeecord lets you connect multiple servers with only 1 ip (basically)
so that means I need to pay for multiple servers?
Still not sure why that error would occur though
do you have a playerbase yet?
I'd recommend just using 1 server until you build up a playerbase
theres always plugins such as Multiverse which lets you make multiple worlds
or could I host a Bungeecord server on my computer and then host the "lobby" server on the host im using
yeah but ping might be high
and u should setup tcpshield if so
it's rare but someone might want to ddos or act like they know where you live and scare/threaten/etc
If you’re trying to have a multi-server network, using Minecraft server hosting is not the way to go
so what is the way to go?
You would want either a vps or a dedi
first of all
as I mentioned earlier, if you're starting out, you prob don't even want bungee (due to complexity and cost)
Once you've got experience, you can also use that experience to use a dedi or vps
but vps/dedi for the first time isn't as simple as paying and booting up a server
once you get used to it it's ez
Yes, I don’t recommend starting with a bungee network, but it will always be more cost effective to use one of those options when doing so
so Multiverse is the way to go in the beginning then, as I have no playerbase
but starting a bungee server + spigot servers + vps/dedi all at the same time and for the first time isn't the way to go
(+ vps/dedi probably would prob be even more expensive if you don't need a powerful server)
Yeah, likely
Unless you have actual issues with conflicting plugins/server software, it’s less efficient to have multiple servers
for me yeah
its a large company
so i assume they have good uptimes
Just making sure they’re not pulling some minehut shit
I think ill stick with Multiverse
Yeah, multiverse is nice
yeah
but if you wanna try out oracle (for free), u can use the guide i linked above 😉
i should prob update the guide a bit
but
maybe when I get actual players.. lol
alright thank you
Yeah I’m kind of over my head in server space
Not a good place to be unless you got money to burn
welll
a lot of well known members in helpchat got their vps randomly terminated
but that was a while ago
we forget those things, right....? 😉
Lol
Did it delete data?
Accidentally deleted my production sql database once
and give you a week before terminating if you don't meet those
ooooooof
gitlab
🤡
did u see the gitlab scenario
Luckily all the important stuff is in firestore
I have another question! If I want my Spigot/Paper/Bukkit idk whatever server to work on 1.8.9-1.19.4/latest version, what do I use?
No
Use 1.8.9 as the jar and get viaversion
you use Pufferfish 👍
but I recommend 1.19.4 and viaversion + the 3 (or 4?) addons
i think
Never heard of that, trust him over me
pufferfish..?
paper but better 😌
u can use paper for stability ig
what theheck is pufferfish
but pufferfish has been out for a while now
lol
just dont use spigot or bukkit 👍
so Paper
yeah
lol my internet
I’m having a really fun time digging through nms rn
paperweight 😌
I’ve heard of it, can’t figure out how to install it though
The readme wasn’t very clear
ah
yeah
it has like separate modules
https://github.com/PaperMC/paperweight-test-plugin
then run gradle reobfJar instead of shadowJar (I think? feel free to experiment)
lines 22 and below are unneeded i think
One sec
so I can make the server 1.8.8 and install viaversion for it to support 1.19.4?
I think the issue is that I don't know how to install gradle plugins lol
Yes
yes but I wouldn't recommend it
why not?
since plugin devs aren't gonna like you 🥲
why
since its old
My life
so the api is missing a lot
eh, what could possibly go wrong
u can also use viaversion on 1.19
but then i need like 5 other via plugins
thanks u
hey guess what - another question!!!
how can i make it so (in F3) it doesnt say "PaperSpigot" server?
Gotta edit the server jar.
Iirc
and how do i do that?
Whats the issue?
You're not going to be able to edit that unless you know how to read and compile code
i dont so yea just forget it lol
use a plugin
i bet theres a plugin for that
no server jar editing needed
np 👍
hey im trying to use json messages (click events and such) in 1.8.8 but im having trouble finding documentation, examples, tutorials, etc... online, anyone got any?
or maybe if someone just knows how to string together multiple TextComponents (in 1.11 i was using the ComponentBuilder but it doesnt rly seem to work in 1.8.8 for some reason, unless im just using it wrong)?
bungee textcomponent?
yes
how can i make it so the Minecraft "Statistics" thingy doesnt update?
¯_(ツ)_/¯
thanks
say more
itd be easier if i could send pictures
i think u can
spigot.yml disable-saving?
although
this disables achievements too
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ah those statistics
i think i have to break apart the TextComponent and then do individual calls to the ComponentBuilder 
which makes ZERO fucking sense
I can get you an example
1s
@dark garnet Looks like you need "TextComponent.addExtra()"
something something adventure
[Server] [ERROR] Could not pass event WorldLoadEvent to Multiverse-Core v2.5-b699
rip
decided to just have a List<BaseComponent> and then convert it to BaseComponent[] when i want to
makes everything 10x easier lmao
Nice
alright im back with more json stuff 💀
how the heck do i use HoverEvent.Action.SHOW_ACHIEVEMENT, HoverEvent.Action.SHOW_ITEM, and HoverEvent.Action.SHOW_ENTITY?
cause HoverEvent.Action.SHOW_TEXT is just used like this: new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("text to show on hover").create())
the only constructor for HoverEvent is HoverEvent(HoverEvent.Action, BaseComponent[])
I believe that show item and entity expect some NBT https://javadoc.io/doc/net.kyori/adventure-api/latest/net/kyori/adventure/text/event/HoverEvent.ShowItem.html
with paper api you can do smth like Component.hoverEvent(ItemStack) https://javadoc.io/static/net.kyori/adventure-api/4.13.1/net/kyori/adventure/text/Component.html#hoverEvent(net.kyori.adventure.text.event.HoverEventSource)
And I can't find show achievement
for adventure there's a PR for it, but show achievement got removed in 1.12 anyway
Hey I have the following problem (Spigot 1.19.3):
I want to set a player's spectator target, which by itself is no issue, however if the target is a farther away then it won't work and the player only gets teleported to the target.
v1: Only works on close distances
player.setGameMode(GameMode.SPECTATOR);
player.setSpectatorTarget(target);
v2: same results as v1
player.setGameMode(GameMode.SPECTATOR);
player.teleport(target.getLocation());
player.setSpectatorTarget(target);
v3: this actually works, but the delay is very noticeable
player.setGameMode(GameMode.SPECTATOR);
player.teleport(target.getLocation());
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> player.setSpectatorTarget(target), 1);
Does anyone here have an idea what I could do differently so I wont have to add a delay?
Hello, anyone knows how to go over the 16 char limits in the nametags in 1.8.8 ? I did a lot of research but with no achievement, hypixel does, and a french server named FunCraft does in 1.9.4
- by switching to a more relevant verison
- invisible named entities or invisible armor stands
i've found this by searching the question on google:
They use scoreboard teams to split the name up in three sections of 16 characters and set them as the prefix, name and suffix of the team. This way they can have name length up to 48 characters.
you should probably go with first option and update your server tho
The thing is that switching version wont help me, my server IS 1.8 to 1.19 so persons with old version can't see more than 16. Also, I'm actually using scoreboards, and using armorstand on the player wont help me too because the custom name of the armorstand IS too high
I tried everything that you've said to me
lower the armor stand?
persons with old version can't see more than 16, doesn't viabackwards take care of this?
it takes, it's just that the person has not done any research on this
Tho if I were you I would just drop 1.8 support, it's been more than 8 years since it's release
because all of their questions would've been already solved
the thing is that the client blocks the nametag limit to 16.
I did.
it barely takes google search to figure that out
well for the first error at least
for the second error it looks like a region from ur world is corrupt
wrong channel, and your using 1.8.8 which is super legacy, + wrong java version
i think u just have to deal with the delay, at least thats how i did it im pretty sure (altho i have a more complicated setup that runs every 5 ticks, but i assume it doesnt work the first time cause of distance)
ah well that sucks
I'll have to work with effects then to make it less abrupt
it shouldnt be that noticeable tho right?
its just 1 tick
ah damn
well it is noticeable
dang ye, rip
So ik this doesnt rlly deal with code but im making this plugin where you can use 3 special moves and doing something allows you to activate, one of them is an ultimate. I was originally going to go with shift-leftclick and shift-rightclick with a pvp command activated but I feel like there could be a more efficient way that I just cant see
So using reflection to generate an object... When looping through the constructors from PacketPlayOutPlayerInfo.PlayerInfoData I get
DEBUG (Construct) >> public net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo$PlayerInfoData(net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo,com.mojang.authlib.GamePro file,int,net.minecraft.server.v1_16_R3.EnumGamemode,net.minecraft.server.v1_16_R3.IChatBaseComponent)
But the constructor doesn't contain PacketPlayOutPlayerInfo as a parameter... and when running newInstance(params) it errors.
public PacketPlayOutPlayerInfo$PlayerInfoData(GameProfile var1, int var2, @Nullable EnumGamemode var3, @Nullable IChatBaseComponent var4) {
this.d = var1;
this.b = var2;
this.c = var3;
this.e = var4;
}
ohh
your trying to create the data object
the only constructor for that object is (ClientboundPlayerInfoPacket arg0, com.mojang.authlib.GameProfile arg1, int arg2, GameType arg3, Component arg4)
huh
i wonder where they pull that constructor if its wrong
maybe cus its a subclass or something like that
Adding PacketPlayOutPlayerInfo to the parms works but why would I have to add that in the first place when the parameters of the constructor don't include it. (Atleast in the actual code.)
id assume some bullshit with playerinfodata being a subclass
what this error means in my plugin?
https://pastebin.com/zAQTCP64
placeholderapi is not present on the server and you are trying to register an expansion probably
previous convo: #dev-general message
they check if papi is enabled, so it should be working, I'm not sure why 🤔
thats what i initially thought as well 🥲
is installed 😦
make sure you add it as softdepend or depend to your plugin
its added as a depend
but no works
Hi ! is anyone already use the BetterRTP api ? I have a nullRef about getInstance()
Caused by: java.lang.NullPointerException: Cannot invoke "me.SuperRonanCraft.BetterRTP.BetterRTP.getRTP()" because the return value of "me.SuperRonanCraft.BetterRTP.BetterRTP.getInstance()" is null
else { // Teleport player on random location using BetterRTP
if (sender == null) sender = this.plugin.getServer().getConsoleSender();
// Biome list
List<String> biomes = KSMP.config.getStringList("biomes");
HelperRTP.tp(player, sender, world, biomes, RTP_TYPE.FORCED, true, true);
}
What did I do wrong?
is betterRTP installed on the server and your plugin soft or hard depends on it?
either depends: or softdepend: [BetterRTP] in your plugin.yml
Yes it's on the server, and for the depend i made this :
depend:
- Multiverse-Core
- BetterRTP
That's very weir cause i tried this
me.SuperRonanCraft.BetterRTP.BetterRTP rtp = null;
if (Bukkit.getServer().getPluginManager().isPluginEnabled("BetterRTP")) {
// Log the class of Bukkit.getServer().getPluginManager().getPlugin("BetterRTP")
sender.sendMessage(ChatColor.GREEN + Bukkit.getServer().getPluginManager().getPlugin("BetterRTP").getClass().toString());
rtp = (me.SuperRonanCraft.BetterRTP.BetterRTP) Bukkit.getServer().getPluginManager().getPlugin("BetterRTP");
}
and i have this error :
Caused by: java.lang.ClassCastException: class me.SuperRonanCraft.BetterRTP.BetterRTP cannot be cast to class me.SuperRonanCraft.BetterRTP.BetterRTP (me.SuperRonanCraft.BetterRTP.BetterRTP is in unnamed module of loader 'BetterRTP.jar' @642748a; me.SuperRonanCraft.BetterRTP.BetterRTP is in unnamed module of loader 'KSMP.jar' @543e636c)
yes it work normally on the server
according to this the plugin hasnt loaded before you attempted to call that method
so im just confused as why it hasnt been enabled if your loading after it
hmm the error i trigger by a command so i don't think the BetterRTP is not loaded at this moment
are you useing betterRTP?
i think thats obvious
i had trouble using it on my server
it made it crash over and over
and the permissions for it weird
so I just found another one
and that one works
i didnt think that betterrtp had any form of api tbh
yeah
what is it ?
1 sec got to find it
so it does exist
ic
last update 2019, F
probably doesnt have any api documentation, or any api at all
oh i didnt know you need that
join the betterrtp discord
they might beable to answer better since they actually know their plugin
yes i already do that, i'm waiting now
tbh im trying to test it myself and the maven repo doesnt even work
turns out 3.6.2 doesnt work
changed it to 3.6.8-3 and it worked
i got it to work
its not complaining of the instance being null
what version of betterrtp are you trying to use?
I was using 3.6.9-1 so i'm testing with the 3.6.8-3
what version are you depending on in either your pom.xml or build.gradle
put this in your onEnable() as a test to see what it comes up with
if (Bukkit.getPluginManager().getPlugin("BetterRTP") != null) {
BetterRTP rtp = (BetterRTP) Bukkit.getPluginManager().getPlugin("BetterRTP");
if (rtp != null) {
getLogger().info("BetterRTP found, instance exists");
WORLD_TYPE type = HelperRTP.getWorldType(Bukkit.getWorld("world"));
} else {
getLogger().info("BetterRTP found, instance is currently null :(");
}
} else {
getLogger().info("BetterRTP Not Found :(");
}
cus its what i used to see if it worked or not
I'm new with java and maven so i think i'v did weird think with my imports and i cannot make it work :/
Hello, please tell me how to use the % sign in math
?
Number with % example 100+10%
Thank you very much, you helped me a lot
Hi, how do i do in java a global variable for all players, for example if a player place a block it add 1 to the variable, and if an other player place a block it add 1 to the variable that make is value at 2 ???? Thanks
This, thanks, but how do I write % in the PlaceholderAPI plegen
Me in addition to PlaceholderAPI
ok thx
Wait, this is not an answer, I thought you answered me
Ok then sorry
Make a static variable
I am developing a backend system for a server built to withstand high player counts. It involves some RPG stuff, and I have a lot of data that needs to be loaded. Some needs to be loaded when the player is offline, so I have offline data classes that are loaded when the player's data is queried and they are offline, and is transferred to the main player instance when they come online. Should I preload all the offline data instances when starting the server, or just load them on a need-be basis? That seems a little inefficient, although having potentially thousands of instances of classes all loaded at once doesnt sound like a good idea. Is this where Redis comes in handy? What do you guys think?
is the trigger for loading offline player data random? or can you predict it somehow
for example, maybe only data from offline friends of an online player need to be loaded
if something like that is the case then you can def squeeze by with loading all friend data when someone hops on
It is triggered randomly by players or events, like friend requests and auctions and stuff
both friend requests and auctions can probably survive without prefetching offline player data
I might load all the offline data into a redis, and then load from the redis, just from a speed standpoint. Not sure what the load times are between Redis and MySQL and if it would make a difference.
Its a lot more than that, those are just examples
how much latency are you willing to tolerate
also mysql generally caches data that is frequently accessed, so there is a chance that repeated queries will be done from memory rather than reading from disk each time
i think if i were in your shoes i would not preoptimize too much by trying to load everything into memory, since it should be pretty easy to toss that functionality in down the line if you design things right
Certainly load when needed
Employ a system where profiles can be loaded instantaneously
I prefer NoSQL options, but MySQL generally works as well
The only reason to ever attempt to load all profiles is if you're indexing leaderboard data or something
Yeah load when needed, keep in a lru cache
If its used frequently it’ll be in the cache, otherwise it’ll just be pushed out when the cache is full with more recently used things
yo guys, can someone help me with installing phpMyAdmin on my VPS and make it accessible with a subdomain?
what's a phpmypanel
phpmyadmin
oh I miss typed it
Hey!
I'm currently having some issues with setting a spectator target.
Basically, what I'm doing is teleport the player to the target and then set the spectator target. The target doesn't move at all, yet as soon as I set the spectator target, the camera seems to always do a 180 degree turn. Does anybody know what could cause this or how to prevent it?
(The teleport as well as the delayed task are to help with larger distances.)
Edit: tried manually rotating 180 degrees to test, but there's still rotation happening
Spigot 1.19.3 / Java 17.0.3
public void setSpectate(Player target) {
player.setGameMode(GameMode.SPECTATOR);
PotionEffect blindness = PotionEffectType.BLINDNESS.createEffect(30, 9);
PotionEffect slowness = PotionEffectType.SLOW.createEffect(30, 0);
player.addPotionEffects(Arrays.asList(blindness, slowness));
player.hidePlayer(plugin, target);
player.teleport(target.getLocation());
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
player.showPlayer(plugin, target);
player.setSpectatorTarget(target);
}, 10);
}
I assume the entity is facing the same way as the player
Player and target should be facing in the same direction, because I’m teleporting to the targets exact location which includes yaw and pitch
So I don’t understand why there’s a 180 degree turn happening
I was coding a simple Plugin to log the Ingame chat to discord via webhooks. On my testing machine everything worked. Once I started to use it on a "production" server I'm receiving this error: ```
[20:53:37] [Server thread/ERROR]: Could not load 'plugins/VaroChatlog.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:162) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_362]
Caused by: java.util.zip.ZipException: invalid END header (bad central directory offset)
at java.util.zip.ZipFile.open(Native Method) ~[?:1.8.0_362]
at java.util.zip.ZipFile.<init>(ZipFile.java:228) ~[?:1.8.0_362]
at java.util.zip.ZipFile.<init>(ZipFile.java:157) ~[?:1.8.0_362]
at java.util.jar.JarFile.<init>(JarFile.java:171) ~[?:1.8.0_362]
at java.util.jar.JarFile.<init>(JarFile.java:135) ~[?:1.8.0_362]
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:150) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
... 5 more
my plugin.yml looks like this: ```yml
name: VaroChatlog
version: 1.0
main: ppy.sh.VaroChatlog.Main```
It used to be a bit longer, but I scrapped it to hopefully fix it.
My test machine and the production server are using the same spigot version.. YAML Formatter says everything is fine. And yes the plugin.yml is in the jar.
Only the java versions are different, could that maybe be the issue?
the classic 'works on my machine'
i think i usually get the "invalid END header" error whenever the jar file of the plugin is corrupted or just not built correctly (ex: when i uploading the file to a server while its still building/downloading)
That was one of my first thoughts
so i waited a minute before copying it to the server
u could use 7-zip to just confirm the plugin.yml is being correctly added to the jar
I checked it and its fine
I mean it shouldn't matter, but local and host servers are different OS's, right?
Yes its built on macOS M1 and i want to add it on a Ubuntu server
eh, that's probably it
unrelated, but dont call ur main class Main, just a general guideline to prevent confusion, i usually just call mine the name of the plugin
macos poopoo
yea i expected that
personally I haven't dealt with such issue cuz I don't own a mac, but I assume that's the case
Windows => Unix usually works fine
Thanks for the hint
yeah mac does some rly weird stuff with files
like the infamous _MACOSX folder in zips lmao
we all love it
okay so I guess I will go and built it on windows
if u have the project on github then u can use actions
Wasn't worth for that project imo xd
It might not be the issue, the OS incompatibility or wtv, but that's my best guess, since, well, it should work fine if the files are the same
I'm gonna try it out
for some reason the damage isnt being applied to the item:
if (DAMAGEABLE_CLASS != null && DAMAGEABLE_SET_DAMAGE_METHOD != null && DAMAGEABLE_CLASS.isInstance(meta)) try {
DAMAGEABLE_SET_DAMAGE_METHOD.invoke(meta, damage);
} catch (final IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
```code on github: https://github.com/srnyx/annoying-api/blob/main/api/src/main/java/xyz/srnyx/annoyingapi/file/AnnoyingFile.java#L286-L291
i think its cause the meta variable is of type ItemMeta, so when the item meta of the item is eventually set, it doesnt have the damage information attached with it (cause its just an ItemMeta, not a Damageable), which just means ill have to set the item meta twice 🙃
can anyone confirm or disprove?
Same issue 
Is it possible to make a block appear as one material for one player and another for a different player using packets?
E.g obsidian appears as bedrock for certain players
Hey, I need some quick help with something, I am not sure how to achieve the following:
When hitting a player with lets say a Knockback 5 stick, and the player then "flies" away. How can I damage the Wall / Ground the player hits depending on the velocity of the player?
Yes, this is what some anti Xrays do. Idk specifics but you can probably find some open source anti X-rays online
what about this one?
declaration: package: org.bukkit.entity, interface: Player
Using that you can change a specific Block for a Player
once he tries to break it or interact with it, it will change back
Like break the blocks?
mainly just damage them
Oh if it’s like an anvil
yea
You stuck on the actual damaging? Or the logic for if they slam into it
on each movement, check if bounding box (expand it a little bit) overlaps with any blocks around them
if they do, get their velocity and damage the blocks if it goes above a threshold
only thing that might be tedious here is different bounding boxes for blocks. Maybe there's libraries out there to deal with it already, but if you dont wanna deal with it you can do a super janky way instead, by checking if the players acceleration is very negative but no knockback was applied (they hit a wall) and a block is near them in that direction.
so basically on movement -> check colliding with surrounding solid blocks -> check velocity and damage
yeah
cool lets try
okay so slightly different approach (more like yours)
on move -> get Player BoundingBox and expand it -> somehow get all blocks inside the bounding box / it collides with -> do the rest
is there an easy way to get all blocks that the bounding box is coliding with?
maybe, i dont know off hand
i'd just iterate through the like (maximum 27?) blocks that a player is in
plus or minus 1 on every axis
another thing you want to make sure is that the direction of the block is the same(ish) direction as their velocity, so you can damage the correct block instead of all of the surrounding ones
Just wondering, what are you using reflections for? You can just use the highest api you want to support - e.g. 1.19.4 - and do a version check before calling the method.
🙃
thats risky though since you don't know what api is from what version
and so you might accidentally think that an api is from 1.8 when its not
yeah thats my worry, i dont feel like checking https://helpch.at/docs every time i wanna do something
thank u for saving me from so much pain dkim, i never thought i'd be thanking u for anything
eh, with some exercise you will eventually know when most things were added
tbh it is annoying that not even paper uses @since
lol
lots of effort for little reward
but like, if anyone wants to PR, go ahead
it's just not something dev team will bother doing
yeah but I mean, at least for the new stuff
that exercise will require testing the plugin in multiple versions and the plugin's multiple features (or looking at the docs ig)
if i ever use something new (or if i need to double-check, which ill probably need to do often), ill have to refer back to the docs
also, @SuppressWarnings("deprecation") incoming
🙃
well maybe not a lot
compared to using paper api
but
Well, have fun with reflections then
Also, you are already checking the docs for method name and class 🤣
What @dusky harness
I meant that if using 1.8 api, you don't need to handle deprecation warnings
kinda like using paper api for a spigot compatible plugin, but not as bad
yeah but not for all api stuff which is what i'd have to do if i didnt know when new api stuff was added
and considering there r over 30 versions between 1.8.8 and 1.19.4 i'd have to be checking pretty consistently
although "binary searching" through the versions does help
¯_(ツ)_/¯
still not fun tho
especially if you're testing on 1.19 for stuff that you wouldn't think be unavailable on 1.8
ok well back to my original issue 💀
lol
Thats why you only support the major releases, 1.8.8 1.9.4 etc.
Aaanyways
plugin.log(Level.SEVERE, DAMAGEABLE_CLASS.cast(item.getItemMeta()).getClass().getName()); is logging org.bukkit.craftbukkit.v1_19_R3.inventory.CraftMetaItem, even tho the meta is checked to be of type Damageable beforehand
anyone know how to make gradle be guaranteed to create a new jvm for specific tests?
Gradle makes "forked" jvms responsible for executing x tests but i need to create seperate forked jvms for specific tests
that sounds like bad tests tbh
It's not
Well ig it kinda is but i cant help it
Im starting up paper so i can do integration tests
other than that, I'm not aware of anything where gradle decides which tests are run in which process, it just calls JUnit with a given selection of tests
And pls dont tell me abt mockbukkit. I hate it.
you'd most likely use a custom junit launcher for that I guess
Ill look into that thx
Probably a stupid question but I'm using Spigot 1.8.8 and using the PlayerDeathEvent. I have another Plugin on my server which also uses this event. Now I have the issue that my plugin steals the event from the other one. Is there a way to share the events between the plugins?
only one event is ever created/called so all plugins use the same event object, which means your plugin isnt stealing the event
is there a method or a return object which i have to call so other plugins get the correct data?
org.bukkit.event.EventException: null```
```Caused by: java.lang.NullPointerException
at org.Ziron5.Listeners.PlayerListener.onDeath(PlayerListener.java:287) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_362]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_362]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_362]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_362]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]```
I am pretty new to the Plugin world, so sorry for the time waste with me xd
well itll just get passed along the line of plugins so its up to the plugin devs to make sure that they are checking for null and such
you could post your ondeath method section to paste.helpch.at if its your code thats not working
it isnt mine xd
then its not your problem
But if I remove my plugin (the other one) that doesnt happen
thats why i was wondering
My code isnt modifying any argument/parameter
I am just reading the data which is given by the event
Can't post my code rn
well you're trying to access something from null, the solution is to not do that
Hi, I want to check if the player is holding any axe, my issue is that it doesn't seem to be listed as a tag? https://jd.papermc.io/paper/1.18/com/destroystokyo/paper/MaterialSetTag.html
Ctrl + F; search for AXE and we see it's actually called MINEABLE_AXE
You can just do Material#name()#endsWith("_AXE")
That's the tag for materials mineable by an exe
^
The tag for all axes would be AXES or whatever
🤦♂️
Just like wooden_doors and the rest
👍Your solutions is the best then
That’s still not my plugin xd
Looks like one was added in Mc in 1.19.4 https://minecraft.fandom.com/wiki/Tag#Items
https://jd.papermc.io/paper/1.19/org/bukkit/Tag.html#ITEMS_AXES
Paper's class for tags allows to create your own tags outside the ones registered in the game iirc
But I guess they are like a wrapper for a Set
there's also none for all blocks?? ;-;
d;Material#isBlock
public boolean isBlock()```
Checks if this Material is a placable block
true if this material is a block
Oh, thank you
does anyone have an idea?
Does it happen when you make them spectate without them being teleported first?
Hey guys, I'm very new to coding in java but I'm very open to judgement and criticism. Although, I'm mostly looking for advice lol
I've got a post over in #1007620980627230730 if any of you know anything about Vault Economy, .yml file creation, and writing to said .yml file please check out my post. I've been stumped for too long
Any help is greatly appreciated!
so does anyone know how i can use Damageable via reflection on an item?
yes
So can you help me? :/
have you done any debugging?
ensure the right things are called, what is and isn't null, ... etc
debuging aka => System.out.println 😎
that is one approach yes
cuz whatever this assumption is is wrong lol
Yes lots, for example: I added a log before setting the dmg to confirm there is any to apply and there is
Oh 
just wondering, what item are you using for testing?
for me, reflection is complicated because it feels like programming but backwards, I always feel slow when I need to do things with reflection
that's why it's reflection I guess?
the best way of doing reflection development (among others) is to use a proper debugger instead of trying to println everything, you quickly figure out what works and what doesn't, what methods are available, it's much easier in general
@dark garnet ^
Could use my reflection library 😉
https://github.com/TheCrappiest/ReflectionLibrary
Yeah one of the methods was void but only worked with type I don't remember which though and I'm not at my pc
Pretty sure it was something with the DataWatcher class.

Diamond pickaxe, it works in 1.8.8 as I’m not using reflection for that (just putting it in the item stack constructor)
Wdym? Could you give me an example of a proper debugger?
I’ll look into it, thanks!
You run the server via the IDE
Then you can debug your code by adding breakpoints and whatnot
Np
(look at this)
no but the url still worked
rn
oh wait
do they still support old versions in the api
i thought they were just gonna take the whole v1 api down
oh nvm its a 2kb jar file
weird how the api is still up tho.. even though it doesn't work
oh
this is cool
hilarious
what does FourOhFour refer to lol
instead of paper putting 404 on the api, they instead allowed a jar download with that message
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh 
4 = Four
0 = Oh
4 = Four
🥲 🥲
1.15.2 😵
What IDE do you use? Have you ever tried the red button with a picture of a lady bug instead of the green button when running your Java projects?
Here's a very good explanation: https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html
ladybug? 🤨
i always thought it was a ladybug too, but i guess it could just be any bug
"lay debug"
according to ChatGPT (I could not find anything on Google about this lol) it is indeed a ladybug 😌
i mean the signature ladybug moment is red/black and spots
that icon has neither of those lol
i used to use a shitty IDE called jgrasp
which has a ladybug
maybe its just a standard that was adopted
Hey all, I was wondering is there any recommended ways of storing mass custom items? So far I think enum is what I'm looking for? But I'm no expert.
depends
I'm looking to store a lot of items like 60 + so that I can link them to commands, event etc.
These items would have enchants, a lore, a display name, attributes.
I just want my plugin code to look less messy and just a line per item would look tidier than
ItemMeta itemMetaHelmet = itemStackHelmet.getItemMeta();
itemMetaHelmet.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&7&kL&cGodly Helmet&7&kL"));
List<String> loreListHelmet = new ArrayList<>();
loreListHelmet.add(ChatColor.GRAY + "A godly helmet forged with the blood, sweat and tears of the developer.");
loreListHelmet.add(ChatColor.GRAY + " - = Enchants = -");
loreListHelmet.add(ChatColor.GRAY + "Protection V");
loreListHelmet.add(ChatColor.GRAY + "Projectile Protection V");
loreListHelmet.add(ChatColor.GRAY + "Fire Protection V");
loreListHelmet.add(ChatColor.GRAY + "Blast Protection V");
loreListHelmet.add(ChatColor.GRAY + "Respiration III");
loreListHelmet.add(ChatColor.GRAY + "Extra Hearts III");
loreListHelmet.add(ChatColor.GRAY + "Aqua Affinity");
loreListHelmet.add(ChatColor.GRAY + "Unbreakable");
loreListHelmet.add(ChatColor.translateAlternateColorCodes('&', "&7Obtained from the [&cTier 4 Crate&7]"));
loreListHelmet.add(ChatColor.translateAlternateColorCodes('&', "&7Owned by: &c" + name));
itemMetaHelmet.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, true);
itemMetaHelmet.addEnchant(Enchantment.PROTECTION_EXPLOSIONS, 5, true);
itemMetaHelmet.addEnchant(Enchantment.PROTECTION_FIRE, 5, true);
itemMetaHelmet.addEnchant(Enchantment.PROTECTION_PROJECTILE, 5, true);
itemMetaHelmet.addEnchant(Enchantment.WATER_WORKER, 1, false);
itemMetaHelmet.addEnchant(Enchantment.OXYGEN, 3, false);
itemMetaHelmet.setUnbreakable(true);
AttributeModifier maxHealthBoostHelmet = new AttributeModifier(UUID.randomUUID(), "maxHealthBoost", 3.0, AttributeModifier.Operation.ADD_NUMBER);
itemMetaHelmet.addAttributeModifier(Attribute.GENERIC_MAX_HEALTH, maxHealthBoostHelmet);
itemMetaHelmet.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
itemMetaHelmet.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
itemMetaHelmet.addItemFlags(ItemFlag.HIDE_ENCHANTS);
itemMetaHelmet.setLore(loreListHelmet);
itemStackHelmet.setItemMeta(itemMetaHelmet);```
This over and over again.
Well, you still need to create them all at some point
Yes that's why I'm looking for a way to store the information. Then I'd be able to grab that info from the item storage class and link it too whatever.
That would mean the item gets created when I do a command for example but I'd be keeping all the messy data somewhere else.
Or is it better to type it out each time?
i- i- is that e- eclipse?!?!
Looks like a decompiler, JD GUI?
Yep
You could keep a file in the jar with all the item data and create the item stacks on enable to cache them. Then just make your own item builder methods so you don't have a bunch of duplicated item code.
alternatively if you don't want to define your resources through a config file but through java code, you could use a record class to define a data class for your item
that is if you're using java 14 or later, since records were added then
I think minecraft 1.18(?) requires java 17 anyway
you could do the same thing without records lol, they just make it a little more convenient
That's fair, I just think it would be more convenient to store in an immutable record class
I mean, you can just create the item and just copy it before using it
i personally just have a bunch of classes that define each item and then use another class to generate the item's lore and shit
Given his code though, I think a json string of the item converted/cached onenable would be "cleaner". He also said he wants 60+ items so having all of that code duplicated 60 times is useless.
something that could also work is some form of item wrapper to make generating the itemstack in a much cleaner way without having tons of duplicate code
json would be good only if they can find some tool that lets you import existing NBT and edit it tbh
In his example I don't see any NBT
everything is NBT 🙂
Technically lol. But All his code has methods available from the API.
Hello all I recently bought an api but can’t figure how to create a config I have tried but can’t figure it would anyone be willing to help me figure it out ?
You did what?
bought an api 💀
What the hell
How do you expect them to make money?
I bought it from senior studios
bought what?
An api for making configs items and everything
why
anyways, just ask your question, but I doubt anyone has experience with it if you say it is paid
buys random ass api without figuring out how to use it in the first place then struggle to find anyone to help them with a paid api that likely noone has experience with >>>

@reef delta do you know anything about this? lol
.
Ah, not a clue- I don't have access to all tickets sadly.
They likely requested some Builder API for all I know.
not what I meant to say, is the team selling APIs? 🤣
Oh.
or was it a commission from a dev
They probs mean a library rather than API lol
same shit
yes a library
Then yes, freelancers do make and sell libraries upon request.
Even if a good one already exists
ok I was just curious
(99% of bot requests can be done with corebot but bot devs still make the same fucking bot for more)
Do you wanna know a new level of low I experienced yesterday for clients at Revivenode?
maybe, but #off-topic
eh not the same thing
Ehh, sorta related to this channel, one kid opened a ticket and sent some Java code saying "please add this to my server as a plugin".
at least he was honest xD

¯_(ツ)_/¯
💀
Jeez mackenzie you're everywhere
If I'm creating a plugin which uses a configurable database (for example mysql, postgresql and sqlite) how should I publish the plugin? Should I fade any of these drivers to it or add all of these drivers as a library?
Assuming it’s not the standard jdbc, I would include them, but make sure you relocate it to prevent conflicts with other plugins
you can do what luckperms does and download the driver only if it is needed
I wouldn't say that but ok
He literally makes two of the most useful free plugins
And they’re both super high quality
there's also BungeeGuard
Yes
Hi, i have many errors on this event, how do i modify this code to make that i can use all inventory normally except when the clicked item is "§b§lTest" ???
public void InventoryClickEvent(InventoryClickEvent event) {
Player p = (Player) event.getWhoClicked();
String itemName = event.getCurrentItem().getItemMeta().getDisplayName();
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
if (Main.commandemod.estMod(p)){
if (event.getCurrentItem() != null) {
if (itemName.equals("§b§lTest"){
event.setCancelled(true);
p.updateInventory();
}
}
}
}
}
Here is the error :
Use https://paste.helpch.at/ for errors, logs and configs. So we don't spam the discord.
I have an other error when i shift click on an item in creative:
Whereas i don't use InventoryCreativeEvent in the plugin
String itemName = event.getCurrentItem().getItemMeta().getDisplayName();
if (event.getCurrentItem() != null```
You use the `currentItem` before the null check
Oh yes thx
Is there any api to get materials like deluxe menus? For example being able to using baseheads etc
you could open up deluxemenus using recaf or jdgui or something and see what they do to parse non standard materials
How can i loop through StringLists in a config for broadcasts ik how to put it too a player just not get a random string list from a config as the would be like 1 :Stringlist
2: Stringlist
so on
Broadcasts:
'1': ["This is", "the first broadcast."]
'2': ["Broadcast #2"]
'3': ["Broadcast #3"]
```Just an example layout.
```java
private BukkitTask = broadcastTask;
public void startBroadcaster() {
if(broadcastTask != null)
return; // returns as a task is already running
Random random = new Random(); // or Thread.getCurrentRandom();
broadcastTask = new BukkitRunnable() {
public void run() {
ConfigurationSection cs = getConfig().getConfigurationSection("Broadcasts");
cs.getStringList(random.nextInt(cs.size()-1)).forEach(string -> Bukkit.broadcast(string));
}
}.runTaskTimer(<JavaPlugin>, 0, 600);
}
```Written on phone so code might have to be adjusted.
hello how depend plugin in my plugin with pox.xml ?
why no just add it as dependency in your project structure?
depending on the plugin, it may show you an easily copy and pastable section to add to your pom.xml
for example placeholder api
you would copy everything in the repositories section, find where your repositories tag in your pom.xml is and then paste it in there, then do the same with dependencies, then depending on your ide, for example intellj you would click the red M button that should show up then itll refresh and allow you to use the other plugins code
also make sure to add either softdepend to depend to your plugin.yml
?
I'm looking for data that needs to be stuffed into pom.xml
Then you're done, just reload Maven
it didn't work, that's why I asked for help
Where I have to contact to create an account on extendedclip ?
I wan't to add an extension
did you add the repository aswell?
also i didnt know that deluxemenus had an api
it .. doesn't?
that will be why it doesnt work then more then likely
I'm pretty confused right now... The server I'm working on has all nvme drives but still, this is the report I get: https://spark.lucko.me/sWpils6h0w
Aurelium Skills getting a BlockState, after asking their support, chunk loading is apparently slow. Anything I could check to make it better?
what do you have this set to? https://github.com/Archy-X/AureliumSkills/blob/master/bukkit/src/main/resources/config.yml#L18
Looks like if it is 0, it will load the data async https://github.com/Archy-X/AureliumSkills/blob/001a3b7943d05d64af0e94d9da33bfc140784823/bukkit/src/main/java/com/archyx/aureliumskills/listeners/PlayerJoinQuit.java#L40
ahh I didn't see what's beneath that part
looks like they do some hackery with block state for getting a player's skull
yeah they say its slow chunk loading
ahh I thought that's what they do, "slow chunk loading"
well, ask them why the fuck they set a player skull at playerX 0 playerZ LOL
I thought it is some weird library that does that to cache the skull, but it just sets the skin to the block
hm
But I have been experiencing other issues with slow chunk loading too, but idk why
Is there anything I could do to measure performance?
Someone knows a good class to create custom crafting recipes that allows you to check displayname, lore, or even nbt tags?
d;RecipeChoice$ExactChoice
public static class RecipeChoice.ExactChoice
extends Object
implements RecipeChoice```
RecipeChoice.ExactChoice has 1 extensions, 1 implementations, 4 all implementations, and 8 methods.
Represents a choice that will be valid only one of the stacks is exactly matched (aside from stack size).
Only valid for shaped recipes
Let me re ask the question
Someone knows a good class to create custom crafting recipes that allows you to check displayname, lore, or even nbt tags? (also to support 1.8 so Exact.Choice is not an option, even for 1.13+ i'd need to check for nbttags)
Listening to the craft event is probably the only way
i was asking bc probably someone has a full class for it xd
HEy i keep getting this error - https://sourceb.in/2h1sAXDfPK
whenever i run the plugin in the server, no build errors or such
the dependency on pom.xml is
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.4</version>
<scope>provided</scope>
</dependency>```
and
im using the latest Bukkit version of luckperms in the server, v5.4.79
Hi, I am trying to access the methods/classes from a secondary JAR, through a kotlin project by adding it as a library/dependency in my project.
I have done this, and it allows me to import the packages and access its methods, although when I try to build the project it gives me an error called "Unresolved reference: denis", denis is part of the package name, which has no errors in the code, and can access when doing import, although errors on compile.
e: C:\Users\alme\Downloads\DexCore\dex-core-master\src\main\kotlin\dev\denis\dexcore\DexCore.kt: (17, 11): Unresolved reference: denis
Line 17 is the import of the package
What did you do?
I suspect that you're trying to use a build tool along with IJ/Eclipse's built-in build tool at the same time
But I need more info (what did you use to import the secondary jar?)
I only was trying to build the project through gradle
Added it through Project Structure > Libraries
Yep, you can't use intellijs tool at the same time as gradle
Oh I see, thanks!
Anything else I need for Vault? Cause it ain't working...
Bukkit.getServicesManager().register(VaultImpl.class, new VaultImpl(), Bukkit.getPluginManager().getPlugin("Vault"), ServicePriority.Normal);
}
Excuse the formatting, I'm on my phone
what is not working?
And you most likely want to register Economy.class or whatever VaultImpl extends
having issues learning protocollib, im trying to modify the brand packet and can't get it past this state.
https://ylaees.needs.rest/Screenshot_2023-05-28_132323.png
https://ylaees.needs.rest/Screenshot_2023-05-28_132556.png
im getting this issue on ProtocolLib, when trying to deep clone the packet. https://haste.olziedev.com/deqetihawo.properties
out of curiosity, why clone the packet?
because if i don't im getting weird behavior , for context. Im adding glowing to the player to certain players.
But due to the metadata, if it does change like if a player crouches, it removes the glowing effect. so i add it back again to this event. i only clone it to make sure it doesn't effect the packet to the other players without that it causes a lot of weird behavior
I have a sneaky feeling its actually something to do with the first packet i actually send. which is the glowing effect.
Inventory#firstEmpty is a way to check if the player's inventory is full but If I'm giving the x item and user's inventory already contains x item and it has no empty space it will return -1 which means there is no empty slot. Is the best way to check it is looping over items (or just using any method) and check for any of them is similar with my item?
tbh your probably better off just going off the first empty value
How can I get a jar of the server jar of paper?
I tried versions/1.19.4/paper-1.19.4.jar, but that doesn't seem to have the api or libraries (as those are in the libraries folder)
Ah yea
Anyone know why I'm having an issue with cancelling fall damage?
Both debugs show
but I still die to fall damage
its inside the EntityDamageEvent and theres no way the event ever gets "uncancelled"
its a list of players who dont receive fall damage
Yeah no its worded badly
But the debugs do show and they still die which is so weird
@EventHandler(priority = EventPriority.HIGH)
public void onEntityDamage(EntityDamageEvent event) {
if (event.getCause() != EntityDamageEvent.DamageCause.FALL) {
return;
}
if (event.getEntity() instanceof Player player) {
event.setCancelled(true);
player.setFallDistance(0);
}
}
Oh no I was actually being an idiot
I was using an early return then changed it and you're right it was meant to be noFallDamags.contains 
why 
Hello, I tried making a simple Hello world plugin with a command that gives you back a response in chat, but when I type it in chat nothing happens, no errors or anything either, just nothing.
package me.marphh.helloworld;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.material.Command;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Objects;
public final class HelloWorld extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
// /hello -> hey welcome!
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (label.equalsIgnoreCase("hello")) {
if (sender instanceof Player) {
// player
Player player = (Player) sender;
if (player.hasPermission("hello.use")) {
player.sendMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "Hey welcome to the server!");
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&1H&2a&3v&4e&5 f&6u&7n&8!"));
return true;
}
player.sendMessage(ChatColor.RED + "You do not have perms bruh");
return true;
}
else {
sender.sendMessage("Whats up console");
return true;
// console
}
}
return false;
}
}
plugin yml
name: HelloWorld
version: '${project.version}'
main: me.marphh.helloworld.HelloWorld
api-version: 1.19
authors: [Marphh]
description: Test plugin created may 28th 2023
website: marphh.com
commands:
hello:
description: "pretty cool"
register it on onenable
also u forgot an else with permission checking
added an else statement, nothing.
made it return true instead of false at the end, nothing
🥲
show me the full code
package me.marphh.helloworld;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.material.Command;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Objects;
public final class HelloWorld extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
getCommand("hello").setExecutor(this);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
// /hello -> hey welcome!
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (label.equalsIgnoreCase("hello")) {
if (sender instanceof Player) {
// player
Player player = (Player) sender;
if (player.hasPermission("hello.use")) {
player.sendMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "Hey welcome to the server!");
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&1H&2a&3v&4e&5 f&6u&7n&8!"));
return true;
}
else {
player.sendMessage(ChatColor.RED + "You do not have perms bruh");
return true;
}
}
else {
sender.sendMessage("Whats up console");
return true;
// console
}
}
return true;
}
}
afaik its Bukkit.getPluginCommand("hello).setExecutor(this)
actually doesnt seem to mayter, both are supposed to work
getCommand works too
when you run the command it doesnt say anything, but it comes up as registered right
yep very much so
they should learn the technique of debugging through the use of getLogger or sender.sendMessage
at each point
throw a logger.info at the start, the result of each if ststement that doesnt show up as right and potentially the current values tjat make up the if statements
naaa
he doesnt have the @override annotation
probably
or plugin iss not even being enabled
¯_(ツ)_/¯
afaik the override annotation doesnt actually do anything, just is used by the ide to verify shit
i woupdnt thought that the main class would have to extend or implement CommandExecutor but apparently not
idr if its an interface or not
arent yoh supposed to always supply a usage for each regsitered command
it's not used by the IDE but by the compiler, it doesn't compile if the annotation is applied to a method that does not override another method
Kotlin requires override 😌

Yeah still no luck. It gives me an error when I try adding @Override above the oncommand
In the console logs when the server starts the plugin gets enabled with no errors or warnings
@proud pebble how and where do I add the logger.info?
getLogger.info("text), at the start of the on command
while debugging using some form of print method throughout your method while getting to work isnt a bad way to do things
such as a message at the start of the method to make sure its actually getting there, the result of label since its obviously not returning hello for whatever reason
could i also use just a system.out.println statement?
well yeah, but you shouldnt as the server complains if you do so
getlogger.info is the best option
or sender.sendMessage
up to you
ah gotcha ill try those
player extends sender at some point so player.sendMessage also exists
if when you run the command and even with a print at the start of the onCommand nothing shows up then there really is something wrong
yeah thats what im worried about hahah
never had this issue before its so odd
testing it now
tho pwrsonally id make a class for each command so that you dont have to check label
oh yeah i tried that too but same result
did you register it
yes
also maoe sure that you have set a usage in plugin.yml for the command
its gotta be something with the ide probably
that doesnt really make any sense
Well I'm using the minecraft development plugin with intellij
it only generates an empty projwct
how are you testing the plugin?
localhost server
yep. no luck
only log that went through was the plugin being enabled
are you rebooting after every recompile, using plugman, using /reload, etc
rebooting.
you are 100% sure the jar is actually different right
wdym?
ive had issues in the past while copying the new jar and it just wouldnt be different
it was very annoying
yes since i can see the changes i make when the plugin gets enabled
(like the logging message)
sent you an ss of what i mean
chuck me the jar in dms
i found the issue
:o
since you didnt add an override in ide, it didnt check that the parameters to override the onCommand method were correct
you imported org.bukkit.material.Command instead of org.bukkit.command.Command
so it might look fine, but the import fucked it all up
since it basically thinks this is a new method with new parameters, not the one that already exists so i wont override it
if it gives you an error, you're not overriding a method, as I said before
Yep, luna you're right
actually using the @Override anotation wouldve showed this issue in much faster time
everything works now
one time when override wouldve saved us so much time
luna you're a godsend lmao thank you so much
oh yeah how do i add the override?
it gives me an error when i try to do so
oh
nevermind
you just do @Override above the public void onCommand(...
yeah it wasn't working before
but now that i changed it from material it works just fine
i googled it, saw a stackoverflow thread and boom it was in one of the comments
i knew that this was either something really big issue on my end, or just a tiny little mishap hahah
😂
how did you even register the command executor then @cerulean vessel?
oh I see, you didn't
but it would work because JavaPlugin is a CommandExecutor for some unholy reason
they eventually did
but the whole issue was resolved by fixing the Command import since it was using the material.Command not command.Command
did some more debugging, the damage is retained the entire time even when the item is given to the player
so what the hell is going on?!
its nothing wrong with my reflection or any of my code afaik
im giving the item via Player#getInventory() and then Inventory#addItem(ItemStack)
IM GONNA CRY IM GONNA CRY IM GONNA CRY
i made the item unbreakable this is the worst day of my life im going to quit programming 😭
If anyone knows how NBT tags work on 1.8.8 spigot please feel free to msg me! im here loosing my mind!
Ask your question and show what you have tried.
ItemStack sugarCane = new ItemStack(Material.SUGAR_CANE, amount);
ItemMeta caneMeta = sugarCane.getItemMeta();
caneMeta.setDisplayName(caneName);
caneMeta.setLore(translatedLore);
caneMeta.addEnchant(Enchantment.getById(62), 1, true);
caneMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
sugarCane.setItemMeta(caneMeta);
// Add custom NBT data
try {
Class<?> craftItemStackClass = Class.forName("org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack");
Method asNMSCopyMethod = craftItemStackClass.getDeclaredMethod("asNMSCopy", ItemStack.class);
Method asBukkitCopyMethod = craftItemStackClass.getDeclaredMethod("asBukkitCopy", Class.forName("net.minecraft.server.v1_8_R3.ItemStack"));
Class<?> nmsItemStackClass = Class.forName("net.minecraft.server.v1_8_R3.ItemStack");
Method getTagMethod = nmsItemStackClass.getDeclaredMethod("getTag");
Method setTagMethod = nmsItemStackClass.getDeclaredMethod("setTag", Class.forName("net.minecraft.server.v1_8_R3.NBTTagCompound"));
Class<?> nbtTagCompoundClass = Class.forName("net.minecraft.server.v1_8_R3.NBTTagCompound");
Object nmsItemStack = asNMSCopyMethod.invoke(null, sugarCane);
Object nbtTagCompound = getTagMethod.invoke(nmsItemStack);
if (nbtTagCompound == null) {
nbtTagCompound = nbtTagCompoundClass.newInstance();
}
Method setIntMethod = nbtTagCompoundClass.getDeclaredMethod("setInt", String.class, int.class);
setIntMethod.invoke(nbtTagCompound, "CUSTOM_FARM_ITEM", 1);
setTagMethod.invoke(nmsItemStack, nbtTagCompound);
sugarCane = (ItemStack) asBukkitCopyMethod.invoke(null, nmsItemStack);
} catch (Exception e) {
e.printStackTrace();
}
omfg it was a space ;/
best answer to what were people doing before pdc was invented
also, don't use reflection like this
cache your classes etc
Or if you build a plugin for a single version you can use NMS directly
paperweight 
Isnt that for like 1.16+?
what in the hell is enchantment 62
Lure
shopgui+, "glow: true" gives items enchantement 62
that's lure apparently
that ping was meant for Lunaiskey. My bad
why not use Enchantment.LURE instead of going by getById(62)
@proud pebble cause i didn't know that was a thing 
is there a documentation or something where i can find these things
how the hell did you not know that spigot javadocs exist?
@proud pebble cause im new to plugin deving
so you wrote all this but didnt know the javadocs existed
yep
or did you use chatgpt to write it for you
used a mixture of spigot.org 🙂
or did you just copy and paste it from the internet
na, i have some experience with java, so reading between the lines and have read some of the other devs codes
i just filled in the blanks
to be fair
it's not like nms code is documented lmao
the javadocs wouldnt tell you shit in this case
but like how would they know Enchantment#getById() exists but not Enchantment#[InternalEnchantNameHere] doesnt
¯_(ツ)_/¯
i was using (Enchantment.DURABILITY, 1, true) and ItemFlag.HIDE_ENCHANTS) , but when that didn't work cause the item was different to what i needed
i had to use getById
to make it specific
but like they do the exact same thing, how it wouldnt work doesnt really make sense
i have no clue but when i was checking the nbt data between the two items
it was different
i had to do it via getbyid
tbf i probably had messed something up
ANYWAY, the code works now 🙂
probably forgot to update the items meta
btw if this is for only 1 version of minecraft that your wanting to support you can use nms directly and avoid using reflection
no point using reflection if you dont have to
if you want to use nms directly, run buildtools and have it create a 1.8.8 jar, itll add stuff to your .m2 folder aswell, you have to run buildtools atleast once on your system for each minecraft version to beable to get the nms and craftbukkit classes since spigot cant host them in their repo and itll create them in your local repo. then just change the dependency in either your pom.xml or build.gradle from spigot-api to spigot and you should beable to access all the nms and craftbukkit classes
Class: https://paste.helpch.at/okudutidut.kotlin
Error: https://paste.helpch.at/ujowanusuv.php
Returning null when it has been
it did successfully set the items variable right
how can i check that as ive looked and it does make it
instead of ignoring the exception do e.printstacktrace()
at line 36
in the try catch statement you made
cus its very possible that its throwing the failed to create exception, and if it failed then the items variable was never updated making the object null
heres the new stack trace https://paste.helpch.at/oreceyamem.md
hi, in intellij there is no 1.8 selection for the minecraft intellij plugin when making a project, so i make a 1.12 one and change the version in pom.xml to 1.8.8 after, but when i try and compile i just get "Malformed \uxxxx encoding.", tried doing a lot of stuff from online research but cant seem to fix, any suggestions?
Don't develop for 1.8 is my suggestion
changing the version of spigot to 1.8.8 from 1.12.2 should work just fine
your building for java 8 right?
well that suggestion doesnt do much for me lad ngl
Is anyone able to help me with this please
https://discord.com/channels/164280494874165248/1113272850355331092
you posted in the wrong channel, #placeholder-api would make more sense
NBTAPI 
Yeah that looks like a crime
Tbh using new is cringe
yeah
who doesnt
I run a small assembly executable to allocate new instances by bypassing the kernel to modify the JVM memory pages
Does anyone got any idea on how I might be able to send this packet using protocollib? https://wiki.vg/Protocol#Update_Recipes
haha no code available xd
Uhm... think I need some help with this... this looks like biggest spagetthi code I have ever seen lmao
boolean finished = false;
int offset = 0;
while (!finished) {
HangarProjects projects = hangarClient.getProjects(25, offset).join();
if (projects.result().size() == 0) {
finished = true;
} else {
offset += 25;
for (HangarProject project : projects.result()) {
resourceCache.add(project.namespace().slug(), project, versions);
}
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
(For context, getting all the projects from Hangar, the Thread sleep is def. getting replaced, but it's there to just not fully spam the api)
Hell, I am stupid
Lol
Im trying too put something like this in config its being done all through code as a set
users: {}
iirc {} represents a Map/empty object
but I'm not sure exactly what you're asking
That answer my question thank you
Hi, I'm trying to return the value of a CompletableFuture, here is my code
public <T> T getData(RunnableReturn<T> runnable){
if (shutdown) {
return null;
}
CompletableFuture<T> future = CompletableFuture.supplyAsync(runnable::run, databaseExecutor);
return future.thenAccept(t -> );
}```
how can I return the value "t" inside of the consumer
Ok my question is illogical I've found the solution
I'm stuck with a serialization issue here, I have a Map<String, Object> which values can be anything from simple integers to other complex (but serializable) objects, like Instant, other POJOs, and even other nested Maps inside it.
How can I serialize and deserialize this Map in a way that the new map is .equals to the old map, that is, no types were changed between the old and new maps.
I can use any data representation/format available, it can be literally anything (XML, JSON, you name it), and also any Java/Kotlin library to do this conversion, I just need it to work.
Obs.: Java serialization is out of scope.
Unironically javax serialisation is probably your best approach lmao
Noooo
but with any other framework you’re going to need to register “tags” for all the different types semi-manually
If I’m understand you correctly
why did I read this as 'java sexualization'
projecting
Well, I tried Jackson's enableDefaultTyping configuration, and it did kinda worked, but it could not correctly deserialize the values from a Map.
How so?
Well, I had a Map containing an Instant, that when deserialized, became a list more or less like this:
{
"instant": [
"java.time.Instant",
16487458.8578154
]
}```
instead of becoming an actual `Instant`, but it worked for simple types
kotlinx.serialization is pretty sweet from my limited experience
though having a map of String -> Object is a bit insane to be honest
maybe a bit of an x y problem?
Well, is asking for a complete solution for deserializing objects from and to something without having to spoonfeed the framework with the types a little bit too much?
Tbh I'm kinda frustrated with this issue, I can't believe there is not a single solution (that doesn't such, I'm looking at you, Java Serializable) that works for these issues. I'm not even asking for JSON to do this, I'm asking for a data format that exists and is able to hold types (read Classes) from their values from before being deserialized
i mean what's wrong with Java Serializable?
like, most serialization frameworks can do what you're asking pretty easily
the issue with it is that I'm using some framework classes that do not implement it, so java serialization gives up and explodes when I try to use it