Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Use armor stands to create skills (i.e. comet)
- # Stray (shaman): holds stick, summon angry wolves,
- # Add particles & sounds
- options:
- logo: &4&lBoss&8:&7
- bossGuiName: Bosses
- # Boss health
- maxHealth_zombieBoss: 100
- maxHealth_skeletonBoss: 140
- maxHealth_blazeBoss: 120
- maxHealth_shamanBoss: 110
- # The permission required to execute the command '/boss'
- permission: "boss.*"
- on enable:
- set {zombieBossItem} to zombie head named "&aZombie Boss" with lore " &7Health&8: &7{@maxHealth_zombieBoss}", "&8 ", " &7Click to summon" and " &7the Zombie Boss."
- set {skeletonBossItem} to skeleton head named "&fSkeleton Boss" with lore " &7Health&8: &7{@maxHealth_skeletonBoss}", "&8 ", " &7Click to summon" and " &7the Skeleton Boss."
- set {blazeBossItem} to blaze rod named "&cBlaze Boss" with lore " &7Health&8: &7{@maxHealth_blazeBoss}", "&8 ", " &7Click to summon" and " &7the Blaze Boss."
- set {shamanBossItem} to stick named "&2Shaman Boss" with lore " &7Health&8: &7{@maxHealth_shamanBoss}", "&8 ", " &7Click to summon" and " &7the Shaman Boss."
- function getNewLocation(location: Location, offset: Number, direction: Integer) :: Location:
- if {_direction} is 0:
- set {_location} to location {_offset} meters northeast of {_location}
- else if {_direction} is 1:
- set {_location} to location {_offset} meters northwest of {_location}
- else if {_direction} is 2:
- set {_location} to location {_offset} meters southwest of {_location}
- else if {_direction} is 3:
- set {_location} to location {_offset} meters southeast of {_location}
- return {_location}
- function mustUpdateDirection(input: Number, standsWithTheSameDirection: Integer, dir: Integer) :: boolean:
- if {_standsWithTheSameDirection} < 1:
- set {_standsWithTheSameDirection} to 1
- while {_input} >= {_standsWithTheSameDirection}:
- remove {_standsWithTheSameDirection} from {_input}
- if {_input} is 0:
- return true
- return false
- function getNewDirection(dir: Integer) :: integer:
- add 1 to {_dir}
- if {_dir} is 4:
- set {_dir} to 0
- return {_dir}
- # Number MUST be a duplicate of four
- function circle(loc: location, radius: Integer, amount: Integer, entity: EntityType):
- set {_summonLocation} to location {_radius} meters north of {_loc}
- set {_standsWithTheSameDirection} to {_amount}/4
- set {_distanceBetweenStands} to {_radius}/{_standsWithTheSameDirection}
- set {_dir} to 2
- summon {_entity} at {_summonLocation}
- set metadata value "isBossMinion" of {_target} to true
- set helmet of last spawned entity to unbreakable skull of "MHF_%{_entity}%" parsed as an offline player
- loop {_amount} -1 times:
- set {_summonLocation} to getNewLocation({_summonLocation}, {_distanceBetweenStands}, {_dir})
- if mustUpdateDirection(loop-value, "%{_standsWithTheSameDirection}%" parsed as an integer, {_dir}) is true:
- set {_dir} to getNewDirection({_dir})
- summon {_entity} at {_summonLocation}
- set metadata value "isBossMinion" of {_target} to true
- set helmet of last spawned entity to unbreakable skull of "MHF_%{_entity}%" parsed as an offline player
- add "{ArmorDropChances:[0.0f,0.0f,0.0f,0.0f],HandDropChances:[0.0f,0.0f]}" to nbt of {_boss}
- command /boss:
- trigger:
- if executor is not player:
- send "{@logo} This command can only be executed by a player."
- else if player doesn't have permission {@permission}:
- send "{@logo} You do not have enough permissions to do this."
- else:
- open chest with 3 rows named "{@bossGuiName}" to player
- loop 10 times:
- set slot loop-value - 1 of player's current inventory to gray stained glass pane named "&k"
- set slot 26 - loop-value - 1 of player's current inventory to gray stained glass pane named "&k"
- set slot 10 of player's current inventory to {zombieBossItem}
- set slot 11 of player's current inventory to {skeletonBossItem}
- set slot 12 of player's current inventory to {blazeBossItem}
- set slot 13 of player's current inventory to {shamanBossItem}
- set {boss.currentInventory.%player%} to true
- #
- # B o s s e s
- #
- function getRandomTarget(boss: Entity, radius: Number) :: Entity:
- set {_possibleTargets::*} to all players in radius {_radius} around {_boss}
- set {_targetsAreEntities} to false
- if size of {_possibleTargets::*} < 1:
- set {_targetsAreEntities} to true
- set {_possibleTargets::*} to all entities in radius {_radius} around {_boss}
- while {_possibleTargets::*} is not empty:
- set {_target} to random element out of {_possibleTargets::*}
- remove {_target} from {_possibleTargets::*}
- if {_target} is not a player:
- if {_target} is not {_boss}:
- if {_target} is not a dropped item:
- if {_target} is not experience orb or painting or item frame or armor stand:
- if "%{_target}%" does not contain "arrow":
- if metadata value "isBossMinion" of {_target} is not set:
- return {_target}
- if metadata value "isBossMinion" of {_target} is not true:
- return {_target}
- else if gamemode of {_target} is survival or adventure:
- return {_target}
- set {_stopLoop} to false
- if {_possibleTargets::*} is empty:
- set {_stopLoop} to true
- else if {_possibleTargets::*} is not set:
- set {_stopLoop} to true
- if {_stopLoop}:
- if {_targetsAreEntities} is false:
- set {_targetsAreEntities} to true
- set {_possibleTargets::*} to all entities in radius {_radius} around {_boss}
- else:
- return null
- function damageEntitiesInRadius(location: Location, radius: Number, damage: Number, ignoreEntity: Entity):
- loop all entities in radius {_radius} around {_location}:
- if loop-entity is not {_ignoreEntity}:
- damage loop-entity by {_damage}/(distance between location of loop-entity and {_location})
- function summonBoss(entityType: EntityType, location: Location, name: String, heldItem: Item, isAdult: Boolean) :: entity:
- set {_boss} to {_entityType}
- summon {_boss} at {_location}
- set {_boss} to last spawned entity
- set display name of {_boss} to "%{_name}%"
- set custom name visibility of {_boss} to true
- if {_entityType} is stray:
- set helmet of {_boss} to unbreakable skull of "12345" parsed as an offline player with nbt "{SkullOwner:{Id:""644c9bad-958b-43ce-9d2f-199d85be607c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzhkZGY3NmU1NTVkZDVjNGFhOGEwYTVmYzU4NDUyMGNkNjNkNDg5YzI1M2RlOTY5ZjdmMjJmODVhOWEyZDU2In19fQ==""}]}}}" with name "%{_name}% Trophy"
- else:
- set helmet of {_boss} to unbreakable skull of "MHF_%{_entityType}%" parsed as an offline player with name "%{_name}% Throphy"
- set chestplate of {_boss} to air
- set leggings of {_boss} to air
- set boots of {_boss} to air
- set held item of {_boss} to air
- add "{ArmorDropChances:[0.0f,0.0f,0.0f,1.1f],HandDropChances:[0.0f,0.0f]}" to nbt of {_boss}
- set {_boss} to adult
- if {_isAdult} is false:
- set {_boss} to baby
- return {_boss}
- function summonZombieBoss(location: Location):
- set {_boss} to summonBoss(zombie, {_location}, "&a&lZombie Boss", iron sword, true)
- set max health of {_boss} to {@maxHealth_zombieBoss}
- set health of {_boss} to {@maxHealth_zombieBoss}
- wait 20 ticks
- while {_boss} is alive:
- if {%{_boss}%.hasUsedJumpAbility} is not true:
- set {_rng} to random integer between 0 and 6
- if {_rng} is 0, 1 or 2:
- circle(location of {_boss}, 3, 8, zombie)
- else if {_rng} is 3 or 4:
- delete {_target} # Added to resolve an issue whereas the targetted player will be targetted (even when in creative/spectator)
- set {_target} to getRandomTarget({_boss}, 9)
- if {_target} is set:
- jump({_boss}, 5, {_target})
- wait 68 ticks
- function jump(entity: Entity, height: Number, targetLocation: Location):
- set {%{_entity}%.hasUsedJumpAbility} to true
- push {_entity} (direction from location of {_entity} to {_targetLocation}) at speed 0.7436
- push {_entity} 0.9513 meters upwards
- # Skeleton boss
- function summonSkeletonBoss(location: Location):
- set {_boss} to summonBoss(skeleton, {_location}, "&f&lSkeleton Boss", bow, true)
- set max health of {_boss} to {@maxHealth_skeletonBoss}
- set health of {_boss} to {@maxHealth_skeletonBoss}
- wait 20 ticks
- while {_boss} is alive:
- set {_rng} to random integer between 0 and 7
- delete {_target} # Added to resolve an issue whereas the targetted player will be targetted (even when in creative/spectator)
- if {_rng} is 0, 1 or 2:
- circle(location of {_boss}, 3, 4, skeleton)
- else if {_rng} is 3 or 4:
- set {_target} to getRandomTarget({_boss}, 17)
- if {_target} is set:
- shootArrows({_boss}, random integer between 4 and 7, {_target})
- wait 52 ticks
- function shootArrows(boss: Entity, arrowAmount: Number, target: Entity):
- loop {_arrowAmount} times:
- if {_boss} is alive:
- if {_target} is alive:
- if distance between {_boss} and {_target} <= 17:
- set {_v} to vector from {_boss} to location of {_target}
- make {_boss} shoot arrow at speed 1 {_v}
- wait "%random integer between 5 and 9% ticks" parsed as a timespan
- # Blaze boss
- function summonBlazeBoss(location: Location):
- set {_boss} to summonBoss(blaze, {_location}, "&c&lBlaze Boss", air, true)
- set max health of {_boss} to {@maxHealth_blazeBoss}
- set health of {_boss} to {@maxHealth_blazeBoss}
- wait 20 ticks
- while {_boss} is alive:
- set {_rng} to random integer between 0 and 8
- delete {_target} # Added to resolve an issue whereas the targetted player will be targetted (even when in creative/spectator)
- if {_rng} is 0, 1 or 2:
- circle(location of {_boss}, 4, 4, blaze)
- else if {_rng} is 3 or 4:
- set {_target} to getRandomTarget({_boss}, 17)
- if {_target} is set:
- summonComet({_boss}, {_target})
- wait 52 ticks
- function summonComet(boss: Entity, target: Entity):
- set {_cometY::*} to 0, 0, 0, 0, 0, 0.2 and -0.2
- set {_cometX::*} to 0, 0.2, 0, -0.2, 0, 0 and 0
- set {_cometZ::*} to 0.2, 0, -0.2, 0, 0, 0 and 0
- loop 7 times:
- summon armor stand at location 10+{_cometY::%loop-value%} meters above, {_cometX::%loop-value%} meters east and {_cometZ::%loop-value%} meters south of {_target}
- set {_stand::%loop-value%} to last spawned armor stand
- set metadata value "IsCometStand" of {_stand::%loop-value%} to true
- set helmet of {_stand::%loop-value%} to coal block
- add "{Invisible:1b}" to nbt of {_stand::%loop-value%}
- while {_stand::1} is not on ground:
- wait 5 ticks
- set {_loc} to location of {_stand::1}
- loop {_stand::*}:
- kill loop-value
- damageEntitiesInRadius({_loc}, 3.9, 3.9, {_boss})
- function getRandomVector() :: integers:
- loop 3 times:
- if loop-value is 1:
- add random integer between -1 and 0 to {_values::*}
- else:
- add random integer between -5 and 5 to {_values::*}
- return {_values::*}
- command /fb:
- trigger:
- summonFallingBlock(player, player)
- function summonFallingBlock(boss: Entity, target: Location):
- set {_loc} to getRandomFallingBlockLocation({_boss}, location 1 meters below {_target}, 5)
- set {_block} to block at {_loc}
- set {_valid} to true
- if isValidBlockLocation({_loc}, location 1 meters below {_target}) is false:
- set {_valid} to false
- set {_block} to dirt
- chance of 4%:
- set {_block} to grass block
- spawn falling block of {_block} at location 7 meters above {_target}
- set {_fallingBlock} to last spawned falling block
- set metadata value "IsBossFallingBlock" of {_fallingBlock} to true
- if {_valid}:
- set block at {_loc} to air
- function isValidBlockLocation(location: Location, invalidLocation: Location) :: Boolean:
- if {_location} is {_invalidLocation}:
- return false
- else if block at {_location} is air:
- return false
- return true
- function getRandomFallingBlockLocation(boss: Entity, invalidLocation: Location, retryCount: Integer) :: location:
- loop {_retryCount} times:
- set {_vector::*} to getRandomVector()
- set {_l} to location {_vector::1} meters north, {_vector::2} meters above and {_vector::3} meters east of {_boss}
- if block at {_l} is not air:
- if {_l} is not {_invalidLocation}:
- return {_l}
- return {_l}
- # Head is incorrect
- function summonShamanBoss(location: Location):
- set {_boss} to summonBoss(stray, {_location}, "&2&lShaman Boss", stick, true)
- set metadata value "ExcemptWolfTarget" of {_boss} to true
- set max health of {_boss} to {@maxHealth_shamanBoss}
- set health of {_boss} to {@maxHealth_shamanBoss}
- wait 20 ticks
- while {_boss} is alive:
- set {_rng} to random integer between 0 and 7
- delete {_target}
- if {_rng} is 0 or 1:
- set {_target} to getRandomTarget({_boss}, 21)
- if {_target} is set:
- circle(location of {_boss}, 4, 4, skeleton)
- else if {_rng} is 2 or 3:
- set {_target} to getRandomTarget({_boss}, 27)
- if {_target} is set:
- summonFallingBlock({_boss}, {_target})
- else if {_rng} is 4 or 5:
- if health of {_boss}+20 < max health of {_boss}:
- set health of {_boss} to health of {_boss}+20
- else:
- set health of {_boss} to max health of {_boss}
- wait 52 ticks
- on inventory click:
- if inventory name of player's current inventory is "{@bossGuiName}":
- cancel event
- if clicked item is {zombieBossItem}:
- summonZombieBoss(location of player)
- close inventory of player
- else if clicked item is {skeletonBossItem}:
- summonSkeletonBoss(location of player)
- close inventory of player
- else if clicked item is {blazeBossItem}:
- summonBlazeBoss(location of player)
- close inventory of player
- else if clicked item is {shamanBossItem}:
- summonShamanBoss(location of player)
- close inventory of player
- on inventory close:
- delete {boss.currentInventory.%player%}
- on inventory drag:
- if {boss.currentInventory.%player%} is true:
- cancel event
- on quit:
- delete {boss.currentInventory.%player%}
- on damage:
- if damage cause is fall:
- if {%victim%.hasUsedJumpAbility} is true:
- delete {%victim%.hasUsedJumpAbility}
- damageEntitiesInRadius(location of {_victim}, 4.3, 2.6, victim)
- on right click on armor stand:
- if metadata value "IsCometStand" of clicked entity is true:
- cancel event
- on falling block land:
- if metadata value "IsBossFallingBlock" of event-entity is true:
- clear metadata value "IsBossFallingBlock" of event-entity
- damageEntitiesInRadius(location of event-entity, 4.2, 3.2, event-entity)
Advertisement
Add Comment
Please, Sign In to add comment