minevn / NMSLibrary

library for minecraft plugin that using nms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation

  • Copy NMSLibrary.jar to plugins folder
  • Download here: releases

Maven

  <repositories>
  	<repository>
  	    <id>jitpack.io</id>
  	    <url>https://jitpack.io</url>
  	</repository>
  </repositories>
	<dependency>
	    <groupId>com.github.RemVN.NMSLibrary</groupId>
	    <artifactId>NMSLibrary_API</artifactId>
	    <version>1.3</version>
	    <spoce>provided</scope>
	</dependency>

How to use

I. Depend it in your plugins.yml:

depend: [NMSLibrary]

II. Usage

Adding a String tag to ItemStack

		ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
		NBT nbt = NMSLibrary.getAPI().getNBT();
		nbt.addStringTag(item, "TagName", "TagValue");

Getting a String tag from ItemStack

		ItemStack item = new ItemStack(Material.DIAMOND_SWORD);
		NBT nbt = NMSLibrary.getAPI().getNBT();
		String value = nbt.getStringTag(item, "TagName");

About

library for minecraft plugin that using nms


Languages

Language:Java 100.0%