ballArmorStand: type: entity debug: false entity_type: armor_stand mechanisms: passengers: ballHitboxEntity visible: false gravity: false is_small: true marker: true equipment: helmet: ballHead custom_name: <&r><&6>Мяч #custom_name_visible: true ballHitboxEntity: type: entity debug: false entity_type: magma_cube mechanisms: invisible: true visible: false silent: true has_ai: false collidable: false persistent: true size: 2 # potion_effects: # - [type=INVISIBILITY;amplifier=255;duration=99999s;ambient=false;particles=false;icon=false] tempStand: type: entity debug: false entity_type: armor_stand mechanisms: visible: false is_small: true invulnerable: true gravity: false marker: true ballHead: type: item debug: false material: player_head mechanisms: skull_skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ== ballpickupHandler: type: world debug: false permission: dmc.admin events: on player right clicks ballHitboxEntity: - ratelimit 1s - define number - define skin <[number].flag[ballskin]> - define item - if == m@feather: - if : - animate animation:ARM_SWING - define ball - playsound sound:entity_villager_work_cartographer - playeffect at: effect:DUST_COLOR_TRANSITION special_data:1|green|red offset:1 quantity:15 data:0.05 visibility:100 velocity:0,0.1,0 - define skin - take iteminhand - equip <[ball]> head:]> - flag <[number]> ballskin:<[skin]> - flag ballskin:! - stop - foreach key:skin: - if == <[value].get[name]>: - take iteminhand - animate animation:ARM_SWING - define ball - playsound sound:entity_villager_work_leatherworker - playeffect at: effect:item_crack special_data:<[item]> offset:0.5 quantity:15 data:0.05 visibility:100 velocity:0,0.1,0 - define skin <[value].get[skin]> - equip <[ball]> head:]> - flag <[number]> ballskin:<[skin]> - flag ballskin:! - stop - if && != m@air && : - flag balled - flag ballowner - flag server oneplayer expire:2t - define ball - if <[ball].has_flag[ballnumber]>: - flag ballnumber:! - flag ballnumber:<[ball].flag[ballnumber]> - flag ballskin:<[ball].flag[ballskin]> #- narrate - else: - flag ballnumber:<&f><Уникальный><&sp><номер><&sp><&7><>><&sp><&6>].to[<1000>]> - flag ballskin:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ== - remove - remove #- remove #- remove #- remove - animate animation:ARM_SWING - flag server oneplayer:! - give to: ballItem - playsound sound:item_armor_equip_generic pitch:1 - flag balled:! #- narrate - stop #- run deletetask - else: - wait 1t ballplaceHandler: type: world debug: false permission: dmc.admin events: on player places ballItem using:off_hand: - determine cancelled on player right clicks block with:bundle: - foreach : - if <[value].script.name.equals[ballitem]||false>: - determine cancelled on player places ballItem: - if < 15: - determine cancelled - define num - define skin #- narrate <[skin]> - modifyblock air #- determine passively cancelled #- take item:ballItem - flag ballowner:! - announce to_console "Мяч поставил !" - playsound sound:item_armor_equip_turtle pitch:1 - spawn ballarmorstand save:ball - define ball - define number <[ball].passenger> - adjust <[number]> hide_from_players - wait 4t - equip <[ball]> head:]> - adjust <[number]> show_to_players - flag <[number]> ballnumber:! - flag <[number]> ballnumber:<[num]> - flag <[number]> ballskin:<[skin]> #- narrate <[num]> - flag ballnumber:! - flag ballskin:! #- modifyblock air balldropHandler: type: world debug: false permission: dmc.admin events: after player drops ballItem: - if < 15: - determine cancelled - if : #- adjust <[ballHitboxEntity]> visible:false - define num - define mat - define skin - define entity ]].first.if_null[]> - announce to_console "Мяч выбросил !" - announce to_console "Мяч выбросил !" - remove <[entity]> - flag ballowner:! - playsound sound:item_armor_equip_turtle pitch:1 - spawn ballarmorstand save:ballnumber - define ball - define ballnumber - define number <[ball].passenger> - adjust <[number]> hide_from_players - wait 1t - adjust <[number]> show_to_players - equip <[ball]> head:]> - flag <[number]> ballnumber:! - flag <[number]> ballnumber:<[num]> - flag <[number]> ballskin:<[skin]> #- narrate <[num]> - flag ballnumber:! - flag ballskin:! - adjust <[ball]> damage:1 - wait 1t #- define power 0.2 - define power 0.23 - flag <[ball]> velocity:].sub[]> - animate animation:ARM_SWING #- modifyblock air deletetask: type: task debug: false script: - if : - animate animation:ARM_SWING - give ballItem - flag balled:! - else: - wait 1t ballItem: type: item material: player_head display name: <&r>Мяч lore: - Уникальный<&sp>номер<&sp><&7><>><&sp><&6>> allow in material recipes: true flags: my_flag: mechanisms: skull_skin: recipes: 1: type: shaped recipe_id: my_custom_item_id group: my_custom_group output_quantity: 1 input: - rabbit_hide|string|rabbit_hide - string|material:pufferfish_bucket|string - rabbit_hide|string|rabbit_hide ballcraftHandler: type: world debug: false events: on player crafts ballItem: - if && : - flag ballimit expire:6h - else: - if && : - flag ballimit expire:1h - else: - narrate "<&c>Вы сможете скрафтить новый мяч через ].formatted.replace_text[s].with[с].replace_text[m].with[м].replace_text[h].with[ч].replace_text[d].with[д]>." - determine cancelled testcmd: type: command name: test usage: /test permission: dmc.prime debug: false script: - foreach as:entry: - narrate "found <[entry]>" ballskin: type: command name: ball usage: /ball permission: dmc.prime debug: false tab complete: - choose : - case 0: - determine - case 1: - if && ].not>: - determine - if && ].not>: - define matchingActions *]]||> - determine <[matchingActions]> - choose : - case skin: - determine 'Код головы' - case info: - determine - default: - determine script: - define action - if <[action].advanced_matches[info|skin].not||true>: - narrate '<&c>Выберите действие! (info|skin)' - stop - choose <[action]>: - case info: - if == Мяч: - narrate '<&a>В ваших руках мяч с описанием <&r>«<&r>»<&a> и скином <&6>' - else: - narrate "<&c>У вас в руках должен быть мяч!" - case skin: - define skin ].separated_by[<&sp>]||null> - if : - if <[skin]> == null: - narrate '<&c>Введите код головы!' - stop - if == m@feather: - if == 1: - define done '<&7>Готово к использованию!' - inventory adjust slot: flag:<[skin]> - inventory adjust slot: lore:<[done]> - narrate "<&a>Скин на перо успешно установлен!" - flag ballskintimer expire:5m - else: - narrate "<&c>У вас в руках должен быть предмет в количестве 1!" - else: - narrate "<&c>У вас в руках должно быть перо!" - else: - narrate "<&c>Вы сможете поставить скин на мяч через ].formatted.replace_text[s].with[с].replace_text[m].with[м].replace_text[h].with[ч].replace_text[d].with[д]>." ballHandler: type: world debug: false events: on ballHitboxEntity exits vehicle: - determine cancelled after ballArmorStand spawns: - run updateBall def.ball: - run updateBallHitbox def.entity: on ballHitboxEntity damaged: - determine passively cancelled - if : - stop - define ball - ratelimit 10t - ratelimit 10t #- animate animation:ARM_SWING_OFFHAND - if : #- define power 0.3 - define power 0.01 - flag <[ball]> velocity:].sub[]> - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6 - playeffect effect:sweep_attack at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100 - determine cancelled - if && : #- define power 0.48 - define power 0.8 - flag <[ball]> super - flag <[ball]> velocity:].sub[]> - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6 - playeffect effect:explosion_large at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100 - if <[ball].has_flag[super]>: - repeat 15: - if <[ball].location.above[0.1].material.is_solid.not>: - playeffect effect:sweep_attack at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100 - playeffect effect:REDSTONE special_data:1|white at:<[ball].flag[rawLocation].above[1.5]> offset:0 visibility:100 - wait 4t - flag <[ball]> super:! - determine cancelled - if : #- define power 0.48 - define power 0.6 - flag <[ball]> velocity:].sub[]> - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6 - playeffect effect:explosion_large at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100 - determine cancelled - if : #- define power 0.58 - define power 0.75 - flag <[ball]> super - else: #- define power 0.4 - define power 0.52 - flag <[ball]> velocity:].sub[]> - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6 - playeffect effect:sweep_attack at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100 - if <[ball].has_flag[super]>: - repeat 8: - if <[ball].location.above[0.1].material> == m@air: - playeffect effect:sweep_attack at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100 - wait 7t - flag <[ball]> super:! balllist: type: command name: balllist permission: dmc.admin usage: /balllist script: - narrate "<&a>Мяч есть у:" #- foreach : #- narrate "<&7>- <[value]>" targets: - foreach : - narrate <[value]> targets: updateBallHitbox: type: task debug: false definitions: entity script: - wait 1t - while <[entity].is_spawned||false>: - if <[entity].vehicle||null> == null: - remove <[entity]> - stop - wait 1t getBallOffset: type: procedure debug: false definitions: ball script: - define turn <[ball].armor_pose_map.get[head].x> - define y ].div[3.14].mul[0.4]> - determine ]> updateBall: type: task debug: false definitions: ball script: - flag <[ball]> velocity: - define gravity - define rawLocation <[ball].location> - while <[ball].is_spawned>: #- playeffect effect:smoke at:<[rawLocation].above[1]> offset:0 quantity:10 - chunkload <[ball].location.chunk> duration:3s - if <[rawLocation].above[1].block.is_liquid||false>: - flag <[ball]> velocity:<[ball].flag[velocity].mul[0.7]> - define gravity - else: - define gravity #- spawn tempStand <[ball].location.above[1]> save:tempStand #- define tempStand #- adjust <[tempStand]> hide_from_players - look <[ball]> <[ball].location.add[<[ball].flag[velocity].mul[10]>]> - define hit <[ball].location.above.ray_trace[entities=!ballHitboxEntity]||null> #- adjust <[tempStand]> show_to_players - if <[hit].distance[<[rawLocation].above[1]>]||5> >= <[ball].flag[velocity].vector_length.add[0.5]>: #- flag <[ball]> velocity:<[ball].flag[velocity].add[<[gravity].div[10]>]> - flag <[ball]> velocity:<[ball].flag[velocity].add[<[gravity].div[14]>]> - else: #- teleport <[ball]> <[hitLoc].below[<[ball].eye_height>].below[0.25]> - flag <[ball]> velocity:<[ball].flag[velocity].mul[0.6]> - if <[ball].flag[velocity].vector_length> <= 0.05: - flag <[ball]> velocity: - else: #- spawn tempStand <[rawLocation].above[1]> save:tempStand #- define tempStand #- adjust <[tempStand]> hide_from_players - look <[ball]> <[ball].location.add[<[ball].flag[velocity].mul[10]>]> - wait 1t - define hitNormal <[ball].location.above[1].backward[0.3].ray_trace[entities=!ballHitboxEntity;return=normal]||null> - define hit <[ball].location.above[1].backward[0.3].ray_trace[entities=!ballHitboxEntity;return=block]||null> #- narrate <[hitNormal]> targets: - define axis - foreach <[hitNormal].xyz.split[,]>: - if <[value]> != 0: - define hitAxis <[axis].get[<[loop_index]>]> - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6 - playeffect effect:BLOCK_DUST at:<[ball].location.above[0.6]> special_data:<[hit].block.material> offset:0 quantity:15 data:0.05 visibility:100 - choose <[hitAxis]>: - case x: - flag <[ball]> velocity:<[ball].flag[velocity].with_x[<[ball].flag[velocity].x.mul[-1]>]> - case y: - flag <[ball]> velocity:<[ball].flag[velocity].with_y[<[ball].flag[velocity].y.mul[-1]>]> - case z: - flag <[ball]> velocity:<[ball].flag[velocity].with_z[<[ball].flag[velocity].z.mul[-1]>]> - adjust <[ball]> armor_pose:head=<[ball].armor_pose_map.get[head].x.add[<[ball].flag[velocity].vector_length.mul[0.6]>]>,<[ball].armor_pose_map.get[head].y>,<[ball].armor_pose_map.get[head].z> - define rawLocation <[rawLocation].add[<[ball].flag[velocity]>]> - if <[rawLocation].above[1].block.material.is_occluding||false>: - define rawLocation <[rawLocation].find_blocks.within[2].filter[material.is_solid.not].get[1].center.below[1]> - teleport <[ball]> <[rawLocation].add[<[ball].flag[velocity]>].above[].get[y]>].with_yaw[<[ball].location.yaw>].with_pitch[<[ball].location.pitch>]> - if <[ball].flag[velocity].vector_length> > 0.05: - look <[ball]> <[ball].location.above[1].add[<[ball].flag[velocity].mul[10]>]> #- narrate <[rawLocation].above[1].add[<[ball].flag[velocity]>]> #- narrate <[ball].flag[velocity]> targets: - flag <[ball]> rawLocation:<[rawLocation]> - wait 1t hoverableColor: type: procedure debug: false definitions: type script: - define data ]> - define text <[data].get[skin].parsed> - determine <[text]> colorSettings: type: data debug: false data: white: name: m@white_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ== red: name: m@red_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTUzNTgzNDFkNTM2ODVhNGU1YjE1YzRkNjVkNTg2OGJlNWEzZDU1MDY2ZmFmMDJlYTlkOTJkZGUyMTIzNCJ9fX0= lime: name: m@lime_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2M1NDJhZmViOGM3OTFhNGVhMzU4MTU1NjQyOTBhZGY1M2E5NjQxZDgzMjhiNjlmYjMyZTMyYWVkMWFlOSJ9fX0= blue: name: m@blue_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2Q0MDI4YzAxMWQ2MzYzM2QyZWMwNGE5NDE2NzI5NDhiZjAxMWQxZDdhNGYxNDVmOGNlNjljNzE3MmQzIn19fQ== light_blue: name: m@light_blue_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWE4ZmViODk3OWY3ZTkyN2Q2OWNhODNlZjc4M2NjOWIzNmQ4ZjEwZDU5Yzc5MzA5YWE2N2I4ZWY2MjM4NmQifX19 purple: name: m@purple_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmRiNmVjNmEyMWY2N2FhNTRkZDgxNzA5YjRiN2Q1ZmM5NzUzMmE1M2Y0MGQ5OWZmYzdmNWMxNmY0NzQ3Mzg1In19fQ== orange: name: m@orange_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTI3YjIyYjNiMjk1NGMzNDFmZDZlYjc4Yzg2MDliYzUyYzFlNjU4MTE3Y2E1YmQ5ZGM4NDViNmM5YmQ1YjQ0In19fQ== black: name: m@black_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjFiMDE2NWVlMmIzMjI5NjhmMDE4MDM0YjhkN2UyZGY2MTM1ZmE5NGJlYTdhZTgxY2RmMGJjYjY2YWMyIn19fQ== yellow: name: m@yellow_dye skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2ZlOGIyZTkxOTE3NDI2ZjNlZjhkODVkM2Y2YzA0ZmZmYWU5ZWQ1MTZhNjlhMzQ4ZjNmOWJjZWU0YTljOTEifX19