-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSend_Item.lua
More file actions
51 lines (43 loc) · 981 Bytes
/
Copy pathSend_Item.lua
File metadata and controls
51 lines (43 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--This project is under the CC-BY-4.0 license
--https://github.com/morgatronday1234
--Read the license!
chat = peripheral.wrap("top")
block = peripheral.wrap("right")
mon = peripheral.wrap("monitor_0")
mon.setTextScale(0.5)
term.redirect(mon)
term.clear()
term.setCursorPos(1, 1)
data = block.getBlockData().Items[1]
--print(textutils.serialise(data))
--time for jank fixes
_, item_mod_length = string.find(data.id, ":")
item = string.gsub(string.sub(data.id, item_mod_length+1), "_", " ")
if not (data.tag)
then
data.tag = {none = nil}
end
message = {
{
text = "["
},
{
text = item,
color = "#5555FF",
hoverEvent = {
action = "show_item",
contents = {
id = data.id,
count = 1,
tag = textutils.serialiseJSON(data.tag)
}
}
},
{
text = "]"
}
}
chat.sendFormattedMessage(textutils.serialiseJSON(message), "§aItem-display", "<>")
--This project is under the CC-BY-4.0 license
--https://github.com/morgatronday1234
--Read the license!