Minecraft Data Packs / Tool

Faceless's QuickCommandsHelper

  • check_circle Advancements
  • check_circle Functions
  • 589 views, 3 today
  • 28 downloads, 0 today
  • 2
  • 3
The_Faceless_Hero's Avatar The_Faceless_Hero
Level 4 : Apprentice Miner
0
I have made this data pack with the intent of helping create more data packs. This was specifically started when a friend needed help with custom items and has since evolved.

This data pack adds many new tags that you can add to your item that will help them do many different things. From easy right click detection to custom commands when you eat it. Even to custom durability. Much is possible using this data pack.

It also adds a couple of functions for helping people innovate and have fun creating. Including a /sculk command, a /velocity command, and more..

Full list of tags and functions down below. Can also be found in the HELP.txt file included in the datapack.


TAGS

RightClickCommand:"COMMAND"
  -executes the command listed while you are holding right click with a
warped_fungus_on_a_stick in either your main-hand or your off-hand
StartRightClickCommand:"COMMAND"
  -executes the command listed when you start holding right click with a
warped_fungus_on_a_stick in either your main-hand or your off-hand
StopRightClickCommand:"COMMAND"
  -executes the command listed when you stop holding right click with a
warped_fungus_on_a_stick in either your main-hand or your off-hand

ShiftRightClickCommand:"COMMAND"
  -executes the command listed while you are holding right click while crouching
with a warped_fungus_on_a_stick in either your main-hand or your off-hand
StartShiftRightClickCommand:"COMMAND"
  -executes the command listed when you start holding right click while crouching
with a warped_fungus_on_a_stick in either your main-hand or your off-hand
StopShiftRightClickCommand:"COMMAND"
  -executes the command listed when you stop holding right click while crouching
with a warped_fungus_on_a_stick in either your main-hand or your off-hand

UseCommand:"COMMAND"
  -executes the command listed while you are holding right click with an
item that already has some rightclick functionality
StartRightClickCommand:"COMMAND"
  -executes the command listed when you start holding right click with an
item that already has some rightclick functionality
StopUseCommand:"COMMAND"
  -executes the command listed when you stop holding right click with an
item that already has some rightclick functionality

ShiftUseCommand:"COMMAND"
  -executes the command listed while you are holding right click while crouching
with an item that already has some rightclick functionality
StartUseClickCommand:"COMMAND"
  -executes the command listed when you start holding right click while crouching
with an item that already has some rightclick functionality
StopUseClickCommand:"COMMAND"
  -executes the command listed when you stop holding right click while crouching
with an item that already has some rightclick functionality


RightClickKeepOriginalCrouchState:1b
  -Keeps the crouch state from when you start right clicking.
ForceRCDOffhand:1b
  -forces a warped_fungus_on_a_stick in your offhand. drops the items that were there in the ground so that they may be picked up immidiatly

FoodCommand:"COMMAND"
  -executes this command when you consume this piece of food

ArrowTag:"TAG"
  -applies this tag to the arrow when fired
ArrowHitEntity:"COMMAND"
  -executes this command at the arrow the first time it hits an entity
ArrowHitBlock:"COMMAND"
  -executes this command at the arrow the first time it hits a block
ArrowFireCommand:"COMMAND"
  -executes the command when the arrow is fired
ArrowTickCommand:"COMMAND"
  -executes the command at the arrow every tick
ArrowHeadItem:"ITEM"
  -The item that gets displayed over the arrow, usefull for custom arrow models

AttackCommandOnUser:"COMMAND"
  -executes this command when you attack an entity at your position
AttackCommandOnTarget:"COMMAND"
  -executes this command when you attack an entity at the targets position
KillCommand:"COMMAND"
  -executes this command when you kill an entity at your position

CustomDurability:{}
  -base_max_dur:INT - the base item durability
  -custom_current_dur:INT - the current custom damage applied to the weapon. set to 0 if you don't know what it does
  -base_last_dur:INT - just set this to 0
  -custom_max_dur:INT - the new max durability of the item

  OPTIONAL
  -destroy_on_zero:0/1 - weather or not the item will destroy like a regular item when it reaches 0 durability - defaults to true
  -durability_label:"STRING" - the label that shows when displaying the durability (eg.. >POG< 10/23)
  -force_durability_display:1/0 - weather or not the durability label is forced to be shown, even if you have q.durability_show_durability set to 0
  -BreakCommand:"COMMAND" - the command that will run when the item reaches 0 durability weather or not in breaks


  -/trigger q.durability_show_durability set 1 - enables you to see all custom durability levels
  -/trigger q.durability_show_durability set 0 - disables you from seeing all custom durability levels

FUNCTIONS

function qc:change_item_count {SelectedSlot:INT,Count:INT}
  -changes the selected items count by Count. (SelectedSlot: -1 = Mainhand, -2 = Offhand, -3 = Boots, -4 = Pants, -5 = Chest, -6 = Head, 0..26 = Inventory Slot)
function qc:set_item_count {SelectedSlot:INT,Count:INT}
  -sets the selected items count to Count. (SelectedSlot: -1 = Mainhand, -2 = Offhand, -3 = Boots, -4 = Pants, -5 = Chest, -6 = Head, 0..26 = Inventory Slot)
function qc:create_sculk {Charge:INT,AddX:INT,AddY:INT,AddZ:INT}
  -creates sculk that can spread around. When run, in order to place sculk the block at the current position + the ADD X Y and Z needs to be air touching a solid block in order for it to work properly.
function qc:raycast {StepNum:INT,StepDistance:FLOAT,StepCommand:"COMMAND",SenseType:"is_hitting"or"is_not_hitting",SenseBlock:"BLOCKID",HitCommand:"COMMAND",TerminateCommand:"COMMAND"}
  -StepNum:INT - the max number of steps that the raycast will take
  -StepDistance:FLOAT - the spacing between steps
  -StepCommand:"COMMAND" - the command that will be run at each step. if you don't want a StepCommand just leave it as COMMAND
  -SenseType:"is_hitting"or"is_not_hitting"
  -"is_hitting" - the raycast will go untill it hits the SenseBlock
  -"is_not_hitting" - the raycast will go untill it is no longer touching the SenseBlock
  -SenseBlock:"BLOCKID" - the block the raycast is sensing for
  -HitCommand:"COMMAND" - the command that will run when the raycast finishes
  -TerminateCommand:"COMMAND" - the command that will run when the raycast reaches its max number of steps without finishing
function q_velocity:multiply_velocity {X:INT,Y:INT,Z:INT}
  -multiplies the selected entity's velocity by XYZ. set X, Y, or Z to 0 to not effect that axis
function q_velocity:set/velocity_facing {Power:INT,X:INT,Y:INT,Z:INT}
  -sets the selected entity's velocity facing in a direction. Set X, Y, or Z to -1 to not effect that axis
function q_velocity:set/velocity_x_y_z {X:INT,Y:INT,Z:INT}
  -sets the selected entity's velocity to XYZ. Set X, Y, or Z to -1 to not effect that axis
function q_velocity:add/velocity_facing {Power:INT,X:INT,Y:INT,Z:INT}
  -changes the selected entity's velocity facing in a direction. Set X, Y, or Z to -1 to not effect that axis
function q_velocity:add/velocity_x_y_z {X:INT,Y:INT,Z:INT}
  -changes the selected entity's velocity by XYZ. Set X, Y, or Z to -1 to not effect that axis
function qc:durability/change_durability {SelectedSlot:INT,Count:INT}
  -changes the selected slots custom durability by Count. (SelectedSlot: -1 = Mainhand, -2 = Offhand, -3 = Boots, -4 = Pants, -5 = Chest, -6 = Head, 0..26 = Inventory Slot)
function qc:durability/change_durability_score {SelectedSlot:INT,Score:"PLAYER SCOREBOARD"}
  -changes the selected slots custom durability by a scoreboard value (eg "@s test_scoreboard"). (SelectedSlot: -1 = Mainhand, -2 = Offhand, -3 = Boots, -4 = Pants, -5 = Chest, -6 = Head, 0..26 = Inventory Slot)
function qc:durability/set_durability {SelectedSlot:INT,Count:INT}
  -sets the selected slots custom durability to Count. (SelectedSlot: -1 = Mainhand, -2 = Offhand, -3 = Boots, -4 = Pants, -5 = Chest, -6 = Head, 0..26 = Inventory Slot)
function qc:durability/set_durability_score {SelectedSlot:INT,Score:"PLAYER SCOREBOARD"}
  -sets the selected slots custom durability to a scoreboard value (eg "@s test_scoreboard"). (SelectedSlot: -1 = Mainhand, -2 = Offhand, -3 = Boots, -4 = Pants, -5 = Chest, -6 = Head, 0..26 = Inventory Slot)
function qc:drop_item {SelectedSlot:INT,PickupDelay:INT}
  -places the item in SelectedSlot on the ground. the item can't be picked up for PickupDelay ticks. (SelectedSlot: -1 = Mainhand, -2 = Offhand, -3 = Boots, -4 = Pants, -5 = Chest, -6 = Head, 0..26 = Inventory Slot)
function qc:summon_projectile {Projectile:"ENTITYID",Power:"INT",Rot:"~ ~"}
  -summons the selected entity and launches it in the direction you are facing offset by ROT

DEMO

Some Demo Items.. I recomend referencing a function when making custom items instead of hardcoding commands right into them because then you can change all instances of an items functionallity as you wish. However single command items are a lot of fun and require no extra datapacks.

SNOWBALL
/give @p snowball{display:{Name:'{"text":"TASTY","italic":false}'},ArrowHeadItem:'id:"minecraft_snow_block",Count:1b',ArrowTickCommand:"particle snow ~ ~ ~ 0.3 0.3 0.3 0.05 10 force",ArrowHitEntiy:"fill ~-1 ~-1 ~-1 ~1 ~1 ~1 snow replace air"}

TOME
/give @p book{display:{Name:'{"text":"TOME OF SPIKES","italic":false}'},ForceRCDOffhand: 1b, RightClickCommand: 'execute rotated ~ 0 positioned ^ ^ ^2 run function qc:raycast {StepNum:10,StepDistance:2,StepCommand:"execute positioned over world_surface run summon evoker_fangs",SenseType:"is_hitting",SenseBlock:"bedrock",HitCommand:"COMMAND",TerminateCommand:"COMMAND"}'}

LIGTNING
/give @p bow{display:{Name:'{"text":"LIGHTNING BOW","italic":false}'},ArrowHitBlock: "summon lightning_bolt ~ ~ ~", ArrowTickCommand: "particle electric_spark ~ ~ ~ 0 0 0 1 3 force", ArrowHitEntity: "summon lightning_bolt ~ ~ ~"}

FRUIT
/give @p minecraft:chorus_fruit{display:{Name:'{"text":"TASTY","italic":false}'},FoodCommand:"effect give @s levitation 5 9"} 15
CompatibilityMinecraft 1.20
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome