개인 자료란 (JE)

  서버 커뮤니티

Profile 고고우석 대표칭호 없음
Profile

질문하기 스크립트

스크립트 아이템 인식 오류

2024.12.03 조회 수 73 추천 수 0
이해도 초보자 
게임버전 (JE) 1.20.2 
게임버전 (BE) 관련없음 
스크립트 버전 2.9.5 

if slot 15 of current inventory of player is netherite hoe with custom model data 1:

@send "debug" to player

위와 같은 구문으로 인벤토리의 15번 슬롯이 리소스팩이 적용된 네더라이트 괭이일 때 작동합니다.

그러나 텍스쳐팩이 적용된 네더라이트 괭이의 내구도가 닳았을 때, 작동하지 않습니다.


이 오류와 관련하여 자료를 찾아봤는데

https://github.com/SkriptLang/Skript/issues/1871

같은 이슈가 19년도에도 있었고, 임시로 다운그레이드를 하라는 해결책이 있었으나 곧 버그임을 인지하고 해결된 것으로 확인됩니다.


위에서 해결된 버그를 실험해 봤을 때,

if slot 15 of current inventory of player is netherite hoe :

@send "debug" to player

위와 같은 구문으로 아무런 조건이 붙지 않은 네더라이트 괭이인 경우에는 괭이의 내구도가 닳아 있는 경우에도 작동합니다.


또 다른 조건으로

if slot 15 of current inventory of player is netherite hoe  named "디버그":

@send "debug" to player

위와 같은 구문으로 "디버그" 라는 이름이 붙은 네더라이트 괭이인 경우, 리소스팩 때와 마찬가지로 내구도가 닳아있는 "디버그" 라는 이름이 붙은 네더라이트 괭이를 인식하지 못합니다.

조건이 붙은 아이템을 내구도와 관계없이 인식하는 방법을 알고싶습니다.


2개의 댓글

windy_wind
2024.12.03

set {_item} to (slot 15 of current inventory of player) 을 전제할때

 

1. 이중 if

if type of {_item} is netherite hoe:

@if name of {_item} is "디버그":

@@#action

 

2. with damage %number%를 이용

if {_item} with damage 1 is netherite hoe with damage 1 named "디버그":

@#action

 

고고우석
2024.12.05
@windy_wind

감사합니다. 이중 if 방향성으로 해결되었습니다.

뉴스 및 창작물
/files/thumbnails/844/958/003/262x150.crop.jpg?20250111133615

건축

중세판타지 성 / '판타시아' / 1인 건축 완성 1

콩산

2025-01-11

0

/files/thumbnails/124/946/003/262x150.crop.jpg?20241225132838

모드

Record, Catch Update || Cobblemon 1.6 Official Trailer

BMlight

2024-12-25

2

/files/thumbnails/945/944/003/262x150.crop.jpg?20241223202710

이벤트

세븐일레븐 건축 강좌 보고 댓글달면 건축 가이드 받을 수 있어요!

다코미

2024-12-23

0

/files/thumbnails/206/939/003/262x150.crop.jpg?20241213131516

상품

《레고 마인크래프트 아이디어 북》 출간!

다코미

2024-12-13

1

/files/thumbnails/500/937/003/262x150.crop.jpg?20241210152228

상품

《마인크래프트 1일 1페이지 아이디어 북》 출간!

다코미

2024-12-10

0