#Is there a way to make a custom item frame type display entity?
1 messages · Page 1 of 1 (latest)
Maybe make it so the entity holds the item, and habe their hand be where yoj want it displayed? This tutorial could help with the setup: https://wiki.bedrock.dev/entities/entity-holds-item
I don't remember if there's a component to make an entity hold an item after interacting with it though, might require a script
Oh that sounds promising. I'm going to look into that tomorrow.
Scripting is preferred, actually. I think this is a promising tack, but I haven't figured out how to implement it yet. The link you gave me provides a means for spawning an entity with an item in its hand per a loot table, but I want to be able to give it anything.
It might be possible to make an interaction script which sees what item the player is holding, then swap it with the item the item frame entity is currently holding
Using world.afterEvents.playerInteractWithEntity
I played around with the item frame, and I'm not convinced there's a way to manipulate what's in the item frame.
I think the entity holding an item could be the best way to go, I just can't figure out how to make it do that.
The tutorial for making an entity spawn with a held item contains the things needed to make it able to hold an item. You could then use a script to actually set the item for it. There may also be a component, but if there is I'm not aware of it (I am a bit rusty as well)
That tutorial looks like it just adds the "minecraft:equipment" component.
That component doesn't seem to be accessible via scripting API for entities that aren't the player, though...
Ah, didn't realize that was true. Man