LO
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
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
LootTable sampleLoot = new SampleLoot();
ItemStack item = LootTable.getLoot(sampleLoot);
## Installation
>Current version: 0.1a
maven
<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
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.EvilTerabite:BitsLootTableAPI:<VERSION>'
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta