Added readFromNBT and logic