Reputation: 21
I've been getting a Bukkit(minecraft) package problem!
package org.bukkit does not exist
I'm using ThirtyVirus (a MineCraft coding YouTuber) template plugin.
edit: you can see the code in github templateplugin
Upvotes: 2
Views: 7108
Reputation: 3
If you are using Maven or Gradle, you can Spigot and Bukkit by directly implementing their repo. If you are using IntelliJ IDEA's Artifact Builder, you can build a jar for yourself by Build Tools and it will solve every thing for you, and sorry i dont know about Eclipse, as i havent used it yet
https://www.spigotmc.org/wiki/buildtools/ This is a link to Build Tools for Spigot, which works for every version from 1.8 to 1.16.4 (Latest), if you build a jar from BuildTools you get access to a lot of tools which you cant get from direct repo.
Upvotes: 0
Reputation: 108
First: There are countless repos on GitHub with the name "templateplugin", so we would already need a link.
But I think you mean this one: https://github.com/ThirtyVirus/Plugin_Template
I'm pretty sure you simply forgot to add the Bukkit dependency.
Maven
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Gradle
repositories {
mavenCentral() // This is needed for dependencies.
/*
As Spigot-API depends on the Bungeecord ChatComponent-API,
we need to add the Sonatype OSS repository, as Gradle,
in comparison to maven, doesn't want to understand the ~/.m2
directory unless added using mavenLocal(). Maven usually just gets
it from there, as most people have run the BuildTools at least once.
This is therefore not needed if you're using the full Spigot/CraftBukkit,
or if you're using the Bukkit API.
*/
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
// mavenLocal() // This is needed for CraftBukkit and Spigot.
}
dependencies {
// Pick only one of these and read the comment in the repositories block.
compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT' // The Spigot API with no shadowing. Requires the OSS repo.
compileOnly 'org.bukkit:bukkit:1.12.2-R0.1-SNAPSHOT' // The Bukkit API with no shadowing.
compileOnly 'org.spigotmc:spigot:1.12.2.-R0.1-SNAPSHOT' // The full Spigot server with no shadowing. Requires mavenLocal.
compileOnly 'org.bukkit:craftbukkit:1.12.2-R0.1-SNAPSHOT' // The full CraftBukkit server with no shadowing. Requires mavenLocal.
}
If you do not use maven or gradle, you should learn how to use at least one of them. Otherwise, (not recommended), you can add a jar file as a library locally.
Upvotes: 2