/========== TOOLS & ARMOR ==========

/ stone or iron pick
group:1:(ID=stone_pickaxe;ID=iron_pickaxe)@luck=1

/ stone tools
group(ID=stone_sword;ID=stone_shovel;ID=stone_pickaxe;ID=stone_axe;ID=stone_hoe)@luck=0

/ all leather and gold
group(ID=leather_helmet;ID=leather_chestplate;ID=leather_leggings;ID=leather_boots)@luck=0
group(ID=golden_helmet;ID=golden_chestplate;ID=golden_leggings;ID=golden_boots;ID=golden_horse_armor)@luck=1

/ all horse armor (but diamond)
group(ID=iron_horse_armor;ID=golden_horse_armor)@luck=1

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

type=block,ID=coal_block@luck=0
type=block,ID=redstone_block@luck=0
ID=beacon@luck=2
ID=dragon_egg@luck=2
ID=end_portal_frame,amount=#rand(2,4)@luck=2
ID=tnt,amount=#rand(4,10)@luck=1
ID=enchanting_table@luck=2
ID=ender_chest,amount=2@luck=2
ID=sponge,NBTTag=(display=(Name="$eSpongebob"))@luck=0
ID=dirt,NBTTag=(display=(Name="$4Less $6Lucky Dirt"))@luck=-2
ID=dirt,NBTTag=(display=(Name="$4Even Less $6Lucky Dirt"))@luck=-2

/ retry
group(type=command,ID="/tell #pName Error 666, Try again please.",commandSender="AwesomeMan2812";ID=lucky:lucky_block_dark,NBTTag=(display=(Name="$0Dark Side Lucky Block")))@luck=-1

/ chests
type=block,ID=chest,tileEntity=(Items=#chestDungeonChest)@luck=1
type=block,ID=chest,tileEntity=(Items=#chestVillageBlacksmith)@luck=1
type=block,ID=chest,tileEntity=(Items=#chest(contents=[(id=stick,maxAmount=2,weight=10),(id=glass,maxAmount=5,weight=10),(id=lucky:lucky_block_dark,maxAmount=2,weight=10),(id=spider_eye,maxAmount=3,weight=9)],maxTotalAmount=10))@luck=-1
type=block,ID=chest,tileEntity=(Items=#chest(contents=[(id=grass,maxAmount=10,weight=10),(id=seeds,maxAmount=20,weight=10),(id=iron_hoe,maxAmount=1,weight=10)],maxTotalAmount=10))@luck=-1

/========= ITEMS ==========

ID=cake@luck=1
ID=nether_star@luck=2
ID=saddle,amount=#rand(1,2)@luck=1
ID=rotten_flesh@luck=-1
ID=spider_eye@luck=-1
ID=melon,NBTTag=(display=(Name="$4Delicious Melon"))@luck=0
ID=diamond_horse_armor@luck=2
ID=stick@luck=-1
ID=rabbit_stew,amount=#rand(5,8)@luck=1
ID=apple,amount=#rand(3,6)@luck=1

/========== GROUPS ==========

/ cookies and milk
group(ID=milk_bucket,amount=#rand(1,1);ID=cookie,NBTTag=(display=(Name="$6Grandma's Wonderful Cookies")),amount=#rand(2,5))@luck=1

/ colorful
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=2002,damage=#randPotionParticle,amount=10)@luck=1

/ quartz
group(ID=stone_slab,damage=7,amount=#rand(4,8);ID=quartz_ore,amount=#rand(16,32);ID=quartz_block,amount=#rand(4,8);ID=quartz_block,damage=1,amount=#rand(4,8);ID=quartz_block,damage=2,amount=#rand(4,8);ID=quartz_stairs,amount=#rand(4,8);ID=quartz,amount=#rand(24,32);type=particle,ID=2002,damage=14)@luck=0

/ redstone stuff
group(ID=dispenser,amount=2;ID=noteblock,amount=1;ID=sticky_piston,amount=4;ID=piston,amount=4;ID=tnt,amount=6;ID=lever,amount=2;ID=stone_pressure_plate,amount=2;ID=wooden_pressure_plate,amount=2;ID=redstone_torch,amount=8;ID=stone_button,amount=2;ID=trapdoor,amount=2;ID=iron_trapdoor,amount=2;ID=fence_gate,amount=1;ID=redstone_lamp,amount=4;ID=tripwire_hook,amount=2;ID=wooden_button,amount=2;ID=light_weighted_pressure_plate,amount=1;ID=heavy_weighted_pressure_plate,amount=1;ID=daylight_detector,amount=1;ID=hopper,amount=4;ID=dropper,amount=#rand(2,4);ID=wooden_door,amount=1;ID=iron_door,amount=1;ID=redstone,amount=#rand(32,64);ID=repeater,amount=8;ID=comparator,amount=2;type=particle,ID=2002,damage=9)@luck=1

/ better apples
group(ID=golden_apple,amount=#rand(4,6);ID=golden_apple,amount=#rand(2,3),damage=1)@luck=2

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

/ falling diamond block
group(type=fill,ID=air,size=(1,8,1);type=entity,ID=FallingSand,posY=#bPosY+7,NBTTag=(Block=diamond_block);type=entity,ID=LightningBolt,delay=3)@luck=1

/ 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=\"$eYour wish came true! (If you like enderman)\";type=block,ID=air,posY='#'bPosY+3;type=block,ID=beacon,posY='#'bPosY+2;ID=ender_pearl,amount=#rand(32,64),posY='#'bPosY+10,posOffset='#'circleOffset(2);ID=ender_eye,amount=#rand(12,32),posY='#'bPosY+10,posOffset='#'circleOffset(2);ID=end_portal_frame,amount=#rand(1,4),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=\"$bYour wish came true!\";type=block,ID=air,posY='#'bPosY+3;type=block,ID=beacon,posY='#'bPosY+2;type=entity,ID=FireworksRocketEntity,NBTTag=(LifeTime=20,FireworksItem=(id=fireworks,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))"]))@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=\"$4Is that raining death I hear?\";type=block,ID=air,posY='#'bPosY+3;type=block,ID=beacon,posY='#'bPosY+2;type=entity,ID=PrimedTnt,NBTTag=(Fuse=50b,Motion='#'randLaunchMotion),posY='#'bPosY+8,amount=45)"]))@luck=-2

/ launched tnt
type=entity,ID=PrimedTnt,NBTTag=(Fuse=50b,Motion=#randLaunchMotion),amount=30@luck=-2

/ lucky fort and temple
type=structure,ID=lucky_fort,pos=#pPos@luck=2
type=structure,ID=lucky_temple,pos=#pPos@chance=0.4@luck=2

/ lucky villagers
type=entity,ID=Villager,NBTTag=(Offers=(Recipes=[(buy=(id=iron_ingot,Count=#rand(8,12)),sell=(id=iron_sword,Count=1,tag=(display=(Name="$3$lLightSaber"))),maxUses=2),(buy=(id=diamond,Count=#rand(3,8)),sell=(id=glowstone,Count=1,tag=(display=(Name="$e$lThe Force"))),maxUses=1),(buy=(id=gold_ingot,Count=#rand(9,12)),sell=(id=coal,Damage=1,Count=1,tag=(display=(Name="$0$lThe Dark Side"))),maxUses=1)]),CustomName="$8$lDarth Villader",CustomNameVisible=true)@luck=0
type=entity,ID=Villager,NBTTag=(Offers=(Recipes=[(buy=(id=gold_ingot,Count=#rand(4,10)),sell=(id=potion,Damage=16428,Count=1,tag=(CustomPotionEffects=#unluckyPotionEffects,display=(Name="$e$lRevenge Potion"))),maxUses=1)]),CustomName="$4Revenge Artist",CustomNameVisible=true)@luck=0

/ giant
group(type=difficulty,ID=hard;type=entity,ID=Giant,NBTTag=(display=(Name="$e$lJen's Mom")))@luck=-2

/ somewhat lucky eggs
group(type=entity,ID=ThrownEgg,NBTTag=(Motion=#randLaunchMotion(0.6,15)),amount=40;type=entity,ID=Item,NBTTag=(Item=(id=fish,Count=1),Motion=#randLaunchMotion(0.7,18)),amount=20)@luck=0

/ lightning creeper
group(type=difficulty,ID=hard;type=entity,ID=Creeper;type=entity,ID=LightningBolt)@luck=-2

/========== STRUCTURES ==========

/ traps
type=structure,ID=anvil_trap,pos=#pPos,rotation=#pDirect@luck=-2
type=structure,ID=lava_trap,pos=#pPos,rotation=#pDirect@luck=-2
type=structure,ID=water_trap,pos=#pPos@luck=-2  
type=structure,ID=pit_trap,pos=#pPos@luck=-2

/ explosions
group(type=difficulty,ID=hard;type=explosion,radius=5)@luck=-2
group(type=difficulty,ID=hard;type=explosion,radius=50)@luck=-2

/ colorful pole troll
group(type=fill,ID=air,size=(1,51,1);group(NBTTag=(Block=stained_hardened_clay,Data=14),posY=#bPosY+5;NBTTag=(Block=stained_hardened_clay,Data=1),posY=#bPosY+10;NBTTag=(Block=stained_hardened_clay,Data=4),posY=#bPosY+15;NBTTag=(Block=stained_hardened_clay,Data=5),posY=#bPosY+20;NBTTag=(Block=stained_hardened_clay,Data=3),posY=#bPosY+25;NBTTag=(Block=stained_hardened_clay,Data=11),posY=#bPosY+30;NBTTag=(Block=stained_hardened_clay,Data=10),posY=#bPosY+35;NBTTag=(Block=stained_hardened_clay,Data=2),posY=#bPosY+40;NBTTag=(Block=stained_hardened_clay,Data=6),posY=#bPosY+45),type=entity,ID=FallingSand;type=entity,ID=FallingSand,NBTTag=(Block=coal_block),posY=#bPosY+50)@luck=0

/ troll tower
group(type=fill,ID=air,size=(1,36,1);type=entity,ID=FallingSand,posY=#bPosY+5,NBTTag=(Block=redstone_block);type=entity,ID=FallingSand,posY=#bPosY+10,NBTTag=(Block=tnt);type=entity,ID=FallingSand,posY=#bPosY+15,NBTTag=(Block=redstone_block);type=entity,ID=FallingSand,posY=#bPosY+20,NBTTag=(Block=tnt);type=entity,ID=FallingSand,posY=#bPosY+25,NBTTag=(Block=tnt)type=entity,ID=FallingSand,posY=#bPosY+30,NBTTag=(Block=tnt);type=entity,ID=FallingSand,delay=3,posY=#bPosY+35,NBTTag=(Block=diamond_block))@luck=-2

/ Cow stack
type=entity,ID=Skeleton,NBTTag=(Riding=(id=Cow,Riding=(id=Cow,Riding=(id=Cow,Riding=(id=Cow,Riding=(id=Cow,Riding=(id=Cow,Riding=(id=Cow))))))))@luck=0

/ Bob Zombies
group(type=difficulty,ID=hard;type=entity,ID=Zombie,amount=5,NBTTag=(Equipment=[(id=diamond_sword,Count=1,tag=(ench=#luckySwordEnchantments)),(id=diamond_helmet,Count=1,tag=(ench=#luckyHelmetEnchantments)),(id=diamond_chestplate,Count=1,tag=(ench=#luckyChestplateEnchantments)),(id=diamond_leggings,Count=1,tag=(ench=#luckyLeggingsEnchantments)),(id=diamond_boots,Count=1,tag=(ench=#luckyBootsEnchantments))],DropChances=[#randList(0,2)f,#randList(0,2)f,#randList(0,2)f,#randList(0,2)f,#randList(0,2)f],CustomName="$e$lBob",CustomNameVisible=true))@luck=-2

/========== MONSTER APOCALYPSE ==========

/ sword, difficulty, time, potion effects
group(ID=wooden_sword;type=difficulty,ID=hard;type=time,ID=18750;type=effect,ID=slowness,duration=30,amplifier=4;type=effect,ID=blindness,duration=30; \
/ zombies, creepers, spiders & cave spiders, silverfish & endermites, guardians
group:1:(type=entity,ID=Zombie,amount=#rand(20,50);type=entity,ID=Creeper,amount=#rand(10,30);group(type=entity,ID=Spider,amount=#rand(15,45);type=entity,ID=CaveSpider,amount=#rand(5,10));group(type=entity,ID=Silverfish,amount=#rand(15,45);type=entity,ID=Endermite,amount=#rand(5,10));type=entity,ID=Guardian,amount=#rand(10,30); \
/ all
group(type=entity,ID=Zombie,amount=#rand(20,50);type=entity,ID=Creeper,amount=#rand(10,30);group(type=entity,ID=Spider,amount=#rand(15,45);type=entity,ID=CaveSpider,amount=#rand(5,10);type=entity,ID=Silverfish,amount=#rand(15,45);type=entity,ID=Endermite,amount=#rand(5,10);type=entity,ID=Guardian,amount=#rand(10,30)))),posOffset=#circleOffset(8,10))@luck=-2

/========== ENCHANTED ITEMS ==========

/ lucky dirt
ID=dirt,NBTTag=(display=(Name="$6Lucky Dirt"),ench=[(id=16,lvl=5)])@luck=-1

/ lucky tools
group:#rand(1,2):(ID=diamond_shovel,NBTTag=(ench=#luckyToolEnchantments,display=(Name="$e$lLucky Shovel"));ID=diamond_pickaxe,NBTTag=(ench=#luckyToolEnchantments,display=(Name="$e$lLucky Pickaxe"));ID=diamond_axe,NBTTag=(ench=#luckyAxeEnchantments,display=(Name="$e$lLucky Axe"));ID=diamond_hoe,NBTTag=(ench=#luckyToolEnchantments,display=(Name="$e$lLucky Hoe")))@luck=2

/ unlucky sword
ID=wooden_sword,NBTTag=(display=(Name="$4$lUnlucky Sword"),ench=[(id=16,lvl=1)])@luck=-1

/ the real destroyer
ID=diamond_sword,NBTTag=(ench=#luckySwordEnchantments,display=(Name="$8$lThe Real Destroyer"))@luck=2