Minecraft Blogs / Tutorial

Minecraft Starwars Force Choke

  • 807 views, 0 today
  • 2
  • 1
  • 3
jsb999 avatar jsb999
Level 22 : Expert Modder
4
This is just a dump of all the commands for the YouTube video. If you want to learn to add this to your game watch the video and follow the steps.

1./execute if entity @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] as @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] at @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] anchored eyes positioned ^ ^ ^7 run execute as @e[​distance=..5,limit=1] run tp @s ^ ^ ^-4 ~180 0

2./execute if entity @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] as @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] at @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] anchored eyes positioned ^ ^ ^7 run execute as @e[​distance=..5,limit=1] run effect give @s minecraft:wither 1 3 true

3./execute if entity @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] as @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] at @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] anchored eyes positioned ^ ^ ^7 run execute as @e[​distance=..5,limit=1] run effect give @s minecraft:slow_falling 2 255 true

4.(OPTIONAL). /execute as @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] at @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{display:{Name:'{"text":"force choke"}'}}}]}] run tp @s @s
Tags

Create an account or sign in to comment.

1
11/01/2021 3:47 amhistory
Level 49 : Master Blob
HoboMaggot
HoboMaggot avatar
Not recommended to detect nested item nbt like "display:Name" as that'll cause a lot of lag in the long run (if you run a lot of other commands at the same time or use multiple large datapacks).
Use a custom item tag instead
/give @p dirt{custom_tag:1b}
/execute if entity @p[nbt={SelectedItem:{id:"minecraft:dirt",tag:{custom_tag:1b}}}] run say hi
Notice how a lot less nbt is used; And then after, you can use @s because you've already selected that entity through the 'as' subcommand
e.g. For the 1st command:
/execute as @a[​nbt={Inventory:[{Slot:-106b,id:"minecraft:red_stained_glass_pane",tag:{force_choke:1b}}]}] at @s anchored eyes positioned ^ ^ ^7 as @e[​distance=..5,limit=1] run tp @s ^ ^ ^-4 ~180 0
1
11/06/2021 7:08 pm
Level 22 : Expert Modder
jsb999
jsb999 avatar
Thanks for the tip. I am still learning and wanted to post some old creations. this is one that I made a year ago and I haven't updated my work.
1
10/24/2021 12:49 am
Level 22 : Expert Modder
jsb999
jsb999 avatar
Comment any questions you have
Planet Minecraft

Website

© 2010 - 2023
www.planetminecraft.com

Welcome