High-Fox / InventoryActions

Allows various interactions between blocks and items to be performed within the inventory. Now data-driven!
https://www.curseforge.com/minecraft/mc-mods/inventory-actions
MIT License
1 stars 0 forks source link

setting amount on give_items #4

Open dadoirie opened 1 year ago

dadoirie commented 1 year ago

since there is no discord where I could ask I'll post it here - sorry about that


{
  "type": "inventoryactions:give_items",
  "items": [
    {
      "type": "inventoryactions:mapped",
      "source": "action_target",
      "item_map": {
        "minecraft:oak_planks":"minecraft:oak_slab"
      }
    }
  ]
},
{
  "type": "inventoryactions:give_items",
    "items": [
      {
        "type": "inventoryactions:mapped",
          "source": "action_target",
          "item_map": {
          "minecraft:oak_planks":"minecraft:oak_slab"
        }
      }
    ]
 },```

the only way I managed it to make it work - but obviously there is surely another way
I've checked the wiki, but no real explanation regarding this

I've tried 
`
{
  "type": "inventoryactions:give_items",
  "items": [
  {
    "type": "inventoryactions:mapped",
    "source": "action_target",
    "item_map": {
      "minecraft:oak_planks":"minecraft:oak_slab"
    },
    "amount":2
     }
   ]
 }`
and also
` 
{
  "type": "inventoryactions:give_items",
  "items": [
  {
     "type": "inventoryactions:mapped",
     "source": "action_target",
      "item_map": {
        "minecraft:oak_planks":"minecraft:oak_slab"
      }
    }
  ],
  "amount":2
 }`
and both didn't worked

what would be the right way to do it?

UPDATE: code formatting 
UPDATE2: sorry about the awful code indentation which I don't now how to do  on github -.-

UPDATE3: https://pastebin.com/k0ZNTuac 
this is the action file here (with better code indentation) and showing what I'm trying to accomplish