Skip to content

minevn/NMSLibrary

Repository files navigation

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");