Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Read all registered potions, biomes, entities and enchants from Minecraft Forge Registry
- //Yes it includes modded ones also
- //For Custom NPCs 1.12.2 scripts
- //Author: Runonstof
- var REGISTRY = Java.type('net.minecraftforge.fml.common.registry.ForgeRegistries');
- function getAllPotions() {
- var POTIONS = REGISTRY.POTIONS.getValues();
- var allPotions = [];
- for (var i in POTIONS) {
- var pot = POTIONS[i];
- var pname = REGISTRY.POTIONS.getKey(pot);
- var pid = REGISTRY.POTIONS.getID(pot);
- allPotions.push({
- 'name': pname.toString(),
- 'id': pid
- });
- }
- return allPotions;
- }
- function getAllEnchants() {
- var ENCHANTS = REGISTRY.ENCHANTMENTS.getValues();
- var allEnchants = [];
- for (var i in ENCHANTS) {
- var ench = ENCHANTS[i];
- var ename = REGISTRY.ENCHANTMENTS.getKey(ench);
- var eid = REGISTRY.ENCHANTMENTS.getID(ench);
- allEnchants.push({
- 'name': ename.toString(),
- 'id': eid
- });
- }
- return allEnchants;
- }
- function getAllBiomes() {
- var BIOMES = REGISTRY.BIOMES.getValues();
- var allBiomes = [];
- for (var i in BIOMES) {
- var bio = BIOMES[i];
- var bname = REGISTRY.BIOMES.getKey(bio);
- var bid = REGISTRY.BIOMES.getID(bio);
- allBiomes.push({
- 'name': bname.toString(),
- 'id': bid
- })
- }
- return allBiomes;
- }
- function getAllEntities() {
- var ENTITIES = REGISTRY.ENTITIES.getValues();
- var allEntities = [];
- for (var i in ENTITIES) {
- var entity = ENTITIES[i];
- var bname = REGISTRY.ENTITIES.getKey(entity);
- var bid = REGISTRY.ENTITIES.getID(entity);
- allEntities.push({
- 'name': bname.toString(),
- 'id': bid
- })
- }
- return allEntities;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement