Skip to content

Commit

Permalink
Loot Generates event: context.loot_table_id
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 12, 2021
1 parent d73c239 commit d4055e0
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -38,6 +38,7 @@ public class LootGenerateScriptEvent extends BukkitScriptEvent implements Listen
// <context.entity> returns an entity that caused loot generation, if any.
// <context.inventory> returns the InventoryTag that loot is generating into.
// <context.items> returns a ListTag of the items being generated.
// <context.loot_table_id> returns an element indicating the minecraft key for the loot-table that was generated.
//
// @Determine
// "LOOT:" + ListTag(ItemTag) to change the list of items that will generate as loot.
Expand Down Expand Up @@ -117,6 +118,9 @@ else if (name.equals("items")) {
}
return result;
}
else if (name.equals("loot_table_id")) {
return new ElementTag(event.getLootTable().getKey().toString());
}
return super.getContext(name);
}

Expand Down

0 comments on commit d4055e0

Please sign in to comment.