Coder Social home page Coder Social logo

pickpocket's Introduction

Pickpocket logo

This plugin provides another way of stealing from other players, via pick-pocketing.

How to Pick-pocket

To initiate pick-pocketing, simply crouch and right-click another player.

Pickpocket crouch

Upon clicking the player you will be presented with the "Rummage" GUI. In this GUI you can look through the inventory contents of the player you're looking at.

Pickpocket rummage

While rummaging through a players inventory there is a 10% chance that will get caught, and the rummage inventory will close, alerting you and the person you're pick-pocketing.

Once you have chose then item you would like to pick-pocket, click on it and an inventory mini-game will start.

Pickpocket failure

During this mini-game the item you have chosen to steal will move to a random slot in the inventory every second. You must click the item before the second expires otherwise that will count as a miss. If you miss more than twice, or click the item less than 3 times, the mini-game inventory will close and you will receive a message saying "Theft unsuccessful".

Pickpocket success

However, if you win this mini-game by clicking on the item a minimum of 3 out of 5 times, then you will receive a message saying "Theft successful", and the item you stole will get added to your inventory.

Disabling Pick-pocketing for Yourself

You can choose to opt out of pick-pocketing by using the command '/pickpocket toggle'. This command will prevent you from being pick-pocketed and will also prevent you from pick-pocketing.

Commands and Permissions

Command Permission Description
/pickpocket [name] pickpocket.use Allow usage of the plugin. Without this permission a player cannot pick-pocket.
/pickpocket admin pickpocket.admin Receive admin notifications when a player has stolen from another player. (may be broken)
/pickpocket exempt [name] pickpocket.exempt Toggle exemption from pick-pocketing for yourself or another player.
/pickpocket bypass [name] pickpocket.bypass Toggle cooldown bypass for yourself or another player.
/pickpocket toggle pickpocket.toggle Toggle pick-pocketing for yourself.
/pickpocket reload pickpocket.reload Reload the configuration file.

Support Discord

https://discord.gg/wBc8T7A

GitHub Repository

https://github.com/escape9179/pickpocket

pickpocket's People

Contributors

escape9179 avatar

Stargazers

 avatar zeyad rashed avatar  avatar Nicolas Shreiner avatar

Watchers

Nicolas Shreiner avatar  avatar

pickpocket's Issues

crouch to pick-pocket

The player must crouch in order to pick-pocket another player. This should add a level of compatibility with other plugins that use player interaction as means of functionality.

Clumsiness trait

This would cause the item the player is trying to pickpocket to drop on the ground instead of getting added directly to their inventory.

IndexOutOfBoundsException in GUIAPI

org.bukkit.event.EventException: null
	at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:320) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:529) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:514) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at org.bukkit.craftbukkit.v1_14_R1.event.CraftEventFactory.handleInventoryCloseEvent(CraftEventFactory.java:1246) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1912) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.PacketPlayInCloseWindow.a(PacketPlayInCloseWindow.java:18) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.PacketPlayInCloseWindow.a(PacketPlayInCloseWindow.java:1) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(SourceFile:144) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(SourceFile:118) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:909) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:902) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:886) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:819) [spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:657) ~[?:1.8.0_211]
	at java.util.ArrayList.get(ArrayList.java:433) ~[?:1.8.0_211]
	at logan.guiapi.GUIAPI.callInventoryCloseEvents(GUIAPI.java:54) ~[?:?]
	at logan.pickpocket.listeners.InventoryClose.onInventoryClose(InventoryClose.java:25) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
	at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:316) ~[spigot-1.14.4-R0.1-SNAPSHOT.jar:git-Spigot-cbd1a1b-009d8af]
	... 18 more

Add rummaging mechanic that only displays portions of a players inventory at once

Instead of showing all inventory contents of the victim, the pick-pocketing player should only be able to see a small assortment of items at a time. There will be buttons the player can click to view another random assortment of inventory contents.

  • Basic rummaging functionality
  • Add paging system to rummaging inventory
  • Add chance for player to get caught while rummaging
  • Add sound effects when the player is rummaging

A pickpocket cooldown to prevent spamming

If a player attempts to pickpocket a person directly after failing a pickpocketing attempt they will receive a message along the lines of "You are too nervous", or "You must regain your composure".

The player should have to play an inventory mini-game to pickpocket an item

The player plays an inventory mini-game where the item the player intends on stealing randomly moves from slot to slot. This game will last around 4-8 seconds depending on the players experience level and the resistance of the victim. Every time the item is clicked, the chance of stealing the item increases. Every time the item is missed, the more likely the item is to drop to the ground or remain in the victims inventory.

  • Create mini-game inventory
  • Modify a chance variable when item is clicked/missed
  • Shuffle items in inventory when item is clicked
  • Create timer that will shuffle all items in the inventory if the player hasn't clicked in time

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.