#help-development
1 messages · Page 1231 of 1
are you sure you even had it reloaded in thef irst place
yes i did it like 10 times with number changes and everything idk what i forgot
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
torchFreezeTickers.stream()
.map(Bukkit::getPlayer)
.filter(Objects::nonNull)
.forEach(
p -> {
((CraftPlayer) p).getHandle().setIsInPowderSnow(true);
p.setFreezeTicks(p.getFreezeTicks() + 1);
}
);
}, 0, 1);
a
Hey guys, what is the go to GUI API nowadays?
I saw that but I don't use Kotlin for my current project sadly.
?gui
You could use actual incendo/interfaces but it's kinda dead
hey I have a question, if I want to rotate a player but change the rotation taking into account mouse movements, how do I do that?
player.setRotation or player.teleport doesnt allow movements
last commit was 2 years ago nah? 🫡
Yeaaa that's what I meant
Might still work, but probably better off with other ones
interfaces-kotlin is great tho
Okayy, i'm checking the thread
it looks really great yeah
-# we can change that
private void changePlayerLook(Player player) {
Random random = new Random();
boolean turnLeft = random.nextBoolean();
float currentYaw = player.getLocation().getYaw();
float currentPitch = player.getLocation().getPitch();
if (turnLeft) {
currentYaw -= 0.2f;
} else {
currentYaw += 0.2f;
}
currentPitch -= 0.3f;
player.setRotation(currentYaw, currentPitch);
}
thats my code but it blocks any mouse movements when setRotation is applied
is there any better alternative?
Someone needs to make an updated version using menu types
Where can i modify the mining speed of an item?
modify the Tool component
aaa
@river oracle
version: 1.21.4, hash: d68245377d
This new for 1.21.4? It shows on all my custom items even though they do not run commands. Is there a way to hide it with code? I have HIDE_ATTRIBUTES
It’s an ops only thing iirc
let me see
Ooh ok, i never use op on my server thats why i guess ive not noticed. even with * perm that doesnt show. Wonder if theres a way to hide it tho
this class don't exist
Why does ItemMeta#getTool#getRules returns nothing for a Diamond pickaxe? Shouldn't there be some rules declaring how fast it breaks stone and etc?
ah yes, the totally flexible and not flawed ItemMeta system

i blame the way ItemMeta works
the way the data components map works takes this stuff into account, but itemmeta works solely and entirely, by design, on the patch layer, without considering the whole component map
Howcome I can't get my IDe to recognize ServerPlayer?
Do I need to rerun buildtools?
you dont have the remapped-mojang classifier
How do u set up rescourse pack to autodownload with the accept/dont accept screen when u login to the server? anyone got any tips or tricks for me? ❤️
You can set a download link in the server.properties
Needs to be a direct link to the resourcepack zip
It's also recommended to provide the sha1 sum of it so the client knows that it downloaded things correctly
Use #help-server for non-development questions
If it does direct file download
So like no buttons being pressed
Ok ok Thank thanks 😄
Would it be possible to fake give an item to a player with NMS that has the id minecraft:emerald_sword for example and the client already has textures and models for it via a resource pack?
Why do you need a custom item
Just use an existing item with custom model data/custom model
but it sucks
imagine seing emerald sword with the id of diamond sword
it just sucks
Who looks at the id of items that often
Sure
If you unfreeze the registry, inject a custom item, and then have a client mod that recognizes that item
but do you need a mod for the client? Would be a ressource pack enough?
No
damn it
The client can’t recognize an item that doesn’t exist
does mjoang plan to add custom items like custom enchantments somehow? xd
one day there will only be one item, and all item types will just be variations with different item_model etc components
You can already make custom enchantments 👀
I can't read
Wow, someone is spamming #help-server . Anyway, I need help with creating custom enchantments
What type of devs?
ones that work for free
except they want to exploit the term interns for their own personal benefit
or ppl who want to work for us for fun
But I don't know. What type of work you looking for? Plugins like EpicFarming and EpicHoppers. If you mean that. Wait, I don't know if I should trust this. You still looking @quaint mantle . Sorry, not getting a risk of legal trouble, that is why my code is not going to github
any kind of plugin dev or dev that can do stuff
sry im new to this kind of stuff
To my help question, how can I get a custom enchantment working?
how am i supposed to know, ive only mastered lua coding
taking an awfully lot of time to type there
how many ppl are in ur server?
@quaint mantle You better purchasing plugins then trying to find devs. If you want to learn how to make plugins, I would recommend learning Java. There are tutorials out there on YouTube. Once you learned that, all you need to learn is the spigot api. I don't recommend this but most people is using paper since paper is more stable. But I think just learning one thing a time like I doing is a good move then to learn multiple apis at once
I DONT GOT DA MONEY
80+
9 are active but since we basicly completed almost everything they rarely hop on anymore
tats why we need more content
@wet breach How can I create a custom enchantment?
@quaint mantle Well, I cannot help you there. But if you want to learn how to make a plugin like this channel is for. I can give you sources to watch and learn from
I don't think adv is allowed
thx tho
how many concurrent players did you have at peak?
not adv i jsut tell him
at peak we had 6 ppl online at the same time
not sure if that is still relevant but hopefully it helps steer you in the right direction
hm
seems pretty interesting, but Im not sure I have enough time for doing smth like this
maybe I can do smth during the summer
just a small plugin like a weapon that gives buffs or extra health and damage is fien for us
oh ok thats easy
its fine
good luck finding someone
I'll see if I can do it
bet
but I can't guarantee anything
also this is the channel to get help about developing
not get help for develeloping lol
ye
I need a updated version, this one has deprected warnings
deprecated doesn't mean unusable
and you should be able to figure out from deprecations updated alternatives if one exists
True but I don't want to used that because it might not be there on newer versions
you will never make an update proof plugin unless its something like a command plugin that doesn't really do much
Does anyone know of a plug in that allows people to run some sort of /wardrobe command in the server and they are able to change, save, their skins while in the server?
Are you interested in developing this?
How hard is it, realistically based on the things you saw I was seeking
I don't think it's that difficult.
your hardest part may be just setting their skin correctly but the rest is simple
or u can fork skinrestorer 💀
and add a limiter
but if you wanna learn make it from scratch
Not hard.
GUI can be done with any old API, I prefer IF. Create a Pane which displays the player's skins, you should do this with pagination in case there are excess skins, around the sides create some border, with a button in the bottom middle that symbolizes "Add New", perhaps using a head here, which asks them to type either a Username in chat to sample the skin from, OR a texture URL. Or instead of having the "add new" functionality in the GUI, you could instead just have a command for it that takes either value as a paramater, and just use the GUI for displaying and switching skins.
Retrieving the skins, and subsequently setting them isn't hard at all. Take the Base64 JSON data of the texture, then just construct a ProfileProperty out of it. Grab the Player's PlayerProfile, use setProperties and append the property, then save.
Using PlayerProfile, you can also get the skin's head, which you can display in the GUI. Using IF you can handle click events to handle the setProperties.
Do I have to do the second part each time, or will do it automatically each time someone runs the command?
You just make a function which takes some value, whether you're passing the username of another player and retrieving their skin, or a texture file directly, and return a Profile Property from it, then when it goes to applying, you would just grab the player's existing profile, use SetProperty, and pass what was just returned
You realize the usage of development in this channels name means like code right?
I really havent found a solution, can someone tell me a method to implement a rotation of pitch/yaw without using player.teleport or player.setRotation??
those 2 are always blocking player movement or rotation when called
Other choice would be packet manipulation?
yeah ive tried changing entity.look packets but nothing happens on client side
What do you mean blocking player movement btw.
Isn’t this what PacketPlayOutPosition is used for?
probably, chatgpt suggested something with protocollib something, with positionpackets? idk what those are? is nms generally better than protocollib?
not yet ill look into it
I think thier final solution was
Location loc = event.getTo();
ClientboundPlayerPositionPacket positionPacket = new ClientboundPlayerPositionPacket(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), setPitch, Set.of(), player.getEntityId());
for(Player players : Bukkit.getOnlinePlayers()){
((CraftPlayer) players).getHandle().connection.send(positionPacket);
}
Can you make NPC usernames appear in tab complete as if it is a normal player
Depends
If they are added to the tablist, they will be in the tab complete list (iirc)
They aren’t appearing 😦
If it's in your own commands then you have full control over what you return in the tab complete list
Basically for my vanish I add a NPc of the staff member so players think they are just afk
But when typing a message “Hello <press tab>” it doesn’t show the Npc username
how do you add the NPC
Packets
You might want to use that https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setCustomChatCompletions(java.util.Collection)
declaration: package: org.bukkit.entity, interface: Player
Although it might be better to find a way to have the player in the list by default
Got it, hoped there was an easier way lol
Iirc, Mojang does not want any modifications from the player list, so any project related to "fake players" becomes tedious
How to send a packet so that the player's effect is to display Speed in 1.21.4 ?
I dont think its a thing of not wanting, i think the whole playerlist and tablist thing is too hardcoded
Why not PotionEffect Api?
PotionEffect glowing = new PotionEffect(PotionEffectType.GLOWING,Integer.MAX_VALUE,1,true,false,true);
player.addPotionEffect(glowing);
because i want the effect to be customised
strength can be 10% or 30%
Packets won't let you customize it any more than the API
Hey, does anyone know how to prevent Bats from colliding with blocks like a vex does. My guess would be something with the BoundingBox, but I dont know how to apply it on NMS 1.17.
Hi, why does this always return false
boolean hasDecoration = player.getInventory().getItemInMainHand().getItemMeta().displayName().hasDecoration(TextDecoration.ITALIC);
That's not Spigot code
Even though I holding an item in hand that have italic display name.
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
Take a look at how the Vex works in NMS
I believe there’s just a no collision Boolean
Is there an easy way to convert a Java resources pack to bedrock?
Not really
didnt geyser have one?
What?
no idea if it works or not
Lol I will try it
If it doesn't work I will tell them to throw the switch in a volcano and buy a PC
based
Bedrock was a mistake tbh, Java is so much better
bedrock also updates approximately every 35 seconds and the launcher either doesn't let you, or the xbox kids can't figure out how to, go back to the previous version
so in my support chat i will invariably get "when will server update to 1.21.40694???" every other day
So does anyone know how to use this?
I'm too low IQ, if there's no .exe I can't do it
looks like it's a "library for converting packs"
so you're probably expected to use it from a plugin to convert a pack automatically
i.e. not a standalone program
So basically it's useless for me right
No I'm just desperate because the shitty bedrock version can't see my resource packs
I think the logical next step is to destroy the switch with a hammer, then work 40 hours a week and buy a PC
sounds good
you could probably figure out how to write a super simple main class to call the library and then run it within an hour
probably not on a switch though
if they have something to run an exe they have something to make an exe
Or I can pay someone 50$ to do it for me perhaps? 🥹
i can give it a shot but the only form of payment i accept is you going to the towny discord to annoy llmdl
Lol
could ask in https://discord.gg/8YftGTZ3
do not annoy the llmdl
they're a popular place to ask for (paid) services
https://download.mc-packs.net/pack/2d7350e2ad7149888ef19a72e4e652456a8365ae.zip
Anyone wanna try their luck? xD
Thanks
I’m aware,
it's very simple, i've done it some years back though i don't really remember anything about how i did it
whether it's feasible for you to do or not depends entirely on you
tryitandsee
if you run into a problem, ask for help with that problem; but trying to seek help or confidence ahead of time "u guys think i can do it?" is not constructive and gets you nowhere
org.bukkit.plugin.InvalidPluginException: Cannot find main class `Plugin'
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:66) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [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_442]
Caused by: java.lang.ClassNotFoundException: Plugin
at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_442]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_442]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_442]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_442]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_442]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
... 7 more
can someone explain to me where its supposed to be :c
.
├── net
│ └── leahmc
│ └── recipes
│ └── Plugin.java
└── plugin.yml
Looks like it's missing the package
Use net.leahmc.recipes.Plugin
as the main class in your plugin.yml
?paste
but it says this again
How are you compiling your plugin?
im using this script
well its one line lol
jar cvf Recipes.jar -C Recipes/ .
i am not a Java developer at all
net.leahmc.recipes.Plugin or not?
it is now
ah yeah I don't recommend using the cli directly
main: net.leahmc.recipes.Plugin
why do i need a build system?
Makes dependency management easier
You can do it that way if you want to but I wouldn't recommend it
Just make sure your class actually is in your jar
oh i have a thought
yeah nvm
i am pretty sure this is a correct build command
looking at the structure of another plugin it does look the same
do you think it needs to be a .class?
Yes it needs to be a .class
or would it compile that automatically
a build system compiles it to a class
.java is the source .class is the compiled version
right
it did say class but they are defined using a class definition so i didnt see that
Save yourself the trouble and use maven
It's a good idea to know how it works
So you can use the java ecosystem easily
ill use it if i need it
right. its not compiled
.
├── META-INF
│ └── MANIFEST.MF
├── net
│ └── leahmc
│ └── recipes
│ └── Plugin.java
├── plugin.yml
└── Recipes.jar```
Gotta call javac to compile
will having a .java and .class conflict?
What's meta-inf doing there
i assume not bc it doesnt look for .java
No the server doesn't care about .java files
thank you
javac complains it doesnt have the appropriate libraries
i mean its right but its a part of the server and not of my jdk
You need to 'link' api jar
^^
Just use build system
Create pom.xml file
pain
Not really
Yep
Intellij creates it automatically so not for me
and then :3
Do you have your pom.xml?
I havent used maven a while 💀
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>package</groupId>
<artifactId>pluginName</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Dependencies here -->
</dependencies>
</project>
That's a basic pom.xml
Then follow
?maven
oh thats lovely that pulls api stuff
And set java compiler versions to 8
what does dependencies here mean lol
do i specify like <plugin="net.leahmc.Recipes.Plugin">?
No
The dependency here would be the spigot api
You can see how to add it in the link the bot sent
It will automatically download it for you and link when building
right so ig i just paste this
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
and resources in src/main/resources
inside a <dependency> block yeah
yes
Need the repo as well
right so
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<groupId>package</groupId>
<artifactId>pluginName</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependencies>
</project>
have to change version but does this look good?
the repo needs to go inside of a <repositories> block
it says repository on the site
oh right
for multiple repos
and so now, can i just run like
maven build or something
maven install
oh i am using 1.8.8 for my server
can i just put "1.8.8" instead of "1.20.4..."
ok well i am
i have 1.13 api on my plugin.yml but iirc like spigot api is backwards compatible
i think it might be fine i dont know lol
api-version is ignored in versions below 1.13
right so it doesnt matter
Yeah
Do depend on 1.8.8 in your pom
so you don't accidentally call a method that doesn't exist
yeah the spigot api in your pom
i dont see where i can do that :c
well alright
struggling to get maven installed lol excuse me
its package for some reason doesnt include its executable??
Linux or windows
Linux
I recommend using SDKMan for all things Java
i guess ill just get the tar for maven and use it locally
ugh this is so much work lol
eh not that bad
Use intellij idea if you hate doing this 🗿
Especially compared to other languages
in C++ i have a like tiny makefile of 3 lines
and the source
in any directiories i want
and then i run make and it just works
or i just yk run clang++ src/main.cc (etc)
not really here to complain though lol
it is what it is
OOOOOOOOH
ITS MVN
Yeah
the executable is named mvn 😭
people do be lazy with the executable names
lol
i hate vowels
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Malformed POM /home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<dependencies>\n <groupId>... @24:14) @ /home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml, line 24, column 14
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project package:pluginName:1.0-SNAPSHOT (/home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml) has 1 error
[ERROR] Malformed POM /home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<dependencies>\n <groupId>... @24:14) @ /home/leah/files/necessary-evils/leahmc/plugins/Recipes/pom.xml, line 24, column 14 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
maven outputs this, at the root of the plugin
?paste your pom
Could you send your pom
line 24 column 14
muh indentation
xml doesn't care about that?
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<groupId>package</groupId>
<artifactId>pluginName</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8</version>
<scope>provided</scope>
</dependencies>
</project>
it shouldn't afaik
i was about to say im 99% sure xml doesnt do that
but it's the only thing wrong i see at a glance
i could change it to 4 space
oh, you forgot to wrap it in <dependency>
the groupid?
the dependency
group id artifact id version and scope
the only child tags <dependencies> accepts are <dependency>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
like this
yes
Yes
tryitandsee but yes
mvn install is doing its thing now :3
i think i provided an invalid version
1.13 it is
1.8 is starting to be very invalid for sure
lol
as in ♿
It's the pom
<version>1.8.8</version>
yeah this is wrong
-R0.1-SNAPSHOT or something
1.8.8-R0.1-SNAPSHOT
Please don't use a decade old version
its necessary unfortunately
sadge
it's a bit boilerplatey but it's simple and straight forward
I still use it 
install worked
i do still prefer it over gradle
it does make sense
i understand what its doing
i now have a /target/ directory
target/
├── maven-archiver
│ └── pom.properties
└── pluginName-1.0-SNAPSHOT.jar```
Yeah that's your jar
Yes
i ran mvn install and it compiled my project?
yes
do i need to pull the dependencies every time
Shouldn't it be package?
i see
alright i just expected it to be like mvn or mvn build lol
install is for installing the artifact (your jar + some maven metadata) to the local maven repository
so that other maven projects can be built against it
similarly to how your current build grabs the spigot artifact from the spigot repo
[08:57:37 ERROR]: Could not load 'plugins/pluginName-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:154) ~[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_442]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
a pre-requisite for this is compiling it of course
├── net
│ └── leahmc
│ └── recipes
│ └── Plugin.java
├── plugin.yml
├── pom.xml
└── target
├── maven-archiver
│ └── pom.properties
└── pluginName-1.0-SNAPSHOT.jar
i thought this was right?
i mean it detected it before
This is not a valid structure for maven
maven expects resources to be placed in a specific directory
src/main/java
/resources
something like this
(src/main/resources)
just the src part right
nerd
this can be changed in the build file of course but it's better to stick to the standard
I told you this earlier
It's okay
so i copy /net/ to /src/main/
They're learning
/src/main/java
i dont use java or spigot and i am usually a very hands on person with this stuff i dont like abstraction
and now recompile
Clean and recompile 
you can always javac it yourself and pass on the 100 million dependencies in the classpath from jars you've manually downloaded
i appreciate yalls patience
i swear every time i build paper it eats up like 5gb of my disk space just caching all the dependencies
What is it even downloading lol
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project pluginName: Fatal error compiling: invalid target release: 21 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
.
├── plugin.yml
├── pom.xml
├── src
│ └── main
│ └── java
│ └── net
│ └── leahmc
│ └── recipes
│ └── Plugin.java
...
oh i think
i shouldnt put net
Yeah set it to 8
Target release is for Java 21 which 1.8.8 does't use
Isn't it 1.8 for java 8 or does it not matter
No worries
java 8
Yeah 1.8
yes it is
I use 17
- was dropped in Java 9 and above
(wish minecraft did that)
Not for 1.8.8 you do unless you use a fork
too long
[ERROR] /home/leah/files/necessary-evils/leahmc/plugins/Recipes/src/main/java/net/leahmc/recipes/Plugin.java:[5,28] onEnable() in Plugin cannot implement onEnable() in org.bukkit.plugin.Plugin
[ERROR] overriding method is static
[ERROR] /home/leah/files/necessary-evils/leahmc/plugins/Recipes/src/main/java/net/leahmc/recipes/Plugin.java:[15,28] onDisable() in Plugin cannot implement onDisable() in org.bukkit.plugin.Plugin
[ERROR] overriding method is static
[ERROR] /home/leah/files/necessary-evils/leahmc/plugins/Recipes/src/main/java/net/leahmc/recipes/Plugin.java:[7,5] cannot find symbol
[ERROR] symbol: class ShapelessRecipe
...
its just more of these
i think it didnt find the stuff its actually using
Can you paste the code?
why
yes lol
just avoid the word static if you don't know what you're doing 
public static final void onEnable lol
neoforge?
it means a different thing in C i guess, static solidifies its place in memory and allows quicker lookup in some circumstances
Paper probably uses some of their tooling
My laptop would have given up half way
static in Java means the field/method belongs to the class rather than the object
oh ew
Java is not C unfortunately
i tihnk i forgot to import something
Java loves consuming memory if done in the wrong way
In terms of c++ you can think of methods as being virtual by default
You can do that
yayy
I mean usually you'd just rely on the IDE to handle imports for you
^
That's not gonna import everything tho, right.
it will
not nested packages
Ye, that's what I mean
any ide worth its salt will import for you 
What kind of plugin are you making anyways?
what ide r u using
im not using an ide i dont even think i have lsp hinting for this
i just want to edit some crafting recipes
How are you even programming this
nvm, 1.8 lol
import org.bukkit.*;
public class Plugin extends JavaPlugin
{
public final void onEnable()
{
ShapelessRecipe gcarrot = new ShapelessRecipe(
new ItemStack(Material.GOLDEN_CARROT, 1)
);
gcarrot.addIngredient(4, Material.GOLD_NUGGET);
gcarrot.addIngredient(1, Material.CARROT);
getServer().addRecipe(gcarrot);
}
public final void onDisable()
{
}
}
text editors? xd
4 instead of 8 nuggets
You are def a c dev
lol why
public class Plugin extends JavaPlugin
{```
oh yea
Criminal
whhaaat ur mean
^
?ban @latent rampart syntax
nooooo im sorry
Then you'll have to take me with them
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
^^^^^^^^^^^^^^^^^^^^^^^^^^
does this part of the url
tell met he package
https://google.github.io/styleguide/javaguide.html most spigot devs agree on this
correct
Yes
oh then thats easy im just being lazy
Wait
The package is also here
ooooooooh
Can't you just do
#.getServer().addRecipe(new ());
?
omg
i love oneliners
if i dont have to make an arraylist of recipes i will be overjoyed
Please don't one line too much
lol
That will just make things hard to read
java requires you to import a gababollion things just to do simple stuff especially when working with an API like spigots
just get an IDE
Don't use a text editor pls
id hate to use something im not familiar with with an api im not familiar with with a language im not familiar with
I can write java in a text editor :3
can != should
Why
Also 1.8 is ancient
I like showing off
Java exams on Paper:
well ur gonna spend half ur time coding looking up imports
Gotta know your syntax
Which paper are we talking about
LOL thats what im doing
"spigot shapelessrecipe"
Oh
also yeah my comp sci class made us do our final in google docs
actually i think i can search the docs
i had my java finals on literal paper
same
HOW
Pen and Paper Java 🔥
how do you compile the project
Write fizzbuzz enterprise edition on a4 paper
so much talk about paper that i want to ?whereami
"find 6 logical errors and 3 syntax errors in this code" 11 pages of java
u cant
What if something's wrong in the code?
nice
Plus
thats like almost a minute per line im on good pace
You can make this plugin in 2 lines
wouldve taken u 3 to install intellij community
is it in the correct location?
Did you move it to /src/main/resources
thats what i thought
iss it in the jar?
wh
check if its in the jar
i didnt know this 😭
okay
Yeah I did warn you about that earlier
maven only adds resources from that path
xd
✨
What did you expect for a c dev
gods favorite operation system
thats true
TempleOS 🗣️
c and windows arent fun alone either
You said this like 5 times already, I think that was enough
im also like 99% sure that what you are making already exists
..cannot find main class
6th time is the charm
Oh I'm gonna be annoying
If all you're adding is just some recipes, why not use a plugin that allows you to add custom recipes via config ?
^
not last time I checked
everything is free if ur a student
everything is free if you're a 🏴☠️
it's a subscription
just get the student developer pack 😭
I don't code in c++ anyways
Remove src.main.java
oooookay
😭
read the docs 
it kinda interprets this however it wants to
lol like absolute path and then local path
no
oh but this is the default config
maven compiles it from java/
so i could change that if i wanted to
in the compiled jar the file is gonna sit at net.leahmc.recipes.Plugin
theres so many small like issues i think im like dodging the actual problem
i did change the path in plugin.yml
wouldve all been fixed if u used intellij it even has a plugin to auto create minecraft pluginss xd
The actual problem that you're not using an IDE
whhhhaaat
Please install ij
Intellij will download all the tools and has a plugin to setup a project for you
but you've kind of done that part now
so 🤷♂️
.
├── pom.xml
├── src
│ └── main
│ ├── java
│ │ └── net
│ │ └── leahmc
│ │ └── recipes
│ │ └── Plugin.java
│ └── resources
│ └── plugin.yml
so plugin at net.leahmc.recipes.Plugin
main: net.leahmc.recipes.Plugin
this is what it says in the yml
yes
and it cant find the main class
sanity check time
i dont get it lol
okay
They're using a text editor to do this
I don't know why
🤡
can't you do that with datapacks now
1.8
1.8
thatss like saying im not an artist so im gonna use a rock instead of a paintbrush
there should be like a spigot build setup tool
ultra-clown
Intellij has that
there is
its inside of intellij
as a plugin
and then i make the project, put my code, and compile it with the script
again, if it's a simple recipe you should have just used an existing plugin
there is. its. in. intellij.
anyway open up the jar and see where the classes are
yeah but thats like saying "the debugger is part of visual studio"
that's the ground truth
If you don't want to use Intellij
I probably have mentioned this 7 times 😭
I believe mfnalex has a tool to setup projects
lol ok
oh oki
like a few months ago
someone made a cli one
and we all bashed them for it
saying its useless
Maven archetypes exists as well
I was gonna make a CLI for sploon
.
├── META-INF
│ ├── MANIFEST.MF
│ └── maven
│ └── package
│ └── pluginName
│ ├── pom.properties
│ └── pom.xml
├── Plugin.class
└── plugin.yml
??? when i unzip the jar it looks like this
Yea looks good
run clean install
okay..
Wait
but the class is not in the proper package
Do you manually type the command?
mvn clean install?
yes
yes
Make sure you declared package in the class
package nano.my.beloved
oooh
at the very top of the source file, yes
^
before imports
tbf even in intellij I like to type the commands manually sometimes
why
yes
oh okay
definitely more convenient than fiddling with run configs to add command line params you only need to use once
so I don't forget the names of the commands
yeah me too
The name is on the sidebar though
its faster lol
dont wanna click through 10 windows
especially when running more complex commands with flags
idk
mvn clean install -U
it's easier to retain knowledge if you're doing it yourself, it's why homework exists 
ok NOW it has the class
i do the same for git(hub)
im gonna cry diude
.
├── META-INF
│ ├── MANIFEST.MF
│ └── maven
│ └── package
│ └── pluginName
│ ├── pom.properties
│ └── pom.xml
├── net
│ └── leahmc
│ └── recipes
│ └── Plugin.class
└── plugin.yml
🎉
Time to do some crafting
nice
time to inform you to never run /reload in the future as a note or else the plugin will complain about duplicate plugin registration 
reload is silly anyway
oh do i really have to wait the 30 seconds to shutdown and restart the server
and it still takes 30 seconds?
oh no i meant
thats a file i have
but no it does a bunch of other stuff like making world backups
yeah in that case its way slower
no
anyway thank u all i think ive reached a conclusion with this
i just have bad code now
/reload is fine unles ur doing specific stuff
dont let this community gaslight you
and ofc only use it during developoment
I mean, I usually do ./start.sh
lol which one of us is gaslighting
Extremely lazy to type the entire command out
what
wtf do u mean that is the whole command
who manually types the start command
nono that IS the command
java -jar server.jar
fr double click the jar
u mean like bash start.sh??
oh mine is much worse
hold on
/lib/jvm/java-8-openjdk/jre/bin/java -jar -Xmx1024M -Xms1024M ./spigot-1.8.8.jar nogui | tee ./latest.log
what the
I don't know anyone who types out the startup params manually lol
thats nothing
the 30 second loadtime is from java initializing classes, spigot etc, and on shutdown saving etc
not from having to type the start command lol
just specified the java location, usage, nogui and log
huh what's the point of that tee
thank u guys i think i earned a slice of garlic bread after this
Spigot already has a log file
it does??
yes
yea
the tee is so that i can see it in the output and also have it as a file
I use aikar flags so mine are longer 
it uses log4j
spigot has log4j which automatically creates logs
world changing information
Fair
chatting in here is fine-ish when people aren't asking for help but when someone asks for help please try to minimize it, lest you drown out messages like these #help-development message
okay
seems like there is no duplicate of this issue
any modifications you did on bt?
got java 8?
tried using it but it said that there is a jdk minimum
double check you have java 8 downloaded and check the project is set to use it
Detected JDK version 1.8.0-442 (JAVA_HOME=/usr/lib/jvm/java-8-openjdk/jre) is not in the allowed range [9,).
i get this
Cloned from stash?
yes
Why not direct download from jenkins?
I'm trying to port this to 1.19+ since packets change, but I'm getting issues if someone knows how this can be fixed or can give me an updated wiki for protocollib packets that works on 1.19+ lmk
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
protocolManager.addPacketListener(new PacketAdapter(partyPvP, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
Set<EnumWrappers.PlayerInfoAction> actions = packet.getPlayerInfoActions().read(0);
if (actions.contains(EnumWrappers.PlayerInfoAction.ADD_PLAYER) ||
actions.contains(EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE)) {
List<PlayerInfoData> dataList = packet.getPlayerInfoDataLists().readSafely(0);
if (dataList == null || dataList.isEmpty()) {
return;
}
List<PlayerInfoData> modifiedDataList = new ArrayList<>();
for (PlayerInfoData data : dataList) {
if (data != null && data.getProfile() != null) {
UUID uuid = data.getProfile().getUUID();
WrappedChatComponent wrappedDisplayName = data.getDisplayName();
PlayerInfoData modifiedData = new PlayerInfoData(
data.getProfile(),
data.getLatency(),
EnumWrappers.NativeGameMode.CREATIVE,
wrappedDisplayName
);
modifiedDataList.add(modifiedData);
}
}
packet.getPlayerInfoDataLists().write(0, modifiedDataList);
}
}
});
partyPvP.getLogger().info("Custom spectators have been registered!");
}```
cause
yknow
jenkins has been working tirelessly
Hello, how can I read files in a folder embedded in my plugin ?
I tried this but got a ReferencePipeline$Head for BufferedReader#lines : https://paste.md-5.net/bofireyage.java
Well, I'd recommend trying the download from there.
https://hub.spigotmc.org/jenkins/job/BuildTools/
Not entirely sure why you would be getting the error you are getting unless it was a borked jar file.
im trying to compile it through maven currently i'd rather do it this way
what are these issues
Wdym compile through maven? Are you trying to compile it from source and run your own version of it?
yes
Cause BuildTools also uses maven to compile spigot itself.
Ah
Well, then yea, as long as you cloned from master, you should just be able to mvn package it.
just cloned it fresh from stash directly and compiled fine for me
im getting a not in the allowed range error for the jdk version of 1.8.0
https://hub.spigotmc.org/stash/scm/spigot/buildtools.git
Clone link btw
that you told me to use
ik
not setting the bootstrap class path may lead to class files that cannot run on JDK 8
--release 8 is recommended instead of -source 8 -target 1.8 because it sets the bootstrap class path automatically
makes me wonder
but
it is yapping about not being able to use 1.8
also [INFO] BUILD SUCCESS
jdk 23 is borked
i mean 23
BuildTools only works well with Java 21 and below.
AFAIK, Java 23 is still too new to use reliably.
java moment
Straight up
i think you guys should mention that on the readme
because i will totally forget in 5 years when i want to play minecraft again
by then it'll be java 32 that's too new to use reliably
Thx, I fixed it. In modern versions (1.19+) the player info data is at index 1 instead of 0
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
protocolManager.addPacketListener(new PacketAdapter(partyPvP, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
Set<EnumWrappers.PlayerInfoAction> actions = packet.getPlayerInfoActions().read(0);
if (actions.contains(EnumWrappers.PlayerInfoAction.ADD_PLAYER) ||
actions.contains(EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE)) {
List<PlayerInfoData> dataList = packet.getPlayerInfoDataLists().readSafely(1);
if (dataList == null || dataList.isEmpty()) {
return;
}
List<PlayerInfoData> modifiedDataList = new ArrayList<>();
for (PlayerInfoData data : dataList) {
if (data != null && data.getProfile() != null) {
PlayerInfoData modifiedData = new PlayerInfoData(
data.getProfile(),
data.getLatency(),
EnumWrappers.NativeGameMode.CREATIVE,
data.getDisplayName()
);
modifiedDataList.add(modifiedData);
}
}
packet.getPlayerInfoDataLists().write(1, modifiedDataList);
}
}
});
partyPvP.getLogger().info("Custom spectators have been registered!");
}```
Fixed code in case someone needs it
Hopefully our tooling will be much better by then. :/
can someone explain how this doesnt work
ShapelessRecipe golden_carrot = new ShapelessRecipe(
new ItemStack(Material.GOLDEN_CARROT, 1)
);
golden_carrot.addIngredient(4, Material.GOLD_NUGGET);
golden_carrot.addIngredient(1, Material.CARROT);
Bukkit.getServer().addRecipe(golden_carrot);
ive looked through like
the documentation on all of these
the itemstack declaration is deprecated but its apparently still available
4 different demonstrations of this stuff
and they all use this kind of setup but it doesnt work for me
i did try splitting the itemstack into its own variable for sanity checking but that didnt work either
How are you crafting that golden carrot
its a shapelessrecipe so i just place 1 carrot and 4 nuggets anywhere
yes
✨
actually let me log something to see if its actually enabled
thats a smart idea
yup it does
Bukkit.broadcastMessage does something