# EntityHelper
> Utility class for entity manipulation including item giving, damage, teleportation, and player resets.
`gg.lode.bookshelfapi.api.util.EntityHelper`
---
## Signature
```java
public class EntityHelper
```
---
## Static Methods
### Inventory
| Method | Return Type | Description |
|--------|-------------|-------------|
| `giveOrDrop(HumanEntity player, ItemStack... items)` | `void` | Gives items to a player, dropping overflow at their location. |
| `giveOrDrop(Inventory inv, Location loc, ItemStack... items)` | `void` | Adds items to an inventory, dropping overflow at the location. |
### Entity Management
| Method | Return Type | Description |
|--------|-------------|-------------|
| `killGracefully(LivingEntity entity)` | `void` | Kills an entity cleanly. |
| `resetDefaults(Player player)` | `void` | Resets a player to default state (health, food, inventory, etc.). |
| `isOnGround(Player player)` | `boolean` | Checks if the player is on the ground. |
| `teleportEvenWithPassengers(Entity entity, Location location)` | `void` | Teleports an entity including any passengers. |
### Damage
| Method | Return Type | Description |
|--------|-------------|-------------|
| `reduceDamageByResistance(LivingEntity entity, double damage)` | `double` | Reduces damage based on the entity's resistance effect. |
| `genericPhysicalDamage(...)` | `void` | Applies generic physical damage to an entity. |
| `forceDamage(...)` | `void` | Forces damage on an entity, bypassing certain protections. |
### Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| `player` | `HumanEntity` / `Player` | The target player. |
| `items` | `ItemStack...` | Items to give or drop. |
| `inv` | `Inventory` | Target inventory. |
| `loc` / `location` | `Location` | The location for drops or teleportation. |
| `entity` | `LivingEntity` / `Entity` | The target entity. |
| `damage` | `double` | The damage amount. |
---
## Usage
```java
// Give items safely
EntityHelper.giveOrDrop(player, new ItemStack(Material.DIAMOND, 64));
// Reset player state
EntityHelper.resetDefaults(player);
// Teleport with passengers
EntityHelper.teleportEvenWithPassengers(horse, spawnLocation);
// Kill entity
EntityHelper.killGracefully(zombie);
```
---
## Related Pages
- [[InventoryHelper]]
- [[LocationHelper]]