#Entity UI with Item

27 messages · Page 1 of 1 (latest)

digital ravine
#

Yeah I wanna open the entity inventory only when the player is holding a specific item. I don't know what more to add...

copper tinsel
#

Maybe offer what you have already tried to do?

digital ravine
#

I tried using the interact component but that canceled the inventory

copper tinsel
#

Maybe the interaction could be used to cancel the inventory if they are not holding that specific item

#

That seems sound to me

#
{
  "on_interact": {
    "filters": {
      "test": "has_equipment",
      "subject": "other",
      "operator": "!=",
      "value": "specific_item"
    }
  }
}
digital ravine
#

I see

#

Let me try that

#

Well, that did it, thanks.

copper tinsel
#

You are welcome. If you have no additional questions, be sure to close your post

digital ravine
#

One more:

#

If my entity is at 0, 64, 0 and I'm at let's say 10k, 64, 10k, will that entity be able to tp to me? From my testing I assume so but then sometimes when crossing dimensions it Despawns...

#

Wait this is unrelated

#

To the posr

copper tinsel
#

You're fine

#

As long as the chunk the entity is in remains loaded, it can be selected and it can teleport

#

I'm not sure why it would be despawning when crossing dimensions though, could you elaborate on how you are getting that behavior?

digital ravine
#

It's random. The entity tps to me when I hold an item and when I keeps entering and leaving dimensions the target is lost.

#

So I assume it depspawns.

copper tinsel
#

Oh so you are leaving some dimension through a portal and are wanting it to teleport to you

digital ravine
#

Yes

copper tinsel
#

From my understanding nether portals should keep both sides loaded for a short period of time after changing dimensions

digital ravine
#

What If I wait too long to tp the entity to me?

copper tinsel
#

It will most likely get lost—it will not despawn in the most likely circumstance, but simply be unreachable because the chunks it is located in are now unloaded

digital ravine
#

Guess it's time to write a script to teleport it to the player once the player leaves or enter the dimension.

copper tinsel
#

And what if the player simply walks a good distance from the last time they held the item? Are you teleporting the entity somewhere it will always remain loaded?

digital ravine
#

That I'm still trying to do. I want it to be like 20 blocks above the player when item is not held. But with scripts idk how I'd do that, maybe I can use Behavior Animations?