How to make a mob drop a cooked version of it's drop when on fire

Started by Cosmic_Mango33 on

Topic category: Help with modding (Java Edition)

Last seen on 15:10, 2. Jan 2023
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a mob drop a cooked version of it's drop when on fire

I'm trying to make a squid drop a custom item when it is on fire and I have no clue where to start. I have created a loot table to make it drop both ink sacs and raw calamari, but I don't know how to make it drop cooked calamari if it is on fire when killed. I have already created the raw and cooked calamari items.

Last seen on 07:06, 18. May 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if entity dies and if entity…
Thu, 10/20/2022 - 12:56

if entity dies and if entity is on fire drop cooked meat

Last seen on 15:10, 2. Jan 2023
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I figured it out by myself…
Thu, 10/27/2022 - 16:20

I figured it out by myself. If anyone wants to know how I did it, I entered this code:

If you want to change it for your specific mob, change where it says "name": "more_meat:raw_calamari" to "name": "[name of mod or minecraft if it is a minecraft item]:[raw food name]" and then change the min and max to the minimum and maximum amount of the item you want it to drop. You would also have to change the ink sac part to whatever other item you wanted, or delete it if you only want it to drop the one item

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "more_meat:raw_calamari",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1,
                "max": 3
              }
            },
            {
              "function": "minecraft:furnace_smelt",
              "conditions": [
                {
                  "condition": "minecraft:entity_properties",
                  "entity": "this",
                  "predicate": {
                    "flags": {
                      "is_on_fire": true
                    }
                  }
                }
              ]
            },
            {
              "function": "minecraft:looting_enchant",
              "count": {
                "min": 0,
                "max": 1
              }
            }
          ]
        }
      ]
    },
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:ink_sac",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1,
                "max": 3
              }
            },
            {
              "function": "minecraft:looting_enchant",
              "count": {
                "min": 0,
                "max": 1
              }
            }
          ]
        }
      ]
    }
  ]
}