ph2
대표칭호 없음
P0rnhub_com 8437300efbf74ddd9848e87807f731ea
이해도 | 플러그인 |
---|
World world = player.getWorld(); Location location = player.getLocation(); world.dropItem(location, new ItemStack(Material.BOW, 1)); 오픈소스 파일 수정중인데 내구도가 96밖에 없는 활을 주게끔 바꾸고십읍니다. 어떻게하나요 ? ?? ?? ??? ??
dontstarve
2022.01.01저는 잘 모르겠네요
ph2
2022.01.01?
허두
2022.01.02?
데드풀리오
2022.01.01https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/ItemStack.html
-> https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/meta/ItemMeta.html
참고하세요~
ph2
2022.01.01오. 근데제가 뉴비라그런데. 응용법을몰라요. 읽어보니 itemmeta로 넣어야하는거같은데. 수정해주실수있나요 감사합니다.
데드풀리오
2022.01.01이런식으로 하셔도 상관은 없을거같네요
ph2
2022.01.01Deprecated.
durability is now part of ItemMeta. To avoid confusion and misuse, getItemMeta(), setItemMeta(ItemMeta) and Damageable.setDamage(int) should be used instead. This is because any call to this method will be overwritten by subsequent setting of ItemMeta which was created before this call.
Sets the durability of this item
선생님. item.setDurability를 넣었더니 이런 오류가뜹니다
ph2
2022.01.02ItemStack bow=new ItemStack(Material.BOW);
World world = player.getWorld();
Location location = player.getLocation();
world.dropItem(location, new ItemStack(Material.BOW,1));
ItemMeta m=(ItemMeta) bow.getItemMeta();
Damageable
선생님 오류뜨는거 보고 독학으로 여기까지왔습니다 이제어쩌죠
허두
2022.01.02Damageable dm = (Damageable) m;
dm.setDamage(숫자);
bow.setItemMeta(dm);
이런식으로 하면 작동되려나요?
ph2
2022.01.02다른분 도움 받아서 완성햇읍니다. 올려주신거랑 같은코드같네여. 감사합니다
허두
2022.01.02해결되셨다니 다행입니다 :)