Modding:Adding Block Behavior: Difference between revisions

From Vintage Story Wiki
Marked this version for translation
No edit summary
(Marked this version for translation)
Line 7: Line 7:


<translate>
<translate>
= Introduction = <!--T:49-->
= Introduction = <!--T:49-->
Block Behaviors are useful when you want different blocks to act in the same way, as you can attach one or more block behaviors to an arbitrary number of blocks.
Block Behaviors are useful when you want different blocks to act in the same way, as you can attach one or more block behaviors to an arbitrary number of blocks.
You may want to have a look at the existing [[Block Json Properties#p_behaviors|block behaviors]] before implementing your own.
You may want to have a look at the existing [[Block Json Properties#p_behaviors|block behaviors]] before implementing your own.
Line 75: Line 75:
         {
         {
<translate>
<translate>
             // Remove the block at the current position and place it at the target position
             <!--T:88-->
// Remove the block at the current position and place it at the target position
</translate>
</translate>
             world.BlockAccessor.SetBlock(0, blockSel.Position);
             world.BlockAccessor.SetBlock(0, blockSel.Position);
Confirmedusers
409

edits