com.lop.devtools.monstera.files.beh.entitiy.components.ComponentLayEgg.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of monstera Show documentation
Show all versions of monstera Show documentation
A library and environment designed to streamline the development of Minecraft addons.
package com.lop.devtools.monstera.files.beh.entitiy.components
import com.lop.devtools.monstera.files.beh.entitiy.data.Subject
class ComponentLayEgg {
val general = mutableMapOf()
var priority: Int? = null
var speedMultiplier: Float? = null
var searchRange: Number? = null
var searchHeight: Number? = null
var goalRadius: Float? = null
/**
* 0..1
*
* Event to run when this mob lays the egg.
*/
fun onLay(event: String, target: Subject? = null) {
val data = mutableMapOf("event" to event)
if(target != null)
data["target"] = target.toString().lowercase()
general["on_lay"] = data
}
fun getData(): MutableMap {
priority?.let { general["priority"] = it }
speedMultiplier?.let { general["speed_multiplier"] = it }
searchHeight?.let { general["search_height"] = it }
searchRange?.let { general["search_range"] = it }
goalRadius?.let { general["goal_radius"] = it }
return general
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy