# Player Methods

### When dealing with items, you can use the manual methods shown here (where you define item ID, count, custom model data etc), or use the Defined Items system.

You can find the [defined-items](https://docs.roanoke.dev/mods/mods/lazy-npcs/defined-items "mention") info on that page.

#### player.has\_item(identifier: string, \[count: int] 1, \[customModelData: int])

Identifier should be an Item Identifier, i.e. "minecraft:grass\_block". This method has an optional second argument, count, and a third optional argument, custom model data, which checks custom model data. Useful for custom items that are retextured chorus fruit/paper. Could do:

```
q.player.has_item("minecraft:paper", 1, 1593)
```

To check for a Mega Stone that is a paper item, with custom model data of "1593". This method returns true if the item is present in the player's inventory, false otherwise.

```
q.player.has_item("minecraft:wheat", 64)
```

This would check whether or not the player has a stack of wheat.&#x20;

{% hint style="warning" %}
**The count/amount is PER Item Stack, so even if a player has three stacks of 63 wheat, that wouldn't return true.**
{% endhint %}

#### q.player.take\_item(identifier: string, \[count: int] 1)

This method also takes an item identifier, i.e. "minecraft:diamond", and has an optional second argument, count, which determines how many of the items to take. This defaults to "1". This method returns true if the item(s) were taken, and false otherwise.&#x20;

#### q.player.max\_int\_from\_permission\_node(node: string)

This method grabs the highest int following this node, which is used for grabbing information like max sethomes in EEssentials/Oxygen.&#x20;

```
q.player.max_int_from_permission_node("eessentials.homes.")
```

This example would return the amount of homes the player can set in EEssentials.
