MarkusBordihn / BOs-Player-Companions

Player Companions adds additional NPC which will follow, protect or help you...
Other
2 stars 5 forks source link

How do I replace the name of the companion with commands? #8

Closed m00t01 closed 1 year ago

m00t01 commented 1 year ago

I'm trynna use it with twitchspawn, for whenever people follow me, they give me a random minion and I spawn it and it appears with their name, but the spawn item (tamed) appears as ex. "Jhon23" but when I spawn it with right click it appears with a random predefined name and I don't want that.

I tried using the customname nbt but only works with untamed ones and spawn eggs, but I wont have time to tame them with twitch spawn where the chat can spawn me sh!t that I could die of

MarkusBordihn commented 1 year ago

Thanks for the feedback, interesting use-case. Just to understand you correctly, because I never used twitch-spawn myself.

It would be great if you could provide a screenshot / part of the stream how the item appears first with "Jhon23" over twitchspawn before you spawn it. Thanks.

MarkusBordihn commented 1 year ago

Relevant Mod: https://www.curseforge.com/minecraft/mc-mods/twitchspawn

m00t01 commented 1 year ago

Thanks for the feedback, interesting use-case. Just to understand you correctly, because I never used twitch-spawn myself.

  • You want that companions items (automatically tamed on your first use), has an option to pre-define the name and/or to change it over an simple command ?
  • Ideal they should take the name from twitchspawn automatically.

It would be great if you could provide a screenshot / part of the stream how the item appears first with "Jhon23" over twitchspawn before you spawn it. Thanks.

Yes, I can represent it with images: TwitchSpawn can automatically drop you named items, its like the game uses the CustomName NBT tag on the gifted item on itself, like passing it on an anvil before droping it to you image

But when I use the custom named ite, the minion doesn't appear with the custom name I gave him with the anvil (nor wit the custom name NBT nor the TwitchSpawn's CustomName Command) image

So I would love that you make it that when you custom name the item your companion automatically appears with the name you gave him on the anvil, so that problem would be solved.

With that also should happen that if I give him a custom skin it doesn't override the name cuz they are different nameslol image

MarkusBordihn commented 1 year ago

Thanks a lot for the details, they help a lot. I added a fix which should help with the naming issue.

If you rename a "untamed" companion item, it will automatically use the name for the companion on the first spawn. If you want to rename the companion later, you need to use a name-tag instead. So the naming of the companion item and the companion itself are not linked together.

Unfortunately automatically using the "texture" name as companion name is not really easy to do, because you can add URLs as well which is not really a valid name for a companion.

Let me know what you think about the following: I could add an option that companion names starting with # or @ like #Juan / @Juan will automatically try to set the texture, if support by the companion. This would allow twitchspawn to spawn companions with the correct name and possible texture.

You only need to make sure that you are not spawning to many companions at once and you should maybe delay the stream in the case some using an inappropriate skin with his name.