#Returning a trident instantly after launching it

1 messages · Page 1 of 1 (latest)

south mountain
#

Hello, i am trying to make a system in which when the player is launching a trident with a custom tag, it will propel him forward and "not" launch his trident, it will only be used for the animation, however i could have help for this one please since i am very unfamiliar with /data,

here is initially what i thought for the system.
Load file
scoreboard objectives add UseSpear minecraft.used:minecraft.trident

Tick File
execute as @a[scores={UseSpear=1..},nbt={SelectedItem:{id:"minecraft:trident",tag:{netherite_spear:1b}}}] at @s run function combatexpansion:items/weapons/spear/netherite/spear_dash

spear_dash File :
execute as @a[scores={UseSpear=1..},nbt={SelectedItem:{id:"minecraft:trident",tag:{netherite_spear:1b}}}] at @s run function delta:api/launch_looking

data get entity @e[type=minecraft:trident,tag=netherite_spear,limit=1]

then i don't know how to give the player the spear back with all the data it had in it, like enchants or custom names

hard moonBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

#
⚠️ You already have a question open!

Don't forget to close or resolve your old questions once you're done with them. It makes our lives much easier! :D

Open question: #1205112702528266250

clever kettle
#
  • store the item data in a storage
  • when the player uses it check if they do not have the trident in their main/offhand
  • if so, retrieve the data from the storage and summon an item using that data at the player
  • remove the data from the storage and do whatever other stuff you want
#

i'm saying this off my head, maybe there are some parts i got wrong

#

you should definitely learn /data btw

south mountain
#

i will i swear

#

but it seems so hard to understand idk

#

is there any good tutorial that you have in mind for /data ?

clever kettle
south mountain
#

in a load function :
data modify storage combatexpansion: TempTrident set value {}

spear_dash function :
data modify storage combatexpansion: TempTrident set from entity @s SelectedItem
data get entity @e[type=minecraft:trident,tag=netherite_spear,limit=1]
execute at @a[scores={UseSpear=1..}] run summon item ~ ~1 ~ {Item:{id:"minecraft:trident",Count:1b,tag:{CustomModelData:271200}}}
execute as @a[scores={UseSpear=1..}] at @s run data modify entity @a[scores={UseSpear=1..},nbt={SelectedItem:{id:"minecraft:trident",tag:{netherite_spear:1b}}},limit=1] Item.tag set from storage combatexpansion: TempTrident

south mountain
#

i think that my issue is at the last command

hard moonBOT
#
Question Closed

Your question, #1206071664652328970 (Returning a trident instantly after launching it), was resolved!

Original Message

Hello, i am trying to make a system in which when the player is launching a trident with a custom tag, it will propel him forward and "not" launch his trident, it will only be used for the animation, however i could have help for this one please since i am very unfamiliar with /data,

here is initially what i thought for the system.
Load file
scoreboard objectives add UseSpear minecraft.used:minecraft.trident

Tick File
execute as @a[scores={UseSpear=1..},nbt={SelectedItem:{id:"minecraft:trident",tag:{netherite_spear:1b}}}] at @s run function combatexpansion:items/weapons/spear/netherite/spear_dash

spear_dash File :
execute as @a[scores={UseSpear=1..},nbt={SelectedItem:{id:"minecraft:trident",tag:{netherite_spear:1b}}}] at @s run function delta:api/launch_looking

data get entity @e[type=minecraft:trident,tag=netherite_spear,limit=1]

then i don't know how to give the player the spear back with all the data it had in it, like enchants or custom names

Duration open

3h14m

south mountain
#

is it possible to reopen

hard moonBOT
south mountain
#

ah yes

#

i have an issue i don't know why but it seems that when i use /data to pur back the informations on the item i only copy the custom model data