类 StopUsingItemTest
java.lang.Object
net.neoforged.neoforge.oldtest.item.StopUsingItemTest
This test mod provides two items for testing the Forge onStopUsing hook. Both items attempt to create an item that increases FOV and allows creative flight when used
stop_using_item:bad_scope
: Implements the item without the onStopUsing to demonstrate the problem. Should see that when selecting another hotbar slot or dropping the item, the FOV is not properly reverted and you remain flying.stop_using_item:good_scope
: Implements the item with onStopUsing to test that the hook hook works. Should see that when selecting another hotbar slot or dropping the item, the FOV is properly reverted and you stop flying.
-
嵌套类概要
嵌套类修饰符和类型类说明static class
private static class
-
字段概要
字段修饰符和类型字段说明static DeferredItem
<Item> Attempt at a "reverse scope" that also makes you fly without using the Forge method.private static float
Current FOV change, consumed by the event.static DeferredItem
<Item> Successful "scope item" using the Forge method, all cases of stopping using the item will stop the FOV changeprivate static final DeferredRegister.Items
protected static final String
-
构造器概要
构造器 -
方法概要
-
字段详细资料
-
MODID
- 另请参阅:
-
ITEMS
-
fovChange
private static float fovChangeCurrent FOV change, consumed by the event. Good enough for a test mod as we only need one copy for the client player, in a real mod you probably want to reset this on world exit. -
BAD
Attempt at a "reverse scope" that also makes you fly without using the Forge method. Will not remove the speed if you scroll away or swap items -
GOOD
Successful "scope item" using the Forge method, all cases of stopping using the item will stop the FOV change
-
-
构造器详细资料
-
StopUsingItemTest
public StopUsingItemTest(net.neoforged.bus.api.IEventBus modEventBus)
-
-
方法详细资料
-
addCreative
-
onVanillaEvent
-