--- a/docs/source/actions.rst Fri Aug 12 20:53:57 2011 -0400
+++ b/docs/source/actions.rst Fri Aug 12 21:10:22 2011 -0400
@@ -55,3 +55,11 @@
This action is fairly low level. Expect to see some fun path-finding
algorithms/libraries in the future that will remove the need to call this directly.
+
+respawn
+-------
+
+``(clojurecraft.actions/respawn bot)``
+
+The ``respawn`` action tells your bot to respawn. Only send this if your bot has
+died, because I'm not sure what the vanilla server will do otherwise.
--- a/src/clojurecraft/actions.clj Fri Aug 12 20:53:57 2011 -0400
+++ b/src/clojurecraft/actions.clj Fri Aug 12 21:10:22 2011 -0400
@@ -26,3 +26,7 @@
(defn chat [bot message]
(delay
(write-packet bot :chat {:message message})))
+
+(defn respawn [bot]
+ (delay
+ (write-packet bot :respawn {:world 0}))) ; Always respawn in the normal (non-Nether) world for now.
--- a/src/clojurecraft/out.clj Fri Aug 12 20:53:57 2011 -0400
+++ b/src/clojurecraft/out.clj Fri Aug 12 21:10:22 2011 -0400
@@ -59,7 +59,7 @@
(-write-string-ucs2 conn message))
(defn- write-packet-respawn [conn {world :world}]
- (-write-bool conn world))
+ (-write-byte conn world))
(defn- write-packet-player [conn {onground :onground}]
(-write-bool conn onground))