Interface IBlock

All Known Subinterfaces:
IBlockFluidContainer, IBlockScripted, IBlockScriptedDoor

public interface IBlock
  • Method Details

    • getX

      int getX()
    • getY

      int getY()
    • getZ

      int getZ()
    • getPos

      IPos getPos()
    • getProperty

      Object getProperty(String name)
    • setProperty

      void setProperty(String name, Object val)
    • getProperties

      String[] getProperties()
    • getName

      String getName()
      Returns:
      Returns this blocks name
    • remove

      void remove()
      Removes this block
    • isRemoved

      boolean isRemoved()
      Returns:
      Returns whether or not this block has been replaced by another
    • isAir

      boolean isAir()
    • setBlock

      IBlock setBlock(String name)
    • setBlock

      IBlock setBlock(IBlock block)
      Parameters:
      block - Sets the block to replace this one
      Returns:
      Returns the new block
    • hasTileEntity

      boolean hasTileEntity()
    • isContainer

      boolean isContainer()
      Returns:
      Returns whether it has items stored inside it (e.g. chests, droppers, hoppers, etc)
    • getContainer

      IContainer getContainer()
    • getTempdata

      IData getTempdata()
      Temp data stores anything but only untill it's reloaded. (works only for customnpcs blocks)
    • getStoreddata

      IData getStoreddata()
      Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved (works only for blocks with TileEntities)
    • getWorld

      IWorld getWorld()
    • getBlockEntityNBT

      INbt getBlockEntityNBT()
    • setTileEntityNBT

      void setTileEntityNBT(INbt nbt)
    • getMCTileEntity

      net.minecraft.world.level.block.entity.BlockEntity getMCTileEntity()
      Expert users only
      Returns:
      Returns minecrafts tilentity
    • getMCBlock

      net.minecraft.world.level.block.Block getMCBlock()
      Expert users only
      Returns:
      Returns minecrafts block
    • blockEvent

      void blockEvent(int type, int data)
      Parameters:
      type - Event type
      data - Event data Example: Chests - type:1 data:1 opens the lid, type:1 data:0 closes the lid Note block - type:(0-9) data:(0-24) plays different notes
    • getDisplayName

      String getDisplayName()
    • getMCBlockState

      net.minecraft.world.level.block.state.BlockState getMCBlockState()
      Expert users only
      Returns:
      Returns minecrafts iblockstate
    • interact

      void interact(int side)
      Simulates a player interacting with this block (can give weird results)
      Parameters:
      side - The side of the block interacted with