I am able to get the item from a container slot by using world.containerItemAt(), but for some reason everytime I do Item.price, it always returns 1. Here's some code: local Item = world.containerItemAt(entity.id(),0) --Name and Count world.spawnItem("money",Pos,Item.price,Item.parameters)
Default* item JSON. The item parameters overwrite the default parameters. If the price parameter is missing on the item (nil or type(param) ~= "number"), you can assume the default price from the itemConfig function. I assume the count parameter is nullable and defaults to 1, which if why you're ending up with one pixel. PHP: local itemPrice = 0if Item.parameters and type(Item.parameters.price) == "number" then itemPrice = Item.parameters.priceelse local itemConfig = root.itemConfig(Item.name) itemPrice = itemConfig.config.price or 0endif itemPrice > 0 then world.spawnItem("money",Pos,itemPrice)end (Also you probably don't want to spawn money with the parameters of the actual item)