I have another Entity question, how can I spawn a charged creeper? Or better, how can I charge a creeper? I'm spawning an Creeper Entity to one player and I want to charge it and then make it explode a few seconds later, I can do the wait task for however long I want to wait before exploding but how can I do both of those things?
Testing is essential part of programming. PHP: $this->namedtag->powered = new ByteTag("powered", $powered ? 1 : 0);$this->setDataProperty(/*self::DATA_POWERED*/19, self::DATA_TYPE_BYTE, $powered ? 1 : 0); Add this to NBT PHP: $nbt["powered"] = new ByteTag("powered", 1); Note: boolean is alias to byte, false represents 0 and true represents 1.
Dislike. Boolean is not alias to byte. A boolean is represented by a Tag_BYTE in NBT, but that doesn't mean that a byte is necessarily a boolean. A boolean basically refers to the data type that is fundamentally one-bit long, which can represent either true or false, or technically, 1 (on) or 0 (off). A byte refers to the data type that is normally 8-bit long (1-byte long) (I forgot where I read it: bytes are actually 9 bits long, with the 9th bit for checksum or something like that; citation needed please, can't google that), which can represent a range of 256 values, namely 0 to 255, or -128 to 127, inclusively. In Minecraft NBT, the Tag_BYTE also has its uses apart from storing booleans. For instance, according to http://minecraft.gamepedia.com/Player.dat_format#Potion_Effects, status effects are stored in Tag_COMPOUNDs that contain a Tag_BYTE for storing the effect ID. Therefore, bytes are not equivalent to booleans. In addition, when we want to store an array of booleans, we use a bitmask. See http://php.net/chmod for example; it should be the most known example of bitmask. (Hopefully everyone here knows the chmod command in Linux, and knows something more than "chmod +x file") In this case, a data type of larger size, such as a Tag_LONG with 64 bits, can be used if we want to store 64 booleans in one tag. In conclusion, byte ∉ boolean, and boolean ∉ byte. (∉ is the mathematical symbol that means "not in the set of". P.S. Once upon a time, I heard my teacher said that 1 is "on" and 0 is "off", so I naively thought that 3 is "sleep" and 4 is "hibernate" and 5 is "reboot", etc.
Sorry Chris, I shall Google it to approve the information I post next time Edit: I probably meant - boolean represents a one bit (0 - false, 1 - true). I have to be true this time right?
Chris? My name is not Chris. Boolean represents one bit, but technically it is difficult to write one bit into a file without filling the other 7 bits, so it is often represented as a byte.
According to https://github.com/PEMapModders/repo/issues/1#issuecomment-212441193, @PEMapModder clarified that "Chris" is a dummy name for any person. Moreover, I have already, in my status, clarified that I am not @PEMapModder. My name is not Chris. My name is SOFe.
Does anyone wonder why "not @PEMapModder" is so familiar with all @PEMapModder repos and knows PocketMine so good? Even in your signature You claim to be incognito user, I would be too in his place (yes I read the whole signature). I doubt that you're an 78 year old female anyway. @Gamecrafter mentioned that @PEMapModder name was Chris. I can't find your Github profile but I'm 80% sure It's new. As @Hotshot_9930 confirmed, your status proves nothing Anyway, @PEMapModder PocketMine needs you.
Either he/she is @PEMapModder, or just someone intentionally trying to lead people on and/or troll. Either way, @SOFe is an interesting character.
It is an honour that you would compare me to @PEMapModder, but I'm afraid that you can't eliminate the possibility that I am just someone closely related to @PEMapModder, but not @PEMapModder itself.