specify
This commit is contained in:
1 parent
1ef764b9b1
commit
c5f666b95c
2 files changed
+18
No files matched your search
@@ -56,6 +56,7 @@ import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.EntityHitResult;
|
||||
@@ -1376,6 +1377,19 @@ public class EntityValue extends Value
|
||||
}
|
||||
});
|
||||
|
||||
put("swing", (e, v) -> {
|
||||
if (e instanceof LivingEntity)
|
||||
{
|
||||
Hand hand = Hand.MAIN_HAND;
|
||||
if (v != null)
|
||||
{
|
||||
String handString = v.getString().toLowerCase(Locale.ROOT);
|
||||
if (handString.equals("offhand") || handString.equals("off_hand")) hand = Hand.OFF_HAND;
|
||||
}
|
||||
((LivingEntity)e).swingHand(hand, true);
|
||||
}
|
||||
});
|
||||
|
||||
put("silent",(e,v)-> e.setSilent(v.getBoolean()));
|
||||
|
||||
put("gravity",(e,v)-> e.setNoGravity(!v.getBoolean()));
|
||||
|
||||
Reference in new issue
Block a user