#I want to put a custom hat on a chicken

1 messages · Page 1 of 1 (latest)

novel ferry
#

I made a custom model for a crown in Minecraft that I want a specific chicken to wear

quartz galeBOT
#

<@&1201956957406109788>

Someone will come and help soon!

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

🙇 If nobody has answered you by <t:1724527389:t>, feel free to use the Summon Helpers button to ping our helper team.

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

orchid lava
#

Chickens don't render armor.

novel ferry
#

I meant as an item placed on its head or an armor stand if that’s not possible but I think it is.

#

A custom mob

snow prairie
#

you might be able to have an invisible armor stand ride the chicken and have the crown on the armour stand be offset to roughly sit on the chickens head, not sure if you'd have some wierd lining up issues though

wispy moth
snow prairie
#

nah true, forgot about item displays

wispy moth
novel ferry
#

Would it be possible to place via commands the display entity on a preexisting chicken rather than spawning in a chicken with the display entity?

valid elk
#

Yes

#

You just need to summon it, then use /ride to mount it on the chicken

novel ferry
#

might you know why the texture for my custom item looks like this? It's just supposed to be yellow

novel ferry
noble aurora
#

The easy approach would be to tag the chicken and all chickens tp the nearest item display (at a certain distance) to themselves but that is a little inconsistent

#

The safer way would be an id system:

brave cloudBOT
#

Player Id System

    >>> ## Give each player a unique ID

Create a scoreboard in a load function that runs on /reload

# namespace:load
scoreboard objectives add playerid dummy

Create a function to assign a unique id to the player

# namespace:assign_id
scoreboard players add .global playerid 1
scoreboard players operation @s playerid = .global playerid

Create a tick advancement to assign an id to a player when they first join

{
  "criteria": { "requirement": { "trigger": "minecraft:tick" }},
  "rewards": { "function": "namespace:assign_id" }
}

Check if an entity has the same ID as the player

Create a predicate that compares the id

// namespace:match_id
{ "condition": "minecraft:entity_scores", "entity": "this", "scores": {
  "playerid": {
    "min": { "type": "minecraft:score", "target": { "type": "minecraft:fixed", "name": "#this" }, "score": "playerid" },
    "max": { "type": "minecraft:score", "target": { "type": "minecraft:fixed", "name": "#this" }, "score": "playerid" }
  }}
}

To use it in a function, you can do that following

scoreboard players operation #this playerid = @s playerid
say @e[predicate=namespace:match_id] HAVE THE SAME PLAYERID
noble aurora
#

This is written for players but can easily be generalized for a chicken - display entity relation instead

valid elk
#

You don't actually need this if they're riding

#

You can just use execute on vehicle to detect the chicken that an item display is riding

quartz galeBOT
#
🗑️ Recycling Thread

This thread has been inactive for some time, so I'm going to archive it.

If you're still using the thread, just send a message and it'll pop back on the thread list.

novel ferry
valid elk
#

You probably need to tag the chicken, then reference that

#

So something like:

execute on vehicle run tag @s add vehicle
execute rotated as @n[tag=vehicle] run tp @s ~ ~ ~ ~ ~
tag @n[tag=vehiclie] remove vehicle
novel ferry
#

Sorry I really know nothing about commands. So first of all what’s the /ride command to get a display item riding a chicken?

boreal compass
#

Well the command is /ride, why don't you try writing it out in-game so you can see the syntax?

novel ferry
#

I just see @s and such

quartz galeBOT
#
🗑️ Recycling Thread

This thread has been inactive for some time, so I'm going to archive it.

If you're still using the thread, just send a message and it'll pop back on the thread list.

quartz galeBOT
#
🗑️ Recycling Thread

This thread has been inactive for some time, so I'm going to archive it.

If you're still using the thread, just send a message and it'll pop back on the thread list.

novel ferry
#

Also how can I make the item display disappear upon the chickens death?

drifting glade
#

Oh, I didn't look at the date... Has it been decided yet?

mortal phoenixBOT
#

If it's riding the chicken, you can detect that the chicken has died and kill it once it no longer has a vehicle, like so:

tag @s add kill
execute on vehicle on passengers run tag @s remove kill
kill @s[tag=kill]
valid elk
#

That essentially gives the item display the kill tag, but if there's a vehicle (i.e. the chicken is still alive), it removes the tag. Then, if it still has the tag, that means there is no vehicle and it should kill itself.