Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Auto-Generated Code:
- package net.mcreator.spikespurgatory.procedures;
- import net.minecraft.world.entity.Entity;
- import net.minecraft.commands.arguments.EntityArgument;
- import net.minecraft.commands.CommandSourceStack;
- import net.mcreator.spikespurgatory.network.SpikesPurgatoryModVariables;
- import com.mojang.brigadier.exceptions.CommandSyntaxException;
- import com.mojang.brigadier.arguments.BoolArgumentType;
- public class ResetInPurgatoryProcedure {
- public static void execute(CommandContext<CommandSourceStack> arguments) {
- {
- boolean _setval = BoolArgumentType.getBool(arguments, "new_ipg_val");
- (new Object() {
- public Entity getEntity() {
- try {
- return EntityArgument.getEntity(arguments, "player_target");
- } catch (CommandSyntaxException e) {
- e.printStackTrace();
- return null;
- }
- }
- }.getEntity()).getCapability(SpikesPurgatoryModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
- capability.ipg = _setval;
- capability.syncPlayerVariables((new Object() {
- public Entity getEntity() {
- try {
- return EntityArgument.getEntity(arguments, "player_target");
- } catch (CommandSyntaxException e) {
- e.printStackTrace();
- return null;
- }
- }
- }.getEntity()));
- });
- }
- }
- }
- Correct code:
- package net.mcreator.spikespurgatory.procedures;
- import net.minecraft.world.entity.Entity;
- import net.minecraft.commands.arguments.EntityArgument;
- import net.minecraft.commands.CommandSourceStack;
- import net.mcreator.spikespurgatory.network.SpikesPurgatoryModVariables;
- import com.mojang.brigadier.exceptions.CommandSyntaxException;
- import com.mojang.brigadier.arguments.BoolArgumentType;
- import com.mojang.brigadier.context.CommandContext; //THIS LINE IS MISSING, I had to add it manually.
- public class ResetInPurgatoryProcedure {
- public static void execute(CommandContext<CommandSourceStack> arguments) {
- {
- boolean _setval = BoolArgumentType.getBool(arguments, "new_ipg_val");
- (new Object() {
- public Entity getEntity() {
- try {
- return EntityArgument.getEntity(arguments, "player_target");
- } catch (CommandSyntaxException e) {
- e.printStackTrace();
- return null;
- }
- }
- }.getEntity()).getCapability(SpikesPurgatoryModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
- capability.ipg = _setval;
- capability.syncPlayerVariables((new Object() {
- public Entity getEntity() {
- try {
- return EntityArgument.getEntity(arguments, "player_target");
- } catch (CommandSyntaxException e) {
- e.printStackTrace();
- return null;
- }
- }
- }.getEntity()));
- });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment