Comments (7)
I think it's acceptable for entities to handle their own events and for other mods to hook into the callbacks. So I'd consider this low priority
from minetest.
As an alternative approach, you could overwrite the on_death
callback of the entities that are considered as "monster":
Lines 5092 to 5094 in eb432d3
local function register_entity_as_monster(name)
local def = minetest.registered_entities[name]
local old_cb = def.on_death
def.on_death = function(self, killer)
my_achievements_callback("entity died", name)
if old_cb then
old_cb(self, killer)
end
end
end
register_entity_as_monster("monsters:monster_a")
from minetest.
I think it's acceptable for entities to handle their own events and for other mods to hook into the callbacks. So I'd consider this low priority
aw man(
from minetest.
As an alternative approach, you could overwrite the
on_death
callback of the entities that are considered as "monster":Lines 5092 to 5094 in eb432d3
local function register_entity_as_monster(name) local def = minetest.registered_entities[name] local old_cb = def.on_death def.on_death = function(self, killer) my_achievements_callback("entity died", name) if old_cb then old_cb(self, killer) end end end register_entity_as_monster("monsters:monster_a")
it didnt work for me for some reason
from minetest.
As an alternative approach, you could overwrite the
on_death
callback of the entities that are considered as "monster":Lines 5092 to 5094 in eb432d3
local function register_entity_as_monster(name) local def = minetest.registered_entities[name] local old_cb = def.on_death def.on_death = function(self, killer) my_achievements_callback("entity died", name) if old_cb then old_cb(self, killer) end end end register_entity_as_monster("monsters:monster_a")
i wanted answers, why it dont work for me? please
from minetest.
What does "didn't work" mean?
The issue tracker isn't a place to receive modding help
from minetest.
What does "didn't work" mean?
The issue tracker isn't a place to receive modding help
oh god😭
from minetest.
Related Issues (20)
- Add shift-click and middle click interactions to [item image] buttons HOT 4
- Random SIGBUS crashes with Radeon graphics HOT 5
- Removing Variables from Item Def/Definitions
- Minetest on Linux (glibc) is not able to give back freed MapBlocks to the OS HOT 6
- Android: ANR in Address::Resolve HOT 1
- Improve Appstream metadata
- Expose footsteps sounds HOT 4
- The water glitches out visually. HOT 7
- Build Flatpak from GitHub CI
- Mainmenu performance regression HOT 6
- Implementation of Compound Operators HOT 4
- Minetest crashes on macOS and has no image HOT 8
- Falling blocks stay immortals HOT 7
- `inventory_overlay` and `color` don't work correctly when item is held in hand HOT 2
- Build modernize: Object targets / Client and server build should share objects
- Can't run 64-bit Minetest 5.9 on 64-bit Windows 10 HOT 11
- Reduce retinal rivalry and color shimmering in anaglyph 3D rendering mode by using filters HOT 1
- Clicking outside formspec with a `field` causes a crash HOT 8
- Some kind of issue with symlinks (I think)
- Inv list click doesn't work after shift clicking if on_metadata_inventory_put adds a button to the formspec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minetest.