contains

public abstract boolean contains(Material material)

Checks if the inventory contains any ItemStacks with the given material.

Return

true if an ItemStack is found with the given Material

Parameters

material

The material to check for

Throws

if material is null


public abstract boolean contains(ItemStack item)

Checks if the inventory contains any ItemStacks matching the given ItemStack.

This will only return true if both the type and the amount of the stack match.

Return

false if item is null, true if any exactly matching ItemStacks were found

Parameters

item

The ItemStack to match against


public abstract boolean contains(Material material, int amount)

Checks if the inventory contains any ItemStacks with the given material, adding to at least the minimum amount specified.

Return

true if amount is less than 1, true if enough ItemStacks were found to add to the given amount

Parameters

material

The material to check for

amount

The minimum amount

Throws

if material is null


public abstract boolean contains(ItemStack item, int amount)

Checks if the inventory contains at least the minimum amount specified of exactly matching ItemStacks.

An ItemStack only counts if both the type and the amount of the stack match.

Return

false if item is null, true if amount less than 1, true if amount of exactly matching ItemStacks were found

Parameters

item

the ItemStack to match against

amount

how many identical stacks to check for

See also