Skip to content

Commit 916aedc

Browse files
committed
release(0.5.4): adds place block helper function
1 parent e2a6823 commit 916aedc

File tree

8 files changed

+23
-0
lines changed

8 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.4] - 2023-02-02
9+
### Added
10+
- Helpers / Block / Place, places the given block at ~ ~ ~. Runs a callback when it has finished.
11+
812
## [0.5.3] - 2023-02-01
913
### Added
1014
- String / Filter, returns true if the given string is not in the target array.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function moxlib:helpers/block/place/init
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
scoreboard objectives add moxlib.helpers.block.place dummy
12
scoreboard objectives add moxlib.helpers.data.calculate_pages dummy
23
scoreboard objectives add moxlib.helpers.inventory.compact dummy
34
scoreboard objectives add moxlib.helpers.inventory.strip_slots dummy
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
scoreboard players add @s moxlib.helpers.block.place 1
2+
execute unless block ~ ~1 ~ minecraft:air run function moxlib:helpers/block/place/delete
3+
execute if block ~ ~1 ~ minecraft:air unless score @s moxlib.helpers.block.place matches 10.. run schedule function moxlib:helpers/block/place/cleanup 1t
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
execute as @e[type=shulker,tag=moxlib.helpers.block.place] at @s run function moxlib:helpers/block/place/check
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
execute positioned ~ ~1 ~ run function #moxlib:api/helpers/block/place/finished
2+
execute if block ~ ~ ~ minecraft:moving_piston run setblock ~ ~ ~ minecraft:air
3+
tp @s ~ ~-500 ~
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
execute if block ~ ~-1 ~ minecraft:air run setblock ~ ~-1 ~ moving_piston
2+
execute align xyz run summon shulker ~ ~-1 ~ {Silent:1b,Invulnerable:1b,DeathLootTable:"minecraft:empty",NoAI:1b,AttachFace:0b,Tags:["moxlib.helpers.block.place"],ActiveEffects:[{Id:14,Amplifier:1b,Duration:199999980,ShowParticles:0b}]}
3+
4+
summon falling_block ~ ~ ~ {DropItem:false,Tags:["moxlib.helpers.block.place"]}
5+
execute as @e[type=falling_block,limit=1,sort=nearest,tag=moxlib.helpers.block.place] run data modify entity @s BlockState set from storage moxlib:api/helpers/block/place target
6+
7+
schedule function moxlib:helpers/block/place/cleanup 1t
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"values": []
3+
}

0 commit comments

Comments
 (0)