Hi, I wanted to remove a button and a string from an exisiting gui. "event.buttonList.remove(2);" worked perfectly fine to remove the button but is there a similar code to remove a string?
And also, is there a way to change the state of a button? For instance when I click on "Create World" it's usually set to "Survivial" and I would like it to be set to "Creative" without having to click on it
Hello! I wanted to change the drops of boats. So firstly I tried to disable the drops, but that code didn't do anything :L
It still dropped the items. Is EntityBoat even the correct one to use? Do boats use a different code for the drops, compared to normal entities?
@SubscribeEvent
public void LivingDropsEvent(LivingDropsEvent event)
{
if (event.entity instanceof EntityBoat)
{
event.drops.clear();
}
}
}
I want the player to get healed when he wakes up in the morning.
But the PlayerWakeUpEvent also gets triggered when you press the wake up button in bed and don't actually sleep 'till the next day. :L
Does anyone have an idea how I could do that, that the player only gets healed when he stays in the bed?
@SubscribeEvent
public void PlayerWakeUpEvent(PlayerWakeUpEvent event)
{
event.entityPlayer.heal(20);
}
}
7 replies
Important Information
By using this site, you agree to our Terms of Use.