Difference between revisions of "Unknown Item"

From Minetest Wiki
Jump to navigation Jump to search
(“Subgames” were renamed to “games”)
(rename Minetest to Luanti)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Languages}}
+
{{Languages|nocat=1}}
 +
 
 
{{Item Data
 
{{Item Data
|wherein=[[Minetest]]
+
|wherein=[[Luanti]]
 
|type=Internally-used item
 
|type=Internally-used item
 
|name=Unknown Item
 
|name=Unknown Item
Line 9: Line 10:
 
}}
 
}}
  
An '''Unknown Item''' is a pseudo-item in Minetest to represent an item of which the item definition is unknown. These items must never appear in the game, it's always an error when you encounter it.
+
An '''Unknown Item''' is a pseudo-item in Luanti to represent an item of which the item definition is unknown. These items must never appear in the game, it's always an error when you encounter it.
  
 
== Behaviour ==
 
== Behaviour ==
If you rightclick or try to drop the unknown item, an error message is shown which reveals the item's [[Itemstrings|itemstring]]. You can still store and move this item in inventories. But any sort of world interaction is not possible. Due to a bug in Minetest, it's not even possible to drop these items.
+
Most types of world interactions are not possible. Dropping an unknown item is not possible. You can still store and move this item in inventories.
 +
 
 +
If you try to place, use or drop an unknown item, an error message will be shown to the server. This message is not visible if you are connected to a server as a normal player. The error message reveals the item's [[Itemstrings|itemstring]].
  
 
Internally, an unknown item still knows the “real” item it represents and the associated data. To fix problems with unknown item, first check the troubleshooting section. You can destroy unknown items with the <code>pulverize</code> [[Server commands|server command]].
 
Internally, an unknown item still knows the “real” item it represents and the associated data. To fix problems with unknown item, first check the troubleshooting section. You can destroy unknown items with the <code>pulverize</code> [[Server commands|server command]].
Line 22: Line 25:
  
 
== Technical background ==
 
== Technical background ==
Technically, an unknown item still kinda acts like a normal item, and most item query and manipulation functions will still work. If you query the itemstring of an unknown item with e.g. <code>itemstack:get_name()</code>, you get the itemstring which the unknown item represents. To find out in Lua whether an item is unknown, do a lookup in <code>minetest.registered_items</code>. If the item does not occour in this table, it is unknown.
+
Technically, an unknown item still kinda acts like a normal item, and most item query and manipulation functions will still work. If you query the itemstring of an unknown item with e.g. <code>itemstack:get_name()</code>, you get the itemstring which the unknown item represents. To find out in Lua whether an item stack is unknown, call <code>itemstack:is_known()</code>.
  
 
== See also ==
 
== See also ==

Latest revision as of 22:35, 22 October 2024

Languages Language: English


Unknown Item
Unknown Item.png
An item in Luanti
Item Type Internally-used item
Renewable N/A
Durability N/A
Stackable Yes (99)
Itemstring N/A

An Unknown Item is a pseudo-item in Luanti to represent an item of which the item definition is unknown. These items must never appear in the game, it's always an error when you encounter it.

Behaviour

Most types of world interactions are not possible. Dropping an unknown item is not possible. You can still store and move this item in inventories.

If you try to place, use or drop an unknown item, an error message will be shown to the server. This message is not visible if you are connected to a server as a normal player. The error message reveals the item's itemstring.

Internally, an unknown item still knows the “real” item it represents and the associated data. To fix problems with unknown item, first check the troubleshooting section. You can destroy unknown items with the pulverize server command.

Troubleshooting

A common reason for this item to appear is when you have previously activated a mod which added some new item, stored some of these items in an inventory, then later deactivated said mod. Now all items from this mod will appear as an unknown items. In this case, you can solve this simply by enabling the missing mod again. If you forgot to which mod this item belonged, rightclick with the item in hand to see its itemstring. The part before the colum is the mod name.

Another source of this item is a bug in mods or games or just general developer clumsiness. Developers of a game may have made a mistake or removed items intentionally without any replacement. Complain to the game authors if this happens, as this is generally considered poor development practice. If unknown items occour without you using any mods, this is almost certainly a bug.

Technical background

Technically, an unknown item still kinda acts like a normal item, and most item query and manipulation functions will still work. If you query the itemstring of an unknown item with e.g. itemstack:get_name(), you get the itemstring which the unknown item represents. To find out in Lua whether an item stack is unknown, call itemstack:is_known().

See also