Why did my printer's nozzle dig itself into my print?
You are using incorrect commands in your end-code for the incorrect tool with respect to the print head raise.

Slic3r has no knowledge of the maximum printer height (as in variable max_print_height) because there is no input field to specify this, as can be seen in this partial screenshot:



However, in Slic3r PE (Prusa Edition), there is a possibility to enter such a value, as seen in the following partial screenshot:



Note that in both editions, the Bed shape interface is equivalent when Set... is pressed:


To use the raising of the head, respecting the maximum print height, in Slic3r PE, you need to add the following line:

{if layer_z &lt; max_print_height}G1 Z{z_offset+min(layer_z+60, max_print_height)}{endif}


This will parse fine in Slic3r PE, but not in Slic3r (as max_print_height is not known).

If you want such a command in Slic3r, you need to enter (for a printer with a maximum print height of 240&nbsp;mm):

G1 Z{[z_offset]+min([layer_z]+3, 240)}


results in Slic3r for a 20x20x20&nbsp;mm calibration cube with a zero z_offset to:

G1 Z23