BlockBreakEvents:
type: world
debug: true
events:
##### - Minerals - #####
on player breaks COAL_ORE:
- inject s@BlockEvents
on player breaks DIAMOND_ORE:
- inject s@BlockEvents
on player breaks EMERALD_ORE:
- inject s@BlockEvents
on player breaks GLOWING_REDSTONE_ORE:
- inject s@BlockEvents
on player breaks REDSTONE_ORE:
- inject s@BlockEvents
on player breaks GOLD_ORE:
- inject s@BlockEvents
on player breaks IRON_ORE:
- inject s@BlockEvents
on player breaks LAPIS_ORE:
- inject s@BlockEvents
on player breaks QUARTZ_ORE:
- inject s@BlockEvents
##### - Mundane Ground - #####
on player breaks SAND:
- inject s@BlockEvents
on player breaks GRAVEL:
- inject s@BlockEvents
on player breaks OAK_LOG:
- inject s@BlockEvents
on player breaks DARKOAK_LOG:
- inject s@BlockEvents
on player breaks BIRCH_LOG:
- inject s@BlockEvents
on player breaks JUNGLE_LOG:
- inject s@BlockEvents
on player breaks ACACIA_LOG:
- inject s@BlockEvents
on player breaks SPRUCE_LOG:
- inject s@BlockEvents
on player breaks SOUL_SAND:
- inject s@BlockEvents
on player breaks STONE:
- inject s@BlockEvents
BlockEvents:
type: task
tools:
- LivingPick:
+ Lebende Spitzhacke:
stone: true
coal_ore: true
diamond_ore: true
emerald_ore: true
redstone_ore: true
gold_ore: true
iron_ore: true
lapis_ore: true
quartz_ore: true
- LuckShovel:
+ Daemmer Schaufel:
sand: true
gravel: true
soul_sand: true
- FlameAxe:
+ Flammen Spalter:
oak_log: true
birch_log: true
spruce_log: true
jungle_log: true
acacia_log: true
darkoak_log: true
script:
- - if <player.item_in_hand.has_display> == true {
- - define tool 'none'
- - if <player.item_in_hand.display> == "§2Lebende Spitzhacke" {
- - define tool 'LivingPick'
- }
- - if <player.item_in_hand.display> == "§bDaemmer Schaufel" {
- - define tool 'LuckShovel'
- }
- - if <player.item_in_hand.display> == "§bFlammen Spalter" {
+ - if <player.item_in_hand.has_display.not> {
+ - queue clear
+ }
+ - define tool '<player.item_in_hand.display.strip_color>'
+ - if <script.list_keys[tools]> !contains '<def[tool]>' {
+ - queue clear
+ }
+ - if <s@BlockEvents.list_keys[tools.<def[tool]>]> !contains '<context.material.name>' {
+ - queue clear
- - define tool 'FlameAxe'
- }
- - if <s@BlockEvents.yaml_key[tools.<def[tool]>.<context.material.name>]||false> == true {
- - define rarity 1.0
- - determine passively "NOTHING"
- - run instantly BlockDrops def:<context.location>|<context.material>|<def[tool]>|<def[rarity]> player:<player>
}
- }
+ - define rarity 1.0
+ - determine passively "NOTHING"
+ - run instantly BlockDrops def:<context.location>|<context.material>|<def[tool]>|<def[rarity]> player:<player>
BlockDrops:
type: task
debug: true
definitions: block|material|tool|rarity
drops:
- LivingPick:
+ Lebende Spitzhacke:
def: true
amt: 1
chance: 75
stone:
exists: true
diamond:
chance: 0.075
amount: 1
emerald:
chance: 0.075
amount: 1
gold_ingot:
chance: 0.1
amount: 1
iron_ingot:
chance: 0.2
amount: 1
lapis_lazuli:
chance: 0.2
amount: 3
redstone:
chance: 0.2
amount: 3
coal:
chance: 0.5
amount: 1
coal_ore:
exists: true
diamond:
chance: 2.5
amount: 1
emerald:
chance: 2.5
amount: 1
gold_ingot:
chance: 5.0
amount: 1
iron_ingot:
chance: 7.0
amount: 1
lapis_lazuli:
chance: 7.0
amount: 3
redstone:
chance: 7.0
amount: 3
coal:
chance: 8.0
amount: 1
diamond_ore:
exists: true
diamond:
chance: 10.0
amount: 1
emerald:
chance: 10.0
amount: 1
gold_ingot:
chance: 20.0
amount: 1
iron_ingot:
chance: 25.0
amount: 1
lapis_lazuli:
chance: 25.0
amount: 3
redstone:
chance: 25.0
amount: 3
coal:
chance: 30.0
amount: 1
emerald_ore:
exists: true
diamond:
chance: 33.0
amount: 1
emerald:
chance: 33.0
amount: 1
gold_ingot:
chance: 40.0
amount: 1
iron_ingot:
chance: 50.0
amount: 1
lapis_lazuli:
chance: 25.0
amount: 3
redstone:
chance: 25.0
amount: 3
coal:
chance: 30.0
amount: 1
redstone_ore:
exists: true
diamond:
chance: 5.0
amount: 1
emerald:
chance: 5.0
amount: 1
gold_ingot:
chance: 10.0
amount: 1
iron_ingot:
chance: 12.5
amount: 1
lapis_lazuli:
chance: 12.5
amount: 3
redstone:
chance: 12.5
amount: 3
coal:
chance: 15.0
amount: 1
gold_ore:
exists: true
diamond:
chance: 5.0
amount: 1
emerald:
chance: 5.0
amount: 1
gold_ingot:
chance: 10.0
amount: 1
iron_ingot:
chance: 12.5
amount: 1
lapis_lazuli:
chance: 12.5
amount: 3
redstone:
chance: 12.5
amount: 3
coal:
chance: 15.0
amount: 1
iron_ore:
exists: true
diamond:
chance: 3.0
amount: 1
emerald:
chance: 3.0
amount: 1
gold_ingot:
chance: 6.0
amount: 1
iron_ingot:
chance: 8.5
amount: 1
lapis_lazuli:
chance: 8.5
amount: 3
redstone:
chance: 8.5
amount: 3
coal:
chance: 7.5
amount: 1
lapis_ore:
exists: true
diamond:
chance: 5.0
amount: 1
emerald:
chance: 5.0
amount: 1
gold_ingot:
chance: 10.0
amount: 1
iron_ingot:
chance: 12.5
amount: 1
lapis_lazuli:
chance: 12.5
amount: 3
redstone:
chance: 12.5
amount: 3
coal:
chance: 15.0
amount: 1
quartz_ore:
exists: true
diamond:
chance: 3.0
amount: 1
emerald:
chance: 3.0
amount: 1
gold_ingot:
chance: 6.0
amount: 1
iron_ingot:
chance: 8.5
amount: 1
lapis_lazuli:
chance: 8.5
amount: 3
redstone:
chance: 8.5
amount: 3
coal:
chance: 7.5
amount: 1
- LuckShovel:
+ Daemmer Schaufel:
def: false
amt: 1
chance: 33
sand:
exists: true
glowstone_dust:
chance: 25.0
amount: 2
gold_nugget:
chance: 20.0
amount: 1
diamond:
chance: 2.0
amount: 1
coal:
chance: 20.0
amount: 1
emerald:
chance: 5.0
amount: 1
gold_ingot:
chance: 10.0
amount: 1
flint:
chance: 14.0
amount: 1
skull_item:
chance: 1.0
amount: 1
bone:
chance: 3.0
amount: 1
gravel:
exists: true
glowstone_dust:
chance: 30.0
amount: 2
gold_nugget:
chance: 25.0
amount: 1
diamond:
chance: 3.0
amount: 1
coal:
chance: 25.0
amount: 1
emerald:
chance: 6.0
amount: 1
gold_ingot:
chance: 12.5
amount: 1
flint:
chance: 17.5
amount: 1
skull_item:
chance: 2.0
amount: 1
bone:
chance: 6.0
amount: 1
soul_sand:
exists: true
glowstone_dust:
chance: 50.0
amount: 2
gold_nugget:
chance: 30.0
amount: 1
diamond:
chance: 4.0
amount: 1
coal:
chance: 30.0
amount: 1
emerald:
chance: 7.0
amount: 1
gold_ingot:
chance: 15.0
amount: 1
flint:
chance: 20.0
amount: 1
skull_item:
chance: 5.0
amount: 1
bone:
chance: 10.0
amount: 1
- FlameAxe:
+ Flammen Spalter:
def: false
amt: 1
chance: 100
oak_log:
exists: true
coal:
chance: 100.0
amount: 1
birch_log:
exists: true
coal:
chance: 100.0
amount: 1
spruce_log:
exists: true
coal:
chance: 100.0
amount: 1
jungle_log:
exists: true
coal:
chance: 100.0
amount: 1
acacia_log:
exists: true
coal:
chance: 100.0
amount: 1
darkoak_log:
exists: true
coal:
chance: 100.0
amount: 1
def:
amt: 1
stone:
exists: true
drop: cobblestone
coal_ore:
exists: true
drop: coal
diamond_ore:
exists: true
drop: diamond
emerald_ore:
exists: true
drop: emerald
redstone_ore:
exists: true
drop: redstone
gold_ore:
exists: true
drop: gold_ingot
iron_ore:
exists: true
drop: iron_ingot
lapis_ore:
exists: true
drop: lapis_lazuli
quartz_ore:
exists: true
drop: quartz
sand:
exists: true
drop: sand
gravel:
exists: true
drop: gravel
soul_sand:
exists: true
drop: soul_sand
oak_log:
exists: true
drop: oak_log
birch_log:
exists: true
drop: birch_log
spruce_log:
exists: true
drop: spruce_log
jungle_log:
exists: true
drop: jungle_log
acacia_log:
exists: true
drop: acacia_log
darkoak_log:
exists: true
drop: darkoak_log
script:
#- narrate '[DEBUG] BlockBreak at:<def[block]> Material: <def[material]> (<def[rarity]>) with Tool: <def[tool]> Mode: <player.gamemode>'
- if <player.gamemode.id> == 0 || <player.gamemode.id> == 2 {
- if <player.item_in_hand.lore.contains_text[<&b>Level]> == true {
# Experience Gain if the Tool is Supposed to have a Level
- if <player.item_in_hand.nbt[experience]> == null || <player.item_in_hand.nbt[level]> == null {
- nbt <player.item_in_hand> "experience:0.0" "save:updateitem"
- nbt <entry[updateitem].new_item> "level:1.0" "save:updateitem"
- adjust <entry[updateitem].new_item> durability:<player.item_in_hand.durability.add[2]> save:updateitem
- define item <entry[updateitem].result>
- inventory set o:<def[item]> d:<player.inventory> slot:<player.item_in_hand.slot>
}
- define item <player.item_in_hand>
- define tlevel <player.item_in_hand.nbt[level]||1.0>
- define texperience <player.item_in_hand.nbt[experience]||0.0>
- define nexperience <el@1000.add[<el@100.mul[<def[tlevel].add[-1]>].power[1.5]||1>].as_int>
- nbt <player.item_in_hand> "experience:<player.item_in_hand.nbt[experience].add[250.0]||0.0>" "save:updateitem"
- nbt <entry[updateitem].new_item> "level:<def[tlevel]>" "save:updateitem"
- adjust <entry[updateitem].new_item> durability:<player.item_in_hand.durability.add[2]> save:updateitem
- define item <entry[updateitem].result>
- if <def[texperience]> >= <def[nexperience]> && <def[tlevel]> < 15 {
# Adding a Level
- nbt <def[item]> "experience:0" "save:updateitem"
- nbt <entry[updateitem].new_item> "level:<def[tlevel].add[1].as_int>" "save:updateitem"
- adjust <entry[updateitem].new_item> lore:<player.item_in_hand.lore.set[<&b>Level<&co><&sp><def[tlevel].add[1]>&fs15].at[1]> save:updateitem
- define item <entry[updateitem].result>
}
- inventory set o:<def[item]> d:<player.inventory> slot:<player.item_in_hand.slot>
}
### Loot ###
## Looting Enchantment ?! ##
- define LootMult 1
- define luck 100
## - Actual Loot - ##
- define lootexist <s@BlockDrops.yaml_key[drops.<def[tool]>.<def[material].name>.exists]>
- define defaultexists <s@BlockDrops.yaml_key[drops.def.<def[material].name>.exists]>
- if <def[lootexist]> == true {
- define loot_amt <s@BlockDrops.yaml_key[drops.<def[tool]>.amt]>
- define loot_chance <s@BlockDrops.yaml_key[drops.<def[tool]>.chance]>
- define drops <s@BlockDrops.list_keys[drops.<def[tool]>.<def[material].name>]>
- define drops <def[drops].exclude[exists]>
- define defaultdrop <s@BlockDrops.yaml_key[drops.<def[tool]>.def]>
- define drops_given 0
- if <util.random.int[1].to[100]> <= <def[loot_chance]> {
- repeat <def[loot_amt]> {
- if <def[drops_given]> >= <def[loot_amt]> {
- repeat stop
}
- foreach <def[drops]> {
- if <util.random.decimal[0].to[100]> <= <s@BlockDrops.yaml_key[drops.<def[tool]>.<def[material].name>.<def[value]>.chance]> {
- define drops_given <def[drops_given].add[1]>
- drop i@<def[value]> <def[block].add[0.5,0.5,0.5]> quantity:<s@BlockDrops.yaml_key[drops.<def[tool]>.<def[material].name>.<def[value]>.amount]>
}
}
}
- if <def[drops_given]> == 0 {
- define defaultdrop true
}
}
}
- if <def[lootexist]> == false || <def[defaultdrop]> {
- if <def[defaultexists]> == true {
- drop i@<s@BlockDrops.yaml_key[drops.def.<def[material].name>.drop]> <def[block].add[0.5,0.5,0.5]> quantity:1
}
- if <def[defaultexists]> == false {
- drop i@<def[material].name> <def[block].add[0.5,0.5,0.5]> quantity:1
}
}
}