• Hey! Register here to create your account, engage with the community, and talk about what is new!

how to get the item inside an item frame

ppurple_

Active member
Overlord
Joined
Feb 22, 2023
Messages
42
Reaction score
3
ok so I have a catalog of useless items displayed in item frames and I want players to be able to rc the item frame to get it, is there a way to softcode this?
 

CoderElias

Notorious member
Overlord
Joined
Jun 15, 2022
Messages
101
Reaction score
17
If I remember correcty there is not a way to get an item in an item frame, I may be wrong though. For now I would just hard code it, but that's your choice
 

Jimmy_The_Knight

Well-known member
Joined
Dec 28, 2020
Messages
73
Reaction score
34
Impossible, but you can do something like this:
  • Create two (ordered) lists: one with the block locs of the item frames and one with the items in them
  • On player click entity event, check whether its an item frame and if yes then get its location and align its location to the center of the block (dont forget to remove rotation)
  • Check if the location list contains the itemframe loc (get list index of value), if the index is greater than 0 (so it exists), then get the item from the items list at the index and give it to the player
 

ppurple_

Active member
Overlord
Joined
Feb 22, 2023
Messages
42
Reaction score
3
Impossible, but you can do something like this:
  • Create two (ordered) lists: one with the block locs of the item frames and one with the items in them
  • On player click entity event, check whether its an item frame and if yes then get its location and align its location to the center of the block (dont forget to remove rotation)
  • Check if the location list contains the itemframe loc (get list index of value), if the index is greater than 0 (so it exists), then get the item from the items list at the index and give it to the player
thank you! too late tho i just made a menu-
 
Top Bottom