개인 자료란 (JE)

  서버 커뮤니티

Profile gurem0 대표칭호 없음
Profile

질문하기 스크립트

ray trace 질문

2024.12.02 조회 수 39 추천 수 0
이해도 초보자 
게임버전 (JE) 관련없음 
게임버전 (BE) 관련없음 
스크립트 버전 2.9.5 
스크립트 애드온 skbee 

options:

    gun-item: netherite hoe

    gun-name: "총"

    damage: 10

    range: 50

    particle-effect: "crit"



on right click with {@gun-item}:

    if name of player's tool is {@gun-name}:

        set {target.%player%} to ray trace from player with max distance 25 while ignoring passable blocks

        if {target.%player%} is not set:

            send "&7아무것도 맞추지 못했습니다." to player

        else:

            if {target.%player%} is entity:

                damage {target.%player%} by 3 hearts

                send "&c대상에게 {@damage}의 피해를 입혔습니다!" to player

            else:

                send "&7블록에 맞았습니다." to player

                play sound "entity.firework_rocket.blast" at player


raytrace가 블럭만 감지를 하네요.. 허허

1개의 댓글

windy_wind
2024.12.03

player를 ray trace에서 가져오고

player != entity로 감지되기 때문에

is entity의 else로 계속 실행되는겁니다.

뉴스 및 창작물
/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