Terraria.ModLoader.GlobalTile

This class allows you to modify the behavior of any tile in the game. Create an instance of an overriding class then call Mod.AddGlobalTile to use this.

Methods

AddToArray(System.Int32[]@,System.Int32)()
A convenient method for adding an integer to the end of an array. This can be used with the arrays in TileID.Sets.RoomNeeds.
AddModTree(System.Int32,Terraria.ModLoader.ModTree)()
Allows the given type of tile to grow the given modded tree.
AddModPalmTree(System.Int32,Terraria.ModLoader.ModPalmTree)()
Allows the given type of tile to grow the given modded palm tree.
AddModCactus(System.Int32,Terraria.ModLoader.ModCactus)()
Allows the given type of tile to grow the given modded cactus.
Autoload(System.String@)()
Allows you to automatically load a GlobalTile instead of using Mod.AddGlobalTile. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload or to control the internal name.
SetDefaults()
Allows you to modify the properties of any tile in the game. Most properties are stored as arrays throughout the Terraria code.
KillSound(System.Int32,System.Int32,System.Int32)()
Allows you to customize which sound you want to play when the tile at the given coordinates is hit. Return false to stop the game from playing its default sound for the tile. Returns true by default.
NumDust(System.Int32,System.Int32,System.Int32,System.Boolean,System.Int32@)()
Allows you to change how many dust particles are created when the tile at the given coordinates is hit.
CreateDust(System.Int32,System.Int32,System.Int32,System.Int32@)()
Allows you to modify the default type of dust created when the tile at the given coordinates is hit. Return false to stop the default dust (the dustType parameter) from being created. Returns true by default.
DropCritterChance(System.Int32,System.Int32,System.Int32,System.Int32@,System.Int32@,System.Int32@)()
Allows you to modify the chance the tile at the given coordinates has of spawning a certain critter when the tile is killed.
Drop(System.Int32,System.Int32,System.Int32)()
Allows you to customize which items the tile at the given coordinates drops. Return false to stop the game from dropping the tile's default item. Returns true by default.
CanKillTile(System.Int32,System.Int32,System.Int32,System.Boolean@)()
Allows you to determine whether or not the tile at the given coordinates can be hit by anything. Returns true by default. blockDamaged currently has no use.
KillTile(System.Int32,System.Int32,System.Int32,System.Boolean@,System.Boolean@,System.Boolean@)()
Allows you to determine what happens when the tile at the given coordinates is killed or hit with a pickaxe. Fail determines whether the tile is mined, effectOnly makes it so that only dust is created, and noItem stops items from dropping.
CanExplode(System.Int32,System.Int32,System.Int32)()
Whether or not the tile at the given coordinates can be killed by an explosion (ie. bombs). Returns true by default; return false to stop an explosion from destroying it.
NearbyEffects(System.Int32,System.Int32,System.Int32,System.Boolean)()
Allows you to make things happen when the tile is within a certain range of the player (around the same range water fountains and music boxes work). The closer parameter is whether or not the tile is within the range at which things like campfires and banners work.
ModifyLight(System.Int32,System.Int32,System.Int32,System.Single@,System.Single@,System.Single@)()
Allows you to determine how much light the block emits. Make sure you set Main.tileLighted[type] to true in SetDefaults for this to work.
Dangersense(System.Int32,System.Int32,System.Int32,Terraria.Player)()
Allows you to determine whether the block glows red when the given player has the Dangersense buff.
SetSpriteEffects(System.Int32,System.Int32,System.Int32,Microsoft.Xna.Framework.Graphics.SpriteEffects@)()
Allows you to determine whether or not a tile will draw itself flipped in the world.
AnimateTile()
Allows animating tiles that were previously static. Loading a new texture for the tile is required first. Use Main.tileFrameCounter to count game frames and Main.tileFrame to change animation frames.
PreDraw(System.Int32,System.Int32,System.Int32,Microsoft.Xna.Framework.Graphics.SpriteBatch)()
Allows you to draw things behind the tile at the given coordinates. Return false to stop the game from drawing the tile normally. Returns true by default.
DrawEffects(System.Int32,System.Int32,System.Int32,Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Color@,System.Int32@)()
Allows you to make stuff happen whenever the tile at the given coordinates is drawn. For example, creating dust or changing the color the tile is drawn in.
PostDraw(System.Int32,System.Int32,System.Int32,Microsoft.Xna.Framework.Graphics.SpriteBatch)()
Allows you to draw things in front of the tile at the given coordinates. This can also be used to do things such as creating dust.
SpecialDraw(System.Int32,System.Int32,System.Int32,Microsoft.Xna.Framework.Graphics.SpriteBatch)()
Special Draw. Only called if coordinates are placed in Main.specX/Y during DrawEffects. Useful for drawing things that would otherwise be impossible to draw due to draw order, such as items in item frames.
RandomUpdate(System.Int32,System.Int32,System.Int32)()
Called for every tile the world randomly decides to update in a given tick. Useful for things such as growing or spreading.
TileFrame(System.Int32,System.Int32,System.Int32,System.Boolean@,System.Boolean@)()
Called for every tile that updates due to being placed or being next to a tile that is changed. Return false to stop the game from carrying out its default TileFrame operations. Returns true by default.
CanPlace(System.Int32,System.Int32,System.Int32)()
Allows you to stop a tile from being placed at the given coordinates. Return false to block the tile from being placed. Returns true by default.
AdjTiles(System.Int32)()
Allows you to determine which tiles the given tile type can be considered as when looking for crafting stations.
RightClick(System.Int32,System.Int32,System.Int32)()
Allows you to make something happen when any tile is right-clicked by the player.
MouseOver(System.Int32,System.Int32,System.Int32)()
Allows you to make something happen when the mouse hovers over any tile. Useful for showing item icons or text on the mouse.
MouseOverFar(System.Int32,System.Int32,System.Int32)()
Allows you to make something happen when the mouse hovers over any tile, even when the player is far away. Useful for showing what's written on signs, etc.
AutoSelect(System.Int32,System.Int32,System.Int32,Terraria.Item)()
Allows you to determine whether the given item can become selected when the cursor is hovering over a tile and the auto selection hotkey is pressed.
PreHitWire(System.Int32,System.Int32,System.Int32)()
Whether or not the vanilla HitWire code and the HitWire hook is allowed to run. Useful for overriding vanilla behavior by returning false. Returns true by default.
HitWire(System.Int32,System.Int32,System.Int32)()
Allows you to make something happen when a wire current passes through any tile.
Slope(System.Int32,System.Int32,System.Int32)()
Allows you to control how hammers slope any tile. Return true to allow the tile to slope normally. Returns true by default.
FloorVisuals(System.Int32,Terraria.Player)()
Allows you to make something happen when a player stands on the given type of tile. For example, you can make the player slide as if on ice.
ChangeWaterfallStyle(System.Int32,System.Int32@)()
Allows you to change the style of waterfall that passes through or over any tile.
SaplingGrowthType(System.Int32,System.Int32@)()
Allows a tile to support a sapling that can eventually grow into a tree. The type of the sapling should be returned here. Returns -1 by default. The style parameter will determine which sapling is chosen if multiple sapling types share the same ID; even if you only have a single sapling in an ID, you must still set this to 0.
PlaceInWorld(System.Int32,System.Int32,Terraria.Item)()
Allows you to do something when this tile is placed.