Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import crafttweaker.event.PlayerInteractEvent;
- import crafttweaker.event.PlayerInteractBlockEvent;
- import crafttweaker.event.PlayerInteractEntityEvent;
- import crafttweaker.event.EntityLivingUseItemEvent.Start;
- import crafttweaker.entity.IEntityLiving;
- import crafttweaker.entity.IEntityEquipmentSlot as slots;
- import crafttweaker.server.IServer;
- import crafttweaker.block.IBlock;
- import crafttweaker.entity.IEntity;
- import crafttweaker.world.IFacing;
- /* import crafttweaker.command.ICommand; */
- import crafttweaker.command.ICommandSender;
- import mods.ctutils.utils.Math;
- import scripts.player_interact_statics as stats;
- events.onPlayerInteract(function(event as PlayerInteractEvent)
- {
- /* print("PlayerInteract");
- print("PlayerInteractEvent is PlayerInteractBlockEvent: "~((event instanceof PlayerInteractBlockEvent) as string));
- print("PlayerInteractEvent is PlayerInteractEntityEvent: "~((event instanceof PlayerInteractEntityEvent) as string)); */
- if(!event.player.world.isRemote()) { return; }
- print("PlayerInteract block: "~event.block.definition.id);
- print("Player blockPos y-1 block: "~event.world.getBlock((event.player as IEntity).position.getOffset(IFacing.down(), 1)).definition.id);
- print("event.block == event.world.getBlock y-1 ([] has)?: "~((([event.block] as IBlock []) has event.world.getBlock((event.player as IEntity).position.getOffset(IFacing.down(), 1))) as string));
- print("event.block == event.world.getBlock y-1 (has)?: "~((event.block has event.world.getBlock((event.player as IEntity).position.getOffset(IFacing.down(), 1))) as string));
- /* print("event.block == event.world.getBlock y-1 (==)?: "~((event.block == event.world.getBlock((event.player as IEntity).position.getOffset(IFacing.down(), 1))) as string)); */
- print("current item: "~event.player.currentItem.definition.id);
- if (event.player.currentItem.definition.id == <minecraft:fire_charge>.definition.id)
- {
- print("fire charge used!");
- server.commandManager.executeCommand(event.player, "summon small_fireball "~(event.player.x as string)~" "~(event.player.y+3 as string)~" "~(event.player.z as string)~" {direction:[0.0,0.0,0.0],power:[0.1,0.0, 0.0]}");
- }
- });
- /* val direction as
- eyeHeight
- heldEquipment
- rotationYaw
- rotationPitch
- lookingDirection */
Add Comment
Please, Sign In to add comment