Minecraftmodcustomstuff Wiki
Register
m (Updated article to CS2. Put CS1 Content in a fold. Added CS2 Header. Added "Examples" Category.)
m (Removed picture I accidentally copied from the crosstexture page when I was copying the format.)
 
Line 6: Line 6:
   
 
==Pressure Plate Block==
 
==Pressure Plate Block==
newPlate.js (CS2 v.0.9.10 and later) [[File:2012-10-19_21.32.46.png|thumb|CrossTexture block]]
+
newPlate.js (CS2 v.0.9.10 and later)
 
id = config.getBlockId("plateID");
 
id = config.getBlockId("plateID");
 
name = "ExamplePressurePlate";
 
name = "ExamplePressurePlate";

Latest revision as of 13:37, 4 May 2013

This Article is up to date with Custom Stuff 2 "Denotes content compatible with Custom Stuff 2"

A Pressure Plate is a relatively flat block that activates when an entity occupies its space, sending out a redstone signal to all adjacent spaces. In the vanilla game, there are two comparable pressure plates: wood and stone. The notible difference between the two is whether or not drops can activate the pressure plate, with only the sooner of the two being activated.

With Custom Stuff, it is possible to create several more interesting and unique pressure plates that are activated only by specific classes of entities, as defined by the trigger attribute.

Note that this block functions like the two classic pressure plates. The Weighted Pressure Plates have not yet been implemented in CS2.

Pressure Plate Block

newPlate.js (CS2 v.0.9.10 and later)

id = config.getBlockId("plateID");
name = "ExamplePressurePlate";
displayName[0] = "Example Pressure Plate";
material = "rock";
stepSound = "stone";
hardness[0] = 0;
drop[0] = config.getBlockId("plateID") + ":0 1";
addToCreative[0] = true;
textureFileYN[0] = "exampleImage.png";

mod.js

config.addBlockIdProperty("plateID", 1005);
mod.addBlock("newPlate.js", "pressurePlate");

Pressure Plate Block Attributes

Below is a table of attributes available to Pressure Plate-type blocks, including information on notable attributes.

Required Attributes

Optional Attributes

textureFile and textureIndex
In CS2 versions for 1.4.7 and below, CS2 0.9.9 or below, textureFile was used to specify the texture sheet and textureIndex was used for identifying the specific icon within the texture sheet. If using CS2 0.9.9 or lower, make sure to use both of these attributes.

trigger
This attribute defines what types of entities trigger the pressure plate. These come in a variety of categories, making it easy to create special-purpose pressure plates. If not set, this will default to "all", which is what a standard wooden pressure plate is set to.

CS1
Older Examples and Information for Custom Stuff 1.

Example Pressure Plate - Iron Pressure Plate

Here's an example of a pressure plate that will only activate when a player steps on it, making it an effective 'welcome mat' for doors since mobs can't activate it.

name="Iron Pressure Plate";
id=222;
texturefile="terrain.png";
textureindex=22;
material="iron";
type="pressureplate";
stepsound="metal";
transparent="true";
opacity=0;
toolclass="pickaxe";
harvestlevel=1;
pressureplatetrigger="player";

Pressure Plate Block Attributes

Below is a table of attributes available to pressure plate-type blocks, including information on notable attributes.

Required Attributes

Optional Attributes

type
This must be set to 'pressureplate' in order for the block to function as a pressure plate.

pressureplatetrigger
This attribute defines which types of entities can activate the pressure plate. Without this attribute set, any entity will activate the plate.