• 0

    posted a message on Adding a variable to EntityPlayer

    I'm a little new to modding, but been programming in java for a while.


    I want that all EntityPlayers will contain another variable, foo.

    I started By Creating a class that extends EntityPlayer:

    public class Player extends EntityPlayer {
            public int foo;
    }


    However eclipse gave me an error, to add a constructor and unimplemented methods, so I did.

    public class Player extends EntityPlayer {
    
    	public Player(World worldIn, GameProfile gameProfileIn) {
    		super(worldIn, gameProfileIn);
    	}
    
    	@Override
    	public boolean isSpectator() {
    		return false;
    	}
    
    	
    	public int foo;
    }


    As far as I understand, I need to tell minecraft that on creating an EntityPlayer, it has to be my EntityPlayer, and not theirs. How do I come about adding this variable? Any help i appreciated.

    Posted in: Modification Development
  • 0

    posted a message on WIP Mod: Player Variable Increment on Tick

    I'm a little new to modding, just learned how to make food, armor and weapons off of youtube, however, I've been programming in java for a while.


    What I want: on eating a custom food item, add a variable to the player class of who ate it, and every tick increment the variable by one. I've been trying very hard, but couldn't figure out how to add a variable to the player by simply extending the class. Any help is appreciated.

    Posted in: WIP Mods
  • 0

    posted a message on Shotgun/Rapid Fire

    This is easiest with plugins, a resource pack and many (like a lot a lot) of command blocks. I don't think this I quite what to want to immediately jump into, first (if you don't know) you should learn basic commands and their syntax, then scoreboard commands and how they work (that took me a year) and then, if you want to make things simpler, learn to program (maybe in java) so you can make you own plugins. My point is, this is really hard, and you shouldn't start off with these things. Try to take apart your problem and ask us about small issues that aren't working, don't expect us to give you a full answer. (P.S. if you are looking for something like hypixel's blocking dead, beware they use plugins for almost everything).

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Help with advancements

    Please don't ask this in the commands section, were not the guys :P

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [ Entity Looks where i do ]

    The detection of the direction that you look is a know problem. However, Making the zombie look with commands is. For example (which I saw on the web) if you wanted to fire a snowball on the use of a sword, the sword detection is no problem, but getting the snowball to shoot in the direction of the player is really difficult, and the shortest solution requires around a thousand command blocks, each detecting which direction you are looking and sets a direction according to that.



    However, you could use an invisible villager at the place of the player, so the zombie would see you/the villager no matter what.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on HELP! Need to detect if a player is NOT inside a block radius.

    @AppleManYT: you can use conditional chain command blocks, look it up on the wiki.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on "Unable to summon object" whenever I try to summon an item

    Just a note: please try and google it a little harder, I believe all of use knew that answer.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboards?

    Not a solution, but I believe that you shouldn't jump strait into scoreboards like those, which are very complicated. First google the command itself, and understand how it works. Also beware: many servers use plugins to help them display these stats, thus what you exactly want may be unachievable without creating you own plugin, which is an entirely new subject (of course I'm guessing you don't want to learn java, for mods). If no one posts a solution soon, I may bring you one, but it might not be exactly what you want.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to test for entities in a square area?

    Forgot to say... If x is 5 and dx is 5 the the result is x=5 dx=10. Dx is basically the offset from the x.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [ Vanilla ] Random teleport between coordinates. { SOLVED }

    @Gavinr1 : now understood, thanks, and sorry for the trouble NEOelder

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to test for entities in a square area?
    /execute @e[dx=DX,dy=DY,dz=DZ,x=X,y=Y,z=Z] ~ ~ ~ /your command

    The coordinates dx, dy, dz, x, y and z specify the two points in the box.

    Alternatively, you can use:

    /execute @e[x=X,y=Y,z=Z,r=5] ~ ~ ~ /your command

    Which will receive all entities within five blocks of x y z, in all dimensions.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [ Vanilla ] Random teleport between coordinates. { SOLVED }

    A little simpler, you could use

    /spreadplayers 0 0 0 1000 false @p[r=5]

    Then at x900 z-387 have a command block executing on that precise block, that teleports you back into the range to the spreadplayers command block.

    This way, if you go to 900 -387 you will go back to the start, thus teleporting again.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on I Need Help with Spawning A Mob With a Custom Head

    This is possible, but with third party plugins, which you would have to create. In commands, it is not.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command block anti-grief!

    I am not sure I fully understood, but this is what I got: when a player breaks a block, you want to execute some special command. You can use the scoreboard block break criteria, like this:

    execute once, using single player commands:

    /scoreboard objectives add breakblock stat.mineBlock
    /scoreboard players set @a breakblock 0

    repeat command block:

    /execute @a[score_breakblock_min=1] ~ ~ ~ /your_command
    /scoreboard players set @a[score_breakblock_min=1] breakblock 0

    btw I haven't tested this

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on /fill command, Help!

    like what mine_boy60 said, you can use clone, but in addition if you want you can use a fill in any other part of the world and simply clone it over, then remove the blocks with fill.

    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.