1.12.2 NBT is not imported

Discussion in 'Spigot Plugin Development' started by Lemar98, Feb 25, 2020.

  1. Hi everyone!
    I have a little problem...

    I use paper 1.12.2 (maven)

    I need use the nbt tags in my plugin, but it is not imported. I have no "net.minecraft.server" package... How i do to fix it?

    Maybe paper not contains nbt ?
     
  2. 1) This is Spigot, not paper
    2) Show us your pom, please
    3) Do you know about the PersistentDataHolder-API?
     
  3. 1) I know it
    2) wait five minutes)
    3) I know what it is in 1.14 version api, but no in 1.12
     
  4. Code (Text):
    <?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>ru.lemar98</groupId>
        <artifactId>survivaltaiga</artifactId>
        <version>0.1</version>
        <packaging>jar</packaging>

        <name>SurvivalTaiga</name>

        <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>
                                <relocations>
                                    <relocation>
                                        <pattern>com.zaxxer.hikari</pattern>
                                        <shadedPattern>ru.lemar98.survivaltaiga.shade.com.zaxxer.hikari</shadedPattern>
                                    </relocation>
                                </relocations>
                                <createDependencyReducedPom>false</createDependencyReducedPom>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>
        </build>

        <repositories>
            <repository>
                <id>destroystokyo-repo</id>
                <url>https://repo.destroystokyo.com/repository/maven-public/</url>
            </repository>
            <repository>
                <id>sonatype</id>
                <url>https://oss.sonatype.org/content/groups/public/</url>
            </repository>
        </repositories>

        <dependencies>
            <dependency>
                <groupId>com.destroystokyo.paper</groupId>
                <artifactId>paper-api</artifactId>
                <version>1.12.2-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
                <version>LATEST</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </project>
     
     
  5. anyone help me?
     
  6. The API, just like when you only import Bukkit, does not contain NMS classes; so it doesn't contain NBT either. Not sure if there's an equivalent to craftbukkit in paper, that's on you to find out.