All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lop.devtools.monstera.files.beh.entitiy.components.ComponentLayEgg.kt Maven / Gradle / Ivy

Go to download

A library and environment designed to streamline the development of Minecraft addons.

There is a newer version: 0.4.5
Show newest version
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