I did a quick search for "Unknown blocks" in this forum and the related-projects forum, and the dev wiki, and turned up suprisingly little.... so here's my question:
Would it be of relevance/desire to add a "on_unknownblock(itemstring)", "on_unknownitem" and "on_unknownentity(itemstring)" set of callbacks so that we could control behaviour on "Unknown"?
So that when a mod is removed or changed, instead of having lots of unknown blocks lying around we could define their replacements dynamically
For example this pseudocode (I am gradually learning lua, the below may contain some python or bash :-/)
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
global.on_unknowitem = function(itemstring)
case itemstring in:
"farming:bread":
return "default:apple 10"
"ethereal:fancywood":
return "default:wood_pine"
end-case
return itemstring -- just leave it actually unknown
end-function
global.on_unknownblock = function(itemstring)
return "default:dirt" -- just replace any block with dirt
end-function
global.on_unknownentity = function(itemstring)
return null -- remove the item from the world
-- return "mobs:rat" -- example of replacing all unknown mobs with rats...
end-function