Skip to content

Instantly share code, notes, and snippets.

@EthanWall
Created June 9, 2023 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EthanWall/8d4491d09d4d88c0ae8f1260d3c09eca to your computer and use it in GitHub Desktop.
Save EthanWall/8d4491d09d4d88c0ae8f1260d3c09eca to your computer and use it in GitHub Desktop.
CraftTweaker script to add Dragon Mounts: Reborn eggs to dungeon loot
import crafttweaker.api.loot.condition.LootTableIdLootCondition;
import crafttweaker.api.loot.modifier.CommonLootModifiers;
import crafttweaker.api.loot.condition.LootConditions;
// Aether
loot.modifiers.register(
"aether_egg_dungeon_chest",
LootConditions.only(LootTableIdLootCondition.create("minecraft:chests/simple_dungeon")),
CommonLootModifiers.addWithChance(<item:dragonmounts:dragon_egg>.withTag({ItemName: "dragon_breed.dragonmounts.aether", BlockEntityTag: {HatchTime: 12000, Breed: "dragonmounts:aether"}}) % 20)
);
// Fire
loot.modifiers.register(
"fire_egg_pyramid_chest",
LootConditions.only(LootTableIdLootCondition.create("minecraft:chests/desert_pyramid")),
CommonLootModifiers.addWithChance(<item:dragonmounts:dragon_egg>.withTag({ItemName: "dragon_breed.dragonmounts.fire", BlockEntityTag: {HatchTime: 12000, Breed: "dragonmounts:fire"}}) % 8.5)
);
// Forest
loot.modifiers.register(
"forest_egg_temple_chest",
LootConditions.only(LootTableIdLootCondition.create("minecraft:chests/jungle_temple")),
CommonLootModifiers.addWithChance(<item:dragonmounts:dragon_egg>.withTag({ItemName: "dragon_breed.dragonmounts.forest", BlockEntityTag: {HatchTime: 12000, Breed: "dragonmounts:forest"}}) % 30)
);
// Ghost
var ghost_egg = <item:dragonmounts:dragon_egg>.withTag({ItemName: "dragon_breed.dragonmounts.ghost", BlockEntityTag: {HatchTime: 12000, Breed: "dragonmounts:ghost"}});
loot.modifiers.register(
"ghost_egg_mineshaft_chest",
LootConditions.only(LootTableIdLootCondition.create("minecraft:chests/abandoned_mineshaft")),
CommonLootModifiers.addWithChance(ghost_egg % 7.5)
);
loot.modifiers.register(
"ghost_egg_mansion_chest",
LootConditions.only(LootTableIdLootCondition.create("minecraft:chests/woodland_mansion")),
CommonLootModifiers.addWithChance(ghost_egg % 20)
);
// Ice
loot.modifiers.register(
"ice_egg_igloo_chest",
LootConditions.only(LootTableIdLootCondition.create("minecraft:chests/igloo_chest")),
CommonLootModifiers.addWithChance(<item:dragonmounts:dragon_egg>.withTag({ItemName: "dragon_breed.dragonmounts.ice", BlockEntityTag: {HatchTime: 12000, Breed: "dragonmounts:ice"}}) % 20)
);
// Nether
loot.modifiers.register(
"nether_egg_bastion_chest",
LootConditions.only(LootTableIdLootCondition.create("minecraft:chests/bastion_treasure")),
CommonLootModifiers.addWithChance(<item:dragonmounts:dragon_egg>.withTag({ItemName: "dragon_breed.dragonmounts.nether", BlockEntityTag: {HatchTime: 12000, Breed: "dragonmounts:nether"}}) % 35)
);
// Water
loot.modifiers.register(
"water_egg_treasure_chest",
LootConditions.only(LootTableIdLootCondition.create("minecraft:chests/buried_treasure")),
CommonLootModifiers.addWithChance(<item:dragonmounts:dragon_egg>.withTag({ItemName: "dragon_breed.dragonmounts.water", BlockEntityTag: {HatchTime: 12000, Breed: "dragonmounts:water"}}) % 17.5)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment