Custom NPCs Scripting Tutorial #5 - Interacting With Redstone

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии • 38

  • @Daot
    @Daot 9 лет назад +2

    One of my biggest problems is reading Noppes API. Like right now I can't understand how to work with any of the scoreboard methods. How do I figure it out.

    • @Daot
      @Daot 9 лет назад +1

      Daot finally figured it out:
      world.getScoreboard().getPlayerScore("daotdlog","Deaths","")

  • @lolavlogs4648
    @lolavlogs4648 8 лет назад

    Hey Osimon I wanna know do you know how Aphmau makes her custom npc's do what they do. Like how they talk in color and then it switches to a diffrent one after? She also makes their heads and makes them move but I doubt it's the wand because their movement is so strange they jump and do all these thing can you help?

  • @PowaCreator
    @PowaCreator 8 лет назад

    Hi what is that npcp (npc+) thing? You didn't show where you created the object (stored in world tempData), thanks in advance!

  • @cisco8257
    @cisco8257 7 лет назад

    how do you get theme to take damage

  • @sethain4952
    @sethain4952 8 лет назад

    plz come back Osimon we want you back

  • @Medixum
    @Medixum 9 лет назад

    It would be awesome if you could make use of the minecraft source codes to make the npcs copy structures and build them elsewhere

    • @OsimonB
      @OsimonB  9 лет назад +1

      Medixum That sounds like a fun challenge, I'll add it to list of things to try. :)

  • @_nixxie_
    @_nixxie_ 9 лет назад

    Could you use this to get the metadata for wheat etc to create a farmer who checks for the wheat to be fully grown and then faux farms it and replants it?

    • @OsimonB
      @OsimonB  9 лет назад

      Nicole Sijnja Yes you could, good idea! If I remember correctly, the metadata value for fully grown crops is 7. You should give it a try and see what happens.

    • @_nixxie_
      @_nixxie_ 9 лет назад

      Osimon I have been trying to work out a way to do this, so that we have a very alive feeling to our villages we are building. I will certainly give this a try!

  • @MCArothin
    @MCArothin 9 лет назад

    how do you get them to use right-click functions like using a bucket, and how do you get them to use a crafting table?

    • @OsimonB
      @OsimonB  9 лет назад

      Arothin Lasgalen Because of the way they are made, they can't actually *use* the bucket or crafting table. But you can make them simulate it. Such as for the bucket of water you could, put a bucket of water in their hands, swing their arm and place some water in front of them, then replace the bucket in their hands with an empty one. It would look like they actually used a bucket, when really they didn't.

    • @MCArothin
      @MCArothin 9 лет назад

      Osimon thank you! is there a detect funtion for their inventory? like if they have items A B and C then give them item D and take items ABC to simulate crafting?

  • @joygaming8511
    @joygaming8511 8 лет назад

    Osimon how to change skin in minecraft version mod forge ??

  • @OymyOwtf
    @OymyOwtf 8 лет назад

    how do i use the function "setOwner()"? Bcuz i tried using npc, player and event but they didn't work. I just want to know if there's another way to command them through dialog. It'd mean a lot if someone could actually tell me what to use or how to make it work.

  • @mariushauge7628
    @mariushauge7628 8 лет назад +1

    Thanks so much, man! This video was really helpful! Anyway, I'm kind of a programming noob, and therefore I wonder if there is an easy way to make a certain block spawn at a specific set of coordinates when a NPC is, say, killed or spoken to or whatever. I'm pretty stuck on this problem, so help would be much appreciated :)

    • @mariushauge7628
      @mariushauge7628 8 лет назад

      I'm on 1.8.0 if that makes any difference.

  • @thefluffygamer2173
    @thefluffygamer2173 7 лет назад

    how does someone make a legit puppet musicbox timer, and an alarm go off as the timer goes off? can someone give me the script to that? (and a play sound script?)

  • @LPOktabyte
    @LPOktabyte 8 лет назад

    Is it possible to access the minecraft stuff aswell? Like net.minecraft.util.BlockPos for example?
    Something like
    var BlockPos = net.minecraft.util.BlockPos; // This does not work - doesn't know class net

  • @lilyevanora7423
    @lilyevanora7423 9 лет назад +1

    i don't understand any of this (i haven't watched the vid, i know weird but i have no where else to ask) i am looking for a way to make customnpcs build and move a certain way, for example, close a door, say "let's make sure no one can hear us" and then turn towards me, shift, and sit on a chair, grab an object from a chest, and give the object to me while saying "here are the documents, now you must go" or something like that. is scripting what i should use? then how do i use it?

    • @OsimonB
      @OsimonB  9 лет назад

      +Lily Evanora Yes you would need scripting for that. What you're wanting to achieve could be done using state logic. Do you have any previous experience with coding?

    • @lilyevanora7423
      @lilyevanora7423 9 лет назад +1

      Osimon no :/ i was looking for an alternative.. like maybe a mod or something i could download to make certain things happen. but i don't think there is. i don't know if i can code. my parents tell me i should since i use computers 24/7 practically, but i'm not sure what it really does. maybe you could give me steps on how to set everything up?

    • @gfp9336
      @gfp9336 8 лет назад

      just say '' o hai ima grill gamer, make screeptz for mi plz'' and you will be good to go.

  • @pixelnuts6594
    @pixelnuts6594 9 лет назад

    Thanks a lot for your tutorial.
    What is the best way to learn coding npc script?
    Language & Examples?

    • @OsimonB
      @OsimonB  9 лет назад

      Squaramashow Parodies Well, I found when I first learnt how to code, that the best way to learn is to experiment. Change bits of the code to see what it does and try to do things yourself before searching up how to do it. By default Custom NPCs just uses Javascript so any Javascript tutorial would help you learn. I learnt many years ago on a site called Tizag, it's still around I think

    • @Daot
      @Daot 9 лет назад

      Squaramashow Parodies www.w3schools.com/ is a great source for Javascript

  • @ArahAkachi
    @ArahAkachi 9 лет назад

    If I wanted a npc to target and attack a certain player when he gets in range, how would I do this? I'm so confused.

    • @OsimonB
      @OsimonB  9 лет назад

      Arah Are you just wanting the NPC to attack a specific player? Or just any player in range? Because by default you can set them to attack any player within a range without using scripts.

    • @ArahAkachi
      @ArahAkachi 9 лет назад

      A certain player when they come into range.

    • @OsimonB
      @OsimonB  9 лет назад

      Arah You could try use something along the lines of:
      var target = event.getTarget();
      if (!target || target.getType() != 1 || target.getName() != "Player name") {
      event.setTarget(null);
      }
      What this does is it checks to see what the target is, then if it's a player it checks the name. Only if the target exists, is a player and has the given name will it then target that player, otherwise it will ignore every other target. This does have it's consequences though, it can cause a bit of confusion when multiple people are surrounding it. But with just a few players it should be alright.

    • @ArahAkachi
      @ArahAkachi 9 лет назад

      Aah thank you! One more question, what tab in the scripting section would I put this?

    • @ArahAkachi
      @ArahAkachi 9 лет назад

      I'm using 1.7.10 but it says it can't find the function getTarget

  • @theothorel9009
    @theothorel9009 9 лет назад

    How to do a Lumberjack??

    • @OsimonB
      @OsimonB  9 лет назад

      Fury&Fly Officiel What do you mean by lumberjack? Like an NPC that wanders around cutting down trees?

  • @GothMoonCat
    @GothMoonCat 9 лет назад

    Hey there, I just want to say great videos! You've earned a subscriber :)
    I have a request, would you be able to make an NPC be able to turn into different saved NPCs? I.e; Go from Zombie to skeleton to creeper, it would really help with my plans to create a multi tier boss fight. If you could do that, I would be the most grateful person ever. Also, a few videos ago, I saw a comment that asked for something along the lines of having an NPC unable to see you in certain light levels, if you could do that aswell, I'd be even more grateful. Thanks ^-^

    • @OsimonB
      @OsimonB  9 лет назад

      Gabriel Mccardle I can look into it if you'd like. I've been a bit busy lately with other stuff but I have done all the code to work with the light levels. I just haven't got around to recording the video yet.

    • @GothMoonCat
      @GothMoonCat 9 лет назад

      Osimon It's alright, take your time, aslong as you enjoy what you do, keep doing it :)