Trying to represent an InputItem / Ingredient w/ amount in json, but running into strange issues. InputItem#toJson() returns in the form { ingredient: {...}, count: 1 } when I need it to be { item: 'foo:bar' , count: 1} or { tag: '#foo:bar' , count: 1}.
This is what I'm currently trying, however addProperty keeps adding the value as a string instead of a number
let test = InputItem.of('2x minecraft:gold_ingot')
let test2 = test.ingredient.toJson().getAsJsonObject()
test2.addProperty('count', test.count)
console.log(test2)
//log output
[17:02:57] [INFO] server_scripts:recipes/hexerei.js:27: {count="2", item="minecraft:gold_ingot"} [java.util.HashMap]