[Mod] Mobs Redo [1.55] [mobs]

PetiAPocok
Member
Posts: 25
Joined: Thu Apr 23, 2020 14:43
GitHub: PetiAPocok
In-game: PetiAPocok
Location: Hungary

Re: [Mod] Mobs Redo [1.54] [mobs]

by PetiAPocok » Post

TenPlus1 wrote:
Thu Dec 31, 2020 14:50
@PetiAPocok - I'm not sure if entities support transparent faces just yet, it's either textured or 100% see through for now.
I checked it. It's supported but if there are two transparent TEXTURES next to each other and you look trough the first, the second one is invisible.

Bastrabun
Member
Posts: 136
Joined: Mon Nov 04, 2019 19:48

Re: [Mod] Mobs Redo [1.55] [mobs]

by Bastrabun » Post

For certain events, I'd like to spawn mobs with different stats, sometimes from worldedit's lua command, sometimes from a commandblock. Different stats means different nametag, different damage, range, sight_range, hitpoints and so on.

So I do

//lua minetest.add_entity({x=1,y=2,z=3},"mobs_monster:sand_monster",minetest.serialize({hp_min=1000,hp_max=1000,nametag="Sandmonster+"})

The sandmonster does appear and when hit counts down from 1000 hitpoints. However, after I beat it down to ~950, it dies. I tried grabbing the object and assigning it health, doesn't work either. Looks like this is not the way to do it.

Any ideas how to spawn that mob with 1000 HP or other, different stats?

User avatar
TenPlus1
Member
Posts: 2960
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Mobs Redo [1.55] [mobs]

by TenPlus1 » Post

Spawn your mob as usual but get the luaentity() information and edit that directly for values you want to change, check the api.txt for information:https://notabug.org/TenPlus1/mobs_redo/ ... i.txt#L318

Bastrabun
Member
Posts: 136
Joined: Mon Nov 04, 2019 19:48

Re: [Mod] Mobs Redo [1.55] [mobs]

by Bastrabun » Post

I tried it this way (linebreaks for readability):

Code: Select all

//lua 

local pname="Service" 
local monsta=minetest.add_entity(minetest.get_player_by_name(pname):get_pos(),"mobs_monster:sand_monster",minetest.serialize({hp_min=100,hp_max=200,nametag="Sandmonster+"}))
minetest.chat_send_player(pname,dump(monsta:get_luaentity().health))
monsta:get_luaentity().health=200
minetest.chat_send_player(pname,dump(monsta:get_luaentity().health))
I can see in the luaentity that hp_max is 200, hp_min is 100 and health is 200 as assigned. Only it dies after I deal it ~15 to 20 damage. It dutifully counts down from 200, but when it reaches 180 it dies.

What do I do wrong?

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 8 guests