> For the complete documentation index, see [llms.txt](https://minetorio.gitbook.io/minetorio-or-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minetorio.gitbook.io/minetorio-or-wiki/developers/example-usage.md).

# Example Usage

Some basic examples of how to use the API

```java
@EventHandler
public void onBreak(BlockBreakEvent event) {
    if(MTAPI.isDevice(event.getBlock().getLocation())){
        //do something
    }
}

@EventHandler
public void onBreak2(BlockBreakEvent event) {
    Device device = MTAPI.getDevice(event.getBlock().getLocation());
    if(device != null){
        event.getPlayer().damage(1.0); //do something
    }
}

@EventHandler
public void onBreak3(BlockBreakEvent event) {
    PlayerData playerData = MTAPI.getPlayerData(event.getPlayer().getUniqueId());
    if(playerData != null){
        if(playerData.hasTech("Steam Technology")){
            //do something
        }
    }
}

@EventHandler
public void onBreak4(BlockBreakEvent event) {
    PlayerData playerData = MTAPI.getPlayerData(event.getPlayer().getUniqueId());
    if(playerData != null){
        playerData.unlockTech("Steam Technology");
    }
}

@EventHandler
public void onBreak5(BlockBreakEvent event) {
    SuperChunk superChunk = MTAPI.getSuperChunk(event.getBlock().getLocation());
    if(superChunk != null){
        superChunk.addPollution(100);
        superChunk.setPollution(0);
        superChunk.setLifeSpanPollution(0);///Used for evolution %
        ArrayList<Chunk> chunks = superChunk.getChunks();//Get all chunks
    }
}
```
