import { world, system , BlockComponent } from '@minecraft/server';
import { ActionFormData, ModalFormData } from '@minecraft/server-ui';

system.afterEvents.scriptEventReceive.subscribe((event) => {
    let playername = event.sourceEntity
	let id = event.id
    let rawMessage = {
	  rawtext: [{ translate: "text.tutorial1" }, {text:"\n"}, {text:"\n"}, 
	  { translate: "text.tutorial2" }, {text:"\n"}, {text:"\n"}, 
	  { translate: "text.tutorial3" }, {text:"\n"}, {text:"\n"}, 
	  { translate: "text.tutorial4" }, {text:"\n"}, {text:"\n"}, 
	  { translate: "text.tutorial5" }, {text:"\n"}, {text:"\n"}, 
	  { translate: "text.tutorial6" }, {text:"\n"}, {text:"\n"}, 
	  { translate: "text.tutorial7" }, {text:"\n"}, {text:"\n"}, 
	  { translate: "text.tutorial8" }, {text:"\n"}, {text:"\n"}, ]
	};
    if (id == "fara:tutorial") {
        let form = new ActionFormData();
		form.title("Backrooms Hotel");
		form.body(rawMessage);
		form.button("Ok");
		
		form.show(playername)
   }
});