개인 자료란 (JE)

  서버 커뮤니티

Profile 덕가이 대표칭호 없음
Profile

강좌 자바 에디션(JE) 플러그인 개발

마인크래프트 움직이는 gui

2024.03.10 조회 수 418 추천 수 0
분야 스크립트 
게임버전 1.20.x 
API 페이퍼 
자료글 https://www.youtube.com/watch?v=TTbmuyHBgFo 

마크 스크립트로 움직이는 gui를 만들고 싶은데 어떻게 해야할까요?

몇초마다 gui 이름을 바꾸는 코드를 쓰라는데 어떻게 하는지 모르겠네요..

그리고 gui는  

        set {_gui} to a new chest inventory with 4 rows with name ":offset_-8::mainui:"

        set {_gui2} to a new chest inventory with 4 rows with name ":offset_-8::mainui2:"

        set {_gui3} to a new chest inventory with 4 rows with name ":offset_-8::mainui3:"

        set {_gui4} to a new chest inventory with 4 rows with name ":offset_-8::mainui4:"

        set {_gui5} to a new chest inventory with 4 rows with name ":offset_-8::mainui5:"

        set {_gui6} to a new chest inventory with 4 rows with name ":offset_-8::mainui6:"

이렇게 설정하고 open {_gui} to player로 보여줍니다

예시 링크 33초 쯤 나오는 것처럼 하고 싶습니다.


13개의 댓글

학교가기싫다
2024.03.10

질문은 질문게시판에서 하세요

https://www.koreaminecraft.net/qna

덕가이
2024.03.16
@학교가기싫다

처음으로 와서 죄송합니다 앞으로는 이런 실수 하지않도록 노력하겠습니다!

 

슈퍼레몬
2024.03.15

인벤토리 오픈 구문이 있죠? 거기에

set {_guinumber} to 1

while player's invertory open: 하고

open {_gui%{_guinumber}%}

if {guinumber} >= 7:

@set {guinumber} to 1

else:

@add 1 to {guinumber}

wait n second

하시면 될듯 합니다.

덕가이
2024.03.16
@슈퍼레몬

오 감사합니다!

 

덕가이
2024.03.16
@슈퍼레몬
  1. set {_guinumber.num} to 1
  2.                 while name of current inventory of player contain ":offset_-8::mainui":
  3.                     open {_gui%{_guinumber.num}%} to player
  4.                     if {_guinumber.num} >= 7:
  5.                         set {_guinumber.num} to 1
  6.                     else:
  7.                         add 1 to {_guinumber.num}
  8.                         wait 2 second 이런식으로 썼는데 클릭시 gui 이미지가 안바뀌는데 이유가 있을까요?

슈퍼레몬
2024.03.16
@덕가이

일단 아이템에더는 :offset: 이걸로 이름이 인식되지 않고 유니코드로 인식이 됩니다.

사용한 유니코드 받아서 or 사용하셔야 됩니다.

덕가이
2024.03.16
@슈퍼레몬

아 그렇군요.. 그럼 빈칸 유니코드를 가져와야 하는건가요?

슈퍼레몬
2024.03.17
@덕가이

일단 저는 아이템 에더를 사용하고 있지 않습니다.

:offser-8:이 하나의 placeholder라면 :offset-8:의 유니코드를 가져와서 contain 으로 비교하시면 될것같고 아니라면 저기 들어간 유니코드 모조리 긁어와서 or로 비교하시면 되요

덕가이
2024.03.23
@슈퍼레몬

그래서 코드를 set {_guinumber.num} to 1

set {_placeholder} to "⬅︎"

set {_unicode} to "ꘔ"

loop 7 times:

set {_inventory_name} to name of current inventory of player

if {_inventory_name} contains ":offset-8::mainui" or {_inventory_name} contains {_placeholder} or {_inventory_name} contains {_unicode}:

open {_gui%{_guinumber.num}%} to player

if {_guinumber.num} is greater than or equal to 7:

set {_guinumber.num} to 1

else:

add 1 to {_guinumber.num}

wait 2 seconds

else:

stop 이렇게 써봤는데 맞을까요?

슈퍼레몬
2024.03.23
@덕가이

댓글에 쓰면 탭이 다 망가져서 전체코드를 본문에 첨부해주세요

덕가이
2024.03.23
@슈퍼레몬
  1.                 set {_guinumber.num} to 1
  2.                 set {_placeholder} to "⬅︎"
  3.                 set {_unicode} to "ꘔ" 

  4. loop 7 times: 
  5.     set {_inventory_name} to name of current inventory of player
  6.     if {_inventory_name} contains ":offset-8::mainui" or {_inventory_name} contains {_placeholder} or {_inventory_name} contains {_unicode}:
  7.         open {_gui%{_guinumber.num}%} to player
  8.         if {_guinumber.num} is greater than or equal to 7:
  9.             set {_guinumber.num} to 1
  10.         else:
  11.             add 1 to {_guinumber.num}
  12.         wait 2 seconds
  13.     else:
  14.         stop
슈퍼레몬
2024.03.23
@덕가이

일단 한 if문에 contain을 여러개 작성할수 없고요

제가 덕가이님의 아이템에더 placeholder를 알지 못하기 때문에 한마포에서는 도움을 드리기 어렵습니다.

디코 superlemon1118#4620으로 아이템에더 설정(그러니까 placeholder같은거), 전체 코드(.sk 파일)를 보내주세요

덕가이
2024.03.24
@슈퍼레몬

아 넵 알겠습니다. 조만간 연락 한번 드리겠습니다!

 

뉴스 및 창작물
/files/thumbnails/439/832/003/262x150.crop.jpg?20240711073840

레드스톤

【Ado】루루 (RuLe) | 피아노 & 노트블럭 커버

노트블럭전문가

2024-07-11

0

/files/thumbnails/600/818/003/262x150.crop.jpg?20240622093723

레드스톤

[마크 피아노커버] 에반게리온 잔혹한 천사의 테제 2

노트블럭전문가

2024-06-22

3

/files/thumbnails/647/816/003/262x150.crop.jpg?20240619112336

건축

숭례문(프리퀄) 4

KHC

2024-06-19

0

/files/thumbnails/308/815/003/262x150.crop.jpg?20240617084353

레드스톤

[피아노커버] 디스코드 - QWER 3

노트블럭전문가

2024-06-17

1

/files/thumbnails/932/812/003/262x150.crop.jpg?20240622110502

업데이트

마인크래프트 1.21 정식 업데이트

학교가기싫다

2024-06-14

1

/files/thumbnails/308/805/003/262x150.crop.jpg?20240605201646

레드스톤

[노트블럭 커버] 팬서비스/mona 【 HoneyWorks 】 1

노트블럭전문가

2024-06-05

1

/files/thumbnails/288/791/003/262x150.crop.jpg?20240602150002

아티클

《까다로운 시련》 업데이트 날짜 공개 및 정보

학교가기싫다

2024-06-02

0