Minecraft Blogs / Tutorial

DataPack Function Tutorial 1️⃣ | Right Click Detection

  • 3,197 views, 7 today
  • 5
  • 3
  • 2
DanialCP's Avatar DanialCP
Level 60 : High Grandmaster Sheep
144
Hey Today I Am Will Learn You How Right Click Detection

This Tutorial For Players Want Make Parkour Maps Or Custom Swords Pack


Normal Command (Impulse Commands)
Get "Carrot On The Stick"

give @p carrot_on_a_stick{display:{Name:'{"text":"Example"}'},RepairCost:1,Unbreakable:1b,Damage:1,CustomModelData:123456,exampletag:1b} 1
Tick Commands (Requested To Repeat)
Add Scoreboard (Requested Command)

scoreboard objectives add example minecraft.used:minecraft.carrot_on_a_stick


Player Holding Detection (Requested Command)

execute as @a[scores={example=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{exampletag:1b}}}] at @s run INSERT A COMMAND HERE


Right Click Detection (Request Command)

scoreboard players remove @a[scores={example=1..}] example 1


YOU FOUND A CP EASTER
Tags

Create an account or sign in to comment.

1
10/26/2021 2:40 pm
Level 50 : Grandmaster Wizard
Flyrr
Flyrr's Avatar
Try using predicates, its way more effective than nbt checks :)
3
09/22/2021 4:52 am
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
Now do right click detection using an advancement, armorstands and non-rightclickable items (such as sticks)
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome