LootTable API icon

LootTable API -----

Allows developers to create Loot Tables directly in their projects.



Loot Table API

Introduction

This API allows developers to create loot tables in classes easily, all you have to do is extend the LootTable class.


Code Samples


Sample Loot Table

Code (Java):
public class SampleLoot extends LootTable {

    @Override
    public List <Pool > pools ( ) {
        List <Entry > entries = new ArrayList <> ( ) ;
        Entry diaPick = new Entry. EntryBuilder ( )
                //In this version, you have to include all the methods.
                . setEnchantmentList ( new ArrayList <> ( Arrays. asList (Enchantment. MENDING, Enchantment. DAMAGE_ALL ) ) )
                . setExplosionDecay ( false )
                . setFortune ( false )
                . setItem ( new ItemStack (Material. DIAMOND_PICKAXE ) )
                . setMaxCount ( 2 )
                . setMinCount ( 1 )
                . setMaxLevel ( 5 )
                . setMinLevel ( 2 )
                . setSilkTouch ( false )
                . setType (Entry. EntryType. ITEM )
                . setWeight ( 30 )
                . build ( ) ;

        Entry cobble = new Entry. EntryBuilder ( )
                . setEnchantmentList ( new ArrayList <> ( Arrays. asList (Enchantment. MENDING, Enchantment. DAMAGE_ALL ) ) )
                . setExplosionDecay ( false )
                . setFortune ( false )
                . setItem ( new ItemStack (Material. COBBLESTONE ) )
                . setMaxCount ( 2 )
                . setMinCount ( 1 )
                . setMaxLevel ( 5 )
                . setMinLevel ( 2 )
                . setSilkTouch ( false )
                . setType (Entry. EntryType. ITEM )
                . setWeight ( 60 )
                . build ( ) ;

        entries. add (diaPick ) ;
        entries. add (cobble ) ;
        Pool pool = new Pool (entries, 1, 5, 0 ) ;


        return new ArrayList <> ( Arrays. asList (pool ) ) ;
    }

Getting the loot from the table
Code (Java):
LootTable sampleLoot = new SampleLoot ( ) ;
ItemStack item = LootTable. getLoot (sampleLoot ) ;
## Installation

>Current version: 0.1a

maven

Code (Text):
    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>


    <dependency>
        <groupId>com.github.EvilTerabite</groupId>
        <artifactId>BitsLootTableAPI</artifactId>
        <version>VERSION</version>
    </dependency>

gradle

Code (Text):

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }



    dependencies {
            implementation 'com.github.EvilTerabite:BitsLootTableAPI:<VERSION>'
    }
 
Resource Information
Author:
----------
Total Downloads: 98
First Release: Jun 5, 2021
Last Update: Jun 5, 2021
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings