User Tools

Site Tools


tutorial:blocks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:blocks [2020/06/14 01:00] – fix highlighting + more comments draylartutorial:blocks [2020/06/14 01:02] – more highlighting draylar
Line 153: Line 153:
 You can override methods in the block class for custom functionality. Here's an implementation of the ''onUse'' method, which is called when you right-click the block. We check if the interaction is occurring on the server, and then send the player a message saying, //"Hello, world!"// You can override methods in the block class for custom functionality. Here's an implementation of the ''onUse'' method, which is called when you right-click the block. We check if the interaction is occurring on the server, and then send the player a message saying, //"Hello, world!"//
  
-<code java [enable_line_numbers="true"]>+<code java [enable_line_numbers="true",highlight_lines_extra="8,9,10,11,12,13,14,15"]>
 @Override @Override
 public class ExampleBlock extends Block { public class ExampleBlock extends Block {
Line 174: Line 174:
 To use your custom block class, replace //new Block// with //new ExampleBlock//: To use your custom block class, replace //new Block// with //new ExampleBlock//:
  
-<code java [enable_line_numbers="true"]>+<code java [enable_line_numbers="true",highlight_lines_extra="7"]>
 public class ExampleMod implements ModInitializer { public class ExampleMod implements ModInitializer {
  
tutorial/blocks.txt · Last modified: 2024/04/15 01:52 by solidblock