Guest User

Mannequin commands by MLGLOL80

a guest
Oct 17th, 2025
714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.88 KB | Gaming | 0 0
  1. Most commands can be generated by visiting websites like "MCStacker" or "GamerGeeks", Here are only the more complex commands.
  2.  
  3. //========SITTING NPC========\\
  4. 1. Repeating command block: execute as @e[tag=toilet_npc] at @s run tp @s ~ ~ ~ facing entity @p[distance=..3]
  5. 2. Summon the Horse: summon horse ~ ~-1.5 ~ {Invulnerable:1b,Silent:1,NoAI:1b,NoGravity:1b,Rotation:[180.0f,0.0f],Tame:1b,SaddleItem:{id:"minecraft:saddle",Count:1b},Passengers:[{id:"mannequin",profile:"player",immovable:1b,Tags:["toilet_npc"]}]}
  6. 3. Deactivate the repeat command once you're happy with the mannequin's rotation, then run the command: effect give @e[type=horse] minecraft:invisibility infinite 1 true
  7.  
  8. //========Walking NPC========\\
  9. 1. Summon the NPC: summon minecraft:mannequin x y z {Tags:[NPC_Path]} (REPLACE X Y Z WITH THE INTENDED LOCATION)
  10. 2. Make it walk: execute at @e[tag=NPC_Path] as @e[tag=NPC_Path] if block ~ ~-2 ~ minecraft:lime_concrete run tp @e[tag=NPC_Path] ~ ~ ~.1 0 0
  11. 3. execute at @e[tag=NPC_Path] as @e[tag=NPC_Path] if block ~ ~-2 ~ minecraft:blue_concrete run tp @e[tag=NPC_Path] ~-.1 ~ ~ 90 0
  12. 4. execute at @e[tag=NPC_Path] as @e[tag=NPC_Path] if block ~ ~-2 ~ minecraft:red_concrete run tp @e[tag=NPC_Path] ~ ~ ~-.1 180 0
  13. 5. execute at @e[tag=NPC_Path] as @e[tag=NPC_Path] if block ~ ~-2 ~ minecraft:yellow_concrete run tp @e[tag=NPC_Path] ~.1 ~ ~ 270 0
  14. (YOU CAN CHANGE THE BLOCKS, TAGS, SPEED, ROTATION, LOCATION TO ANYTHING YOU WISH FOR.)
  15. To make it crouch: summon minecraft:mannequin x y z {Tags:[NPC_Sneak],pose:crouching} (You can change the tag, pose, or anything else. To make it move, use the same commands as above — just adjust the speed. For example, change 0.1 to 0.05 for slower movement.)
  16.  
  17. //========Make an NPC look at you========\\
  18. 1. Repeater: execute as @e[tag=NPC_Look] at @s if entity @p[distance=..5] facing entity @p feet run tp @s ~ ~ ~ ~ ~ (Make sure to summon an NPC with a tag, You should know how by now, based on the earlier examples :D, you can also change the distance, or not mention it at all, if you want all mannequins to look at you, replace [tag=NPC_Look] with [type=mannequin])
  19.  
  20. //========Make it follow you========\\
  21. 1. Make it follow you ONLY when it has a specific block below it: execute as @e[tag=NPC_Follow] at @s if block ~ ~-2 ~ minecraft:lime_concrete if entity @p[distance=..5] facing entity @p feet run tp @s ^ ^ ^0.1 ~ ~
  22. 2. Stop it from following you once the block below it changes (Also prevents it from getting stuck, usually): execute as @e[tag=NPC_Follow] at @s unless block ~ ~-2 ~ minecraft:lime_concrete run tp @s ^ ^ ^-0.05
  23.  
  24. //========Copy Hands (Accurate)========\\
  25. 1. Summon NPC, with two tags: /summon minecraft:mannequin ~ ~2 ~ {Tags:[npc_items_main,npc_items_off],Rotation:[180f,0f]}
  26. 2. 2 Repeaters (Copy):
  27. Main hand: execute as @e[tag=npc_items_main] run data modify entity @s equipment.mainhand set from entity @p SelectedItem
  28. Off hand: execute as @e[tag=npc_items_off] run data modify entity @s equipment.offhand set from entity @p equipment.offhand
  29. 3. 2 Repeaters (Remove):
  30. Main hand: execute as @e[tag=npc_items_main] at @s unless data entity @p SelectedItem run data modify entity @s equipment.mainhand set value {id:"minecraft:air",Count:1b}
  31. Off hand: execute as @e[tag=npc_items_off] at @s unless data entity @p equipment.offhand run data modify entity @s equipment.offhand set value {id:"minecraft:air",Count:1b}
  32.  
  33. //========Copy Armor (Accurate)========\\
  34. 1. 4 Repeaters (Copy): execute as @e[tag=npc_gear] run data modify entity @s equipment.head set from entity @p equipment.head
  35. 2. 4 Repeaters (Remove): execute as @e[tag=npc_gear] at @s unless data entity @p equipment.head.id run data remove entity @s equipment.head
  36. // Repeat for chestplate, leggings, boots by replacing:
  37. head → chest
  38. head → legs
  39. head → feet
  40.  
  41. //======== Dynamic Poses ========\\
  42. 1. Place an Impulse Command Block with a simple Redstone Clock: execute as @e[tag=npc_pose] run data modify entity @s pose set value "crouching"
  43. You can use up to 5 different poses:
  44. 1 - crouching
  45. 2 - standing
  46. 3 - swimming
  47. 4 - sleeping
  48. 5 - fall_flying
  49. Each pose needs its own command block, cycle through them using a redstone clock for dynamic animation effects.
  50.  
  51. //========Hostile NPC========\\
  52. ALL COMMANDS ARE SET TO REPEAT
  53. 1. gives NPC the tag: execute as @e[type=minecraft:mannequin,tag=attacker,tag=!active] at @s if entity @p[distance=..5] run tag @s add active
  54. 2. Face the player: execute as @e[type=minecraft:mannequin,tag=attacker,tag=active] at @s run tp @s ^ ^ ^0 facing entity @p
  55. 3. Walk towards the player: execute as @e[type=minecraft:mannequin,tag=attacker,tag=active] at @s run tp @s ^ ^ ^0.1
  56. 4. Attack: execute as @e[type=minecraft:mannequin,tag=attacker,tag=active] at @s if entity @p[distance=..1] run damage @p 2
  57. 5. (Optional), play a sound: execute as @e[type=minecraft:mannequin,tag=attacker,tag=active] at @s if entity @p[distance=..1] run playsound minecraft:entity.villager.no master @p ~ ~ ~ 1 1
  58. 6. Stop attacking if out of range: execute as @e[type=minecraft:mannequin,tag=attacker,tag=active] at @s unless entity @p[distance=..6] run tag @s remove active
  59.  
  60. //======== NPC vs NPC ========\\
  61.  
  62. 1. Summon two NPCs with different tags (example: "red" and "blue")
  63. /summon minecraft:mannequin ~ ~ ~ {Tags:["red"]}
  64. /summon minecraft:mannequin ~ ~ ~ {Tags:["blue"]}
  65.  
  66. 2. Set up scoreboards
  67. /scoreboard objectives add isFighting dummy
  68. /scoreboard objectives add fightTimer dummy
  69.  
  70. ALL COMMANDS BELOW SHOULD BE IN REPEATING COMMAND BLOCKS
  71.  
  72. 3. Detect active fight
  73. execute as @e[tag=blue] if entity @e[tag=red] run scoreboard players set @s isFighting 1
  74. execute as @e[tag=red] if entity @e[tag=blue] run scoreboard players set @s isFighting 1
  75.  
  76. 4. Clear fight flag if opponent is dead or missing
  77. execute as @e[tag=blue] unless entity @e[tag=red] run scoreboard players set @s isFighting 0
  78. execute as @e[tag=red] unless entity @e[tag=blue] run scoreboard players set @s isFighting 0
  79.  
  80. 5. Face opponent while fighting
  81. execute as @e[tag=blue,scores={isFighting=1}] at @s run tp @s ^ ^ ^0 facing entity @e[tag=red,limit=1]
  82. execute as @e[tag=red,scores={isFighting=1}] at @s run tp @s ^ ^ ^0 facing entity @e[tag=blue,limit=1]
  83.  
  84. 6. Move forward (simulate combat)
  85. execute as @e[tag=blue,scores={isFighting=1}] at @s run tp @s ^ ^ ^0.1
  86. execute as @e[tag=red,scores={isFighting=1}] at @s run tp @s ^ ^ ^0.1
  87.  
  88. 7. Deal damage if in range
  89. execute as @e[tag=blue,scores={isFighting=1}] at @s if entity @e[tag=red,distance=..1] run damage @e[tag=red,limit=1,distance=..1] 2
  90. execute as @e[tag=red,scores={isFighting=1}] at @s if entity @e[tag=blue,distance=..1] run damage @e[tag=blue,limit=1,distance=..1] 2
  91.  
  92. 8. Start post-fight timer (after fight ends)
  93. execute as @e[scores={isFighting=0..0}] run scoreboard players add @s fightTimer 1
  94.  
  95. 9. Kill winner after 60 ticks (Optional cleanup)
  96. execute as @e[scores={fightTimer=60..}] run kill @s
  97.  
  98. //======== Motion Capture (Sneaking Detection) ========\\
  99.  
  100. 1. Copy player's rotation (Repeat Command Block)
  101. execute as @e[tag=MotionCap] run data modify entity @s Rotation set from entity @p Rotation
  102.  
  103. 2. Setup scoreboard to detect sneaking
  104. /scoreboard objectives add sneaking minecraft.custom:minecraft.sneak_time
  105.  
  106. 3. Sneak Detector Logic (Use SAME x y z for all)
  107. REPEAT: Reset block every tick (clears old state)
  108. setblock x y z air
  109.  
  110. CHAIN 1: If player is sneaking, place a visible flag block
  111. execute as @a[scores={sneaking=1..}] at @s run setblock x y z minecraft:redstone_lamp[lit=true]
  112.  
  113. CHAIN 2: NPC crouches if the redstone lamp exists
  114. execute as @e[tag=MotionCap] at @s if block x y z minecraft:redstone_lamp[lit=true] run data modify entity @s pose set value "crouching"
  115.  
  116. CHAIN 3: NPC stands if redstone lamp is NOT there
  117. execute as @e[tag=MotionCap] at @s unless block x y z minecraft:redstone_lamp[lit=true] run data modify entity @s pose set value "standing"
  118.  
  119. CHAIN 4: Reset the sneaking score after each tick
  120. scoreboard players reset @p sneaking
  121.  
Add Comment
Please, Sign In to add comment