Last active
June 24, 2020 19:48
-
-
Save apaleslimghost/36a9b2e58ea3ed5c382eeef0d0d69f3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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