Minecraft Skript/강좌&구문

[마인크래프트 스크립트] GUI열기

Script_Coder 2022. 2. 20. 08:00
728x90
반응형

오류때문에 구문에서 tab누른게 잘 안보일 수 있습니다.

 

안녕하세요. 오늘은 마인크래프트 스크립트에서 GUI를 열는 구문을 알려드리려고 합니다.

 

기본적인 구문은

open chest with 6 rows named "GUI이름" to player

입니다.

 

여기서 6 rows는 총 6줄이 있는 GUI를 연다는 뜻입니다.

그리고 GUI를 연 후에 아이템을 배치하는 구문은 다음과 같습니다. 

set slot 다음에 오는 숫자는 아이템을 배치할 GUI의 슬롯을 정하는거고 맨 뒤에는 배치할 아이템을 입력하면 됩니다.

둘이 합쳐보면, 다음과 같은 구문이 나오게됩니다.

 

open chest with 6 rows named "GUI이름" to player
set slot 0 of current inventory of player to 아이템
set slot 1 of current inventory of player to 아이템
set slot 2 of current inventory of player to 아이템
set slot 3 of current inventory of player to 아이템

지금까지 GUI를 열고 원하는 슬롯에 아이템을 배치하는 방법을 알아보았습니다.

이제 GUI의 슬롯 5를 클릭했을 때 그 이벤트를 취소하고 GUI를 닫는 구문을 만들어보겠습니다.

on inventory click:
	if inventory name of event-inventory contains "GUI이름":
		if clicked raw slot is 5:
        	cancel event
            close player's inventory

다음과 같이 on inventory click: 으로 구문을 만들 수 있습니다.

 

그리고 인벤토리를 닫았을 때 라는 이벤트는

on inventory close: 로 위 구문과 똑같이 사용할 수 있습니다.

 

 

감사합니다.

728x90
반응형