Tile Placement Component

From wiki
Jump to: navigation, search

Category:Component Modding are all optional properties that can be added to any file. Components are useful in extending the original files with even more information, such as the cost of the item or whether the block can be broken by a weapon.

On this page, we go over the Tile Placement component, signified by the following;

"tilePlacement": {
  =Content=
}

Tile Placement components are used to adjust how the tile sits in the hand of the player. This is especially useful for objects like the balloon, where the player wouldn't hold it in the centre of the string.

When and How to use

Tile Placement components are needed whenever you want to adjust how the tile looks in the hand. Therefore a Tile is needed first.

To start off with first, make sure to create a Tile. Once that is done, you can add the following below the last property of the file;

"tilePlacement": {
  "inHandRotation": {
    "x": 0.0,
    "y": 0.0,
    "z": -1.54
  },
  "inHandOffset": {
    "x": 0.0,
    "y": 0.0,
    "z": 0.5
  },
  "inHandScale": 3.0
},

All three of these values act similar to the properties by the same name in Craft Items.

#"inHandRotation" is used to specify the 3 axis rotation of the object in the hand. This is in Radians and not degrees. #"inHandOffset" is used to specify the offset of the object in the hand. And finally #"inHandScale" is used to specify how large the object should be.

With that, this component is complete.


Config Options

All config options must be inside the body of;

"tilePlacement": {
  =Config Here=
}

"inHandOffset"

Valid options (Vector 3 - Float): { "x": 0, "y": 0, "z":0 }

Default Value: If not specified, it will have no offset applied.


This is the offset of the object in the hand while holding the object. Useful for making sure the item is held correctly.


"inHandRotation"

Valid options (Vector 3 - Float): { "x": 0.0, "y": 0.0, "z": 0.0 }

Default Value: No default value is specified. Always need to provide your own.


This is the rotation of the item in the player's hand. This is used to make sure the item is facing the correct direction. Rotations are in Radians and not Degrees.


"inHandScale"

Valid options (Double): A positive decimal value.

Default Value: If not specified, it will have a scale of 1.


This is the scale of the object in the hand while holding the object. The value is just a multiplier to the overall size of the object. Useful for making sure the item is of the appropriate size.