LuckPerms

LuckPerms

41.4k Downloads

LuckPermsAPI not working in project

hamelech2007 opened this issue ยท 20 comments

commented

I am trying to create a plugin that can give a rank through a command and I need luckperms api for it but I cant make it work. I've downloaded the jar and used it in the project structure but it doesn't recognize it in the IDE I am using IntelliJ 2020 community edition. I am very new to programming so if someone can help me please do it as detailed as you can. Thank you for any help.

commented

Either use Maven or Gradle for plugin development, because using Jars isn't really good to do.

commented

Do i need to put <dependencies> <dependency> <groupId>net.luckperms</groupId> <artifactId>api</artifactId> <version>5.0</version> <scope>provided</scope> </dependency> </dependencies>} In the pom.xml because when I do put it there it shows invalid element found starting with element.... when I hover on the dependency

commented
  1. Please use code blocks. Inline code is ugly for this.
  2. https://github.com/lucko/LuckPerms/wiki/Developer-API#maven
commented

It's what I typed exactly but it does not work

commented

Then you made something wrong.
We can't read minds, nor see your PC, so actually provide information

commented

Can you tell me what I did wrong?
1
2

commented
    <dependency>
        <groupId>net.luckperms</groupId>
        <artifactId>api</artifactId>
        <version>5.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
commented

Sure you don't already have another

<dependencies>
...
</dependencies>
```?
commented

when I uploaded the .jar of the api it wont show it in the external libraries as a .jar it shows it as a folder and inside it instead of .java there is .html

commented

3

commented

Maybe I am doing everything wrong. Can someone make a step-by-step guide on how to do it in maven

commented

Can someone make a step-by-step guide on how to do it in maven

Learn to use maven. This has nothing to do with LuckPerms. Nothing about the LP API is special in terms of usage with Maven (or Gradle for that matter)

commented

I don't understand

commented

Can you paste your whole pom.xml in https://hasteb.in, but be sure to strike out any passwords (if you have some in there)

commented

is there any thing wrong here?

commented
<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>me.hamelech2007</groupId>
    <artifactId>Signs</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Signs</name>

    <description>signs</description>
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <defaultGoal>clean package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.15.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
             <groupId>net.luckperms</groupId>
             <artifactId>api</artifactId>
             <version>5.0</version>
             <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

Try that

commented

it shows a problem with .luckperms

commented

LP should work the same way. I am not sure what you are doing wrong.

commented

I use another API in my project and all I had to do is just put the .jar in the project structure and everything worked fine.

commented

I am stupid... I've put the wrong .jar. Thank you for anyone who tried helping me. I'm sorry for wasting your time.