RandomizableContainer

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.world.RandomizableContainer;

Implements

RandomizableContainer implements the following interfaces:

Container,Clearable

Members

canPlaceItem(index as int, stack as ItemStack) as bool
script.zs
// RandomizableContainer.canPlaceItem(index as int, stack as ItemStack) as bool;
myRandomizableContainer.canPlaceItem(myInt, myItemStack);

Parameters:

index Type: int
stack Type: ItemStack

Return Type: bool

Getter
script.zs
// RandomizableContainer.changed
myRandomizableContainer.changed
changed()
script.zs
// RandomizableContainer.changed();
myRandomizableContainer.changed();
clearContent()
Clears the contents of this Clearable.
script.zs
// RandomizableContainer.clearContent();
myRandomizableContainer.clearContent();
Getter
Gets the size (how many slots) of this Container
script.zs
// RandomizableContainer.containerSize as int
myRandomizableContainer.containerSize

Return Type: int

containerSize() as int
Gets the size (how many slots) of this Container

Returns: The amount of slots this Container has.

script.zs
// RandomizableContainer.containerSize() as int;
myRandomizableContainer.containerSize();

Return Type: int

countItem(item as Item) as int
script.zs
// RandomizableContainer.countItem(item as ItemDefinition) as int;
myRandomizableContainer.countItem(myItem);

Parameters:

Return Type: int

countStack(item as IItemStack) as int
script.zs
// RandomizableContainer.countStack(item as IItemStack) as int;
myRandomizableContainer.countStack(myIItemStack);

Parameters:

item Type: IItemStack

Return Type: int

getItem(index as int) as ItemStack
Gets the ItemStack in the given slot.

Returns: the ItemStack in the given slot.

script.zs
// RandomizableContainer.getItem(index as int) as ItemStack;
myRandomizableContainer.getItem(myInt);

Parameters:

index Type: int - The slot index to get.

Return Type: ItemStack

hasAnyOf(items as Set<Item>) as bool
script.zs
// RandomizableContainer.hasAnyOf(items as Set<ItemDefinition>) as bool;
myRandomizableContainer.hasAnyOf(mySet);

Parameters:

items Type: Set<ItemDefinition>

Return Type: bool

Getter
Checks if this Container is empty.
script.zs
// RandomizableContainer.isEmpty as bool
myRandomizableContainer.isEmpty

Return Type: bool

isEmpty() as bool
Checks if this Container is empty.

Returns: True if empty. False otherwise.

script.zs
// RandomizableContainer.isEmpty() as bool;
myRandomizableContainer.isEmpty();

Return Type: bool

Getter
Gets the seed used by the loot table.
script.zs
// RandomizableContainer.lootSeed as long
myRandomizableContainer.lootSeed

Return Type: long

Setter
Sets the seed used by the loot table.
script.zs
// RandomizableContainer.lootSeed = (seed as long);
myRandomizableContainer.lootSeed = myLong;

Parameters:

seed Type: long - The seed for the loot table to use.
lootSeed() as long
Gets the seed used by the loot table.

Returns: The seed used by the loot table.

script.zs
// RandomizableContainer.lootSeed() as long;
myRandomizableContainer.lootSeed();

Return Type: long

lootSeed(seed as long)
Sets the seed used by the loot table.
script.zs
// RandomizableContainer.lootSeed(seed as long);
myRandomizableContainer.lootSeed(myLong);

Parameters:

seed Type: long - The seed for the loot table to use.
Getter
Gets the loot table used by the container.
script.zs
// RandomizableContainer.lootTable as ResourceKey<LootTable>
myRandomizableContainer.lootTable

Return Type: ResourceKey<LootTable>

Setter
Sets the loot table used by the container.
script.zs
// RandomizableContainer.lootTable = (lootTable as ResourceKey<LootTable>);
myRandomizableContainer.lootTable = myResourceKey;

Parameters:

lootTable Type: ResourceKey<LootTable> - The new loot table for the container to use.
lootTable() as ResourceKey<LootTable>
Gets the loot table used by the container.

Returns: The loot table used by the container.

script.zs
// RandomizableContainer.lootTable() as ResourceKey<LootTable>;
myRandomizableContainer.lootTable();

Return Type: ResourceKey<LootTable>

lootTable(lootTable as ResourceKey<LootTable>)
Sets the loot table used by the container.
script.zs
// RandomizableContainer.lootTable(lootTable as ResourceKey<LootTable>);
myRandomizableContainer.lootTable(myResourceKey);

Parameters:

lootTable Type: ResourceKey<LootTable> - The new loot table for the container to use.
Getter
script.zs
// RandomizableContainer.maxStackSize as int
myRandomizableContainer.maxStackSize

Return Type: int

maxStackSize() as int
script.zs
// RandomizableContainer.maxStackSize() as int;
myRandomizableContainer.maxStackSize();

Return Type: int

removeItem(var1 as int, var2 as int) as ItemStack
script.zs
// RandomizableContainer.removeItem(var1 as int, var2 as int) as ItemStack;
myRandomizableContainer.removeItem(myInt, myInt);

Parameters:

var1 Type: int
var2 Type: int

Return Type: ItemStack

removeItemNoUpdate(index as int) as ItemStack
script.zs
// RandomizableContainer.removeItemNoUpdate(index as int) as ItemStack;
myRandomizableContainer.removeItemNoUpdate(myInt);

Parameters:

index Type: int

Return Type: ItemStack

setItem(index as int, stack as ItemStack)
script.zs
// RandomizableContainer.setItem(index as int, stack as ItemStack);
myRandomizableContainer.setItem(myInt, myItemStack);

Parameters:

index Type: int
stack Type: ItemStack
setLootTable(lootTable as ResourceKey<LootTable>, seed as long)
Sets the loot table used by the container.
script.zs
// RandomizableContainer.setLootTable(lootTable as ResourceKey<LootTable>, seed as long);
myRandomizableContainer.setLootTable(myResourceKey, myLong);

Parameters:

lootTable Type: ResourceKey<LootTable> - The new loot table for the container to use.
seed Type: long - The seed for the loot table to use.
setLootTable(lootTable as ResourceLocation)
Sets the loot table used by the container.
script.zs
// RandomizableContainer.setLootTable(lootTable as ResourceLocation);
myRandomizableContainer.setLootTable(myResourceLocation);

Parameters:

lootTable Type: ResourceLocation - The new loot table for the container to use.
setLootTable(lootTable as ResourceLocation, seed as long)
Sets the loot table used by the container.
script.zs
// RandomizableContainer.setLootTable(lootTable as ResourceLocation, seed as long);
myRandomizableContainer.setLootTable(myResourceLocation, myLong);

Parameters:

lootTable Type: ResourceLocation - The new loot table for the container to use.
seed Type: long - The seed for the loot table to use.
startOpen(player as Player)
script.zs
// RandomizableContainer.startOpen(player as Player);
myRandomizableContainer.startOpen(myPlayer);

Parameters:

player Type: Player
stillValid(player as Player) as bool
script.zs
// RandomizableContainer.stillValid(player as Player) as bool;
myRandomizableContainer.stillValid(myPlayer);

Parameters:

player Type: Player

Return Type: bool

stopOpen(player as Player)
script.zs
// RandomizableContainer.stopOpen(player as Player);
myRandomizableContainer.stopOpen(myPlayer);

Parameters:

player Type: Player