If you prefer to use the given command to obtain a daylight detector, here’s how you can use it in Minecraft Java Edition (PC/Mac):
Version 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, and 1.19.4:
/give @p daylight_detector 1
Version 1.8, 1.9, 1.10, 1.11, and 1.12:
/give @p daylight_detector 1 0
/g;
var matches = html.match(regex);
if(matches) {
var toReplace = [];
for(var i=0; i < matches.length; i++) {
toReplace.push(matches[i].replace(/(
]+?>|
|<\/p>)/img, ""));
}
for(var i=0; i < toReplace.length; i++) {
html = html.replace(matches[i], toReplace[i]);
}
}
return html;
}
function getSanitizedHeadingHTML(infoInput, slug) {
if(!infoInput) {
return "";
}
//ignore content if it has only whitespaces (\n, etc)
if(infoInput.textContent.trim() === '' && !infoInput.innerHTML.match(/
";
}
var entityName = "