Difference between revisions of "Sponge Items"

From wiki
Jump to: navigation, search
m (DeamonHunter moved page Sponge to Sponge Items)
m (Forgot an instruction)
 
Line 26: Line 26:
 
},
 
},
 
</pre>
 
</pre>
 +
 +
Now that you have two items. Put the codes of the opposite sponges into <code>"soakedVariant"</code> and <code>"dryVariant"</code>.
  
 
If all is set up properly, the unsoaked version should appear in the creative menu, and turned into the soaked version after you collect some water.
 
If all is set up properly, the unsoaked version should appear in the creative menu, and turned into the soaked version after you collect some water.

Latest revision as of 05:11, 16 November 2018

Items are fairly broad in their types. Each type has it's own properties and uses. This page is for sponges, items that can pick up an item and place it down later.

Sponges are all items that have the following line;

"kind": "staxel.item.Sponge",

Sponges can pick up Tiles in the world and then place them at a later time.


Creating a Placer

To start creating a Sponge, first create a normal Craft Item specified at . This will end up being the dry version of the sponge.

Once that is created, swap the "kind" value to "staxel.item.Sponge". Then add the following to your file;

"sponge": {
  "soakedVariant": "staxel.item.soakedVersion"
},

Now you need to repeat above, however replace "soakedVariant" with "dryVariant". Giving you;

"sponge": {
  "dryVariant": "staxel.item.unsoakedVersion"
},

Now that you have two items. Put the codes of the opposite sponges into "soakedVariant" and "dryVariant".

If all is set up properly, the unsoaked version should appear in the creative menu, and turned into the soaked version after you collect some water.


Spawning in a Placer

Follow the guide at Items#How to Spawn an Item. When that guide mentions "kind", make sure to use "staxel.item.Sponge" instead of "staxel.item.CraftItem" else you won't be able to spawn the item.

You can add an additional parameter as noted below;

{
  "kind": "staxel.item.Sponge", 
  "waterBlockCode": "staxel.tile.water"
}

The second property, "waterBlockCode" does not need to be included. But including this will give your spawned sponge, a tile to place.

Configuration Options

The list of basic properties is included at Items#Config Options.

The item itself, does need additional information. However additional information is contained in a Sponge Component which needs to be added along with the item file.