Latest build : v0.6 CraftBukkit: 1.5.2
Easily create blocks with custom effects ! Persistence beetween restart !
Do not need Spout or SpoutCraft !
This plugin provides an API for plugin developers to create blocks with custom effects. It's like creating new blocks but without new textures. You've got the total control of what you can do. There are some new events like when the player walks on your block, when he right/left click on, and soon much more !
Commands & Permissions
| command | information | permission |
|---|---|---|
| /blocklist | Display the whole custom block list | cblock.list |
| /getblock <name> [amount] | Gives you the custom block with that name in amount times | cblock.get |
DEVELOPER PART
How to create my custom block ?
Plugin Solution
BlockAPI blockAPI =(BlockAPI) plugin.getServer().getPluginManager().getPlugin("BlockAPI"); if(blockAPI==null) //Here handle that BlockAPI isn't installed on this server else blockAPI.addMyCustomBlock(myCustomBlock); //OR blockAPI.addMyCustomBlocks(myCustomBlockList):
No plugin just the class
Methods
To see all the methods of CustomBlock and all the BlockAPI methods, see here
Sample
Otherwise this is a sample TrampolineBlock :
public class TrampolineBlock extends CustomBlock{ public TrampolineBlock() { super("trampo"); setName("Trampoline"); setBlockID(1); setMaxStackSize(128); ArrayList<String> desc = new ArrayList<String>(); desc.add("Jump ! Jump !"); setDescription(desc); setDrops(BlockAPI.getItem(this)); } @Override public void walk(PlayerMoveEvent event){ event.getPlayer().setFallDistance(0); event.getPlayer().setVelocity(event.getPlayer().getVelocity().setY(1)); } }
and here then the code added in onEnable() in the plugin class if you use the plugin solution, otherwise that's it.
BlockAPI blockAPI =(BlockAPI) plugin.getServer().getPluginManager().getPlugin("BlockAPI"); blockAPI.addMyCustomBlock(new TrampolineBlock());
Render
Block in inventories will now render as normal Blocks but their name will change to your custom block name and the quantity is handled in the title to avoid to limit maxStackSize

To do