#help-development
1 messages · Page 1657 of 1
how do you export the jar?
If you are new to programming then you dont even understand what a dependency is. And then using a dependency manager
is like building a woodworking factory just to sharpen a stick.
thats not how u send code my guy
is anyone privvy to what the DataWatcherObject object does?
do u use some dependencies?
It keeps track of an entities metadata
so do i have to use reflection to perhaps access the private DataWatcherObject?
I think there is a getter for that in entity
can u show onEnable method
anyone that for some reason wants to come and check my like 15 classes to tell me how could I make them better?
.-.
Depends if you offer versionless support (otherwise just use the api calls)
Are you sure that you also included com.notablenoah.tourneymanager.listeners.JoinListener in your jar?
couldnt find one
i am very tired though i could have skipped over it
and also JoinListener
private static final DataWatcherObject<Integer> bU;```
@lost matrix this is whati need to access
seems like a rabbithole to go down bU = DataWatcher.a(EntitySlime.class, DataWatcherRegistry.b);
Thanks @lost matrix! That wasn't the fix for the error, but I realized the error, because of your idea.
Isn't this supposed to be .class instead of .java
Ah i see. This one should be inside the DataWatcher of the slime. Maybe you can get the DataWatcher and iterate through its DataWatcherObjects.
how the heck u compile ur plugin?
I exported it
in eclipse
I dont think it worked
is it the this.Y?
i think its wrong option
Export is teh correct option
w2hat options do i click
ensure you tick plugin.yml and config.yml
ik that much
this.getDataWatcher()
thats all
correct
err is same?
you can untick project and classpath
idk
@lost matrix how would i search for the correct watcherobject
is exception in console same that before
I havent exported yet
I am making that a armor stand wil change the head position but only the player who clicked can see the rotation. Does anyone know how I can solve this? https://pastebin.com/sdYKbLEh
idk if thats correct
export
the thing that theres no .class file is not normal i think
cuz server just cant load .java file
no this is exported I turned the jar into a zip to check if it is a .class
its still the same
so it exported wrong
goto Project menu, Build all
its grey
ensure your project is selected in the left
lef?
is Build automatically ticked?
yes
Anyone wants to spend some time helping me checkout my code? I know the plugin.yml and main arent registering the commands, i will do it later
Yes i know its all a mess but please dm me stuff to make it better (I havent tested it yet and i prob will have 1k bugs when i do lmao)
if so,
https://github.com/2Hex/Teams
sorry for being selfish
ok I clicked build all
now you can export
If you tick the Build automatically in the Project menu, you don;t neeed to manually build
it should be selected by default
its still not a class file when I export it
where are the logs
Console tab, usually below the code
PlayerJoinEvent
I dont have the console tab
how about the Problems tab?
0 items
what happened when you clicked build all?
nothing
go Project -> clean
I just assumed it did something
then build all
nothing happened
then you have something really funky going on with your Eclipse
tryna set a player's max health when they join but SetMaxHealth is deprecated
Project menu -> properties
I cant click that
select the builders
oh wait
then click on yoru project first
nvm
Read Javadoc as to why (hint: use attributes)
ok
in your builders, do you see a Java Builder, and its ticked?
Then I see no reason for you to be having problems
-.-
thats your project folder?
ok, whats inside bin? it shoudl be compiled class files
folder is empty
I'd say reinstall Eclipse and import your project again then
No clue why but your IDE is not building your project.
I cant be bothered could I just get someone to compile this stuff for me
We can;t be bothered either
its not exactly difficult, its unzipping a folder
that takes much more effort than downloading someone's project and compiling
Can anyone help me?
im getting an error saying jar does not contain plugin.yml but i checked and there is a valid plugin.yml
you have to include it on export
did you check actually in the jar itself, and its in the root?
lol
Then your error message probably has more to it and says its corrupt or missing
ill send it
[10:36:28 ERROR]: Could not load 'plugins\Half Heart Survival.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[patched_1.17.1.jar:git-Paper-187]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:160) ~[patched_1.17.1.jar:git-Paper-187]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:404) ~[patched_1.17.1.jar:git-Paper-187]
at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:276) ~[patched_1.17.1.jar:git-Paper-187]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126) ~[patched_1.17.1.jar:git-Paper-187]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-187]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more
it says jar does not contain plugin.yml
wait lol its in the package im so stupid
Yeah, I did say root 🙂
how i can sort the tablist players by playrs group using a array?
sort them before you put them in the array
[10:39:04 ERROR]: Could not load 'plugins\Half Heart Survival.jar' in folder 'plugins': uses the space-character (0x20) in its name
lol
can plugins have spaces
nope
im guessing not
i already sorted by your names, but i dont know how i can do this using a group object
😦
like owner to member understand
You would have to manually sort or write a Comparator
wait where does it mean for the spaces thing in plugin.yml or smwhere else
what do you mean sort manually ?
loop over and sort them
cuz the plugin.yml is spaced
I think I found out why it wont compile
i think about doing this, but i dont know make do this organized straight from a list, so I can do a foreach
that example just sorts alphabetically, but you can easily change it to sort by groups then name
that's what I needed for the group, but there's not here
somehow I am too stupid to make a full command run asynchronously,
I tried just putting it into a BukkitScheduler (runTaskAsynchronously), but that said Cannot resolve method 'runTaskAsynchronously(me.konstanius.konstanius.konstanius, <lambda expression>)'
Then I tried to google for how to run commands asynchronously but that didn't yield any good results
my cursor on Eclipse just turned into something idk how to change it back
it looks like: :
out of curiosity since im struggling to get my slimes working, is there a better way to resize/reposition armour stands on entities?
press insert @quaint mantle
doesnt do anything, just toggles insert on and off
You need to add your spigot.jar as a library
how does one do that
that doesn't help at all
Source menu -> add import
why not?
how do i fix this
fix what?
tried resetting something?
yup
tried it all
unless i missed something??
its not Insert
well it is, but its just "Insert" mode??
because I know how runTaskAsynchronously works, but I am getting the error I sent previously, even though I am not accessing anything like player inventories, blocks, locations etc
ah because you are trying to use a lambda
source menu is just grey
I am pretty sure there is no lambda in my entire command
select yoru project first
String.valueOf(player.getInventory().getItemInMainHand().getType()); Found a problem .-.
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { }); works fine here
yeah but that can't be run asynchronously
sec and I'll test
it can't, these interactions won't work in async
bruh
what?
Why are you running it async if the code you want to run can;t run async?
I realized just now that I am getting the item in main hand in the middle of it so I can't run it async
There is very little in the Bukkit API you can safely access async
can someone help? idk why this is happening, but earlier there were two related problems on intellij but when i restarted it's no longer there
[17:11:10 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'hatscatalog' in plugin MakaCore v1.0.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.17.1.jar:git-Paper-205]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.17.1.jar:git-Paper-205]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:832) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.network.PlayerConnection.handleCommand(PlayerConnection.java:2169) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1980) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1961) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:46) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:6) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$ensureRunningOnSameThread$1(PlayerConnectionUtils.java:36) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.util.thread.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:149) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.executeTask(IAsyncTaskHandlerReentrant.java:23) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:1348) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:190) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.util.thread.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:122) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.bf(MinecraftServer.java:1327) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1320) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.util.thread.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:132) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1281) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1192) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-205]
> at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 54 out of bounds for length 54
at java.util.Arrays$ArrayList.set(Arrays.java:4169) ~[?:?]
at net.minecraft.core.NonNullList.set(NonNullList.java:54) ~[patched_1.17.1.jar:git-Paper-205]
at org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryCustom$MinecraftInventory.setItem(CraftInventoryCustom.java:141) ~[patched_1.17.1.jar:git-Paper-205]
at org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventory.setItem(CraftInventory.java:99) ~[patched_1.17.1.jar:git-Paper-205]
at com.buenny.makacore.hats.HatsCatalog.init(HatsCatalog.java:32) ~[MakaCore.jar:?]
at com.buenny.makacore.hats.HatsCatalog.<init>(HatsCatalog.java:23) ~[MakaCore.jar:?]
at com.buenny.makacore.hats.HatsCatalogCommand.onCommand(HatsCatalogCommand.java:20) ~[MakaCore.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.17.1.jar:git-Paper-205]
... 21 more```
?paste delete that
whoever just said that, you're blocked for me, so don't bother helping
where do I even get the bukkit jar that I import
lol
Aight not helping you
?bt run buildtools
An item is being set at slot 54 when the max slot any doublechest can have is 53
idfk, nobody's helping me without doing ?google or telling me to switch to IntelliJ
w h a t
idk how to get it back to the normal cursor
I have never seen an eclipse cursor like that
ya
i'm googling and googling
its soemthing to do with Insert..??
i cant turn Insert off im pretty sure
Eclipse has | and a block when inserting
i dont remmeber it always being "Insert"
thats there too!! dw
if i turn Insert Overwrite mode on, yeah its the fat bar that replaces characters
but thats appearently just "insert"
yep
which i'm doing as google instructs.. and pressing my Insert key
which isnt doing anything but turning Overwrite on and off
nothing happens when i respawn anyone know why? (no errors btw)
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event) {
Player p = event.getPlayer();
p.setHealth(1);
}
You have to delay one tick as you are not actually alive yet in the event
o
worked for me before with 54, but when i added init(); everythin went to heck
@eternal oxide is there anything i can do because idk
btw what's this all about and how do i get rif of it
https://i.imgur.com/fapR0Qu.png
restart your ide maybe
um, I've never seen that cursor
fair
[18:00:54 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'hatscatalog' in plugin MakaCore v1.0.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.17.1.jar:git-Paper-205]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.17.1.jar:git-Paper-205]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:832) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.network.PlayerConnection.handleCommand(PlayerConnection.java:2169) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1980) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1961) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:46) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:6) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$ensureRunningOnSameThread$1(PlayerConnectionUtils.java:36) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.util.thread.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:149) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.executeTask(IAsyncTaskHandlerReentrant.java:23) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:1348) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:190) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.util.thread.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:122) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.bf(MinecraftServer.java:1327) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1320) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.util.thread.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:132) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1281) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1192) ~[patched_1.17.1.jar:git-Paper-205]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-205]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.IllegalArgumentException: Size for custom inventory must be a multiple of 9 between 9 and 54 slots (got 53)
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[patched_1.17.1.jar:git-Paper-205]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.createInventory(CraftServer.java:1969) ~[patched_1.17.1.jar:git-Paper-205]
at org.bukkit.Bukkit.createInventory(Bukkit.java:1380) ~[patched_1.17.1.jar:git-Paper-205]
at com.buenny.makacore.hats.HatsCatalog.<init>(HatsCatalog.java:22) ~[MakaCore.jar:?]
at com.buenny.makacore.hats.HatsCatalogCommand.onCommand(HatsCatalogCommand.java:20) ~[MakaCore.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.17.1.jar:git-Paper-205]
... 21 more```emphazie on
`Caused by: java.lang.IllegalArgumentException: Size for custom inventory must be a multiple of 9 between 9 and 54 slots (got 53)`
oh my
emphasize* idk
a page and a half
@lean gull do you know how to do inventories
so the size for inventories is how many slots
yes, i'm following a tutorial that has worked before
Size is 54 but slot count starts a 0. 0-53
so i'd do (9*the amount of rows you want)
that was 2 pages and a half
54 but it starts at 0
i would just do (9*the amount of rows)
Is there a way to allow players to put sharpness books on other items like pickaxes and shovels?
i did 54 before and it worked, but then i added init(); to add my items to the gui and now this is what i get
then dont init();
You could try addUnsafe
but then how do i have my items
by adding them to the inventory
Would be alot easier to help you if you post your code
what are you supposed to put here?
Bukkit.getScheduler().runTaskLater(something, () -> {
p.setHealth(1);
}, 20L);
?paste
i have a lot of code
where the something is
which part do you want
?paste
all of it
plugin
i like my code not stolen, thanks
ok
just the word plugin?
thanks for asking for help but we cant help
You're literally copying a tutorial
lol
shshsh let them be dumb and fail
no im using a tutorial to do the template
Also why would we want to steal your code
Your plugin instance. If in the main class it would be this
ok
guarantee i could do it faster
LOL
because you can fix it and steal my ideas?
i am
you tryna hide something???
Okay if you're going to be cynical then find it out yourself
i literally just agreed with you that i am paranoid
ya
trying to guess your issue is annoying and time consuming
just
alr if you're gonna be mean: don't
Google your question before asking it:
https://www.google.com/
that ^
No one is going to steal your ideas. I guarantee its been thought of and posted here before.
woudlnt this also allow things like sharpness 50
now what
it will probably allow a lot of wierd enchants
i tried putting init in one of the methods, didn't work
you should have a spigot jar in the folder with buildtools now
i see ty
when i do this still nothing happens when i respawn
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event) {
Player p = event.getPlayer();
Bukkit.getScheduler().runTaskLater(this, () -> {
p.setHealth(1);
}, 1);
its a folder do i zip it and turn it into a jar?
or will that not work
make player final, and is that method in yoru main class?
oh is this buenny person the one who blocked everyone in #help-development for trying to help them
nah i blocked everyone for being mean
lolol
yes its in my main class
Yes
You just take the spigot jar out of the folder
i might be stubborn but i do not like meanies
shut up we are friendly
cough
@lean gull you're command is named "hatscatalog" you realize HeadDataBase and a whole bunch of other alternatives exist right?
god is not friendly
i am very friendly
Shhh that's his completely original idea
honestly i did not know that was a thing
where the hell is that there are so many folders
omg i love ur idea
can i do /catalog hat
or /catalog hats
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Should be in the same folder with the buildtools.jar
add a sysout as the very firrst line of your event. make sure its being triggered
blocked
k
this happened before?
Yep
send your buildtools.log
i love it
he blocks anyone who he feels didn;t speak nice enough to him
love that
doesnt know spigot
How can I set that the ender dragon has already been killed? Cause I don't want the ender dragon or any portals to spawn in my end world.
All I found is World.getEnderDragonBattle().hasBeenPrviouslyKilled()
its not being triggered
i also tried that with join and its also not triggered
then you havn;'t registered yoru main class as a Listener
o
Not what I am looking for... Every time I load my world it spawns an end portal and the enderdragon saying "Legacy the dragon hasn't been killed before" or what ever.
the compile failed
bruh
where
why
how
what
when
and whyyyyyyy
spekaing
like
this
does
not
get
your
point
across
Someone just finished watching spy kids
I
am
confused
but theres no error in log whats the problem?
I
still
need
help
no
meanies
please
lol i forgot how to register a listener class
there is an error -.-
i just did it like yesterday with another plugin lol
where?????????????????????????????????????
open the file and look
ah
it's literally at the very bottom
i was looking from discord
WHhhYyy Isss there aLWAys a god damn error
I hate my life
curse this dumb java
I hate it
Move BuildTools to a folder thats not on your desktop. a Folder on C:\ Your paths are getting mighty long and will likely be causing issues.
how do u register the main class as a listener
cut down not across
pls no spam :(
Download/Stream "EVERYBODY" here: http://smarturl.it/LogicEverybody?iqid=yt
Director - Andy Hines
Executive producer- Luga Podesta & Brandon Bonfiglio
Producer- Andrew Lerios & Alex Randall
Director of photography- Jeff Bierman
Production Designer - Hannah Beachler
Edited by Joe Calardo
Casting - German Legarreta
Assistant production supervi...
me?
lol
what is not working?
getServer().getPluginManager().registerEvents(this, this);
I love this.
thx im an idiot xD
wait where do i put that it doesnt work in just the class
from what i understand, if i put the init method in my main method of the class, it will break everything, if i don't, i will get an empty gui
in onEnable
can you show some code? there's no one here who will still it or something
the most I'll steal are your shoes
eh whatever i just want my code to work
btw for the first this it says that that part is supposed to be a listener
!paste
ready for the spam
how do i do the paste thing
do ?paste
?paste
?paste
well if you don't show what isn't working we won't see
ty
I wouldn't say no one lol I mean there are alot of sketchy users here still.
wait what did i just say
for (int i = 0; i < 54; i++) { Remove the equals because slots are 0-53
yikes
oh i see now
first of all set this to 54
inv = Bukkit.createInventory(this, 53, "ʜᴀᴛѕ ᴄᴀᴛᴀʟᴏɢ");
what
incompatible types: com.tristandasavage.halfheartsurvival.HalfHeartSurvival cannot be converted to org.bukkit.event.Listener
sorry i don't know what's a constructor yet
haven't you been learning java for like 4 months
public HatsCatalog() {
inv = Bukkit.createInventory(this, 53, "ʜᴀᴛѕ ᴄᴀᴛᴀʟᴏɢ");
init();
}
constructor
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
yeah, my methods are slow
my discord hates me
rip
espically when the servers i get to to get help are full of meanies
go away kss
go hover over the eyes @tardy delta, the reaction in chat the popup is from
ah its gone
incompatible types: com.tristandasavage.halfheartsurvival.HalfHeartSurvival cannot be converted to org.bukkit.event.Listener
why cant it be converted
You need to implement Listener
Buenny inventory slot count must be divisable by 9
you don't have to do this check, lore can be set to null @lean gull
if (lore != null) {
meta.setLore(lore);
}
wew
Collections.singletonList(null)
is ur main class the one u extend javaplugin in? iirc you don't have to register events in the same class as the one that extends javaplugin, unless that's changed
k
ok we're not mean, we are trying to help you. you make that impossible, its like asking for help from a mechanic and not showing your car
You don;t but I'm assuming its not his actual main as his event isn;t triggering
its 54 in the Bukkit.createInv and 53 is the maximum index of the chest
indexes start with 0 👀
for the index? thats not possible
inv = Bukkit.createInventory(this, 54, "ʜᴀᴛѕ ᴄᴀᴛᴀʟᴏɢ");
if you do inventory.get(54) that will throw an error
yea thats fine
54 is the size
so 54 slots
btw im getting some errors
which ones?
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
?learnjava
show com.buenny.makacore.hats.HatsSlotPlacement.RightClickEvent(HatsSlotPlacement.java:30)
gud bai
you are trying to get a slot that doesnt exist
both of ya
?learnjava
ok i made a new listeners class and migrated my events over but im getting this
lol 2 times now
ok sry ^^'
first arg must be ur plugin not listener class
hi, I am getting a java.lang.SecurityException: Invalid signature file digest for Manifest main attributes but only when I set the output directory of my artifact to my plugins folder, any ideas why?
if that method is not in your main class then pass the main class' instance
u can do YouPluginClass.getPlugin(YourPLuginClass.class)
so basically the main class
ye
yea
Hmm, don't make newbie do that ^^'
why?
Cause, they should inject
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
what do i do for the YourPluginClass part
main class
ur actuall plugin class name
Just make a proper dependency injection lmao
maybe this is better
but i always just define final class which stores static vars with plugin, server, pluginloader, registerEvents and etc. its kinda easy
idk i thought i used it
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Ew
lmao the same link is like 20 messages above
package com.aregcraft.customcrates.utils;
import com.aregcraft.customcrates.CustomCrates;
import org.bukkit.Server;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.command.PluginCommand;
import java.util.Objects;
public class Common {
public static final CustomCrates PLUGIN = CustomCrates.getPlugin(CustomCrates.class);
public static final Server SERVER = PLUGIN.getServer();
public static final PluginManager PLUGIN_MANAGER = SERVER.getPluginManager();
public static final ConsoleCommandSender CONSOLE_SENDER = SERVER.getConsoleSender();
public static final int CHAT_LENGTH = 53;
public static void registerEvents(Listener listener) {
PLUGIN_MANAGER.registerEvents(listener, PLUGIN);
}
public static void unregisterEvents(Listener listener) {
HandlerList.unregisterAll(listener);
}
public static void setCommandExecutor(String name, CommandExecutor executor) {
Objects.requireNonNull(PLUGIN.getCommand(name)).setExecutor(executor);
}
public static void setCommandCompleter(String name, TabCompleter completer) {
Objects.requireNonNull(PLUGIN.getCommand(name)).setTabCompleter(completer);
}
}
?paste
Objects.requireNonNull 👀
Lmao
thats just the same as throwing nullptr
dont be toxic
still adds 1 line of lore for some reason
idk intellij says me to do that
yea same
dont use IntelliJ :)
if its null?
Where did you see that you should code like that ?
no
whats there
Even the spigot tutorial isn't like that
be nice
i didnt saw this anywhere
is there something as default lore
// creates items
public static ItemStack createItem(String name, Material mat, List<String> lore, Integer cmd) {
ItemStack item = new ItemStack(mat, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setLore(lore);
if (cmd != 0) {
meta.setCustomModelData(cmd);
}
item.setItemMeta(meta);
return item;
}```
its just easier for me
That explain all :/
nopppp
and why Integer and not just int
telling someone to not speak isn't very nice
what is in the lore?
whats the message or something
this is what i set the lore to
Collections.singletonList(null)
I would really suggest you to take a look at the spigot api tutorial (on spigotmc).
just put null smh
wtf lmfao, toxicity again tbh
but i rly dont understand why this is bad
Cause, you're using statics, that's a bit too complicated to explain to you, but trust me, you don't want to have statics everywhere ^^
bad for perfomance?
Here, there will be no problem as the spigot api JavaPlugin is a singleton
Google your question before asking it:
https://www.google.com/
But that's a bad habit and later, you'll see that statics can just make you lose time trying to troubleshoot your code when you would simply DI and didn't get any problem
Anyone know what could be causing security exceptions when I build my plugin in my plugins folder? I have looked on SO and tried all the things they try with maven shade etc but still keep getting the issue?
Moreover, you're on java, it's object oriented. Well, as I said, that's long to explain x)
bruh
Google your question before asking it:
https://www.google.com/
ugh
kay so i read the error and it says the item is null, why is that
There should be a command with the lmgtfy api to make it directly
public class HatsSlotPlacement implements Listener {
@EventHandler
public void RightClickEvent(PlayerInteractEvent e) {
Player player = (Player) e.getPlayer();
HatsCatalog item = new HatsCatalog();
List<String> lore = new ArrayList<>();
lore.add(ChatColor.translateAlternateColorCodes('&', ""));
lore.add(ChatColor.translateAlternateColorCodes('&', "&aᴄᴏᴍᴍᴏɴ"));
ItemStack headband = HatsCatalog.createItem(ChatColor.translateAlternateColorCodes('&', "&3ʜᴇᴀᴅʙᴀɴᴅ")
, Material.PAPER
, lore
, 1);
if (e.getItem().equals(headband)) {
if (player.getInventory().getItem(5).equals(new ItemStack(Material.AIR))) {
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.AIR));
}
}
}
}```here's the code btw
Collections.emptyList()
just null? : (
NPE
for lore?
wdym
i always set it to null
xd
so can anybody help?
player.getInventory().setItem(45, headband); this doesn't do anything either
I think you've blocked everyone who can/would have helped you
unfortunate that all the "meanies" are everyone who tried to help
foruteenbrush is still here ¯_(ツ)_/¯
check if the type of the item isnt Material.AIR and if the item isnt null before comparising it to your own created item
hes not gonna get help if he doesnt accept it
what?
can you explain it in a dum dum version
im waiting for the timer in my game 🥺
if ur bored just make a system for me to check between discord tags or discord IDs 
sensitive weakling who cant accept criticism
what 😳
i already have xd
js
in my discord bot
who is dead now
😂
a plugin I'm working on, for linking discord accounts to their minecraft accounts on the server, saves user's accounts using the discord tag instead of the account IDs 🤮 so im working on fixing that
lol
F
ye i do too
lol i think i just found a glitch
so i gave myself max level regen and i have an onHealthRegainEvent that makes ur health half a heart and if u take fall damage and click respawn you basically come back to life in the same place you died
xD
uhh my brain
Integer slot = player.getInventory().getHeldItemSlot();
if (player.getInventory().getItem(slot).equals(headband)) {
pls help idk what im doing
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
int slot not Integer
wdym
if someone could help, please message me.
i'll be working on something else for now
On learning java ?
lol
why are none of my cmds not working
i aint gonna debugg like 15 commands aaaaaaaaaaaaaaaaaaaa
someone pls help
A string
lololo
rip String.valueof(b)
its really okay its proob better than mine
The code isn't staying and not gonna waste time when I can just add +""
The field isn't static.
lombok, yikes
You can;t do commands like that. You are reasigning the executor every time. Only the very last will be used
lombok sucks
runs
how do you tell if a sender is the console
sender == Bukkit.getConsoleSender()
oh fuck
how do i fix that
You register ONE executor for the main command, then parse teh args in that for your sub commands.
eoafuhahafewawfuaffa
how
what u wnt me to do then
One
you can have them in seperate classes
how
but you only register the root command "teams" with Bukkit
let them extend a command class with the onCmd method
and set the executor for each of the classes
you then parse args with a switch statement and pass the event to teh relevant class
I just told you
This is where you have to start using more grey matter
rub those brain cells together 🙂
both of them 🙂
its actually not hard
register yoru "teams" command
then in the teams onCommand you add a switch statement
you could even use Class.forName to pass the event to teh correct class
you don;t
you only set teams
what
you have ONE root command, so thats the ONLY command you can register with spigot
Wow even after setting isCreateDragonBattle() to false it still spawns the fucking dragon
No event for when a DragonBattle is created either
@eternal oxide lmao i still cant figure it out
all of your sub commands will not be known to spigot. they are your own, you don;t register them
The only command spigot knows about is "teams"
So you have to implement a way for your teams onCommand to parse what is typed in args to pick the correct command to run the code for
o
so basically at teh real bottom of the heap is if (args[0].equalsIgnoreCase("leave")) { }
don;t do that though
you don;t actually want to hard code any commands
You have a couple of ways of doing it.
switch (args[0]){
case "create":
create();
}
return true;
}
public void create(){
plugin.getCommand("create").setExecutor(new Create());
}
maybe smth like dis
You either have to register each of your commands with your own command handler (I wouldn;t)
No. you can;t setExecutor for ANY of your sub commands
JavaPlugin.getCommand(String) reads from plugin.yml
ajgrabgrjbargrjgjgrjgjbgjgjbgbgbfjfbffhfjfjjfjfjfjfjfjfjfjfjfjejefjfenefknfekfe
or you could use reflection to automatically find all yrou commands
I just pass my sub commands to another class.
whats the best way
well best is subjective
easiest
reflection is more complex but allows you to never have to modify yoru command class and it will find any commands you add
but will it take long to do
List<String> newArgs = new ArrayList<>();
for(int i = 1; i<args.length; i++) {
newArgs.add(args[i]);
}
SubCommands.get().onCommand(newArgs.stream().toArray(String[]::new), sender);
else you build a map of yoru commands
which is hard coding them
the map is simplest
ok tehn Map<String, CommandExecutor> commands = new HashMap<>();
o
that goes in your teams class
o
as a Field
then in teh conmstructor (add one if you don;t have one) of yrou teams class....
ok
o ok
now in your onCommand
?paste
CommandExecutor subCommand = commands.get(args[0].toLowercase());
i went to lunch and accidentally left my test server running and i got this
https://paste.md-5.net/uqodefujit.md
o
if (subCommand != null) subCommand.onCommand(fill in values from onCommand);
i do that for every subcommand right
no
one class?
yeh but where
those two lines in your onCommand in your "teams" class
all yoru other command classes stay as they are
ok
:0 how are you still helping people ElgarL, you must have some major patience! well done!
No life
damn thats a sad response ;-;
You may want to use Map<String, ? extends CommandExecutor> commands = new HashMap<>();
o
may not need it though
hes helping people here for over am onth now lmao
doing it all from my head
wooooaaahhh
lol a month, Yep that long
ur brain size is concerning
too big for humans
Required type:
capture of ? extends CommandExecutor
Provided:
Create
e
then leave it as CommandExecutor
ok
?paste your teams class so I can make sure its all correct
you may want to change this bit to java if (subCommand == null) return false; return subCommand.onCommand(sender, command, label, args);
sec
better
o ok
uwu
ternary operator is pretty awesome
mhm?
oh
Discord.getInstance() :/
event.getMember() (:
there is an api
it works with events
oh ):
Can I use Gson with records? Say
public record SomeRecord(@SerializedName("id") recordId) {}
singleton 🤢
try it
pretty sure they just get compiled to objects anyways
finally found the bug I've been chasing for two weeks, feels good man
in this case it was kinda hard to try but from some Java spec it seems that the annotation is just copied over to the field
The concern I have is that the fields are private final, idk how Gson would handle that
me irl
it was really dumb too
an oversight on my core system when I added a new subsystem
during a rewrite
would only cause issues if a very specific sequence of events happens in a certain order then got interrupted in a certain way and only in some cases
this has to be one of my top 3 bugs in how nightmarish it was to even figure out what was going on thus far
💀
Does command alias don't use the auto complete on bungeecoord plugins ?
whats the usage of mojang's server mapping?
Nope, doesn't work... reeeeee
and nobody cares about the issue it seems: https://github.com/google/gson/issues/1794
wtf
Ah I guess the reason is that Gson isn't being properly maintained anymore.... :(
Is it possible to use getResource to extract an entire folder from a plugin jar?
^^^???
is it cuz i dont have getCommand("team").setExecuter(this);
Google your question before asking it:
https://www.google.com/
yep
I did say you register the root command only
o
checked it, but i still have a question is there a way to make intellij idk import mapping to auto change names in ide?
Guys i have big issue,when i join or any member in the server it automaticlly crashes,then restarts.
u dutch?
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: Please report this to PaperSpigot directly!
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: Be sure to include ALL relevant console errors and Minecraft crash reports
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: PaperSpigot version: git-PaperSpigot-"4c7641d" (MC: 1.8.8)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: ------------------------------
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to PaperSpigot!):
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: ------------------------------
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: Current Thread: Server thread
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: PID: 17 | Suspended: false | Native: false | State: RUNNABLE
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: Stack:
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.Chunk.a(Chunk.java:1002)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.World.a(World.java:2621)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.World.getEntities(World.java:2608)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.EntityArrow.t_(EntityArrow.java:183)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.World.entityJoinedWorld(World.java:1650)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.World.g(World.java:1617)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.World.tickEntities(World.java:1450)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.WorldServer.tickEntities(WorldServer.java:600)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:846)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: java.lang.Thread.run(Thread.java:748)
[17:14:12] [PaperSpigot Watchdog Thread/ERROR]: ------------------------------```
i was told to come here :/
?paste
oh 1s
String worldName = plugin.getConfig().getString("warps." + args[0] + ".world", player.getWorld().getName());
World world = Bukkit.getWorld(worldName);
Location loc = new Location(world, plugin.getConfig().getDouble("warps." + args[0] + ".x"), plugin.getConfig().getDouble("warps." + args[0] + ".y"), plugin.getConfig().getDouble("warps." + args[0] + ".z"));
player.teleport(loc);```
HOW CAN IT BE NULL
I HAVE A DEFAULT VALUE
caps
String worldName = plugin.getConfig().getString("warps." + args[0] + ".world", player.getWorld().getName());
HOW TF IS IT NULL
THATS ILLEGAL
its smth related to worlds
it worked before when i didnt include it
ok now
wat
I feel like I'm getting trolled by the rating system on spigot
5x 5 star reviews and the score doesn't budge, 1 4 star review and it goes down by 0.01
I mean I can but it's not like you can really get a historical view of the score
@eternal oxide btw unkown command
zero information
anyone happen to remember off the top of their heads how to detect entities from the sentinel plugin
I had a thing for it somewhere but it seems like I might've lost it in the rewrite
wdym
You told me absolutely nothing I can do anything with "unknown command"
it says unkown command, even tho i registered it
/team
whwat
use teh same command name as you have in yoru plugin.yml
getCommand("team").setExecutor(this);
no
commands:
team:
description: Team Related Commands.
?paste class
currently if you just type /team it shoudl throw an index out of bounds error
o
on line 44
you can use just public class Teams extends JavaPlugin
JavaPlugin already implements CommandExecutor
take final off teh class
or false, whatever you like. if you return false it will say an error with the command. if you return tru then it will just be ignored
and no
use math 🙂 if (args.length == 0) return true;
o
@eternal oxide sorry for ping but why dou think loc is null
World world = Bukkit.getWorld(worldName);
Location loc = new Location(world, plugin.getConfig().getDouble("warps." + args[0] + ".x"), plugin.getConfig().getDouble("warps." + args[0] + ".y"), plugin.getConfig().getDouble("warps." + args[0] + ".z"));
player.teleport(loc);```
theres 3 lines there, any of them can be null
Anyone know how I can use dependencies like Vault without getting a SecurityException error? it has just started happening and im not sure why
I just get this java.lang.SecurityException: Invalid signature file digest for Manifest main attributes I have tried the exclusions for maven shade like it says online everywhere but does not work
yes I use maven
why are you trying to shade vault?
I am not trying to shade it, I just added it as a maven dependency and now I am getting this error
did you add a scope?
and when I look online it is a shade issue
?paste
in my pom.xml?
yes scope provided
Elgar
yes it is scope provided
are you doing new Teams or something?
You are doing somethign funky. Never seen that error before
if its scope provided then it will not be shaded
okay, is there anywhere else that something could be wrong? it builds my plugin but when it launches my server jar I just get this error
Have you shown us the full error?
yes
you never create a new instance of yoru plugin
If I had an Internet gun I would shoot you
what jars are you shading? note that you can not shade any signed jar
is it becuz i didnt load the world or smth
There is a second option 
idk i dont work with worlds much
Then its a world thats not loaded at that point in time
I mean, I am not intentionally shading anything, how will I know if I am shading somethng
how do i load it
paste your pom and we'll tell you
why is 3 getting skipped
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
is it some special world? Not a default one
worldguard needs to be provided
im in a special world and it works, but in the default one (which no one is in rn) its not
lmao
Looks like you are shading worldguard
@waxen plinth personal help assistant until you tell me to stop
ah let me see if that does the trick
no
its a default worled
world

I don't wanna dig through the code for bugs though
Add debug output
The 3 has to be disappearing somewhere
Print stuff out at each step and see where it goes missing
still getting the same error

Theres nothign in your pom thats being shaded
do you have a Manifest file?
not that I can see
I wasnt having this issue yesterday then I boot up the server today and it just starts throwing this error
I'd say delete your shade plugin section of your pom then. You do no shading so don;t need it. then you'll know if its the shade doing it
anyone there
pls help
a Bukkit.getWorld() is returning null
idk why
do i have to load smth or smth
idk
wdym what a world
whats the world name
doesn;t matter, world can not be unloaded
its impossible for Bukkit.getWorld("world") to return null, no matter where you are.
So long as they IS the name of the main world as specified in your server.properties
wtf
wtf
wtf
wt
f
world: !!org.bukkit.craftbukkit.v1_8_R3.CraftWorld
PVP: true
ambientSpawnLimit: 15
animalSpawnLimit: 15
autoSave: true
difficulty: EASY
environment: NORMAL
fullTime: 56104
keepSpawnInMemory: true
monsterSpawnLimit: 70
thunderDuration: 62490
thundering: false
time: 8104
waterAnimalSpawnLimit: 5
weatherDuration: 39615
i just checked my config and i find this
looks like you tried to save a world to yoru config, not a location
OH MY FUCKING GOD
plugin.getConfig().set("warps." + args[0] + ".world", player.getWorld());
🤦
you do know config have getLocation
and you can set a Locations straight to a config
o
removing shade didnt change anything unfortunately 😦
could something in my project structure be wrong or is that just made from pom.xml etc?
I see no reason for your project to be causing this error
yup, me neither, might just remove all the dependencies, start all that stuff from scratch and just add it one by one see what breaks it
are all my dependencies meant to be in this artifacts section?
ItemStack p = new ItemStack(Material.POTION);
ItemMeta meta = p.getItemMeta();
meta.setDisplayName(ChatColor.BLUE + "" + ChatColor.BOLD + player.getName());
return
}
what do i retur in this statement
p
your itemstack, p
but you also need to set the meta back
ik
otherwise nothing will be changed
No idea, I don;t use InteliJ
aight no worries ill see if the plugin still actually works, cheers for the help 🙂
ItemStack p = new ItemStack(Material.POTION);
ItemMeta meta = p.getItemMeta();
meta.setDisplayName(ChatColor.BLUE + "" + ChatColor.BOLD + player.getName());
List<String> lore = new ArrayList<>();
lore.add(ChatColor.AQUA + "death potion of " + ChatColor.BOLD + player.getName());
meta.setLore(lore);
p.setItemMeta(meta);
return p;
}```this should work right
yee looks all good to me
yep just checking
Hi guys !
How to do multi-version compatibility include pre-1.17 and 1.17+ versions ?
I'm not asking about how to find my way in the new NMS structure
My question is about:
- Which version of the Java SDK should I use when compiling my plugin (and which version of gradle accordingly) ?
- Which api-version should I put in the plugin.yml file ?
for some reson when i try to compile my plugin it says that it cannor reach import net.minecraft.core.BlockPosition;
1.13 api version and jdk 8
Btw pre-1.17, you don’t mean like 1.8 tho right
He does probably
Yikes
1.12+ indeed
That’s better
@chrome beacon Thank you for your quick answer ! Nothing else particular to know?
You need java 16
ok i have java 16 so i should switch the version and ittl be all good right?
yep