@Override public void onInteract(Entity entity, Action type) { super.onInteract(entity, type); if (type == Action.RIGHT_CLICK && entity.getController() instanceof VanillaPlayerController) { this.open((VanillaPlayerController) entity.getController()); } }
@Override public void onAttached() { super.onAttached(); getHealth().setSpawnHealth(40); if (getDataMap().containsKey(Data.HELD_ITEM)) { heldItem = getDataMap().get(Data.HELD_ITEM); } getParent().setCollision(new CollisionModel(new BoundingBox(1, 3, 1, 2, 3, 1))); getDrops().addRange(VanillaMaterials.ENDER_PEARL, 1); }
@Override public void finalizeTick() { super.finalizeTick(); this.lastHeldItem = heldItem; }
@Override public void onSave() { super.onSave(); getDataMap().put(Data.HELD_ITEM, heldItem); }
@Override public void onAttached() { super.onAttached(); getHealth().setSpawnHealth(20); }