Skip to content

Commit

Permalink
PlayerTag.fake_op_level mech (paper)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 10, 2022
1 parent 6b0a043 commit 547afbf
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,18 @@ public void adjust(Mechanism mechanism) {
}
player.getPlayerEntity().boostElytra(item.getItemStack());
}

// <--[mechanism]
// @object PlayerTag
// @name fake_op_level
// @input ElementTag(Number)
// @Plugin Paper
// @description
// Sends a fake operator level to the client, enabling clientside op-required features like the debug gamemode hotkey (F3+F4).
// Input should be a number from 0 to 4, 0 indicating not op and 4 indicating maximum level op.
// -->
if (mechanism.matches("fake_op_level") && mechanism.requireInteger()) {
player.getPlayerEntity().sendOpLevel((byte) mechanism.getValue().asInt());
}
}
}

0 comments on commit 547afbf

Please sign in to comment.