Skip to content

Instantly share code, notes, and snippets.

@Blueyescat
Last active August 30, 2019 22:11
Show Gist options
  • Save Blueyescat/e3c9e8d88b764e8d35c1060871051471 to your computer and use it in GitHub Desktop.
Save Blueyescat/e3c9e8d88b764e8d35c1060871051471 to your computer and use it in GitHub Desktop.
on load:
set {meteor::blockTypes::*} to redstone block, redstone ore, magma block, magma block, magma block, magma block and netherrack
expression [the] direction from %location% to %location%:
return type: direction
get:
return new Direction(expr-2.toVector().subtract(expr-1.toVector()))
local effect combine %entity% with %entity% [with offset %-direction%]:
trigger:
set {_offset} to expr-3
if {_offset} is not set:
set {_offset} to direction from expr-2 to expr-1
while expr-1.isDead() and expr-2.isDead() are false:
set {_loc} to location {_offset} expr-2
expr-1.getHandle().setPosition((x coord of {_loc}), (y coord of {_loc}), (z coord of {_loc}))
(first element of passengers of expr-1).setTicksLived(1)
wait a tick
(first element of passengers of expr-1).remove()
expr-1.remove()
local expression a meteor block at %location%:
return type: entity
get:
spawn an armor stand at expr-1
set {_as} to spawned entity
{_as}.setGravity(false)
{_as}.setBasePlate(false)
{_as}.setVisible(false)
{_as}.setMarker(true)
{_as}.setInvulnerable(false)
spawn ("falling %random element out of {meteor::blockTypes::*}%" parsed as entity type) at expr-1
set {_fb} to spawned entity
make {_fb} ride {_as}
{_fb}.setGravity(false)
{_fb}.setDropItem(false)
{_fb}.setHurtEntities(false)
{_fb}.setInvulnerable(false)
return {_as}
effect spawn [a] meteor from %location% to %location%:
trigger:
set {_mainAS} to a meteor block at expr-1
loop sphere at expr-1 with radius 2 and density 2:
if loop-value is not expr-1:
add 1 to {_n}
set {_as::%{_n}%} to a meteor block at loop-value
combine {_as::%{_n}%} with {_mainAS}
set {_vector} to vector from expr-2 to expr-1
set {_flame} to flame
set {_flame}.speed to 0.01
set {_flame}.dX to x of {_vector}
set {_flame}.dY to y of {_vector} * 1.2
set {_flame}.dZ to z of {_vector}
set {_smoke} to campfire signal smoke
set {_smoke}.speed to 0.005
set {_smoke}.dX to x of {_vector}
set {_smoke}.dY to y of {_vector} * 1.2
set {_smoke}.dZ to z of {_vector}
loop line between expr-1 and expr-2 with density 5: # speed (higher = slower)
if {_mainAS}.isDead():
stop
loop random sphere at (location 0.4 meters above loop-value) with radius 2.8 and density 2:
play {_flame} at loop-value-2
if chance of 3%:
play {_smoke} at loop-value-2
play spawner flames at loop-value-2
{_mainAS}.getHandle().setPosition((x coord of loop-value), ((y coord of loop-value) - 0.1), (z coord of loop-value))
wait a tick
(world of expr-2).createExplosion((location 1 meter above expr-2), 18, true)
loop {_as::*}:
set {_fb} to first element of passengers of loop-value
set {_material} to try {_fb}.getBlockData().getMaterial()
if last java error is not set:
set {_material} to {_fb}.getMaterial()
set block 4 below loop-value to new ItemType({_material})
loop blocks in radius 14 of expr-2:
if abs(y coord of loop-value - (y coord of expr-2) - 3) is smaller than 6:
if chance of 30%:
if loop-value is fire:
play campfire signal smoke at block above loop-value
set block below loop-value to netherrack
if chance of 20%:
if distance between loop-value and expr-2 is smaller than 10:
if loop-value is not air, lava or water:
if block below loop-value is not air, lava or water:
play campfire signal smoke at block above loop-value
set loop-value to random item type out of {meteor::blockTypes::*}
if chance of 1%:
if distance between loop-value and expr-2 is greater than 8:
(world of expr-2).createExplosion((location of loop-value), 3, true)
(first element of passengers of {_mainAS}).remove()
{_mainAS}.remove()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment