# ShopBuySellEvent (ShopChest 1.12 API)
Date: 2017-06-08

de.epiceric.shopchest.event

## Class ShopBuySellEvent

- java.lang.Object
- - org.bukkit.event.Event
  - - de.epiceric.shopchest.event.ShopEvent
    - - de.epiceric.shopchest.event.ShopBuySellEvent

All Implemented Interfaces:
  org.bukkit.event.Cancellable

    public class ShopBuySellEvent
    extends ShopEvent
    implements org.bukkit.event.Cancellable

Called when a player buys or sells something from or to a shop

### Nested Class Summary

Nested Classes
`static class` `ShopBuySellEvent.Type`

### Nested classes/interfaces inherited from class org.bukkit.event.Event

`org.bukkit.event.Event.Result`

### Constructor Summary

Constructors
Constructor and Description
`ShopBuySellEvent(org.bukkit.entity.Player player, Shop shop, ShopBuySellEvent.Type type, int newAmount, double newPrice)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getNewAmount()`
`double` `getNewPrice()`
`ShopBuySellEvent.Type` `getType()`
`boolean` `isCancelled()`
`void` `setCancelled(boolean cancel)`

### Methods inherited from class de.epiceric.shopchest.event.ShopEvent

`getHandlerList, getHandlers, getPlayer, getShop`

### Methods inherited from class org.bukkit.event.Event

`getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ShopBuySellEvent

    public ShopBuySellEvent(org.bukkit.entity.Player player,
                            Shop shop,
                            ShopBuySellEvent.Type type,
                            int newAmount,
                            double newPrice)

### Method Detail

#### getType

    public ShopBuySellEvent.Type getType()

Returns:
  Whether the player buys or sells something

#### getNewAmount

    public int getNewAmount()

Returns:
  The amount which might be modified because of automatic item amount calculation

#### getNewPrice

    public double getNewPrice()

Returns:
  The price which might be modified because of automatic item amount calculation

#### isCancelled

    public boolean isCancelled()

Specified by:
  `isCancelled` in interface `org.bukkit.event.Cancellable`

#### setCancelled

    public void setCancelled(boolean cancel)

Specified by:
  `setCancelled` in interface `org.bukkit.event.Cancellable`