Jump to content

Recommended Posts

Posted (edited)

I am having trouble getting players to fly in survival mode! I change the players mayfly boolean but I don't see the player.sendAbilitiesUpdate(); method anymore. I don’t think it is available to use.

My code so far:

@Override
	public void command() {
		command = Commands.literal("fly").executes(
				(commandContext) -> {return fly(commandContext);}
				);
	}
	
	private int fly(CommandContext<CommandSourceStack> commandContext) throws CommandSyntaxException {
		
		Player player = commandContext.getSource().getPlayerOrException();
		player.getAbilities().mayfly = !player.getAbilities().mayfly;
		commandContext.getSource().sendSuccess(Msg.buildMessage("Fly set to : "+player.getAbilities().mayfly), false);
		
		return 1;
	}

 

Edited by X_ZombieSlayer_X
Error fixing
Posted
11 hours ago, Luis_ST said:

which version did you use and what did you mean by "I don't player.sendAbilitiesUpdate(); method anymore."

 

I am not at my computer at the moment. I meant I don’t see the player.sendAbilitiesUpdate method anymore. It is no longer there to use.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.