-
Notifications
You must be signed in to change notification settings - Fork 0
Vanilla Expansion
roidrole edited this page May 24, 2026
·
29 revisions
Adds missing features from crafttweaker itself.
List of expansions :
| Method | Description |
|---|---|
| hasDefinition(IEntityDefintion definition) | Returns whether this IEntity has this definition |
| Method | Description |
|---|---|
| spread() | Returns an IIngredient[] of length this.count populated by this.setCount(1) |
| Methods | Return Type | Description |
|---|---|---|
| asData() | IData | Serializes an ItemStack into its NBT form (also a ZenCaster) |
| fromData(IData data) | IItemStack | Deserialize from NBT (Static method - ne need for an object) |
| isEnergyStorage() | boolean | Returns true if the itemstack is capable of storing energy |
| getEnergy | IEnergyStorage | Get an IEnergyStorage instance from the item stack. Will produce an error if the item is not an energy container. |
| Methods | Return Type | Description |
|---|---|---|
| asIIngredient | IIngredient | Also a ZenCaster. Equivalent to calling .or() repeatedly |
You can call these methods on an IPlayer instance.
| Methods | Parameters | Return Type | Description |
|---|---|---|---|
| addExperience | amount as int | void | adds experiece points, instead of levels |
| removeExperience | amount as int | void | removes experience points |
| getTotalXP | [None] | int | returns total XP amount the player has |
| playSound | sound as string, volume as float, pitch as float | void | Note: Client and server players have different behaviors. For more info see how forge handles sound events. Check for whether the world is remote to determine what side it is on. |
| sendPlaySoundPacket | sound as string, category as string, pos as Position3f, volume as float, pitch as float | void | Makes the player play a sound on their client |
| isPlayerMP | [None] | bool | returns true if the IPlayer's internal object is an instance of EntityPlayerMP (server side player) |
| isFake | [None] | bool | returns true if the IPlayer's internal object is an instance of FakePlayer |
| getAdvancementProgress | IAdvancement | Get the progress of an advancement. Note that the player must be an instance of EntityPlayerMP or this will return null |
| Methods | Description |
|---|---|
| nextGaussian | Returns a random double following a Standard Normal Deviation |
| Method | Return Type | Description |
|---|---|---|
| getPlayers | IPlayer[] | A list of all players on the server |
| getPlayerCount | int | |
| getMaxPlayers | int | |
| getServerCommandSender | ICommandSender | Static method. Returns this server's command sender |
| getPlayerByUUID(uuid as string) | IPlayer | |
| getPlayerByUsername(name as string) | IPlayer | |
| broadcastMessage(message as ITextComponent, @Optional isSystem as bool) | void | Sends a message to all players and print in server logs. If isSystem is true it's a system message, otherwise it's chat message |
| Methods | Parameters | Return Type |
|---|---|---|
| setOrCreateGameRule | key as string, value as string | void |
| getGameRules | IGameRule | |
| playSound | soundResourceLocation as string, soundCategory as string, location as Position3f, volume as float, pitch as float, @Optional distanceDelay as bool | void |
| canSeeSky | pos as IBlockPos | bool |
| canSnowAt | pos as IBlockPos, lightCheck as bool | bool |
| canBlockFreeze | pos as IBlockPos, noWaterAdj as bool | bool |
| getBlockLight | pos as IBlockPos | int |
| getEntityItemsWithinAABB | aabb as IAxisAlignedBB | IEntityItem[] |
| getEntitiesWithinAABB | aabb as IAxisAlignedBB, @Optional entityType as IEntityDefinition | IEntity[] |
| getSkyLight | pos as IBlockPos | int |
| getTopBlock | pos as IBlockPos | IBlockPos |
| getTopSolidBlock | pos as IBlockPos | IBlockPos |
| setSpawnerEntity | pos as IBlockPos, entity as IEntityLivingBase | bool |
| createEntityXp | value as int | IEntityXp |
| spawnEntityXp | value as int, pos as IBlockPos | void |