NBT-API

NBT-API

98.9k Downloads

Unable to invoke new NBTTileEntity(state).toString()

ShirasawaSama opened this issue ยท 3 comments

commented

Unable to invoke new NBTTileEntity(block.getState()).toString().

Exception:

[21:54:18 WARN]: de.tr7zw.nbtapi.NbtApiException: Exception while getting NBTCompound from TileEntity!
[21:54:18 WARN]:        at item-nbt-api-plugin-2.8.0.jar//de.tr7zw.nbtapi.NBTReflectionUtil.getTileEntityNBTTagCompound(NBTReflectionUtil.java:235)
[21:54:18 WARN]:        at item-nbt-api-plugin-2.8.0.jar//de.tr7zw.nbtapi.NBTTileEntity.getCompound(NBTTileEntity.java:36)
[21:54:18 WARN]:        at item-nbt-api-plugin-2.8.0.jar//de.tr7zw.nbtapi.NBTCompound.asNBTString(NBTCompound.java:771)
[21:54:18 WARN]:        at item-nbt-api-plugin-2.8.0.jar//de.tr7zw.nbtapi.NBTCompound.toString(NBTCompound.java:743)
[21:54:18 WARN]:        at NekoMaid-1.0-SNAPSHOT.jar//cn.apisium.nekomaid.builtin.Editors.lambda$null$3(Editors.java:66)
[21:54:18 WARN]:        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[21:54:18 WARN]:        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101)
[21:54:18 WARN]:        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[21:54:18 WARN]:        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1550)
[21:54:18 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:480)
[21:54:18 WARN]:        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1465)
[21:54:18 WARN]:        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1261)
[21:54:18 WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317)
[21:54:18 WARN]:        at java.base/java.lang.Thread.run(Thread.java:831)
[21:54:18 WARN]: Caused by: de.tr7zw.nbtapi.NbtApiException: Error while calling the method 'save', loaded: true, Enum: TILEENTITY_GET_NBT
[21:54:18 WARN]:        at item-nbt-api-plugin-2.8.0.jar//de.tr7zw.nbtapi.utils.nmsmappings.ReflectionMethod.run(ReflectionMethod.java:164)
[21:54:18 WARN]:        at item-nbt-api-plugin-2.8.0.jar//de.tr7zw.nbtapi.NBTReflectionUtil.getTileEntityNBTTagCompound(NBTReflectionUtil.java:230)
[21:54:18 WARN]:        ... 13 more
[21:54:18 WARN]: Caused by: java.lang.NullPointerException
[21:54:18 WARN]:        at jdk.internal.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
[21:54:18 WARN]:        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[21:54:18 WARN]:        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[21:54:18 WARN]:        at item-nbt-api-plugin-2.8.0.jar//de.tr7zw.nbtapi.utils.nmsmappings.ReflectionMethod.run(ReflectionMethod.java:162)
[21:54:18 WARN]:        ... 14 more

Version

NBTAPI

2.8.0

Server

> ver
[21:54:20 INFO]: Checking version, please wait...
[21:54:22 INFO]: This server is running Tuinity version git-Tuinity-"6fd7e2b" (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: 6fd7e2b on HEAD)
You are running the latest version
Previous version: git-Tuinity-26 (MC: 1.17.1)
commented

Pretty sure you called this for a non BlockEntity(Tileentity).

commented

Yes.

So I can't update BlockData by modifying BlockState NBT?

commented

Blocks don't have NBT, so no.
Only BlockEntities do. For example: Chests, Furnance, Shulkers, Signs etc.