X

THANK YOU!

Post has been reported succesfully.

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

1

Add experience orb drops to loot tables

5 Comments

Post a new comment:

Please sign in to leave a comment.

  • Avatar
    Bilbo Baggins commented

    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.

  • Avatar
    Jace Cynth commented

    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.
  • Avatar
    Bilbo Baggins commented

    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.

  • Avatar
    Jace Cynth commented

    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.

  • Avatar
    Bilbo Baggins commented

    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.