Skip to content

Commit

Permalink
1.1
Browse files Browse the repository at this point in the history
- The DataPack now supports 1.19.4.
- Fixed several bugs.
- When you pick up your minion, the upgrades and collected items now drop automatically.
- Fixed the cobblestone advancement issue.
- Added a feature to update all minions when needed.
- Cobblestone advancement fixed.
- Added a way for me to update all minions if needed.
  • Loading branch information
LeoEluf committed Dec 20, 2024
1 parent 9ecb7a1 commit 1955493
Show file tree
Hide file tree
Showing 20 changed files with 96 additions and 41 deletions.
2 changes: 1 addition & 1 deletion data/le_minions/advancement/minions/cobblestone/start.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"conditions": {
"items": [
{
"items": "minecraft:cobblestone_pickaxe",
"items": "minecraft:wooden_pickaxe",
"count": 1
}
]
Expand Down
11 changes: 8 additions & 3 deletions data/le_minions/function/load.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data modify storage le_minions:stats item.lore set value ["\"§7Place this minio

data modify storage le_minions:stats upgrades.storage set value {"minecraft:hopper": {storage: 128, name: "Hopper"}, "minecraft:chest": {storage: 192, name: "Chest"}, "minecraft:barrel": {storage: 256, name: "Barrel"}, "minecraft:trapped_chest": {storage: 320, name: "Trapped Chest"}, "minecraft:ender_chest": {storage: 384, name: "Ender Chest"}, "minecraft:shulker_box": {storage: 448, name: "Shulker Box"}}

data modify storage le_minions:stats upgrades.fuel set value {"minecraft:charcoal": {efficiency: 2, name: "Charcoal", rarity: "Common"}, "minecraft:coal": {efficiency: 4, name: "Coal", rarity: "Uncommon"},"minecraft:coal_block": {efficiency: 6, name: "Block of Coal", rarity: "Rare"},"minecraft:heart_of_the_sea": {efficiency: 8, name: "Heart of the Sea", rarity: "Epic"},"minecraft:nether_star": {efficiency: 10, name: "Nether Star", rarity: "Legendary"},"minecraft:dragon_egg": {efficiency: 50, name: "Dragon Egg", rarity: "Mythic"}}
data modify storage le_minions:stats upgrades.fuel set value {"minecraft:charcoal": {efficiency: 2, name: "Charcoal", rarity: "Common"}, "minecraft:coal": {efficiency: 4, name: "Coal", rarity: "Uncommon"},"minecraft:coal_block": {efficiency: 6, name: "Block of Coal", rarity: "Rare"},"minecraft:heart_of_the_sea": {efficiency: 8, name: "Heart of the Sea", rarity: "Epic"},"minecraft:nether_star": {efficiency: 10, name: "Nether Star", rarity: "Legendary"},"minecraft:dragon_egg": {efficiency: 40, name: "Dragon Egg", rarity: "Mythic"}}

data modify storage le_minions:stats 1.layout set value "'\" §b■ ■ ■ ■ ■§r\"', '\" §b■ ■ ■ ■ ■§r §b■ >> Air \"', '\" §b■ ■ §eM §b■ ■§r\"', '\" §b■ ■ ■ ■ ■§r §eM >> Minion\"', '\" §b■ ■ ■ ■ ■§r\"'"

Expand Down Expand Up @@ -46,5 +46,10 @@ scoreboard players set #20 leMinions.temp 20
scoreboard players set #10 leMinions.temp 10
scoreboard players set #-1 leMinions.temp -1

tellraw @a ["§c§lLEMINIONS §9§l>>§r §aCurrently running on version §e0.1.0§a!"]
# tellraw @a ["§c§lLEMINIONS §9§l>>§r §aUpdating all minions to current version..."]

tellraw @a ["§c§lLEMINIONS §9§l>>§r §aCurrently running on version §b1.1§a!"]
tellraw @a ["§c§lLEMINIONS §9§l>>§r §aAccess ", {"text":"§b§nplanetminecraft.com/member/leoeluf","clickEvent":{"action":"open_url","value":"https://www.planetminecraft.com/member/leoeluf"},"hoverEvent":{"action":"show_text","contents":["§eClick to open"]}}, " §ato know more about my projects!"]

#update
execute as @e[tag=leMinions.minion,type=marker] unless data entity @s data.leMinions{dp_version: 1.1} run function le_minions:minions/update/get_version {version: "1.1"}
tellraw @a ["§c§lLEMINIONS §9§l>>§r §aUpdated all minions to current version..."]
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
execute if data entity @s data.leMinions.ui{page: "root"} run return fail

function le_minions:minions/ui/pages/root/open
function le_minions:minions/ui/refresh
4 changes: 2 additions & 2 deletions data/le_minions/function/minions/display/time.mcfunction
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
execute as @e[type=text_display,tag=leMinions.minion_display] if score @s leMinions.id = @e[tag=leMinions.minion,limit=1,sort=nearest] leMinions.id run tag @s add this

$scoreboard players set @e[tag=this,tag=leMinions.minion_display,limit=1] leMinions.timer $(time)
$data merge entity @e[type=text_display,limit=1,tag=this,tag=leMinions.minion_display] {text:'{"text":"$(text)"}'}
$scoreboard players set @n[tag=this,tag=leMinions.minion_display,limit=1] leMinions.timer $(time)
$data merge entity @n[type=text_display,limit=1,tag=this,tag=leMinions.minion_display] {text:'{"text":"$(text)"}'}

tag @e remove this
6 changes: 3 additions & 3 deletions data/le_minions/function/minions/main_marker.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ execute if entity @s[tag=leMinions.minion_setup,type=marker] run function le_min

#ui anti-griefing
execute positioned ~ ~-1 ~ as @e[type=hopper_minecart,distance=..1] positioned ~ ~1 ~ run function le_minions:minions/ui/block_transfer/hopper_minecart
execute positioned ~ ~-1 ~ if block ~ ~ ~ hopper run function le_minions:minions/ui/block_transfer/hopper
execute positioned ~ ~-2 ~ if block ~ ~ ~ hopper run function le_minions:minions/ui/block_transfer/hopper
execute if block ~ ~-1 ~ hopper positioned ~ ~-1 ~ run function le_minions:minions/ui/block_transfer/hopper
execute if block ~ ~-2 ~ hopper positioned ~ ~-2 ~ run function le_minions:minions/ui/block_transfer/hopper

#barrel anti-griefing
execute unless block ~ ~-1 ~ barrel[facing=up] run function le_minions:minions/barrel
Expand All @@ -27,4 +27,4 @@ execute if score #items leMinions.temp < #max_storage leMinions.temp if data ent
execute if entity @a[distance=..10] run function le_minions:minions/check_player/is_close

#player far
execute unless entity @a[distance=..10] positioned ~ ~-1 ~ run function le_minions:minions/check_player/is_far
execute unless data entity @s data.leMinions.ui{page: "root"} unless entity @a[distance=..10] positioned ~ ~-1 ~ run function le_minions:minions/check_player/is_far
8 changes: 0 additions & 8 deletions data/le_minions/function/minions/ui/action/remove.mcfunction

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# $data modify storage le_minions:ui remove_items append value {id: "$(id)", count: 1b, Slot: $(slot)b}

$data modify block ~ ~ ~ Items append value {id: "$(id)", count: 1b, Slot: $(slot)b}
34 changes: 34 additions & 0 deletions data/le_minions/function/minions/ui/action/remove/start.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#sound and particle
playsound minecraft:block.anvil.destroy master @p[tag=this_player] ~ ~ ~ 1 1.5 1
execute at @s run particle minecraft:cloud ~ ~.5 ~ 0 0 0 0.05 5 normal

#update time action
data modify entity @s data.leMinions.time_action set from entity @s data.leMinions.stats.time_action

#spawn item
execute positioned ~ ~ ~ run function le_minions:minions/item/spawn with entity @s data.leMinions

#disable menu
data remove block ~ ~-1 ~ Items
tag @s remove leMinions.working

#drop items
setblock ~ ~ ~ yellow_shulker_box

#upgrades
execute if data entity @s data.leMinions.ui.upgrades.10 run function le_minions:minions/ui/action/remove/drop_upgrade with entity @s data.leMinions.ui.upgrades.10
execute if data entity @s data.leMinions.ui.upgrades.11 run function le_minions:minions/ui/action/remove/drop_upgrade with entity @s data.leMinions.ui.upgrades.11
execute if data entity @s data.leMinions.ui.upgrades.13 run function le_minions:minions/ui/action/remove/drop_upgrade with entity @s data.leMinions.ui.upgrades.13
execute if data entity @s data.leMinions.ui.upgrades.14 run function le_minions:minions/ui/action/remove/drop_upgrade with entity @s data.leMinions.ui.upgrades.14

#items
function le_minions:minions/get_stats
execute if score #items leMinions.temp matches 1.. run loot insert ~ ~ ~ loot le_minions:minions/items
execute if score #items leMinions.temp matches 1.. run data modify block ~ ~ ~ Items[{id: "minecraft:structure_void"}].id set from entity @s data.leMinions.stats.item

#spawn
loot spawn ~ ~ ~ mine ~ ~ ~ stick[custom_data={drop_contents:1b}]
setblock ~ ~ ~ air

#kill entities
execute as @e if score @s leMinions.id = @e[tag=leMinions.minion,limit=1,sort=nearest] leMinions.id run kill @s
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ $execute unless data storage le_minions:stats upgrades.fuel."$(id)" as @p[tag=th
#sound
execute as @p[tag=this_player] at @s run playsound minecraft:block.note_block.pling master @s ~ ~ ~ 1 2 1

#get efficiency and add data
execute store result score #efficiency leMinions.temp run data get entity @s data.leMinions.efficiency
$execute store result score #upgrade leMinions.temp run data get storage le_minions:stats upgrades.fuel."$(id)".efficiency
scoreboard players operation #efficiency leMinions.temp += #upgrade leMinions.temp
execute store result entity @s data.leMinions.efficiency int 1 run scoreboard players get #efficiency leMinions.temp

#update time action
#update efficiency and time action
$function le_minions:minions/ui/action/upgrades/fuel/update_efficiency {path: "storage le_minions:stats upgrades.fuel.\"$(id)\".efficiency", op: "+"}
function le_minions:minions/ui/action/upgrades/fuel/update_time_action

#update ui
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#sound
execute as @a[tag=this_player] at @s run playsound minecraft:block.note_block.pling master @s ~ ~ ~ 1 1 1

#update time action

#update efficiency
execute store result score #efficiency leMinions.temp run data get entity @s data.leMinions.efficiency
$execute store result score #upgrade leMinions.temp run data get entity @s data.leMinions.ui.upgrades.$(slot).efficiency
scoreboard players operation #efficiency leMinions.temp -= #upgrade leMinions.temp
execute store result entity @s data.leMinions.efficiency int 1 run scoreboard players get #efficiency leMinions.temp

#update time action
$function le_minions:minions/ui/action/upgrades/fuel/update_efficiency {path: "entity @s data.leMinions.ui.upgrades.$(slot).efficiency", op: "-"}
function le_minions:minions/ui/action/upgrades/fuel/update_time_action

#return item
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$data modify storage le_minions:stats upgrades.item set from block ~ ~ ~ Items[{Slot:$(slot)b}]
$data modify storage le_minions:stats upgrades.item.slot set value $(slot)
function le_minions:minions/ui/action/upgrades/fuel/check with storage le_minions:stats upgrades.item
function le_minions:minions/ui/action/upgrades/fuel/insert with storage le_minions:stats upgrades.item
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
execute store result score #efficiency leMinions.temp run data get entity @s data.leMinions.efficiency
$execute store result score #upgrade leMinions.temp run data get $(path)
$scoreboard players operation #efficiency leMinions.temp $(op)= #upgrade leMinions.temp
execute store result entity @s data.leMinions.efficiency int 1 run scoreboard players get #efficiency leMinions.temp
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ scoreboard players operation #calc leMinions.time_action /= #100 leMinions.temp
scoreboard players operation @s leMinions.time_action -= #calc leMinions.time_action
execute store result entity @s data.leMinions.time_action float 0.1 run scoreboard players get @s leMinions.time_action
scoreboard players operation @s leMinions.time_action /= #10 leMinions.temp
execute if score @s leMinions.timer > @s leMinions.time_action run scoreboard players operation @s leMinions.timer = @s leMinions.time_action
execute if score @s leMinions.timer > @s leMinions.time_action run scoreboard players operation @s leMinions.timer = @s leMinions.time_action
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ execute store result entity @s data.leMinions.max_storage int 1 run scoreboard p
$data modify entity @s data.leMinions.ui.upgrades.$(slot) set value {id: "$(id)", slot: $(slot)}
$data modify entity @s data.leMinions.ui.upgrades.$(slot) merge from storage le_minions:stats upgrades.storage."$(id)"

#case shulker box
$execute if items block ~ ~ ~ container.$(slot) #minecraft:shulker_boxes run data modify entity @s data.leMinions.ui.upgrades.$(slot) merge from storage le_minions:stats upgrades.storage."$(id)"

#update count and adjust return
$function le_minions:minions/ui/action/upgrades/update_return_item {slot: "$(slot)", count: "$(count)"}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$data modify storage le_minions:stats upgrades.item set from block ~ ~ ~ Items[{Slot:$(slot)b}]
$data modify storage le_minions:stats upgrades.item.slot set value $(slot)
$execute if items block ~ ~ ~ container.$(slot) #minecraft:shulker_boxes run data modify storage le_minions:stats upgrades.item.id set value "minecraft:shulker_box"
function le_minions:minions/ui/action/upgrades/storage/check with storage le_minions:stats upgrades.item
function le_minions:minions/ui/action/upgrades/storage/insert with storage le_minions:stats upgrades.item
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#create item
$data merge storage le_minions:ui {head_item:{id: "minecraft:player_head", Count: 1b, components: {"minecraft:custom_data": {leMinions: {empty:4b}}, "lore":['"§7To activate your minion, §r"','"§7place it as follows: §r"', $(layout), '""','"§7Time For Action: §b$(time_action_txt)s §r"', '"§7Max Storage: §b$(max_storage)§b/960 §r"']}}}
data modify storage le_minions:ui head_item.components.profile set from entity @s data.leMinions.stats.profile
$data modify storage le_minions:ui head_item.components.item_name set value 'a$(name) Minion§r"'
$data modify storage le_minions:ui head_item.components.item_name set value 'b$(name) Minion§r"'

$execute if data entity @s data.leMinions.efficiency unless data entity @s data.leMinions{efficiency: 0} run data modify storage le_minions:ui head_item.components.lore[8] set value '"§7Time For Action: §a$(time_action_txt)s (-$(efficiency)%) §r"'
$execute if data entity @s data.leMinions.efficiency unless data entity @s data.leMinions{efficiency: 0} run data modify storage le_minions:ui head_item.components.lore[8] set value '"§7Time For Action: §b$(time_action_txt)s (-$(efficiency)%) §r"'

#set item
data modify storage le_minions:ui mask[{Slot:4b}] merge from storage le_minions:ui head_item
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$execute if data entity @s data.leMinions.ui.upgrades.$(slot) run return run function le_minions:minions/ui/models/root/fuel/item with entity @s data.leMinions.ui.upgrades.$(slot)

$data modify storage le_minions:ui mask prepend value {Slot:$(slot)b, id: "minecraft:orange_stained_glass_pane", components: {"minecraft:custom_data": {leMinions:{empty:3b}}, "item_name":'"§aFuel§r"', lore: ['"§7Make your minion works §r"', '"§7faster by adding any §r"', '"§7of the fuels below: §r"','"§7- Charcoal: §b-2%§r"','"§7- Coal: §b-4%§r"','"§7- Block of Coal: §b-6%§r"','"§7- Heart of the Sea: §b-8%§r"','"§7- Nether Star: §b-10%§r"','"§7- Dragon Egg: §b-50%§r"','""','"§e| Place the item here "']}}
$data modify storage le_minions:ui mask prepend value {Slot:$(slot)b, id: "minecraft:orange_stained_glass_pane", components: {"minecraft:custom_data": {leMinions:{empty:3b}}, "item_name":'"§aFuel§r"', lore: ['"§7Make your minion works §r"', '"§7faster by adding any §r"', '"§7of the fuels below: §r"','"§7- Charcoal: §b-2%§r"','"§7- Coal: §b-4%§r"','"§7- Block of Coal: §b-6%§r"','"§7- Heart of the Sea: §b-8%§r"','"§7- Nether Star: §b-10%§r"','"§7- Dragon Egg: §b-40%§r"','""','"§e| Place the item here "']}}
Loading

0 comments on commit 1955493

Please sign in to comment.