2

Custom Fish Data Pack

Welliethedog 3/22/20 3:02 am
230
4/3/2020 3:14 pm
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"}}}
Posted by
Welliethedog
Level 5 : Apprentice System
0

  Have something to say?

JoinSign in

1

FunkyToc
04/03/2020 3:14 pm
He/Him • Level 78 : Legendary Programmer Cat
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 :

/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
1

Welcome