How To Make A Mod:
1. Open a new project in your favorite java IDE (Netbeans, Eclipse, etc).
2. Add API.jar to external libraries (This is different for every IDE, just look up a tutorial).
3. Create a class in default package.
4. Add 'extends Mod'.
5. Make a mod! :smile.gif:
How To Install A Mod:
1. Place the jar in '/addons'
2. Read example in addons.cfg
Credits:
Notch - Making Minecraft and SMP.
Hey0 - some control code, mob spawning, damage/item use/physics callbacks.
Gachl - New addon loading system. Thanks!
Swedman - World.givePlayerItem(), Player.Kick(), and Player.Ban()
Community - Various ideas given through skype, twitter, and forum posts.
[*:2pu2i3yp]Compatible with 0.2.7
[*:2pu2i3yp]Fixed sign placement causing server to crash.
2.8.6_2
[*:2pu2i3yp]Fixed some instances where the player's name would appear as "0".
2.8.7 TNT is a little buggy due to the Map Chunk Packet being do.class.
[*:2pu2i3yp]Reconstructed API base to allow for easier compatability updates.
[*:2pu2i3yp]Added Player and Mob health functions.
[*:2pu2i3yp]Added GUI that toggles addons.
[*:2pu2i3yp]Changed addons.cfg format to work better with GUI.
[*:2pu2i3yp]Depricated Block.isAttachedToActiveRedstone()
[*:2pu2i3yp]Depricated Minecart.getSpeed()
[*:2pu2i3yp]Added Entity.damage()
[*:2pu2i3yp]Added Entity.getPlayer()
[*:2pu2i3yp]Added Entity.ignite()
All Credit to Hey0 for the following:
[*:2pu2i3yp]Server.savePlayerInventories()
[*:2pu2i3yp]Block.isAttachedToActiveRedstoneDirectly()
[*:2pu2i3yp]Block.isAttachedToActiveRedstoneIndirectly()
[*:2pu2i3yp]World.isChunkLoaded()
[*:2pu2i3yp]World.loadChunk()
[*:2pu2i3yp]World.updateBlockPhysics()
[*:2pu2i3yp]damage, physics, and item use callbacks
[*:2pu2i3yp]runecraft compatability
2.8.7_1
[*:2pu2i3yp]Fixed accidental last minute number change that caused chunks to not be sent to players.
2.8.7_2
[*:2pu2i3yp]Fixed Player.toggleInvisibility() not checking the right variable after server update.
[*:2pu2i3yp]Changed Entity.ignite() to HealthBased.ignite() because of some crashing issues.
[*:2pu2i3yp]Added HealthBased.heal()
[*:2pu2i3yp]Added HealthBased.hurt()
[*:2pu2i3yp]Added HealthBased.kill()
[*:2pu2i3yp]Added HealthBased.isAlive()
[*:2pu2i3yp]Added HealthBased.onFire()
[*:2pu2i3yp]Added HealthBased.extinguish()
[*:2pu2i3yp]Added HealthBased.isUnderwater()
[*:2pu2i3yp]Added Block.ignite()
[*:2pu2i3yp]Added Block.onFire()
[*:2pu2i3yp]Added Block.extinguish()
[*:2pu2i3yp]Added Entity.isPlayer()
[*:2pu2i3yp]Added Entity.isMob()
[*:2pu2i3yp]Added Entity.isVehicle()
[*:2pu2i3yp]Added Entity.isMinecart()
[*:2pu2i3yp]Added Entity.isBoat()
2.8.7_3
[*:2pu2i3yp]Made onEntityDamage() pass Player and Mob instead of HealthBased when applicable.
2.8.7_4
[*:2pu2i3yp]Stabilized Map Chunk packet so there shouldnt be as many invisible trees or block update problems beyond what's already broken.
[*:2pu2i3yp]Disabled onItemSpawnFromBlock() because of if.class issues. This will return when one of notch's future updates moves if.class and do.class somewhere else.
[*:2pu2i3yp]Fixed fence placement
2.8.7_5
Tomorrow I will look into fixing the creeper flashing/sound issue.
[*:2pu2i3yp]Fixed Player logout issues.
[*:2pu2i3yp]Fixed player crouching not appearing to other players.
2.8.7_6
My chat was always working, so I hope this fixes everyone elses.
[*:2pu2i3yp]Fixed creeper's not flashing/hissing.
[*:2pu2i3yp]Fixed player location issues after death.
[*:2pu2i3yp]Added onPlayerDeath()
[*:2pu2i3yp]Added onPlayerRespawn()
2.8.7_7
[*:2pu2i3yp]Fixed World.spawnMinecart, MinecartType, and MinecartTypeEnum
[*:2pu2i3yp]Added Entity.getOffRide()
2.8.7_8
[*:2pu2i3yp]Fixed Mob noises/flashing when attacked.
[*:2pu2i3yp]Added onMobSpawn()
2.8.7_9
[*:2pu2i3yp]Fixed potential mob crashing issue.
2.8.7_10
[*:2pu2i3yp]Fixed onPlayerRightClick() not returning an accurate location.
[*:2pu2i3yp]Fixed BlockType and EntityType methods not being static.
2.8.7_11
[*:2pu2i3yp]Fixed multiple instances in the Player class where changing the Inventory,Crafting Table, or Armor would cause a crash, corruption, or exception.
[*:2pu2i3yp]Depricated Player.getItem() with Player.getItemCount()
2.8.7_12
[*:2pu2i3yp]Fiddled with teleportation again a little with the help of Ataman and together we fixed Player.setLocation().
2.8.7_13
[*:2pu2i3yp]Fixed post halloween blocks not calling onPlayerPlaceBlock() when placed.
2.8.7_14
[*:2pu2i3yp]Fixed Chest.isDoubleChest().
2.8.7_15
[*:2pu2i3yp]Added onExplosionRemoveBlock().
2.8.7_16
[*:2pu2i3yp]Fixed potential boat/minecart crash.
2.8.7_17
[*:2pu2i3yp]Fixed double steps, signs, and wooden/iron doors not calling onPlayerPlaceBlock().
2.8.7_18
[*:2pu2i3yp]Added onItemSpawnFromBlock() back to the API (found a better work around since I was tired of waiting for notch).
2.8.7_19
[*:2pu2i3yp]Fixed onEntityDamage not getting called correctly on player damage.
seems to be something similar to hey0's plugin system.
For right now it is, but with the future plans this will be different. Plus I don't offer any administration, just an API. Later on I hope to add a gui and mod manager to activate and disable mods. All suggestions will be considered.
Mh, I was looking at the wrong place (World).
Could you also explain how loading and running addons is supposed to work, because I'm getting an "ERROR - ADDON 'MyAddon' COULD NOT BE LOADED".
I created a class that implements Mod and all the methods, put some business logic in it and exported it to a .jar file, put it in same folder as the API.jar and the minecraft_server.jar and added the addon to the addons.cfg, but it won't work.
Mh, I was looking at the wrong place (World).
Could you also explain how loading and running addons is supposed to work, because I'm getting an "ERROR - ADDON 'MyAddon' COULD NOT BE LOADED".
I created a class that implements Mod and all the methods, put some business logic in it and exported it to a .jar file, put it in same folder as the API.jar and the minecraft_server.jar and added the addon to the addons.cfg, but it won't work.
The mod should go into '/addons' and the jar may or may not have to be the same name as the class.
edit: I just checked and for now the jar must remain the same name as the class that implements Mod.
Okay, last thing to bother you with: onPlayerDestroyBlock gets called when a player HITS a block (even w/o destroying it), so if I'm trying to destroy a block, onPlayerDestroyBlock gets called like 100 times in a row.
edit: it's more like onPlayerHitBlock instead of onPlayerDestroyBlock
Okay, last thing to bother you with: onPlayerDestroyBlock gets called when a player HITS a block (even w/o destroying it), so if I'm trying to destroy a block, onPlayerDestroyBlock gets called like 100 times in a row.
edit: it's more like onPlayerHitBlock instead of onPlayerDestroyBlock
I know...it sucks. As soon as I can figure out the exact variable sent that means the block was 100% destroyed then we'll have to live with this buggy one sorry.
edit: I can make it onPlayerHitBlock if you want and ill see what we can do about the destroy later.
Well, at the moment I don't need it to call when a block is destroyed, it's fine like it behaves now. Also, I think onPlayerDestroyBlock and onPlayerPlaceBlock both return whether the block can be placed/removed or not? I can't test it atm because minecraft.net is down and I can't connect to my server :/
I HATE when that happens. It was extremely annoying while I was making the API to have minecraft go down constantly. Anyway, yes they return false if the player can place/destroy the block and true if they cannot. Sorry if its a bit backwards, but by default or if there are no mods then it will return the wrong value and cause a lockout of creating/destroying blocks. I will fix this in 0.4.
it's up again, yay. So, I figured, that onPlayerPlaceBlock also gets called when I'm not placing a block but rightclicking a random block with empty hands. Still some bugs to fix before this can be used, but not bad for the beginning I must say.
If you need any help with the API, I'd be glad to help you out (I'm a java developer).
I'm a bit annoyed that you took some of my code. I don't mind that you're using it (it's not released under a license, you can basically do whatever with it), but if you aren't going to even credit me it ticks me off.
I'm a bit annoyed that you took some of my code. I don't mind that you're using it (it's not released under a license, you can basically do whatever with it), but if you aren't going to even credit me it ticks me off.
Quote from oddsheogorath »
Callback Functions (I'll post explanations later):
Some of these have been seen before in Hey0's Plugin System for his admin mod. I have many more that I would like to add, but it will take a bit more time to work out the bugs.
That can be Counted as a credit , But I agree he Should state it Better.
JavaDocs here.
Post Your Mods here.
Post any bugs here.
Want to help? Click here!
Contact Me:
Skype - oddsheogorath22
Twitter - pythonic_Sheo
How To Make A Mod:
1. Open a new project in your favorite java IDE (Netbeans, Eclipse, etc).
2. Add API.jar to external libraries (This is different for every IDE, just look up a tutorial).
3. Create a class in default package.
4. Add 'extends Mod'.
5. Make a mod! :smile.gif:
How To Install A Mod:
1. Place the jar in '/addons'
2. Read example in addons.cfg
Downloads:
[*:2pu2i3yp]Release 2.8.7_19
[*:2pu2i3yp]Docs 2.8.7_15
Devs:
[*:2pu2i3yp]Sheo (Oddsheogorath)
[*:2pu2i3yp]Other Pythonic Studios staff
[*:2pu2i3yp]IDeath
Credits:
Notch - Making Minecraft and SMP.
Hey0 - some control code, mob spawning, damage/item use/physics callbacks.
Gachl - New addon loading system. Thanks!
Swedman - World.givePlayerItem(), Player.Kick(), and Player.Ban()
Community - Various ideas given through skype, twitter, and forum posts.
Changelog:
2.8.4
[*:2pu2i3yp]0.2.5_01 compatibility
2.8.5
[*:2pu2i3yp]Fixed Minecart.getSpeed()
[*:2pu2i3yp]Added Player.getRide()
[*:2pu2i3yp]Fixed "<0>" when players chat
[*:2pu2i3yp]Fixed Crafting Table teleportation
2.8.5_1
[*:2pu2i3yp]Fixed onBoatTick() causing errors.
2.8.6
[*:2pu2i3yp]Compatible with 0.2.6_02
2.8.6_1
[*:2pu2i3yp]Compatible with 0.2.7
[*:2pu2i3yp]Fixed sign placement causing server to crash.
2.8.6_2
[*:2pu2i3yp]Fixed some instances where the player's name would appear as "0".
2.8.7
TNT is a little buggy due to the Map Chunk Packet being do.class.
[*:2pu2i3yp]Reconstructed API base to allow for easier compatability updates.
[*:2pu2i3yp]Added Player and Mob health functions.
[*:2pu2i3yp]Added GUI that toggles addons.
[*:2pu2i3yp]Changed addons.cfg format to work better with GUI.
[*:2pu2i3yp]Depricated Block.isAttachedToActiveRedstone()
[*:2pu2i3yp]Depricated Minecart.getSpeed()
[*:2pu2i3yp]Added Entity.damage()
[*:2pu2i3yp]Added Entity.getPlayer()
[*:2pu2i3yp]Added Entity.ignite()
All Credit to Hey0 for the following:
[*:2pu2i3yp]Server.savePlayerInventories()
[*:2pu2i3yp]Block.isAttachedToActiveRedstoneDirectly()
[*:2pu2i3yp]Block.isAttachedToActiveRedstoneIndirectly()
[*:2pu2i3yp]World.isChunkLoaded()
[*:2pu2i3yp]World.loadChunk()
[*:2pu2i3yp]World.updateBlockPhysics()
[*:2pu2i3yp]damage, physics, and item use callbacks
[*:2pu2i3yp]runecraft compatability
2.8.7_1
[*:2pu2i3yp]Fixed accidental last minute number change that caused chunks to not be sent to players.
2.8.7_2
[*:2pu2i3yp]Fixed Player.toggleInvisibility() not checking the right variable after server update.
[*:2pu2i3yp]Changed Entity.ignite() to HealthBased.ignite() because of some crashing issues.
[*:2pu2i3yp]Added HealthBased.heal()
[*:2pu2i3yp]Added HealthBased.hurt()
[*:2pu2i3yp]Added HealthBased.kill()
[*:2pu2i3yp]Added HealthBased.isAlive()
[*:2pu2i3yp]Added HealthBased.onFire()
[*:2pu2i3yp]Added HealthBased.extinguish()
[*:2pu2i3yp]Added HealthBased.isUnderwater()
[*:2pu2i3yp]Added Block.ignite()
[*:2pu2i3yp]Added Block.onFire()
[*:2pu2i3yp]Added Block.extinguish()
[*:2pu2i3yp]Added Entity.isPlayer()
[*:2pu2i3yp]Added Entity.isMob()
[*:2pu2i3yp]Added Entity.isVehicle()
[*:2pu2i3yp]Added Entity.isMinecart()
[*:2pu2i3yp]Added Entity.isBoat()
2.8.7_3
[*:2pu2i3yp]Made onEntityDamage() pass Player and Mob instead of HealthBased when applicable.
2.8.7_4
[*:2pu2i3yp]Stabilized Map Chunk packet so there shouldnt be as many invisible trees or block update problems beyond what's already broken.
[*:2pu2i3yp]Disabled onItemSpawnFromBlock() because of if.class issues. This will return when one of notch's future updates moves if.class and do.class somewhere else.
[*:2pu2i3yp]Fixed fence placement
2.8.7_5
Tomorrow I will look into fixing the creeper flashing/sound issue.
[*:2pu2i3yp]Fixed Player logout issues.
[*:2pu2i3yp]Fixed player crouching not appearing to other players.
2.8.7_6
My chat was always working, so I hope this fixes everyone elses.
[*:2pu2i3yp]Fixed creeper's not flashing/hissing.
[*:2pu2i3yp]Fixed player location issues after death.
[*:2pu2i3yp]Added onPlayerDeath()
[*:2pu2i3yp]Added onPlayerRespawn()
2.8.7_7
[*:2pu2i3yp]Fixed World.spawnMinecart, MinecartType, and MinecartTypeEnum
[*:2pu2i3yp]Added Entity.getOffRide()
2.8.7_8
[*:2pu2i3yp]Fixed Mob noises/flashing when attacked.
[*:2pu2i3yp]Added onMobSpawn()
2.8.7_9
[*:2pu2i3yp]Fixed potential mob crashing issue.
2.8.7_10
[*:2pu2i3yp]Fixed onPlayerRightClick() not returning an accurate location.
[*:2pu2i3yp]Fixed BlockType and EntityType methods not being static.
2.8.7_11
[*:2pu2i3yp]Fixed multiple instances in the Player class where changing the Inventory,Crafting Table, or Armor would cause a crash, corruption, or exception.
[*:2pu2i3yp]Depricated Player.getItem() with Player.getItemCount()
2.8.7_12
[*:2pu2i3yp]Fiddled with teleportation again a little with the help of Ataman and together we fixed Player.setLocation().
2.8.7_13
[*:2pu2i3yp]Fixed post halloween blocks not calling onPlayerPlaceBlock() when placed.
2.8.7_14
[*:2pu2i3yp]Fixed Chest.isDoubleChest().
2.8.7_15
[*:2pu2i3yp]Added onExplosionRemoveBlock().
2.8.7_16
[*:2pu2i3yp]Fixed potential boat/minecart crash.
2.8.7_17
[*:2pu2i3yp]Fixed double steps, signs, and wooden/iron doors not calling onPlayerPlaceBlock().
2.8.7_18
[*:2pu2i3yp]Added onItemSpawnFromBlock() back to the API (found a better work around since I was tired of waiting for notch).
2.8.7_19
[*:2pu2i3yp]Fixed onEntityDamage not getting called correctly on player damage.
Srsly, Liam?
For right now it is, but with the future plans this will be different. Plus I don't offer any administration, just an API. Later on I hope to add a gui and mod manager to activate and disable mods. All suggestions will be considered.
edit: does this api has functions like printing text to the chat and such?
Yes, Player.sendChat(String msg). Ill document this all later.
Could you also explain how loading and running addons is supposed to work, because I'm getting an "ERROR - ADDON 'MyAddon' COULD NOT BE LOADED".
I created a class that implements Mod and all the methods, put some business logic in it and exported it to a .jar file, put it in same folder as the API.jar and the minecraft_server.jar and added the addon to the addons.cfg, but it won't work.
The mod should go into '/addons' and the jar may or may not have to be the same name as the class.
edit: I just checked and for now the jar must remain the same name as the class that implements Mod.
Duh, I'm such a retard thanks.
I didn't fully understand that. Does that mean the name of the jar file of the addon has to have the same name as the class that implements mod?
Yea, i was lost in thought. Fixed.
edit: it's more like onPlayerHitBlock instead of onPlayerDestroyBlock
I know...it sucks. As soon as I can figure out the exact variable sent that means the block was 100% destroyed then we'll have to live with this buggy one sorry.
edit: I can make it onPlayerHitBlock if you want and ill see what we can do about the destroy later.
If you need any help with the API, I'd be glad to help you out (I'm a java developer).
edit: I may look into getting more devs involved a bit later.
That can be Counted as a credit , But I agree he Should state it Better.