How can I set Item in Frame (in sponge 8.0)?

In sponge 7.0 I can set Item into the frame by this code.

itemFrame.offer(Keys.REPRESENTED_ITEM, snapshot);

image

but In sponge 8.0 I couldn’t find the way to set Item into the frame.

How can I set Item in Frame (in sponge 8.0) ?

Please help me.

So there are two ways of doing this.

First. The Key way

Keys.ITEM_STACK_SNAPSHOT

Or the none key way

  ItemStackSnapshot item;
  ItemFrame frame:
  frame.item().set(item);

1 Like

Thank for you care!