# Author Seq
# LuckyBlocks v1.7
# Denizen Script to create LuckyBlock plugin
LuckyBlockLoad:
type: world
events:
on server start:
- flag server "LuckyBlockStatus:false"
LuckyBlocks_Commands:
type: command
name: luckyblock
description: Commands for LuckyBlocks.
usage: /luckyblock <<>action<>> <<>player<>> <<>quantity<>>
permission: luckyblock.command
script:
- define arg_size <context.args.size>
- if %arg_size% == 0 {
- run LuckyBlockInfo
}
else {
- if <context.args.get[1]> != ver && <context.args.get[1]> != give && <context.args.get[1]> != stop && <context.args.get[1]> != start {
- narrate '<red>Unknown Argument(s)!'
}
else if <context.args.get[1]> == "stop" {
- if <flag.server[LuckyBlockStatus]> == false {
- narrate '<gold>LuckyBlocks is already <dark_red>false<gold>!'
}
else {
- narrate '<red>Stopping LuckyBlock.'
- flag server "LuckyBlockStatus:false"
}
}
else if <context.args.get[1]> == "start" {
- if <flag.server[LuckyBlockStatus]> == true {
- narrate '<gold>LuckyBlocks is already <green>true<gold>!'
}
else {
- narrate '<green>Starting LuckyBlock.'
- flag server "LuckyBlockStatus:true"
- run BlockListener
}
}
else if <context.args.get[1]> == "ver" {
- narrate '<gold>LuckyBlock v1.7<yellow> by SeqSEE'
}
else if <context.args.get[1]> == "give" {
- define Player <server.match_player[<context.args.get[2]>]||null>
- if <def[Player]> == null {
- give i@sponge quantity:1
}
else {
- if <context.args.get[3].length> == 0 {
- give i@sponge quantity:1 player:<def[Player]>
}
else {
- if <context.args.get[3]> == null {
- give i@sponge quantity:1 player:<def[Player]>
}
else if <context.args.get[3]> matches number {
- give i@sponge quantity:<context.args.get[3]> player:<def[Player]>
}
else {
- narrate "<red><context.args.get[3]> is not a valid quantity!"
}
}
}
}
}
LuckyBlockInfo:
type: task
debug: false
script:
- narrate "<gold>LuckyBlocks Active:<white> <server.flag[LuckyBlockStatus]>"
- wait 1
- narrate "<yellow>Place LuckyBlocks and break them for surprises!"
- wait 1
- narrate "<yellow>Wet LuckyBlocks are more potent, so to speak."
BlockListener:
type: world
debug: false
events:
on player breaks block:
- if <server.flag[LuckyBlockStatus]> == true {
- flag "BlockLocation:<context.location>"
- if <context.material> == m@sponge {
- run 'DryBroken'
- determine passively "NOTHING"
}
else if <context.material> == m@sponge,1 {
- run 'WetBroken'
- determine passively "NOTHING"
}
}
else if <server.flag[LuckyBlockStatus]> == false {
}
DryBroken:
type: task
debug: false
script:
- random 8
- run Popcorn
- drop i@gold_ingot <player.flag[BlockLocation]> quantity:32
- spawn zombie|zombie|zombie <player.flag[BlockLocation]>
- drop i@iron_sword|i@iron_chestplate|i@iron_leggings|i@iron_helmet| <player.flag[BlockLocation]> quantity:1
- run SkeleBats
- explode power:5 <player.flag[BlockLocation]> fire breakblocks
- drop i@iron_ingot <player.flag[BlockLocation]> quantity:64
- drop i@diamond <player.flag[BlockLocation]> quantity:16
WetBroken:
type: task
debug: false
script:
- random 9
- run ZombiesOnChickens
- run BombBats
- drop i@diamond_block <player.flag[BlockLocation]> quantity:1
- drop i@gold_block <player.flag[BlockLocation]> quantity:5
- spawn creeper|creeper|creeper|creeper|creeper <player.flag[BlockLocation]> persistent
- drop i@diamond_sword|i@diamond_chestplate|i@diamond_leggings|i@diamond_helmet| <player.flag[BlockLocation]>
- run SpiderJokeys
- run Skelombie
- run BurriedAlive
GiveLightDamage:
type: task
debug: false
script:
# Gives player light damage.
- hurt 2.5 <player>
GiveMediumDamage:
type: task
debug: false
script:
# Gives player medium damage.
- hurt 5 <player>
GiveHeavyDamage:
type: task
debug: false
script:
# Gives player heavy damage.
- hurt 10 <player>
BombBats:
type: task
debug: false
script:
- repeat 6 {
- mount e@primed_tnt|bat <player.flag[BlockLocation]>
}
SkeleBats:
type: task
debug: false
script:
- repeat 6 {
- mount e@Skeleton|bat <player.flag[BlockLocation]>
}
SpiderJokeys:
type: task
debug: false
script:
- repeat 6 {
- mount e@Skeleton|Spider <player.flag[BlockLocation]>
}
ZombiesOnChickens:
type: task
debug: false
script:
- repeat 6 {
- mount e@Zombie|chicken <player.flag[BlockLocation]>
}
Skelombie:
type: task
debug: false
script:
- repeat 6 {
- mount e@Skeleton|zombie <player.flag[BlockLocation]>
}
Popcorn:
type: task
debug: false
script:
- shoot <player> origin:<player.location> destination:<player.location.add[0,20,0]> script:GiveMediumDamage
- narrate "Popcorn!"
BurriedAlive:
type: task
debug: false
script:
- teleport <player> <player.location.sub[0,4,0]>
- run GiveHeavyDamage
- narrate "Burried Alive!"