mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
added simple "doesItemExist(item)" function
- very simple function to check existance of an item
This commit is contained in:
@@ -797,3 +797,23 @@ else
|
||||
end, true)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------
|
||||
-- Check Item Existance - return boolean(true,false)
|
||||
-------------------------------------------------------------
|
||||
|
||||
--- checks whether an item exists in your item database
|
||||
---
|
||||
--- @param item string The item name.
|
||||
---
|
||||
--- @usage
|
||||
--- ```lua
|
||||
--- local item = "apple"
|
||||
--- if doesItemExist(item) then print("item exists") end
|
||||
--- ```
|
||||
function doesItemExist(item)
|
||||
if not item or item == "" then return false end
|
||||
if Items[item] ~= nil then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
Reference in New Issue
Block a user