Compare commits

...

5 Commits

Author SHA1 Message Date
AiTechEye a2a6504219
Update README.md 2021-01-05 22:00:33 +01:00
AiTechEye b575fbd43e
Add files via upload 2021-01-05 21:59:43 +01:00
AiTechEye c5e64ab0f1
Add files via upload 2021-01-05 21:57:29 +01:00
AiTechEye d5cd14cd74
Delete readme.txt 2021-01-05 21:56:59 +01:00
AiTechEye 4b9d902826
Delete description.txt 2021-01-05 21:56:52 +01:00
5 changed files with 7 additions and 15 deletions

View File

@ -1,6 +1,6 @@
Licenses: code: LGPL-2.1, media: CC BY-SA-4.0 Licenses: code: LGPL-2.1, media: CC BY-SA-4.0
Version: 3 Version: 4
Hides players nametag when they are sneaking, or invisible if you have the invisible privilege. Hides players nametag when they are sneaking, or invisible if you have the invisible privilege.

View File

@ -1 +0,0 @@
Hide nametag while sneaking, or invisible with the invisible privilege

View File

@ -13,14 +13,13 @@ invisible.toggle=function(user,sneak)
user:set_nametag_attributes({color = {a = 0, r = 255, g = 255, b = 255}}) user:set_nametag_attributes({color = {a = 0, r = 255, g = 255, b = 255}})
invisible[name]={} invisible[name]={}
invisible[name].tool=sneak invisible[name].tool=sneak
invisible[name].collisionbox=user:get_properties().collisionbox
invisible[name].visual_size=user:get_properties().visual_size invisible[name].visual_size=user:get_properties().visual_size
invisible[name].textures=user:get_properties().textures invisible[name].textures=user:get_properties().textures
user:set_properties({ user:set_properties({
visual = "mesh", visual = "mesh",
textures={"invisible_skin.png"}, textures={"invisible_skin.png"},
visual_size = {x=0, y=0}, visual_size = {x=0, y=0},
collisionbox = {0,0,0, 0,0,0}, pointable=false,
}) })
minetest.chat_send_player(name, "invisible on") minetest.chat_send_player(name, "invisible on")
else else
@ -29,7 +28,7 @@ invisible.toggle=function(user,sneak)
visual = "mesh", visual = "mesh",
textures=invisible[name].textures, textures=invisible[name].textures,
visual_size = invisible[name].visual_size, visual_size = invisible[name].visual_size,
collisionbox=invisible[name].collisionbox pointable=true,
}) })
invisible[name]=nil invisible[name]=nil
@ -38,7 +37,6 @@ invisible.toggle=function(user,sneak)
armor:update_inventory(user) armor:update_inventory(user)
end end
minetest.chat_send_player(name, "invisible off") minetest.chat_send_player(name, "invisible off")
end end
else else
@ -78,4 +76,4 @@ minetest.register_globalstep(function(dtime)
invisible.toggle(player) invisible.toggle(player)
end end
end end
end) end)

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name=invisible
description=Hide nametag while sneaking, or invisible with the invisible privilege
optional_depends=3d_armor

View File

@ -1,8 +0,0 @@
Licenses: CC0
Version: 3
Hides players nametag when they are sneaking, or invisible if you have the invisible privilege.
Give yourself the invisible stick, to toggle your invisible on/off
/giveme i