daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function init(event){
  2. event.npc.timers.stop(1);
  3. event.npc.timers.stop(2);
  4. }
  5. //
  6. var nbtcache,motion,boad,boatnbt;
  7. function tick(event){
  8. if (!event.npc.timers.has(1) && !event.npc.timers.has(2)){
  9. if (event.npc.getMount()){
  10.   /*
  11.   boat = event.npc.getMount();
  12.   boatnbt = boat.getEntityNbt()
  13.   */
  14. event.npc.timers.start(1, 40, false);
  15. }
  16. }
  17. }
  18. //
  19. function timer(event){
  20. if(event.id == 1){
  21. event.npc.say("t1");
  22.   boat = event.npc.getMount();
  23.   boatnbt = boat.getEntityNbt()
  24. motion = boatnbt.getList('Motion',boatnbt.getListType('Motion'))
  25. motion = Java.from(motion)
  26. motion[0] = 2.0
  27. motion = Java.to(motion)
  28. boatnbt.setList('Motion', motion)
  29. boat.setEntityNbt(boatnbt)
  30. event.npc.timers.start(2, 100, false);
  31. }
  32. if (event.id == 2){
  33. event.npc.say("t2");
  34.   boat = event.npc.getMount();
  35.   boatnbt = boat.getEntityNbt()
  36. motion = boatnbt.getList('Motion',boatnbt.getListType('Motion'))
  37. motion = Java.from(motion)
  38. motion[0] = -2.0
  39. motion = Java.to(motion)
  40. boatnbt.setList('Motion', motion)
  41. boat.setEntityNbt(boatnbt)
  42. event.npc.timers.start(1, 100, false);
  43. }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top