# Callbacks

### PRE\_ENTITY\_JUMP

Called before an entity jumps

Return true to cancel the jump if it was not called with the force argument

The passed jump config can be directly modified unless it has the IGNORE\_CONFIG\_OVERRIDE flag

| Callback          | Arguments                                                | Return Type |
| ----------------- | -------------------------------------------------------- | ----------- |
| PRE\_ENTITY\_JUMP | Entity \| EntityPlayer entity , PassedJumpConfig config  | boolean     |

### POST\_ENTITY\_JUMP

Called after an entity jumps

| Callback           | Arguments                                              | Return Type |
| ------------------ | ------------------------------------------------------ | ----------- |
| POST\_ENTITY\_JUMP | Entity \| EntityPlayer entity, PassedJumpConfig config | void        |

### ENTITY\_LAND

Called after an entity lands

Not called by JumpLib.QuitJump

| Callback     | Arguments                                    | Return Type |
| ------------ | -------------------------------------------- | ----------- |
| ENTITY\_LAND | Entity \| EntityPlayer entity, JumpData data | void        |

### PRE\_PITFALL

Called before a player falls into a pit

Return true to cancel

Return false to take no damage

Return an integer to override the damage taken

| Callback     | Arguments                          | Return Type    |
| ------------ | ---------------------------------- | -------------- |
| PRE\_PITFALL | EntityPlayer player, JumpData data | boolean \| int |

### PRE\_PITFALL\_HURT

Called before a player takes damage from a pitfall

Return true to take no damage

Return an integer to override the damage taken

| Callback           | Arguments                                      | Return Type    |
| ------------------ | ---------------------------------------------- | -------------- |
| PRE\_PITFALL\_HURT | EntityPlayer player, JumpData data, int damage | boolean \| int |

### PITFALL\_EXIT

Called after a player exits a pit after falling into it

| Callback      | Arguments                          | Return Type |
| ------------- | ---------------------------------- | ----------- |
| PITFALL\_EXIT | EntityPlayer player, JumpData data | void        |

### PRE\_ENTITY\_SET\_FALLSPEED

Called before the speed of an entity's jump is modified

Return true to prevent the speed from being modified

Return float to multiply the speed modifier

| Callback                    | Arguments                                                 | Return Type      |
| --------------------------- | --------------------------------------------------------- | ---------------- |
| PRE\_ENTITY\_SET\_FALLSPEED | Entity \| EntityPlayer entity, float speed, JumpData data | boolean \| float |

### POST\_ENTITY\_SET\_FALLSPEED

Called after an entity's jump's fallspeed is modified

| Callback                     | Arguments                                                 | Return Type |
| ---------------------------- | --------------------------------------------------------- | ----------- |
| POST\_ENTITY\_SET\_FALLSPEED | Entity \| EntityPlayer entity, float speed, JumpData data | void        |

### ENTITY\_UPDATE\_30

Called 30 times per second for each entity in the air

| Callback           | Arguments                                    | Return Type |
| ------------------ | -------------------------------------------- | ----------- |
| ENTITY\_UPDATE\_30 | Entity \| EntityPlayer entity, JumpData data | void        |

### ENTITY\_UPDATE\_60

Called 60 times per second for each entity in the air

| Callback           | Arguments                                    | Return Type |
| ------------------ | -------------------------------------------- | ----------- |
| ENTITY\_UPDATE\_60 | Entity \| EntityPlayer entity, JumpData data | void        |

### PRE\_ENTITY\_UPDATE

Called 60 times per second for each entity in the air, before ENTITY\_UPDATE\_60

Return true to cancel the update

| Callback            | Arguments                                    | Return Type |
| ------------------- | -------------------------------------------- | ----------- |
| PRE\_ENTITY\_UPDATE | Entity \| EntityPlayer entity, JumpData data | boolean     |
