2
Custom Fish Data Pack
I'm very new to creating data packs but I've been working on one that gives the user a book that allows you to customize tropical fish. I've completed all the text and visual components of the book and I'm getting the variant id for the fish (what determines how it looks) by adding to a custom scoreboard when the user selects what colour/shape they want. My only problem is I have no idea how to put this scoreboard data into a summon command. Everything I try either doesn't do anything or just gives a fish with a variant of 0. Any idea on how to fix this, or if it's even possible?
What I want to do (doesn't work)
/trigger fish_id set 1281
/summon minecraft:tropical_fish ~ ~ ~ {Variant:{"score":{"name":"@s","objective":"cf_id"}}}
What I want to do (doesn't work)
/trigger fish_id set 1281
/summon minecraft:tropical_fish ~ ~ ~ {Variant:{"score":{"name":"@s","objective":"cf_id"}}}
1
https://minecraft.gamepedia.com/Tropical_Fish#Data_values
I'm not sure to understand your purpose. You can't use a score in a summon. But you can summon a fish depending of the score value, or modifying Variant after the sapwn
1. the player chose shape, color, other...
2. then he spawns the fish ?
I suggest to summon and immediatly merge the Variant from a SCORE of a player FishId :
You can
I'm not sure to understand your purpose. You can't use a score in a summon. But you can summon a fish depending of the score value, or modifying Variant after the sapwn
1. the player chose shape, color, other...
2. then he spawns the fish ?
I suggest to summon and immediatly merge the Variant from a SCORE of a player FishId :
/summon minecraft:tropical_fish ~ ~ ~
/execute store result entity @e[type=minecraft:tropical_fish,distance=..1,limit=1] Variant double 1 run scoreboard players get FishId SCORE
You can
