#glow_lichen drops

1 messages · Page 1 of 1 (latest)

runic rivet
#

I have a command that summons a custom item wen glow_lichen is mined. (with anything)
I actually want the item to drop in place of the block that was destroyed.
at its spawing where the player is not where the block was.

and glow lichen doesn't drop an item when mined (unless using sheers) so how would you go abou it?

short kestrelBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1742568987:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

#
⚠️ You already have a question open!

Don't forget to close or resolve your old questions once you're done with them. It makes our lives much easier! :D

Open question: #1352059452563390475

loud hornet
#

change the loot table

dusty sphinx
#

Why not replace the glow lichen loot table so it does drop something when mined without shears?

runic rivet
loud hornet
#

yes

#

you can use any predicate and combination of it you want

runic rivet
#

in the glow_lichen loot table. I've added the conditions following the same format as the normal one to no avail.
what am i missing? I have properties north/east/west/south/up/north like the base file but i tried it without that property as well.


            {
              "add": true,
              "conditions": [
                {
                  "condition": "minecraft:location_check",  
                  "predicate": {
                    "dimension": "minecraft:the_end"
                  },                  
                  "properties": {
                    "east": "true"
                  }
                }
              ],
              "count": 1.0,
              "function": "endwarves:event/drop_lichen_crystal"
            },

drop_lichen_crystal is

loot spawn ~ ~ ~ loot endwarves:lichencrystal
dusty sphinx
#

That's not how loot table functions work

#

In loot tables, functions refers to specific operations or changes that you can apply to an entry, not an mcfunction. The formatting is similar to conditions, being a list of objects.

For example, you don't define the count in the loot table entry directly, you apply a set_count function

runic rivet
dusty sphinx
#

Predefined functions. Again, use Misode, because I'm looking at the Glow Lichen loot table right now and it definitely does not have a count outside of a set_count function

#

To make it drop your custom item, you can make the entry type loot_table instead of item, and make it reference your endwarves:lichencrystal loot table

#

Which is what I do

runic rivet
#

this is the file i pulled straight from thhe 1.21.4 loot_table

dusty sphinx
#

Look at it closer. Those are set_count functions

#

Each set_count function itself has conditions, because it's accounting for all the different combinations of blockstates

#

I think the issue is a semantic one; you've made changes to the file without understanding how the original worked, and I was commenting on just the small snippet I could see, and so didn't have the full context to realize that you had modified a set_count function, not an entry

#

Let's simplify this for you. Start from the original glow_lichen loot table, use Misode, and add a new pool. Don't copy and modify the original pool, just add a new one, and give it the location_check condition. Then you can add an entry to that pool that is your custom item's loot table

runic rivet
dusty sphinx
#

In what context?

#

Oh that, it's just in reference to how Minecraft's random number generator works. It's so the random seed for a particular loot table or type can be reset or otherwise proceed in sequence independently of other loot tables or types. You can completely ignore it

loud hornet
#

It just happens to be the path to the file in the default files but they could be any string.

#

If you don't input anything, mc will generate one in the background automatically

runic rivet
#

SO, the first entry type determines output?

the second part, function determins what to do when condition is met, so if condition is using sheers on a specific block state, or using anything on a specific blocktype ect.
conditions are restrictions on when this function will be executed?
is that the right understanding?

{
  "type": "minecraft:block",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:loot_table",
          "value": "endwarves:lichencrystal",
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": 0,
              "add": true
            }
          ],
          "conditions": [
            {
              "predicate": {
                "dimension": "minecraft:the_end"
              },
              "condition": "minecraft:location_check"
            }
          ]
        }
      ]
    }
  ],
  "random_sequence": "minecraft:blocks/glow_lichen"
}```
#

btw this works i'm just trying to see if my understanding is correct

loud hornet
#

kind of. Conditions are restrictions but depending on where you place them in your loot table they can determine when to run specific functions or if it should drop anything at all.

#

That means they are not specifically restricted to functions

dusty sphinx
#

In this particular case, the condition is being applied to the entry, not the function. It's a condition on whether this entry can be selected, and if it is, the function will always apply to it.

#

Which is what you would want here

runic rivet
#

right so in the base file we have two conditions.
one on the entry that is use of shares.
the second is on the actual function, which is to drop 1 item when a share is used on a specific block state.
this in turn enables a glow_lichen block with 5 true block states to drop 5 items essentially.
is that right?

dusty sphinx
#

Exactly

runic rivet
#

thank you kindley onto the next hurdle