# ItemEntityHelper

`com.jsmacrosce.jsmacros.client.api.helper.world.entity.ItemEntityHelper`

A dropped stack of items in the world.  
 ```js
// Log dropped stacks within ten blocks.  
const items = World.getEntities(10, "item");  
if (items !== null) {
  for (const entity of items) {
    if (!(entity instanceof EntityHelpers.Item)) continue;  
    const stack = entity.getContainedItemStack();  
    Chat.log(`${stack.getCount()} ${stack.getItemId()} at ${entity.getPos()}`);  
  }
}
 ```

Available in scripts as `EntityHelpers.Item`.

## Constructors

### new ItemEntityHelper {#com.jsmacrosce.jsmacros.client.api.helper.world.entity.ItemEntityHelper_constructor-ItemEntity-}

```js
new ItemEntityHelper(ItemEntity e)
```

Wraps the supplied item entity.

**Parameters:**
- `e`: raw item entity to wrap

## Methods

### getContainedItemStack {#com.jsmacrosce.jsmacros.client.api.helper.world.entity.ItemEntityHelper_getContainedItemStack-}

```js
getContainedItemStack(): ItemStackHelper
```

Returns the stack currently represented by this entity. The result may be empty;  
 reading it does not pick up the items.

**Returns:** the entity's current stack, possibly empty

### toString {#com.jsmacrosce.jsmacros.client.api.helper.world.entity.ItemEntityHelper_toString-}

```js
toString(): String
```

Returns a diagnostic representation of this item entity and its contained stack.

**Returns:** diagnostic representation of the item entity and its contained stack
