Skip to content

Instantly share code, notes, and snippets.

@apaleslimghost
Last active June 24, 2020 19:48
Show Gist options
  • Save apaleslimghost/36a9b2e58ea3ed5c382eeef0d0d69f3b to your computer and use it in GitHub Desktop.
Save apaleslimghost/36a9b2e58ea3ed5c382eeef0d0d69f3b to your computer and use it in GitHub Desktop.
module.exports = function setNbtValue(nbt, [key, ...rest], value) {
if(!nbt || nbt.value) return
if(rest.length === 0) {
nbt.value[key].value = value
} else {
setNbtValue(nbt.value[key], rest, value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment