Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pitchAtan2(loc1: location, loc2: location) :: number:
- set {_dx} to x-coordinate of {_loc2} - x-coordinate of {_loc1}
- set {_dy} to y-coordinate of {_loc2} - y-coordinate of {_loc1}
- set {_dz} to z-coordinate of {_loc2} - z-coordinate of {_loc1}
- set {_pitch} to 0-atan2(sqrt({_dx}^2+{_dz}^2), {_dy})
- return {_pitch}
- function yawAtan2(loc1: location, loc2: location) :: number:
- set {_dx} to x-coordinate of {_loc2} - x-coordinate of {_loc1}
- set {_dz} to z-coordinate of {_loc2} - z-coordinate of {_loc1}
- set {_yaw} to atan2({_dx}, {_dz})-90
- return {_yaw}
- function gasterBlaster(shooter: entity, target: entity):
- add string, cobweb, dead grass, banner, lever, redstone wire, wooden button, stone button, torch, fire, lava, water, portal, end portal, ender gateway, "6" parsed as itemtype, "37" parsed as itemtype, "38" parsed as itemtype, "39" parsed as itemtype, "40" parsed as itemtype, "175" parsed as itemtype and air to {_nohitblocks::*}
- execute console command "execute %UUID of {_shooter}% ~ ~ ~ playsound gasterblaster.all master @a ~ ~ ~ 3"
- spawn an armor stand at location random number between 2 and 3 meter above location random number between -7 and 7 meter right location of {_shooter}
- set {_blaster} to last spawned armor stand
- add "{Invisible:1b,Marker:1b,NoGravity:1b,ArmorItems:[{},{},{},{id:""minecraft:skull"",Count:1b,Damage:5s}]}" to nbt of {_blaster}
- wait 1 tick
- set {_pitch} to pitchAtan2({_blaster}, {_target})
- if {_pitch} < 0:
- add 360 to {_pitch}
- add "{Pose:{Head:[%{_pitch}%f,0f,0f]},Rotation:[%yawAtan2({_blaster}, {_target})%f,0f]}" to nbt of {_blaster}
- set {_shootloc} to location 1.25 meter above location of {_blaster}
- set pitch of {_shootloc} to pitchAtan2({_shootloc}, {_target})
- wait 0.5 second
- loop 200 times:
- set {_loopnum} to loop-number
- set {_x} to x-coordinate of location {_loopnum}*0.5 meter forwards {_shootloc}
- set {_y} to y-coordinate of location {_loopnum}*0.5 meter forwards {_shootloc}
- set {_z} to z-coordinate of location {_loopnum}*0.5 meter forwards {_shootloc}
- execute console command "execute %UUID of {_shooter}% ~ ~ ~ particle instantSpell %{_x}% %{_y}% %{_z}% 0.5 0.5 0.5 0 50 force"
- loop entities in radius 0.75 around location {_loopnum}*0.5 meter forwards {_shootloc}:
- loop-entity is a living entity
- loop-entity is not {_shooter}
- {_hit.%UUID of loop-entity%} is not set
- make {_shooter} damage loop-entity by 10
- loop-entity.setNoDamageTicks(0)
- set {_hit.%UUID of loop-entity%} to 1
- execute console command "execute %UUID of loop-entity% ~ ~ ~ effect @s 20 10 2"
- if {_nohitblocks::*} do not contain block at location {_loopnum}*0.5+0.5 meter forwards {_shootloc}:
- execute console command "execute %UUID of {_shooter}% ~ ~ ~ particle fireworksSpark %{_x}% %{_y}% %{_z}% 0 0 0 0.5 1000 force"
- stop loop
- wait 1.5 second
- kill {_blaster}
- on shoot:
- shooter is a skeleton
- cancel event
- gasterBlaster(shooter, target of shooter)
- on shoot:
- shooter is a wither
- cancel event
- gasterBlaster(shooter, target of shooter)
- on shoot:
- shooter is a blaze
- cancel event
- gasterBlaster(shooter, target of shooter)
Advertisement
Add Comment
Please, Sign In to add comment