X

NOTICE

Are you sure you want to report this?

A feedback area designed for scripting and mods suggestions and feedback. Please note bug reports and support issues will be removed.

5

Add experience orb drops to loot tables

6 Comments

Post a new comment:

Please sign in to leave a comment.

  • 0
    Bilbo Baggins commented
    Comment actions Permalink

    Are the loot tables hardcoded (which they are)?  Are the experience orb drops hardcoded (which they are)?  Are you saying that they should not be hardcoded?  Are you saying that experience orbs should be part of loot tables?  I think the last question is correct.  I will base this comment on it.

    Loot tables are arrays of items.  It would be impossible to add entities to a list of items.

  • 0
    Jace Cynth commented
    Comment actions Permalink

    In java, you can modify the loot tables using data packs.

     

    "Loot tables are arrays of items.  It would be impossible to add entities to a list of items."

     
    That's exactly what this suggestion is about. To add a "type": "experience" to loot tables. There's currently a "type": "loot_table", "type": "empty" and "type": "item" right now.
     
    It's not impossible. No idea what you're talking about there. They code stuff, it's possible.
  • 0
    Bilbo Baggins commented
    Comment actions Permalink

    I will try to explain.

    Loot_table = {Items.iron_ingot, 3, Items.gold_ingot, 2, Items.diamond, 1};

    Actions.drop_items(Loot_table);

    Actions.spawn_entity(Experience_orb.class, 3);

    This is a basic example of code put in the onDeath() function, which is called when an entity dies.  This would drop 3 xp orbs, 3 iron ingots, 2 gold ingots, and 1 diamond.  Now, if you were to do this:

    Loot_table = {Items.iron_ingot, 3, Items.gold_ingot, 2, Items.diamond, 1, Experience_orb.class, 3};

    Actions.drop_items(Loot_table);

    The game would crash.  An entity physically cannot be dropped as an item.  I hope this helps.

  • 0
    Jace Cynth commented
    Comment actions Permalink

    I don't recall saying to drop it as an item though.

     

    The loot table should be made if the "type" is "experience", it drops the amount of experience orb entities that you specify. Not "type": "item", which I've already explained.

  • 0
    Bilbo Baggins commented
    Comment actions Permalink

    So the loot table is an array of items and entities combined, and it detects whether it is an item or an entity, and if it is an item, it drops an item, and if it is an entity, it drops an entity.

    I forgot to clarify that type(experience) is entity.

  • 0
    Shnupbups commented
    Comment actions Permalink

    This would be greatly beneficial for a multitude of reasons.

    Block loot tables would of course give the experience when mining the block, like Coal Ore, Redstone Ore, Lapis Lazuli Ore, Diamond Ore, Emerald Ore, and Nether Quartz Ore.

    Entity loot tables would of course give the experience on killing the entity.

    Fishing loot tables would of course give the experience upon reeling the rod in.

    Chest loot tables would give the experience upon opening the chest for the first time, when the loot is generated.

    The Piglin Bartering, Cat Morning Gift, and Hero of the Village loot table would give the experience along with the resulting item(s).