/ Lucky drop: iron tools
group(ID=iron_shovel;ID=iron_pickaxe;ID=iron_axe;ID=iron_sword;ID=iron_hoe)@luck=2

/ Unlucky drop: explosion
type=explosion,radius=4,fire=true@luck=-2

Id=clay,amount=5@luck=1



group(group:1:(ID=wool,damage=#rand(0,15),amount=#rand(32,64);ID=stained_hardened_clay,damage=#rand(0,15),amount=#rand(32,64);ID=dye,damage=#rand(0,15),amount=#rand(32,64));type=particle,ID=splashpotion,potion=#randPotion,amount=10)@luck=1

type=structure,ID=clay_shop_lucky_block,pos=#pPos,rotation=#pDirect
type=structure,ID=lucky_clay_hart,pos=#pPos,rotation=#pDirect


ID=gold_ingot,amount=#rand(8,16)@luck=1
ID=stick@luck=-1
ID=painting,amount=4@luck=0
ID=saddle,amount=2@luck=0
ID=cake@luck=0
ID=rotten_flesh@luck=-1
ID=nether_star@luck=2
ID=red_flower,NBTTag=(display=(Name="$cRomantic Rose"))@luck=-1
ID=rabbit_stew,amount=#rand(5,7)@luck=1

/ ========== ENTITIES ==========

/ lucky mobs
group:1:(type=entity,ID=Pig,NBTTag=(CustomName="$e$lLucky Pig",CustomNameVisible=true);type=entity,ID=Cow,NBTTag=(CustomName="$e$lLucky Cow",CustomNameVisible=true);type=entity,ID=Chicken,NBTTag=(CustomName="$e$lLucky Chicken",CustomNameVisible=true);type=entity,ID=Sheep,NBTTag=(CustomName="$e$lLucky Sheep",CustomNameVisible=true);type=entity,ID=Rabbit,NBTTag=(CustomName="$e$lLucky Rabbit",CustomNameVisible=true);type=entity,ID=Squid,NBTTag=(CustomName="$e$lUnlucky Squid",CustomNameVisible=true))@luck=0
/ colored sheep
type=entity,ID=Sheep,NBTTag=(CustomName="$cM$6r. $eR$aa$2i$bn$3b$5o$dw",CustomNameVisible=true,Color=#rand(0,15)),posOffset=#circleOffset(4),amount=16@luck=1

/ eggs + diamonds
group(type=entity,ID=egg,NBTTag=(Motion=#randLaunchMotion(0.6,15)),amount=40;type=entity,ID=Item,NBTTag=(Item=(id=diamond,Count=1),Motion=#randLaunchMotion(0.7,18)),amount=20)@luck=2

/ thrown exp bottles
type=entity,ID=xp_bottle,NBTTag=(Motion=#randLaunchMotion),amount=#rand(16,32)@luck=2
/ launched tnt
type=entity,ID=tnt,NBTTag=(Fuse=50b,Motion=#randLaunchMotion),amount=15@luck=-2

/ lightning creeper
group(type=difficulty,ID=hard;type=entity,ID=Creeper;type=entity,ID=LightningBolt)@luck=-2
/ giant
group(type=difficulty,ID=hard;type=entity,ID=Giant)@luck=-2
/ wither
group(type=difficulty,ID=hard;type=entity,ID=wither)@chance=0.1@luck=-2
/ ghast
group(type=difficulty,ID=hard;type=entity,ID=Ghast)@chance=0.2@luck=-2
/ elder guardian
group(type=difficulty,ID=hard;type=entity,ID=Guardian,NBTTag=(Elder=1)))@chance=0.5@luck=-2
/ killer rabbit
group(type=difficulty,ID=hard;type=entity,ID=Rabbit,NBTTag=(RabbitType=99))@luck=-1
/ bob zombie
group(type=difficulty,ID=hard;type=entity,ID=Zombie,NBTTag=(HandItems=[(id=diamond_sword,Count=1,tag=(ench=#luckySwordEnchantments))],ArmorItems=[(id=diamond_boots,Count=1,tag=(ench=#luckyBootsEnchantments)),(id=diamond_leggings,Count=1,tag=(ench=#luckyLeggingsEnchantments)),(id=diamond_chestplate,Count=1,tag=(ench=#luckyChestplateEnchantments)),(id=diamond_helmet,Count=1,tag=(ench=#luckyHelmetEnchantments))],HandDropChances=[0.5f,0f],ArmorDropChances=[0.3f,0.3f,0.3f,0.3f],CustomName="$9$lBob",CustomNameVisible=true))@luck=-2
/ ghostly horseman skeleton
group(type=difficulty,ID=hard;type=entity,ID=Bat,NBTTag=(Silent=true,ActiveEffects=[(Id=14,Duration=100000,Amplifier=1,ShowParticles=false)],Passengers=[(id=skeleton_horse,Tame=true,Type=4,Passengers=[(id=Skeleton,HandItems=[(id=bow,Count=1,tag=(ench=#luckyBowEnchantments))],ArmorItems=[(id=chainmail_boots,Count=1,tag=(ench=#luckyBootsEnchantments)),(id=chainmail_leggings,Count=1,tag=(ench=#luckyLeggingsEnchantments)),(id=chainmail_chestplate,Count=1,tag=(ench=#luckyChestplateEnchantments)),(id=chainmail_helmet,Count=1,tag=(ench=#luckyHelmetEnchantments))],HandDropChances=[0.5f,0f],ArmorDropChances=[0.3f,0.3f,0.3f,0.3f],CustomName="$7$lGhostly Horseman",CustomNameVisible=true)])]))@luck=-2

/ stacked villager and pigs
type=entity,ID=Pig,NBTTag=(Passengers=[(id=Pig,Passengers=[(id=Pig,Passengers=[(id=Pig,Passengers=[(id=Pig,Passengers=[(id=Pig,Passengers=[(id=Pig,Passengers=[(id=Pig,Passengers=[(id=Villager)])])])])])])])])@luck=0

/ choice of 2 lucky blocks
group:1:(type=structure,ID=lucky_choice_left,rotation=#pDirect;type=structure,ID=lucky_choice_right,rotation=#pDirect)@luck=0

/ wishing wells
group(type=structure,ID=wishing_well;type=message,ID="A wishing well? Maybe you should throw in a coin...";type=command,ID="/give #pName gold_nugget 1 0 {display:{Name:\"$6Coin\"}}";type=block,ID=lucky:lucky_block,posY=#bPosY-3,NBTTag=(Drops=["group(type=message,ID=\"$bYour wish came true!\";type=block,ID=air,posY='#'bPosY+3;type=block,ID=beacon,posY='#'bPosY+2;type=entity,ID=fireworks_rocket,NBTTag=(LifeTime=20,FireworksItem=(id=fireworks,Count=1,tag='#'randFireworksRocket)),amount=20,posY='#'bPosY+3,posOffset='#'circleOffset(2);ID=gold_ingot,amount=#rand(20,30),posY='#'bPosY+10,posOffset='#'circleOffset(2);ID=diamond,amount=#rand(20,30),posY='#'bPosY+10,posOffset='#'circleOffset(2);ID=emerald,amount=#rand(20,30),posY='#'bPosY+10,posOffset='#'circleOffset(2);ID=dye,damage=4,amount=#rand(20,30),posY='#'bPosY+10,posOffset='#'circleOffset(2))"]))@luck=2
group(type=structure,ID=wishing_well;type=message,ID="A wishing well? Maybe you should throw in a coin...";type=command,ID="/give #pName gold_nugget 1 0 {display:{Name:\"$6Coin\"}}";type=block,ID=lucky:lucky_block,posY=#bPosY-3,NBTTag=(Drops=["group(type=message,ID=\"$eYour wish came true! (If you like potatoes)\";type=block,ID=air,posY='#'bPosY+3;type=block,ID=beacon,posY='#'bPosY+2;ID=potato,amount=128,posY='#'bPosY+10,posOffset='#'circleOffset(2);ID=baked_potato,amount=64,posY='#'bPosY+10,posOffset='#'circleOffset(2);ID=poisonous_potato,amount=32,posY='#'bPosY+10,posOffset='#'circleOffset(2))"]))@luck=1
group(type=structure,ID=wishing_well;type=message,ID="A wishing well? Maybe you should throw in a coin...";type=command,ID="/give #pName gold_nugget 1 0 {display:{Name:\"$6Coin\"}}";type=block,ID=lucky:lucky_block,posY=#bPosY-3,NBTTag=(Drops=["group(type=message,ID=\"$4Your death wish came true!\";type=block,ID=air,posY='#'bPosY+3;type=block,ID=beacon,posY='#'bPosY+2;type=entity,ID=tnt,NBTTag=(Fuse=50b,Motion='#'randLaunchMotion),posY='#'bPosY+7,amount=20)"]))@luck=-2

/ lucky items
type=item,ID=lucky:clay_lucky_sword@chance=1.5@luck=2
type=item,ID=lucky:clay_lucky_bow@chance=1.5@luck=2
type=item,ID=lucky:clay_lucky_potion,NBTTag=(Luck=#randList(100,-100)),amount=#rand(10,15)@chance=1.5@luck=2
group(type=item,ID=lucky:clay_lucky_sword;type=item,ID=lucky:clay_lucky_bow;type=item,ID=lucky:clay_lucky_potion,NBTTag=(Luck=#randList(100,-100)),amount=#rand(10,15);type=entity,ID=fireworks_rocket,NBTTag=(LifeTime=20,FireworksItem=(id=fireworks,Count=1,tag=#randFireworksRocket)),amount=20,posOffset=#circleOffset(0,2))@luck=2

/ ========== BLOCKS ==========

ID=sponge,amount=5@luck=1
ID=tnt,amount=8@luck=1
ID=obsidian,amount=14@luck=1
ID=enchanting_table@luck=2
ID=end_portal_frame,amount=#rand(2,6)@luck=2
ID=dragon_egg,amount=14@luck=1
ID=ender_chest,amount=2@luck=0
ID=beacon,amount=5@luck=1
ID=dropper,amount=8@luck=0
ID=hay_block,amount=8@luck=0

/ chests
type=block,ID=chest,tileEntity=(Items=#chestLootTable("chests/spawn_bonus_chest"))@luck=0
type=block,ID=chest,tileEntity=(Items=#chestLootTable("chests/simple_dungeon"))@luck=1
type=block,ID=chest,tileEntity=(Items=#chestLootTable("chests/village_blacksmith"))@luck=1
type=block,ID=chest,tileEntity=(Items=#customChestLootTable({"pools":[{"rolls":{"min":6,"max":12},"entries":[{"type":"item","name":"minecraft:iron_ingot","weight":1,"functions":[{"function":"set_count","count":{"min":1,"max":8}}]},{"type":"item","name":"minecraft:gold_ingot","weight":1,"functions":[{"function":"set_count","count":{"min":1,"max":4}}]},{"type":"item","name":"minecraft:diamond","weight":1,"functions":[{"function":"set_count","count":{"min":1,"max":4}}]},{"type":"item","name":"minecraft:emerald","weight":1,"functions":[{"function":"set_count","count":{"min":1,"max":4}}]},{"type":"item","name":"minecraft:dye","weight":1,"functions":[{"function":"set_data","data":4},{"function":"set_count","count":{"min":1,"max":4}}]},{"type":"item","name":"lucky:lucky_block","weight":1,"functions":[{"function":"set_data","data":0},{"function":"set_count","count":{"min":1,"max":2}}]},{"type":"item","name":"minecraft:golden_apple","weight":1,"functions":[{"function":"set_data","data":0},{"function":"set_count","count":{"min":1,"max":2}}]},{"type":"item","name":"minecraft:golden_apple","weight":1,"functions":[{"function":"set_data","data":1},{"function":"set_count","count":{"min":1,"max":2}}]}]}]}))@luck=2


