개인 자료란 (JE)

  서버 커뮤니티

Profile 인젤리 대표칭호 없음

jelly0831 0ce8150c023145b2a834bc510e92ef8e

Profile

질문하기 커맨드

쉬프트 우클릭(좌클릭)감지 하는방법 어떻게 하나요..

2023.05.28 조회 수 442 추천 수 0
이해도 초보자 
게임버전 (JE) 1.19.4 
게임버전 (BE) 관련없음 

최근에 한 유튜버의 영상에서 커맨드 쉬프트+우클릭(좌클릭) 감지하는 영상을 봤느데요
혹시 어떻게 해야할지.. 인터랙션을 이용하는건 알고 있습니다 근데 쉬프트를 추가 하려니 골치가 아프네요.. ㅜㅜ




4개의 댓글

yusin12
2023.05.28

스코어보드에 쉬프트를 누르면 점수가 올라가는 점수판이 있음다!

인젤리
2023.05.28
@yusin12

거기에 우클릭까지 같이 더해서 설명해 주실수 있나요 쉬프트를 누른 상태에서 우클릭 또는 F를 눌렀을때 상호작용 가능하게

yusin12
2023.05.28
@인젤리

먼저 우클릭을 눌렀을 때, 작동하는 명령어는

#우클릭 감지

execute as @e[type=interaction] on target run say 1

#interaction nbt 태그 초기화

data remove entity @e[type=interaction,limit=1] interaction

 

이걸 개조하는 검다!

 

여기서 쉬프트 감지 스코어보드를 만들고!

/scoreboard objectives add s minecraft.custom:minecraft.sneak_time

 

1번째 커맨드 #interaction을 우클릭 하고 s의 점수가 1점 이상이면 say 1을 실행한다.

execute as @e[type=interaction] on target at @s[scores={s=1..}] run say 1

 

2번째 커맨드 #interaction의 interaction nbt태그 초기화

data remove entity @e[type=interaction,limit=1] interaction

 

3번째 커맨드 #s점수가 1점 이상이라면 초기화

execute as @e[scores={s=1..}] at @s run scoreboard players reset @s s

 

--------------------------------------

 

F 즉 왼손들기 감지하는 방법은 플레이어 nbt로 감지 할 수 있음다!

 

execute as @a[nbt={Inventory:[{id:"minecraft:stone",Count:1b,Slot:-106b}]}] at @s run say 1

 

이런식으로 돌 1개를 슬롯 -106b가 있을 때, say 1을 실행한다.

-106b가 왼손 인벤토리 번호임다!

 

이제

scores={s=1..}만 추가하면...

 

1번째 커맨드 #웅크리고 돌 1개를 왼손들기 했을 때 say 1을 실행한다.

execute as @a[scores={s=1..},nbt={Inventory:[{id:"minecraft:stone",Count:1b,Slot:-106b}]}] at @s run say 1

 

2번째 커맨드 # s점수가 1점이상이라면 초기화

execute as @e[scores={s=1..}] at @s run scoreboard players reset @s s

 

이렇게 말이죠!

인젤리
2023.05.28
@yusin12

감사합니다~!!!!!!!! 덕분에 살았네요 !!!

 

뉴스 및 창작물
/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

Windows Borderless 모드에서 악성코드 발견

학교가기싫다

2024-05-08

0

/files/thumbnails/384/778/003/262x150.crop.jpg?20240507003327

업데이트

마인크래프트 자바 에디션 스냅샷 24w18a

학교가기싫다

2024-05-06

0

/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1

/files/thumbnails/576/775/003/262x150.crop.jpg?20240426232553

아티클

이달의 블록: 단단한 진흙

학교가기싫다

2024-04-26

0

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

업데이트

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

학교가기싫다

2024-04-24

0