Skip to content

Commit

Permalink
added rideable doc
Browse files Browse the repository at this point in the history
  • Loading branch information
12rcu committed Jun 29, 2024
1 parent 127b207 commit 83bcb2c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/pages/Entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,4 +558,36 @@ item("fishing_spear", "Fishing Spear") {
}
}
}
````


### Rideable Entities

You can add the Rideable component to an entity to allow players or mobs to ride on the entity. The player will need a
form of input if they want to be able to move with the entity.

````kotlin
rideable {
pullInEntities = true //pulls in the parrots like the player does for parrots
familyTypes("parrot")
seat {
position(0.2, 1.8, 0)
}
seatCountFromSeats()
}
````

For the player you can use:

````kotlin
rideable {
familyTypes("player")
seat {
position(0, 0, 2)
}
seatCountFromSeats()
}
inputGroundControlled { }
//or
itemControllable { }
````
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class Rideable : MonsteraRawFile() {
@SerializedName("seat_count")
@Expose
var seatCount: Number? = null

/**
* needs to be called after the seats where created
*/
fun seatCountFromSeats() {
seatCount = seatsData?.size
}

@SerializedName("passenger_max_width")
@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ class BasicEntityTest {
avoidWater = true
}
additionalKeys = mapOf("my_component" to "my_value")

rideable {
familyTypes("player")
seat {
position(0, 0, 2)
}
seatCountFromSeats()
}
inputGroundControlled { }
itemControllable { }
}
}
}
Expand Down

0 comments on commit 83bcb2c

Please sign in to comment.