Vanilla Expansion - roidrole/Roids-Tweaker GitHub Wiki

Adds missing features from crafttweaker itself.

List of expansions :

IIngredient Expansion

Method Description
spread() Returns an IIngredient[] of length this.count populated by this.setCount(1)

IItemStack Expansion

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.

IPlayer Expansion

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 advancement IAdvancementProgress Get the progress of an advancement. Note that the player must be an instance of EntityPlayerMP or this will return null

IRandom Expansion

Methods Description
nextGaussian Returns a random double following a Standard Normal Deviation

IServer Expansion

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

IWorld Expansion

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