Created
January 19, 2016 22:22
-
-
Save nasapierce/03794fa9d30f40557dac to your computer and use it in GitHub Desktop.
Shoots boats, not arrows!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function entityAddedHook(entity) { | |
if(Entity.getEntityTypeId(entity) == EntityType.ARROW) { | |
var entity2 = Level.spawnMob(Entity.getX(entity), Entity.getY(entity), Entity.getZ(entity), EntityType.BOAT); | |
Entity.setVelX(entity2, Entity.getVelX(entity)); | |
Entity.setVelY(entity2, Entity.getVelY(entity)); | |
Entity.setVelZ(entity2, Entity.getVelZ(entity)); | |
Entity.remove(entity); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment