개인 자료란 (JE)

  서버 커뮤니티

Profile 덕가이 대표칭호 없음
Profile

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

마인크래프트 움직이는 gui

2024.03.10 조회 수 198 추천 수 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/576/775/003/262x150.crop.jpg?20240426232553

아티클

이달의 블록: 단단한 진흙

학교가기싫다

2024-04-26

0

/files/thumbnails/115/774/003/262x150.crop.jpg?20240426223813

업데이트

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

학교가기싫다

2024-04-24

0

/files/thumbnails/762/770/003/262x150.crop.jpg?20240418073724

레드스톤

T.B.H (고민중독) | 노트블럭 버전 | NoteBlock Cover [한국어 영어 중국어 가사 추가]

노트블럭전문가

2024-04-18

0

/files/thumbnails/218/767/003/262x150.crop.jpg?20240412130213

레드스톤

우리의 꿈 - 원피스 오프닝

노트블럭전문가

2024-04-12

0

/files/thumbnails/505/766/003/262x150.crop.jpg?20240411122306

레드스톤

기동전사 건담 수성의 마녀 | 노트블럭 커버 1

노트블럭전문가

2024-04-11

1

/files/thumbnails/932/765/003/262x150.crop.jpg?20240410124459

레드스톤

마인크래프트 노트블록으로 만든 『 밤양갱 (Bam Yang Gang) 』

노트블럭전문가

2024-04-10

0

/files/thumbnails/403/765/003/262x150.crop.jpg?20240409190538

레드스톤

마인크래프트 노트블록으로 만든 『 밤양갱 (Bam Yang Gang) 』

Sonttukk

2024-04-09

4