MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / entityHealth

Method entityHealth

source/game/scripting/StarWorldLuaBindings.cpp:1411–1417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1409 }
1410
1411 Maybe<Vec2F> WorldEntityCallbacks::entityHealth(World* world, EntityId entityId) {
1412 if (auto entity = world->get<DamageBarEntity>(entityId)) {
1413 return Vec2F(entity->health(), entity->maxHealth());
1414 } else {
1415 return {};
1416 }
1417 }
1418
1419 Maybe<String> WorldEntityCallbacks::entitySpecies(World* world, EntityId entityId) {
1420 if (auto player = world->get<Player>(entityId)) {

Callers

nothing calls this directly

Calls 2

healthMethod · 0.45
maxHealthMethod · 0.45

Tested by

no test coverage detected