Class SNBTConverter
java.lang.Object
io.github.projectunified.craftitem.nbt.SNBTConverter
Converts Java objects to SNBT (Minecraft's text NBT format).
Takes maps, lists, arrays, and primitives and turns them into SNBT strings. Handles all the NBT types (byte, short, int, long, float, double, arrays, etc.) with proper formatting.
Bonus Feature - Data Component Format:
Pass true to the second parameter of convert(Object, boolean) to use the newer
data component format (brackets and equals instead of braces and colons).
-
Method Summary
-
Method Details
-
convert
Converts a value to SNBT string format- Parameters:
value- The value to convert- Returns:
- SNBT formatted string
-
convert
Converts a value to SNBT string format- Parameters:
value- The value to convertuseDataComponentFormat- If true, use Minecraft data component format- Returns:
- SNBT formatted string
-