Difference between revisions of "Unknown Node"

From Luanti Wiki
Jump to navigation Jump to search
(Replaced content with "[https://dev.luanti.org/nodes/#unknown-node This page has moved to the Luanti Developer Wiki!]")
Tag: Replaced
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Languages}}
+
[https://dev.luanti.org/nodes/#unknown-node This page has moved to the Luanti Developer Wiki!]
{{Block Data
 
| image=Unknown Node.png
 
| wherein=[[Minetest]]
 
| block_name=Unknown Node
 
| type = Internally-used block
 
| physics = No
 
| flammable = No
 
| luminance=No
 
| generated = Hopefully not!
 
| itemstring = ''N/A''
 
| drops=[[Unknown Item]]
 
| stackable = ''N/A''
 
}}
 
 
 
An '''unknown node''' (other name: '''<code>CONTENT_UNKNOWN</code>''') is a block which is internally used by Minetest to represent an undefined block. Players should never see this block in the game, it's always an error.
 
 
 
== Internal data ==
 
Internally, an unknown node always “knows” the real block it represents and stll contains all the internal data accociated with it (like an inventory) as long you don't destroy the block. So don't worry if a large portion of your world suddenly turns into unknown nodes, you might still fix this.
 
 
 
Unknown nodes are not items, can not be stored in inventories and have no itemstring.
 
 
 
== Behaviour ==
 
Unknown node is a solid opaque block. When punched, an error message is shown with the [[Itemstrings|itemstring]] of the block it actually represents. It can be [[Mining|mined]] by [[hand]] in 0.5 seconds, even if the actual block it represents would be unbreakable. It drops an [[Unknown Item|unknown item]] with the same itemstring.
 
 
 
Think carefully before destroying an unknown node as all information associated with the block (except the itemstring) will be gone for good. (It might have been the diamond-encrusted golden chest with the flaming longsword of overpower, after all! ;-) ). Try to do some [[#Troubleshooting|troubleshooting]] first.
 
 
 
== Troubleshooting ==
 
A common reason for this block to appear is when you have previously activated a [[mod]] which added some new blocks (e.g. a blue stone), then later deactivated said mod. Now all blocks from this mod will appear as an unknown node. In this case, you can solve this simply by enabling the missing mod again. Punch the block once to see the itemstring. The part before the column is the mod name.
 
 
 
Another source of this block is a bug in mods or subgames or just general developer clumsiness. Developers of a subgame may have made a mistake or removed blocks intentionally without any replacement. Complain to the subgame authors if this happens, as this is generally considered poor development practice. If unknown nodes occour without you using any mods, you can be certain it is a bug.
 
 
 
== Technical background ==
 
Technically, an unknown node still tries it best to pretend like it would be a real node. If an unknown node is queried with a function like [http://dev.minetest.net/minetest.get_node minetest.get_node], the itemstring of the node it actually represents is returned. To find out whether a node is unknown, do a lookup in <code>minetest.registered_nodes</code>. If the node does not occour in this table, it is unknown.
 
 
 
In the Minetest source code, this pseudo-node is also called “<code>CONTENT_UNKNOWN</code>”.
 
 
 
== See also ==
 
 
 
* [[Unknown Item]]
 
* [[Unknown Object]]
 

Latest revision as of 22:51, 20 December 2024