Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### IMPORTS #####
- #/summon minecraft:armor_stand ~ ~ ~ {NoGravity:1b,Invulnerable:1b,Invisible:1,Marker:1b,Tags:["grid"],DisabledSlots:4144959,ArmorItems:[{},{},{},{id:"minecraft:jigsaw",Count:1b,tag:{CustomModelData:0}}]}
- #/setworldspawn 250 63 19
- effect give @p instant_health 9999 0 true
- effect give @p resistance 9999 100 true
- effect give @p saturation 9999 0 true
- effect give @p invisibility 9999 0 true
- effect give @p night_vision 9999 0 true
- kill @e[type=item,x=0,y=235,z=3,dx=34,dy=20,dz=-2]
- scoreboard objectives add facing dummy
- execute as @e[tag=sprite] if data entity @s {Rotation:[90f]} run scoreboard players set facing facing 0
- execute as @e[tag=sprite] if data entity @s {Rotation:[-90f]} run scoreboard players set facing facing 1
- team add nocoll
- team modify nocoll collisionRule never
- team join nocoll @e[tag=click_detect]
- experience set @p 99 levels
- experience set @p 732 points
- kill @e[type=minecraft:experience_orb]
- kill @e[type=minecraft:arrow]
- kill @e[type=minecraft:fireball]
- execute as @e[tag=spawnpoint] at @s run forceload add ~ ~
- ##### MAIN #####
- ## Spawnpoint
- execute as @e[tag=looking_at] at @s if block ~ ~ ~ #minecraft:beds run forceload remove all
- execute as @e[tag=looking_at] at @s run forceload add 250 19
- execute as @e[tag=looking_at] at @s if block ~ ~ ~ #minecraft:beds run kill @e[tag=spawnpoint]
- execute as @e[tag=looking_at] at @s if block ~ ~ ~ #minecraft:beds run summon minecraft:armor_stand ~ ~ ~ {NoGravity:1b,Invulnerable:1b,Invisible:1,Marker:1b,Tags:["spawnpoint"],DisabledSlots:4144959}
- execute as @e[tag=spawnpoint] at @s unless block ~ ~ ~ #minecraft:beds run kill @s
- ## If player not found...
- execute unless entity @e[tag=player] run summon armor_stand 245 64 15 {Tags:["player","spawn"],Invulnerable:1,Pose:{Head:[0f,15f,0f]}}
- execute as @e[tag=player,tag=spawn] at @e[tag=spawnpoint,limit=1] run tp @s ~1 ~ ~
- execute as @e[tag=player,tag=spawn] as @p at @s run playsound minecraft:entity.player.death master @s
- execute as @e[tag=player,tag=spawn] run tellraw @a {"text":"Player fell out of the world"}
- tag @e[tag=player,tag=spawn] remove spawn
- ## Stay on axis
- scoreboard objectives add player_z dummy
- execute as @e[tag=player] store result score @s player_z run data get entity @s Pos[2]
- execute as @e[tag=player] at @s unless score @s player_z matches 15 run tp @s ~ ~ 15
- ## Visuals
- execute as @e[tag=sprite] run data merge entity @s {HandItems:[{},{}],ArmorItems:[{},{},{},{id:"minecraft:player_head",Count:1b}]}
- execute as @e[tag=sprite] run data modify entity @s HandItems[0] merge from entity @p SelectedItem
- execute as @e[tag=sprite] run data modify entity @s HandItems[1] merge from entity @p Inventory[{Slot:-106b}]
- execute as @e[tag=sprite] run data modify entity @s ArmorItems[3] merge from entity @p Inventory[{Slot:103b}]
- execute as @e[tag=sprite] run data modify entity @s ArmorItems[2] merge from entity @p Inventory[{Slot:102b}]
- execute as @e[tag=sprite] run data modify entity @s ArmorItems[1] merge from entity @p Inventory[{Slot:101b}]
- execute as @e[tag=sprite] run data modify entity @s ArmorItems[0] merge from entity @p Inventory[{Slot:100b}]
- ## Time detect
- scoreboard objectives add time dummy
- execute store result score time time run time query daytime
- ## Screen (16:9, or 32x18)
- execute unless score time time matches 12541..23458 run fill 1 254 1 32 237 1 minecraft:light_blue_concrete
- execute if score time time matches 12541..23458 run fill 1 254 1 32 237 1 minecraft:black_concrete
- ## Clone screen
- execute as @e[tag=player] at @s run setworldspawn ~ ~ ~
- scoreboard objectives add clone_delay dummy
- scoreboard players add delay clone_delay 1
- execute if score delay clone_delay matches 5.. run scoreboard players set delay clone_delay 0
- execute if score delay clone_delay matches 0 run execute as @e[tag=player] at @s run clone ~-15 ~-2 ~ ~16 ~15 ~ 1 237 2
- ## Screen movement
- #execute unless entity @e[tag=sprite] run summon armor_stand 16 239 2 {Tags:["sprite"],Invulnerable:1,NoGravity:1,ShowArms:1,Rotation:[-90f],NoBasePlate:1,ArmorItems:[{},{},{},{id:"minecraft:player_head",Count:1b}],Pose:{Head:[0f,15f,0f],RightArm:[340f,0f,0f],LeftArm:[340f,0f,0f]}}
- execute as @e[tag=sprite] at @s run tp @s ~ 239 ~
- #Rotation
- execute as @e[tag=player] store result entity @s Pose.Head[0] float 2.5 run data get entity @p Rotation[1]
- execute as @e[tag=sprite] store result entity @s Pose.Head[0] float 1 run data get entity @e[tag=player,limit=1] Pose.Head[0]
- #Movement
- scoreboard objectives add player_pos dummy
- scoreboard objectives add in_motion dummy
- scoreboard players set @p in_motion 0
- execute store result score x player_pos run data get entity @p Pos[0] 100
- execute store result score y player_pos run data get entity @p Pos[1] 100
- execute store result score z player_pos run data get entity @p Pos[2] 100
- execute if score x player_pos matches 1651.. run scoreboard players set @p in_motion 1
- execute if score x player_pos matches 1651.. run execute as @e[tag=player] run data merge entity @s {Motion:[0.2,0.01,0.0]}
- execute if score x player_pos matches 1651.. run execute as @e[tag=sprite] run data merge entity @s {Rotation:[-90f]}
- execute if score x player_pos matches ..1649 run scoreboard players set @p in_motion 1
- execute if score x player_pos matches ..1649 run execute as @e[tag=player] run data merge entity @s {Motion:[-0.2,0.01,0.0]}
- execute if score x player_pos matches ..1649 run execute as @e[tag=sprite] run data merge entity @s {Rotation:[90f]}
- execute as @e[tag=sprite] at @s if block ~ ~-1 ~ #scripts:non_solid as @e[tag=player] at @s align x run tp @s ~0.5 ~-0.1 ~
- #Animate
- execute as @e[tag=sprite] if data entity @s {Pose:{LeftLeg:[355f,0f,0f],RightLeg:[-355f,0f,0f]}} run data merge entity @s {Pose:{LeftLeg:[0f,0f,0f],RightLeg:[0f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{LeftLeg:[350f,0f,0f],RightLeg:[-350f,0f,0f]}} run data merge entity @s {Pose:{LeftLeg:[355f,0f,0f],RightLeg:[-355f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{LeftLeg:[345f,0f,0f],RightLeg:[-345f,0f,0f]}} run data merge entity @s {Pose:{LeftLeg:[350f,0f,0f],RightLeg:[-350f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{LeftLeg:[340f,0f,0f],RightLeg:[-340f,0f,0f]}} run data merge entity @s {Pose:{LeftLeg:[345f,0f,0f],RightLeg:[-345f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{LeftLeg:[335f,0f,0f],RightLeg:[-335f,0f,0f]}} run data merge entity @s {Pose:{LeftLeg:[340f,0f,0f],RightLeg:[-340f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{LeftLeg:[325f,0f,0f],RightLeg:[-325f,0f,0f]}} run data merge entity @s {Pose:{LeftLeg:[335f,0f,0f],RightLeg:[-335f,0f,0f]}}
- execute as @e[tag=sprite] if score @p in_motion matches 1 run data merge entity @s {Pose:{LeftLeg:[325f,0f,0f],RightLeg:[-325f,0f,0f]}}
- #Auto-jump
- execute if score x player_pos matches 1651.. as @e[tag=player] at @s unless block ~1 ~ ~ #scripts:non_solid if block ~1 ~1 ~ #scripts:non_solid if block ~1 ~2 ~ #scripts:non_solid run tp @s ~0.5 ~1 ~
- execute if score x player_pos matches ..1649 as @e[tag=player] at @s unless block ~-1 ~ ~ #scripts:non_solid if block ~-1 ~1 ~ #scripts:non_solid if block ~-1 ~2 ~ #scripts:non_solid run tp @s ~-0.5 ~1 ~
- execute as @e[tag=player] at @s unless block ~ ~ ~ #scripts:non_solid if block ~ ~1 ~ #scripts:non_solid if block ~ ~2 ~ #scripts:non_solid run tp @s ~ ~1.5 ~
- execute unless score x player_pos matches 1650 run tp @p 16.5 241 13
- execute unless score y player_pos matches 24100 run tp @p 16.5 241 13
- execute unless score z player_pos matches 1350 run tp @p 16.5 241 13
- ## Looking at
- scoreboard objectives add pitch dummy
- #execute unless entity @e[tag=looking_at] as @e[tag=player] at @s positioned ~ ~ ~ run summon armor_stand ~ ~ ~ {Invisible:1,Invulnerable:1,NoGravity:1,Tags:["looking_at"]}
- execute store result score pitch pitch run data get entity @p Rotation[1]
- execute if score facing facing matches 0 if score pitch pitch matches 26..90 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~ ~-1 ~
- execute if score facing facing matches 0 if score pitch pitch matches 9..25 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~-1 ~ ~
- execute if score facing facing matches 0 if score pitch pitch matches -8..8 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~-1 ~1 ~
- execute if score facing facing matches 0 if score pitch pitch matches -16..-9 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~-1 ~2 ~
- execute if score facing facing matches 0 if score pitch pitch matches -90..-17 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~ ~2 ~
- execute if score facing facing matches 1 if score pitch pitch matches 26..90 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~ ~-1 ~
- execute if score facing facing matches 1 if score pitch pitch matches 9..25 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~1 ~ ~
- execute if score facing facing matches 1 if score pitch pitch matches -8..8 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~1 ~1 ~
- execute if score facing facing matches 1 if score pitch pitch matches -16..-9 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~1 ~2 ~
- execute if score facing facing matches 1 if score pitch pitch matches -90..-17 run execute as @e[tag=player] at @s run tp @e[tag=looking_at] ~ ~2 ~
- execute as @e[tag=looking_at] at @s run clone ~ ~ ~ ~ ~ ~ 11 242 7
- #execute unless entity @e[tag=sprite_looking_at] as @e[tag=sprite] at @s positioned ~ ~ ~ run summon armor_stand ~ ~ ~ {Invisible:1,Invulnerable:1,NoGravity:1,Tags:["sprite_looking_at"],Glowing:1b,Small:1b,NoBasePlate:1,Rotation:[90f]}
- execute if score facing facing matches 0 if score pitch pitch matches 26..90 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~ ~-1 ~
- execute if score facing facing matches 0 if score pitch pitch matches 9..25 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~-1 ~ ~
- execute if score facing facing matches 0 if score pitch pitch matches -8..8 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~-1 ~1 ~
- execute if score facing facing matches 0 if score pitch pitch matches -16..-9 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~-1 ~2 ~
- execute if score facing facing matches 0 if score pitch pitch matches -90..-17 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~ ~2 ~
- execute if score facing facing matches 1 if score pitch pitch matches 26..90 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~ ~-1 ~
- execute if score facing facing matches 1 if score pitch pitch matches 9..25 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~1 ~ ~
- execute if score facing facing matches 1 if score pitch pitch matches -8..8 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~1 ~1 ~
- execute if score facing facing matches 1 if score pitch pitch matches -16..-9 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~1 ~2 ~
- execute if score facing facing matches 1 if score pitch pitch matches -90..-17 run execute as @e[tag=sprite] at @s run tp @e[tag=sprite_looking_at] ~ ~2 ~
- ## Detect click
- scoreboard objectives add right_click minecraft.custom:minecraft.talked_to_villager
- scoreboard objectives add left_click dummy
- execute as @e[tag=click_detect] if data entity @s {HurtTime:9s} run scoreboard players set @p left_click 1
- effect give @e[tag=click_detect] invisibility 9999 0 true
- effect give @e[tag=click_detect] resistance 9999 100 true
- effect give @e[tag=click_detect] instant_health 9999 100 true
- execute as @e[tag=click_detect] run data merge entity @s {VillagerData:{profession:"minecraft:none"}}
- execute unless entity @e[tag=click_detect] as @p at @s positioned ~ ~1 ~ run summon villager ~ ~ ~ {Invulnerable:0b,Silent:1b,NoAI:1b,Tags:["click_detect"],VillagerData:{profession:"minecraft:none"},Offers:{}}
- execute as @p at @s positioned ~ ~1 ~ run tp @e[tag=click_detect] ^ ^ ^2
- execute as @e[tag=click_detect] at @s unless block ~ ~ ~ #scripts:non_solid run tp @s 16 241 11
- #Left (Break)
- execute if score @p left_click matches 1.. run execute as @e[tag=looking_at] at @s run loot give @p mine ~ ~ ~ mainhand
- execute if score @p left_click matches 1.. run execute as @e[tag=looking_at] at @s run execute as @p at @s run playsound minecraft:block.stone.break master @s
- execute if score @p left_click matches 1.. run execute as @e[tag=looking_at] at @s unless block ~ ~ ~ bedrock run setblock ~ ~ ~ air destroy
- #Animate
- execute if score @p left_click matches 1.. run execute as @e[tag=sprite] run data merge entity @s {Pose:{RightArm:[280f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{RightArm:[335f,0f,0f]}} run data merge entity @s {Pose:{RightArm:[340f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{RightArm:[325f,0f,0f]}} run data merge entity @s {Pose:{RightArm:[335f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{RightArm:[310f,0f,0f]}} run data merge entity @s {Pose:{RightArm:[325f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{RightArm:[290f,0f,0f]}} run data merge entity @s {Pose:{RightArm:[310f,0f,0f]}}
- execute as @e[tag=sprite] if data entity @s {Pose:{RightArm:[280f,0f,0f]}} run data merge entity @s {Pose:{RightArm:[290f,0f,0f]}}
- scoreboard players set @p[scores={left_click=1..}] left_click 0
- #Right (Place)
- scoreboard players set @p[nbt=!{SelectedItem:{}}] right_click 0
- execute as @e[tag=looking_at] at @s unless block ~ ~ ~ #scripts:non_solid unless score pitch pitch matches 26..90 run scoreboard players set @p[scores={right_click=1..}] right_click 0
- execute as @e[tag=player] at @s if score pitch pitch matches 26..90 unless block ~ ~2 ~ #scripts:non_solid run scoreboard players set @p[scores={right_click=1..}] right_click 0
- execute if score @p right_click matches 1.. run summon item 16 236 20 {Item:{id:"minecraft:oak_log",Count:1b},Tags:["hold"]}
- execute if score @p right_click matches 1.. run execute as @e[tag=hold] store result entity @s Item.Count byte 1 run data get entity @p SelectedItem.Count
- execute if score @p right_click matches 1.. run execute as @e[tag=hold] run data modify entity @s Item set from entity @p SelectedItem
- scoreboard objectives add hold_count dummy
- execute store result score @p hold_count run data get entity @p SelectedItem.Count
- execute store result score minus_1 hold_count run data get entity @p SelectedItem.Count
- scoreboard players remove minus_1 hold_count 1
- execute if score @p right_click matches 1.. if score pitch pitch matches 26..90 run execute as @e[tag=looking_at] at @s run tp @s ~ ~1 ~
- execute if score @p right_click matches 1.. run function scripts:block_ids
- execute if score @p right_click matches 1.. run replaceitem entity @p weapon.mainhand air
- execute if score @p right_click matches 1.. run tp @e[tag=hold] @p
- execute if score @p right_click matches 1.. run execute as @p at @s run playsound minecraft:block.stone.place master @s
- #Animate (imports from #Left)
- execute if score @p right_click matches 1.. run execute as @e[tag=sprite] run data merge entity @s {Pose:{RightArm:[280f,0f,0f]}}
- scoreboard players set @p[scores={right_click=1..}] right_click 0
- ## GUIs
- scoreboard objectives add gui dummy
- execute as @e[tag=player] at @s unless block ~ ~-1 ~ #scripts:guis run scoreboard players set @p gui 0
- execute if score @p in_motion matches 1 run scoreboard players set @p gui 0
- execute as @e[tag=player] at @s if block ~ ~-1 ~ #scripts:guis run scoreboard players add @p[scores={gui=0..1}] gui 1
- execute as @e[tag=player] at @s if block ~ ~-1 ~ crafting_table unless block 16 240 13 crafting_table if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ furnace unless block 16 240 13 furnace if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ anvil unless block 16 240 13 anvil if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ dispenser unless block 16 240 13 dispenser if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ dropper unless block 16 240 13 dropper if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ loom unless block 16 240 13 loom if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ barrel unless block 16 240 13 barrel if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ smoker unless block 16 240 13 smoker if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ blast_furnace unless block 16 240 13 blast_furnace if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ cartography_table unless block 16 240 13 cartography_table if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute as @e[tag=player] at @s if block ~ ~-1 ~ smithing_table unless block 16 240 13 smithing_table if score @p gui matches 1 run clone ~ ~-1 ~ ~ ~-1 ~ 16 240 13
- execute if score @p gui matches 2 as @e[tag=player] at @s if block ~ ~-1 ~ furnace if block 16 240 13 furnace run clone 16 240 13 16 240 13 ~ ~-1 ~
- execute if score @p gui matches 2 as @e[tag=player] at @s if block ~ ~-1 ~ dispenser if block 16 240 13 dispenser run clone 16 240 13 16 240 13 ~ ~-1 ~
- execute if score @p gui matches 2 as @e[tag=player] at @s if block ~ ~-1 ~ barrel if block 16 240 13 barrel run clone 16 240 13 16 240 13 ~ ~-1 ~
- execute if score @p gui matches 2 as @e[tag=player] at @s if block ~ ~-1 ~ smoker if block 16 240 13 smoker run clone 16 240 13 16 240 13 ~ ~-1 ~
- execute if score @p gui matches 2 as @e[tag=player] at @s if block ~ ~-1 ~ blast_furnace if block 16 240 13 blast_furnace run clone 16 240 13 16 240 13 ~ ~-1 ~
- execute if score @p gui matches 0 run setblock 16 240 13 sea_lantern
- ## Move items to player
- execute as @p at @s run tp @e[type=item,distance=..20] @p
- execute as @e[tag=player] at @s run tp @e[type=item,distance=..2] @p
- ## Mobs ??
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement